% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/KrigingClass.R
\name{update_simulate.Kriging}
\alias{update_simulate.Kriging}
\title{Update previous simulation of a \code{Kriging} model object.}
\usage{
\method{update_simulate}{Kriging}(object, y_u, ..., X_u = NULL, noise_u = NULL)
}
\arguments{
\item{object}{S3 Kriging object.}

\item{y_u}{Numeric vector of new responses (output).}

\item{...}{Ignored.}

\item{X_u}{Numeric matrix of new input points.}

\item{noise_u}{Optional numeric vector of observation noise variances
attached to \code{y_u}.}
}
\value{
a matrix with \code{nrow(x)} rows and \code{nsim}
    columns containing the simulated paths at the inputs points
    given in \code{x}.
}
\description{
This method draws paths of the stochastic process conditional on the values at the input points used in the
fit, plus the new input points and their values given as argument (knonw as 'update' points).
}
\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 <- k$simulate(nsim = 3, x = x, will_update = TRUE)

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

X_u <- as.matrix(runif(3))
y_u <- f(X_u)
points(X_u, y_u, col = "red")

su <- k$update_simulate(y_u, X_u)

lines(x, su[ , 1], col = "blue", lty=2)
lines(x, su[ , 2], col = "blue", lty=2)
lines(x, su[ , 3], col = "blue", lty=2)
}
\author{
Yann Richet \email{yann.richet@asnr.fr}
}
