Learn R Programming

spMC (version 0.3.15)

sim_mcs: 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)

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.

Arguments

x

an object of the class multi_tpfit, typically with the output of the function multi_tpfit.

data

a categorical data vector of length \(n\).

coords

an \(n \times d\) matrix where each row denotes the \(d\)-D coordinates of data locations.

grid

an \(m \times d\) matrix where each row denotes the \(d\)-D coordinates in the simulation grid.

knn

an integer value which specifies the number of k-nearest neighbours for each simulation point. If NULL (by default), all observations are considered.

entropy

a logical value. If TRUE, the prediction uncertainties are computed through the entropy (and standardized entropy). The default value is FALSE.

Author

Luca Sartore drwolf85@gmail.com

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.

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

sim_ck, sim_ik, sim_path

Examples

Run this code
# \donttest{
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)
# }

Run the code above in your browser using DataLab