Search code examples
rstochastickriging

How to fit model with individual measurement error in DiceKriging, or can it?


I have a set of 5 data points (x=10,20,30,40,50 and its corresponding response values y and noise as s.d. of y). These data are obtained from stochastic computer experiments.

How can I use DiceKriging in R to fit a kriging model for these data?

x <- seq(from=10, to=50, length=5)
y <- c(-0.071476,0.17683,0.19758,0.2642,0.4962)
noise <- c(0.009725,0.01432,0.03284, 0.1038, 0.1887)

Examples online with heterogeneous noise are pre-specified with coef.var, coef.trend and coef.theta. It is unlikely that I can have a priori on these.

I have referred to the answer here. However, other references suggest adding the nugget parameter lambda is similar to adding homogeneous noise, which is not likely "individual errors".


Solution

  • The use of km with noise is quite simple:

    model <- km(~1, data.frame(x=x), y, noise.var = noise, covtype = "matern3_2")
    

    However, your noise term make the line search part of L-BFGS algorithm fail. It may be due to the fact that is is strongly correlated with y, because when I run the following lines, it works:

    noice <- c(0.009725,0.01432,0.03284, 0.001, 0.1887)
    model <- km(~1, data.frame(x=x), y, noise.var = noise, covtype = "matern3_2")