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 specifying the number of trials in the binomial experiment. It is useful 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 specifying the variance function: constant, tweedie, poisson_tweedie, binomialP or binomialPQ.

covariance

String specifying 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 with the Cholesky decomposition of Σ, Σ^{-1} and the derivative of Σ with respect to the power and tau parameters.

Author(s)

Wagner Hugo Bonat

See Also

mc_link_function, mc_variance_function, mc_build_omega.


mcglm documentation built on Sept. 16, 2022, 1:06 a.m.