Learn R Programming

spMC (version 0.3.15)

quench: Conditional Simulation Adjuster Via Quenching Algorithm

Description

The function adjusts a simulated random field generated by the sim function.

Usage

quench(x, data, coords, sim, GA = FALSE, optype = c("param", 
       "fullprobs", "semiprobs", "coordprobs"), max.it = 1000,
       knn = 12)

Value

A data frame containing the simulation grid, the simulated random field, predicted values and the approximated probabilities.

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.

sim

an object of the class spsim, it is usually the output of the function sim.

GA

a logical value; if TRUE, the function performs the Genetic Algorithm instead of the Simulated Annealing.

optype

a character which denotes the objective function to compute when the optimization is performed.

max.it

a numerical value which specifies the maximum number of iterations to stop the optimization algorithm. For proper results, it should be a multiple of the number of simulation points.

knn

an integer value which specifies the number of k-nearest neighbours for each simulation point. An optimal number is between 4 and 12. If NULL all observations are considered (just for very small dataset!!). It is 12 by default.

Author

Luca Sartore drwolf85@gmail.com

Details

This method perform a simulated annealing or a genetic algorithm to modify the simulation results, in order to reduce artifacts effects. In practice, each simulated configuration is adjusted to reach a pattern similar to the observed sample data. There are several objective functions for this purpose, by setting optype equal to "param" the optimization is performed through parametric methods. The alternatives "fullprobs" and "semiprobs" are based on transition probabilities computed among simulation points, while the option "coordprobs" is based on transition probabilities calculated among observation and simulation points.

This procedure should be executed by setting max.it equal at least to the simulation grid size, or its multiples.

References

Carle, S. F., Fogg, G. E. (1996) Transition Probability-Based Indicator Geostatistics. Mathematical Geosciences, 28(4), 453-476.

Carle, S. F. (1999) T-PROGS: Transition Probability Geostatistical Software. University of California, Davis.

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

Weise, T. (2009) Global Optimization Algorithms - Theory and Application. https://archive.org/details/Thomas_Weise__Global_Optimization_Algorithms_Theory_and_Application.

See Also

sim_ck, sim_ik, sim_mcs, 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 = 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
# Ordinary Indicator Kriging algorithm
myOIKSim <- sim_ik(x, ACM$MAT5, ACM[, 1:3], mygrid)
 
# Perform the quenching algorithm 
# to adjust simulation
quench(x, ACM$MAT5, ACM[, 1:3], myOIKSim, optype = "coordprobs",
       max.it = 2, knn = 12) 
# }

Run the code above in your browser using DataLab