# Sample a Gaussian Matern process on R using a rational approximation
range <- 0.2
sigma <- 1
nu <- 0.8
# compute rational approximation
x <- seq(from = 0, to = 1, length.out = 100)
op <- matern.rational(
range = range, sigma = sigma,
nu = nu, loc = x
)
# Sample the model and plot the result
Y <- simulate(op)
plot(x, Y, type = "l", ylab = "u(x)", xlab = "x")
Run the code above in your browser using DataLab