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)) # add noise dep. on X
points(X, y, col = "blue", pch = 16)
k <- NoiseKriging("matern3_2")
print(k)
fit(k,y,noise=(X/10)^2,X)
print(k)
Run the code above in your browser using DataLab