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

\item{operator_list}{a list of ngme_operator object (length should be p)}

\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{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)}

\item{scale}{A vector of length p with constants to multiply each operator matrix with}
}
\value{
the precision matrix of the multivariate model
}
\description{
Compute the precision matrix for multivariate 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{
rho <- c(-0.5, 0.5, -0.25) # correlation parameters
operator_list <- list(ar1(1:5, rho = 0.4), ar1(1:5, rho = 0.5), ar1(1:5, rho = 0.6))
precision_matrix_multivariate(3, operator_list, rho, theta = c(1, 2, 3))
}
\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
}
