# `NoiseKriging::simulate` ## Description Simulation from a `NoiseKriging` model object. ## Usage * Python ```python # k = NoiseKriging(...) k.simulate(nsim = 1, seed = 123, x) ``` * R ```r # k = NoiseKriging(...) k$simulate(nsim = 1, seed = 123, x) ``` * Matlab/Octave ```octave % k = NoiseKriging(...) k.simulate(nsim = 1, seed = 123, x) ``` ## Arguments Argument |Description ------------- |---------------- `nsim` | Number of simulations to perform. `seed` | Random seed used. `x` | Points in model input space where to simulate. `with_noise` | Set to array of values if wish to add the noise in the simulation. `will_update` | Set to TRUE if wish to use `update_simulate(...)` later. ## Details This method draws paths of the stochastic process at new input points conditional on the values at the input points used in the fit. ## Value A matrix with `nrow(x)` rows and `nsim` columns containing the simulated paths at the inputs points given in `x` . ## Examples ```r 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) + X/10 * rnorm(nrow(X)) points(X, y, col = "blue") k <- NoiseKriging(y, (X/10)^2, X, kernel = "matern3_2") x <- seq(from = 0, to = 1, length.out = 101) s <- k$simulate(nsim = 3, x = x) lines(x, s[ , 1], col = "blue") lines(x, s[ , 2], col = "blue") lines(x, s[ , 3], col = "blue") ``` ### Results ```{literalinclude} ../functions/examples/simulate.NoiseKriging.md.Rout :language: bash ``` ![](../functions/examples/simulate.NoiseKriging.md.png) ## Reference * Code: