Learn R Programming

KrigInv (version 1.3.1)

update_km: Update of a kriging model

Description

Update a km object when one or many new observations are added. Many, but not all, fields of the km object need to be recalculated when new observations are added. It is also possible to modify the k last (existing) observations.

Usage

update_km(model, NewX, NewY, NewX_AllreadyExist = FALSE, 
CovReEstimate = FALSE, new.noise.var = NULL, 
kmcontrol = NULL, F.newdata = NULL)

Arguments

model

Kriging model of km class.

NewX

Matrix with model@d columns and r rows corresponding to the r locations of the observations to be updated. These locations can be new locations or existing ones.

NewY

Matrix with one column and r rows corresponding to the r responses at the r locations NewX.

NewX_AllreadyExist

Boolean: indicate whether the locations NewX are all news or not.

CovReEstimate

Boolean to decide whether the covariance parameters of the km object should be re-estimated.

new.noise.var

Vector containing the noise variance at each new observations.

kmcontrol

Optional list representing the control variables for the re-estimation of the kriging model once new points are sampled. The items are the same as in km

F.newdata

Optional matrix containing the value of the trend at the new locations. Setting this argument avoids a call to an expensive function.

Value

Updated km object

References

Bect J., Ginsbourger D., Li L., Picheny V., Vazquez E. (2010), Sequential design of computer experiments for the estimation of a probability of failure, Statistics and Computing, pp.1-21, 2011, http://arxiv.org/abs/1009.5177

Chevalier C., Bect J., Ginsbourger D., Vazquez E., Picheny V., Richet Y. (2011), Fast parallel kriging-based stepwise uncertainty reduction with application to the identification of an excursion set ,http://hal.archives-ouvertes.fr/hal-00641108/

See Also

km

Examples

Run this code
# NOT RUN {
#update_km

set.seed(8)
N <- 9 #number of observations
testfun <- branin

#a 9 points initial design
design <- data.frame( matrix(runif(2*N),ncol=2) )
response <- testfun(design)

#km object with matern3_2 covariance
#params estimated by ML from the observations
model <- km(formula=~., design = design, 
	response = response,covtype="matern3_2")
model@covariance

new.x <- matrix(c(0.4,0.5),ncol=2)#the point that we are going to add in the km object
new.y <- testfun(new.x)
new.model <- update_km(model=model,NewX=new.x,NewY=new.y,CovReEstimate=TRUE)
new.model@covariance
# }

Run the code above in your browser using DataLab