mc_build_sigma: Build variance-covariance matrix

View source: R/mc_build_sigma.R

mc_build_sigmaR Documentation

Build variance-covariance matrix

Description

This function builds a variance-covariance matrix, based on the variance function and omega matrix.

Usage

mc_build_sigma(
  mu,
  Ntrial = 1,
  tau,
  power,
  Z,
  sparse,
  variance,
  covariance,
  power_fixed,
  compute_derivative_beta = FALSE
)

Arguments

mu

A numeric vector. In general the output from mc_link_function.

Ntrial

A numeric vector, or NULL or a numeric specifing the number of trials in the binomial experiment. It is usefull only when using variance = binomialP or binomialPQ. In the other cases it will be ignored.

tau

A numeric vector.

power

A numeric or numeric vector. It should be one number for all variance functions except binomialPQ, in that case the argument specifies both p and q.

Z

A list of matrices.

sparse

Logical.

variance

String specifing the variance function: constant, tweedie, poisson_tweedie, binomialP or binomialPQ.

covariance

String specifing the covariance function: identity, inverse or expm.

power_fixed

Logical if the power parameter is fixed at initial value (TRUE). In the case power_fixed = FALSE the power parameter will be estimated.

compute_derivative_beta

Logical. Compute or not the derivative with respect to regression parameters.

Value

A list of matrices. The function returns a list of matrices with the Cholesky decomposition of \Sigma, \Sigma^{-1} and the derivative of \Sigma with respect to the power and tau parameters. The returned object is intended for internal use only.

Author(s)

Wagner Hugo Bonat

See Also

mc_link_function, mc_variance_function, mc_build_omega.


mcglm documentation built on Jan. 9, 2026, 1:07 a.m.