mt_build_sigma: Build variance-covariance matrix

View source: R/mt_build_sigma.R

mt_build_sigmaR Documentation

Build variance-covariance matrix

Description

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

Usage

mt_build_sigma(
  mu,
  tau,
  power,
  Z,
  Ntrial,
  variance,
  power_fixed,
  inverse = FALSE,
  compute_derivative_beta = TRUE
)

Arguments

mu

List with expected values and derivatives. In general the output from mt_link_function.

tau

A numeric vector.

power

A list of 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. Each slot of the list should specify the power parameter for each response variable.

Z

A list of matrices.

Ntrial

Number of trials for binomial data.

variance

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

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 \Sigma, \Sigma^{-1} and the derivative of \Sigma with respect to the power, tau and beta parameters.

Author(s)

Wagner Hugo Bonat, wbonat@ufpr.br

See Also

mt_link_function, mt_variance_function, mt_build_omega.


wbonat/mglm4twin documentation built on Oct. 14, 2023, 9:37 p.m.