simulate.Kriging: Simulation from a 'Kriging' model object.

View source: R/KrigingClass.R

simulate.KrigingR Documentation

Simulation from a Kriging model object.

Description

This method draws paths of the stochastic process at new input points conditional on the values at the input points used in the fit.

Usage

## S3 method for class 'Kriging'
simulate(object, nsim = 1, seed = 123, x, will_update = FALSE, ...)

Arguments

object

S3 Kriging object.

nsim

Number of simulations to perform.

seed

Random seed used.

x

Points in model input space where to simulate.

will_update

Set to TRUE if wish to use update_simulate(...) later.

...

Ignored.

Value

a matrix with nrow(x) rows and nsim columns containing the simulated paths at the inputs points given in x.

Note

The names of the formal arguments differ from those of the simulate methods for the S4 classes "km" and "KM". The formal x corresponds to newdata. These names are chosen Python and Octave interfaces to libKriging.

Author(s)

Yann Richet yann.richet@irsn.fr

Examples

f <- function(x) 1 - 1 / 2 * (sin(12 * x) / (1 + x) + 2 * cos(7 * x) * x^5 + 0.7)
plot(f)
set.seed(123)
X <- as.matrix(runif(10))
y <- f(X)
points(X, y, col = "blue")

k <- Kriging(y, X, kernel = "matern3_2")

x <- seq(from = 0, to = 1, length.out = 101)
s <- simulate(k, nsim = 3, x = x)

lines(x, s[ , 1], col = "blue")
lines(x, s[ , 2], col = "blue")
lines(x, s[ , 3], col = "blue")

rlibkriging documentation built on Oct. 3, 2024, 1:06 a.m.