% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/complex-models.R
\name{bv}
\alias{bv}
\title{Ngme bivariate model specification}
\usage{
bv(
  mesh,
  sub_models,
  theta = 0,
  rho = 0,
  c1 = 1,
  c2 = 1,
  share_param = FALSE,
  fix_theta = FALSE,
  use_c_param = FALSE
)
}
\arguments{
\item{mesh}{the mesh where model is defined}

\item{sub_models}{a list of sub_models (total 2 sub_models)}

\item{theta}{the rotation parameter (starting point should be from -pi/4 to pi/4)}

\item{rho}{the parameter related to correlation}

\item{c1}{scaling factor for the first sub-model (default: 1)}

\item{c2}{scaling factor for the second sub-model (default: 1)}

\item{share_param}{TRUE if share the same parameter for 2 sub_models (of same type)}

\item{fix_theta}{TRUE if fix the theta of bv model}

\item{use_c_param}{TRUE to estimate c1 and c2 as parameters, FALSE to fix them at specified values (default: FALSE)}
}
\value{
a ngme_operator of bivariate model
}
\description{
Giving 2 sub_models, build a correlated bivariate operator based on K = D(theta, rho) %*% diag(c1*K_1, c2*K_2)
\deqn{D(\theta, \rho) = \begin{pmatrix}
  \cos(\theta) + \rho \sin(\theta) & -\sin(\theta) \sqrt{1+\rho^2} \\
  \sin(\theta) - \rho \cos(\theta) & \cos(\theta) \sqrt{1+\rho^2}
\end{pmatrix}}
}
\details{
The bivariate model combines two sub-models with a rotation matrix D and optional scaling factors c1 and c2.
When \code{use_c_param = TRUE}, c1 and c2 are estimated as parameters (on log scale).
When \code{use_c_param = FALSE} (default), c1 and c2 are fixed at their specified values (both default to 1).
}
