sim_path: Conditional Simulation Based on Path Algorithms

View source: R/sim_path.R

sim_pathR Documentation

Conditional Simulation Based on Path Algorithms

Description

The function simulates a random field through the Fixed Path algorithm or Random Path technique.

Usage

sim_path(x, data, coords, grid, radius, fixed = FALSE, entropy = FALSE)

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.

radius

a numerical value that specifies a proper radius to search the nearest observed points within a d-D sphere.

fixed

a logical value; if TRUE, the fixed path algorithm is performed. The random path algorithm is performed by default.

entropy

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

Details

These methods compute 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).

\mbox{\hspace{0cm}} Path algorithms are based on Pickard random fields, so that the states of such chain at any unsampled location depends on the state of its nearest known neighbours in axial directions.

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

Li, W. (2007) A Fixed-Path Markov Chain Algorithm for Conditional Simulation of Discrete Spatial Variables. Mathematical Geology, 39(2), 159-176.

Li, W. (2007) Markov Chain Random Fields for Estimation of Categorical Variables. Mathematical Geology, 39(June), 321-335.

Pickard, D. K. (1980) Unilateral Markov Fields. Advances in Applied Probability, 12(3), 655-671.

Sartore, L. (2010) Geostatistical models for 3-D data. M.Phil. thesis, Ca' Foscari University of Venice.

See Also

sim_ck, sim_ik, sim_mcs

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 = 20)
mygrid$Y <- seq(min(ACM$Y), max(ACM$Y), length = 20)
mygrid$Z <- -40 * 0:9 - 1
mygrid <- as.matrix(expand.grid(mygrid$X, mygrid$Y, mygrid$Z))

# Simulate the random field through
# the fixed path algorithm
myFixPathSim <- sim_path(x, ACM$MAT5, ACM[, 1:3], mygrid,
                         radius = 50, fixed = TRUE)

# Simulate the random field through
# the random path algorithm
myRndPathSim <- sim_path(x, ACM$MAT5, ACM[, 1:3], mygrid, radius = 50)

spMC documentation built on May 3, 2023, 9:13 a.m.