% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/omegaVarCov.R
\name{rxOmegaVarCovDeriv}
\alias{rxOmegaVarCovDeriv}
\title{Variance-covariance (non-Cholesky) Omega parameterization derivatives}
\usage{
rxOmegaVarCovDeriv(omega, order = 2L)
}
\arguments{
\item{omega}{symmetric positive-definite random-effects covariance matrix.}

\item{order}{integer; \code{1} for first derivatives only, \code{2} (default) to also
return the second derivatives needed for the covariance Hessian.}
}
\value{
a list with \code{omegaInv}, \code{logDet}, the free-element index matrix
\code{elements} (each row \code{c(a, b)}, \code{a >= b}), first derivatives
\code{dOmegaInv} / \code{dLogDet}, and (when \code{order = 2}) second derivatives
\code{d2OmegaInv} / \code{d2LogDet}.
}
\description{
A non-Cholesky \code{Omega} path that differentiates with respect to the
variance-covariance entries directly (for reporting SEs on the natural scale
or building an analytic covariance over the \code{Omega} elements).  Returns
\code{Omega^{-1}}, \verb{log|Omega|}, and their first (and optionally second)
derivatives with respect to each free lower-triangular element
\verb{omega_\{ab\}}, via
}
\details{
\deqn{\partial \Omega^{-1}/\partial \omega_{ab} = -\Omega^{-1} E_{ab} \Omega^{-1}}
\deqn{\partial \log|\Omega|/\partial \omega_{ab} = \mathrm{tr}(\Omega^{-1} E_{ab})}

where \eqn{E_{ab}} is the symmetric single-entry basis matrix.
}
\author{
Hidde van de Beek
}
