View source: R/marginal_se_spatial.R
| tulpa_spde_precision_Q | R Documentation |
Rebuilds the sparse precision matrix Q(kappa, tau) of an SPDE/Matern
field from its mesh geometry and a (kappa, tau) hyperparameter pair,
mirroring the compiled builder (src/spde_qbuilder.h) that
tulpa_nuts_spde() and fit_spde() use internally. Intended for a caller
running its own outer-grid loop over (range, sigma) around a coupled
model tulpa's own SPDE front doors (fit_spde(), spatial_spde()) do not
fit directly – e.g. a per-species community layer sharing one spatial
field.
tulpa_spde_precision_Q(spatial, kappa, tau_spde)
spatial |
A |
kappa |
Spatial frequency |
tau_spde |
SPDE precision scale (see |
A sparse n_mesh x n_mesh precision matrix.
tulpa_spde_log_hyperprior(), fit_spde(), spatial_spde()
n <- 6L
G <- Matrix::bandSparse(n, k = c(-1, 0, 1),
diagonals = list(rep(-1, n - 1), c(1, rep(2, n - 2), 1),
rep(-1, n - 1)))
sp <- spatial_spde_custom(Matrix::Diagonal(n), G, Matrix::Diagonal(n),
prior_range = c(1, 0.5), prior_sigma = c(1, 0.01))
Q <- tulpa_spde_precision_Q(sp, kappa = sqrt(8) / 1, tau_spde = 1)
dim(Q)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.