| simulate.rSPDEobj1d | R Documentation |
The function samples a Gaussian random field based on a pre-computed rational SPDE approximation.
## S3 method for class 'rSPDEobj1d'
simulate(object, nsim = 1, seed = NULL, ...)
object |
The rational SPDE approximation, computed
using |
nsim |
The number of simulations. |
seed |
an object specifying if and how the random number generator should be initialized (‘seeded’). |
... |
Currently not used. |
A matrix with the n samples as columns.
matern.rational()
# 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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.