Obtains samples of a Whittle-Matérn field on a metric graph.
sample_spde(
kappa,
tau,
range,
sigma,
sigma_e = 0,
alpha = 1,
directional = FALSE,
graph,
PtE = NULL,
type = "manual",
posterior = FALSE,
nsim = 1,
method = c("conditional", "Q"),
BC = 1
)
Matrix or vector with the samples.
Range parameter.
Precision parameter.
Practical correlation range parameter.
Marginal standard deviation parameter.
Standard deviation of the measurement noise.
Smoothness parameter.
should we use directional model currently only for alpha=1
A metric_graph
object.
Matrix with locations (edge, normalized distance on edge) where the samples should be generated.
If "manual" is set, then sampling is done at the locations
specified in PtE
. Set to "mesh" for simulation at mesh nodes, and to "obs"
for simulation at observation locations.
Sample conditionally on the observations?
Number of samples to be generated.
Which method to use for the sampling? The options are "conditional" and "Q". Here, "Q" is more stable but takes longer.
Boundary conditions for degree 1 vertices. BC = 0 gives Neumann boundary conditions and BC = 1 gives stationary boundary conditions.
Samples a Gaussian Whittle-Matérn field on a metric graph, either from the prior or conditionally on observations $$y_i = u(t_i) + \sigma_e e_i$$ on the graph, where \(e_i\) are independent standard Gaussian variables. The parameters for the field can either be specified in terms of tau and kappa or practical correlation range and marginal standard deviation.