% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/models.R
\name{precision_matrix_multivariate_spde}
\alias{precision_matrix_multivariate_spde}
\title{Compute the precision matrix for multivariate spde Matern model}
\usage{
precision_matrix_multivariate_spde(
  p,
  mesh,
  rho,
  alpha_list = NULL,
  theta_K_list = NULL,
  variance_list = NULL,
  B_K_list = NULL,
  theta = NULL,
  Q = NULL
)
}
\arguments{
\item{p}{dimension, should be integer and greater than 1}

\item{mesh}{an fmesher::fm_mesh_2d object, mesh for build the SPDE model}

\item{rho}{vector with the p(p-1)/2 correlation parameters rho_11, rho_21, rho_22, ... rho_p1, rho_p2, ... rho_p(p-1)}

\item{alpha_list}{a list of SPDE smoothness parameter}

\item{theta_K_list}{a list (length is p) of theta_K}

\item{variance_list}{If provided, it should be a vector of length p, where the
kth element corresponds to a desired variance of the kth field. The kth operator
is then scaled by a constant c so that this variance is achieved in the stationary case
(default no scaling)}

\item{B_K_list}{a list (length is p) of B_K (non-stationary case)}

\item{theta}{parameter for Q matrix (length of 1 when p=2, length of 3 when p=3)}

\item{Q}{orthogonal matrix of dim p*p (provide when p > 3)}
}
\value{
the precision matrix of the multivariate model
}
\description{
Compute the precision matrix for multivariate spde Matern model
}
\details{
The general model is defined as $D diag(L_1, ..., L_p) x = M$. D is the dependence matrix, it is paramterized by $D = Q(theta) * D_l(cor_mat)$, where $Q$ is the orthogonal matrix, and $D_l$ is matrix controls the cross-correlation.
See the section 2.2 of Bolin and Wallin (2020) for exact parameterization of Dependence matrix.
}
\examples{
library(fmesher)

# Use a small mesh so the example stays lightweight.
x <- seq(from = 0, to = 1, length.out = 6)
mesh <- fm_rcdt_2d_inla(lattice = fm_lattice_2d(x, x), extend = FALSE)

Q <- precision_matrix_multivariate_spde(
  p = 2,
  mesh = mesh,
  rho = 0.25,
  alpha_list = list(2, 2),
  theta_K_list = list(0, 0),
  variance_list = list(1, 1)
)
dim(Q)
}
\references{
Bolin, D. and Wallin, J. (2020), Multivariate type G Matérn stochastic partial differential equation random fields. J. R. Stat. Soc. B, 82: 215-239. https://doi.org/10.1111/rssb.12351
}
