sim_mcs {spMC} | R Documentation |
Multinomial Categorical Simulation
Description
The function simulates a random field through the Multinomial Categorical Simulation technique (MCS).
Usage
sim_mcs(x, data, coords, grid, knn = NULL, entropy = FALSE)
Arguments
x |
an object of the class |
data |
a categorical data vector of length |
coords |
an |
grid |
an |
knn |
an integer value which specifies the number of k-nearest neighbours for each simulation point. If |
entropy |
a logical value. If |
Details
This method computes an approximation of posterior probabilities
\Pr\left(Z(\mathbf{s}_0) = z_k \left\vert \bigcap_{i = 1}^n Z(\mathbf{s}_i) = z(\mathbf{s}_i)\right.\right).
\hspace{0cm}
The algorithm is based on the Bayesian maximum entropy approach and it honours both the model structure and observed data.
Value
A data frame containing the simulation grid, the simulated random field, predicted values and the approximated probabilities is returned. Two extra columns respectively denoting the entropy and standardized entorpy are bindend to the data frame when argument entropy = TRUE
.
Author(s)
Luca Sartore drwolf85@gmail.com
References
Allard, D., D'Or, D., Froidevaux, R. (2011) An efficient maximum entropy approach for categorical variable prediction. European Journal of Soil Science, 62(3), 381-393.
Sartore, L. (2010) Geostatistical models for 3-D data. M.Phil. thesis, Ca' Foscari University of Venice.
See Also
Examples
data(ACM)
# Model parameters estimation for the
# multinomial categorical simulation
x <- multi_tpfit(ACM$MAT5, ACM[, 1:3])
# Generate the simulation grid
mygrid <- list()
mygrid$X <- seq(min(ACM$X), max(ACM$X), length = 3)
mygrid$Y <- seq(min(ACM$Y), max(ACM$Y), length = 3)
mygrid$Z <- -40 * 0:9 - 1
mygrid <- as.matrix(expand.grid(mygrid$X, mygrid$Y, mygrid$Z))
# Simulate the random field
myMCSim <- sim_mcs(x, ACM$MAT5, ACM[, 1:3], mygrid)