spde.sampling {RGeostats} | R Documentation |
Sampling a data set from Q matrix
spde.sampling(Qrows, Qcols, Qvals, nrow=0, ncol=0, type = 0, flag.norm = TRUE, flag.inter = TRUE, flag.color=FALSE, flag.sparse = FALSE)
Qrows,Qcols,Qvals,nrow,ncol |
If Qrows (first argument) is a sparse matrix (from 'Matrix' package), then the following arguments ('Qcols', 'Qvals', 'nrow' and 'ncol') are useless. Otherwise the arguments 'Qrows', 'Qcols' and 'Qvals' must correspond to three arrays (same dimension) which provide respectively the row, the column indices, as well as the value for the corresponding cell element. If the arguments 'nrow' and 'ncol' are not provided, they are calculated automatically from the contents of the sparse matrix |
type |
Coarsening mode. It may be either 0 for the standard coarsening. When strictly positive, a coarse sample is kept only if at least 'type' pathes exist between two coarse samples of the standard coarsening algorithme. |
flag.norm |
When TRUE, the input matrix is normalized prior to performing the interpolation |
flag.inter |
When TRUE, the interpolation is performed after coarsening. |
flag.color |
When TRUE, an array of colors (per mesh node) is calculated. |
flag.sparse |
When TRUE (if the package 'Matrix' is loaded), the resulting matrices are returned as a sparse matrix. |
The output is a list composed of:
indCo The array of flags set to 1 if the sample is Coarse or 0 otherwise
L Sparse matrix giving the list of the connected samples
IhH Sparse matrix giving the transition matrix from coarse set to fine set (only if flag.inter=TRUE)
Q Sparse matrix giving the normalized version of the input matrix (only if flag.inter=TRUE and flag.norm=TRUE)
A Sparse matrix which corresponds to the input matrix 'Q' (possibly normalized) after it has been interpolated on the coarse samples only (only if flag.inter=TRUE)
sr.IhH Vector giving the row sums of IhH.
colors Vector of color coding per node of the mesh (starting from 1).
If flag.sparse is set to TRUE, the resulting elements 'L', 'IhH', 'Q' and 'A' are returned as sparse matrix (of the 'Matrix' package).