mc_pearson: Pearson Estimating Function

View source: R/mc_pearson.R

mc_pearsonR Documentation

Pearson Estimating Function

Description

Computes the Pearson estimating function for the dispersion parameters in multivariate covariance generalized linear models, together with its associated sensitivity and variability matrices. This function is used internally in the estimating function framework adopted by mcglm.

Usage

mc_pearson(
  y_vec,
  mu_vec,
  Cfeatures,
  inv_J_beta = NULL,
  D = NULL,
  correct = FALSE,
  compute_sensitivity = TRUE,
  compute_variability = FALSE,
  W
)

Arguments

y_vec

Numeric vector of observed responses stacked across response variables.

mu_vec

Numeric vector of fitted means corresponding to y_vec.

Cfeatures

A list containing covariance-related components, typically including the covariance matrix C, its inverse inv_C, and the derivatives of C with respect to the dispersion parameters (D_C).

inv_J_beta

Optional matrix giving the inverse of the sensitivity matrix associated with the regression parameters. Required only when bias correction is requested.

D

Optional matrix of derivatives of the mean vector with respect to the regression parameters. Required only when bias correction is requested.

correct

Logical indicating whether the bias-corrected Pearson estimating function should be computed. Defaults to FALSE.

compute_sensitivity

Logical indicating whether the sensitivity matrix of the Pearson estimating function should be computed. Defaults to TRUE.

compute_variability

Logical indicating whether the variability matrix of the Pearson estimating function should be computed. Defaults to FALSE.

W

Numeric vector or diagonal matrix of weights associated with the observations.

Details

The Pearson estimating function is based on quadratic forms of the residuals and the inverse covariance matrix. When correct = TRUE, a bias-corrected version is computed using the correction term described in Bonat and Jørgensen (2016). The sensitivity and variability matrices correspond to Equations (6), (7) and (8) of that reference.

This function is intended for internal use and is not designed to be called directly by end users.

Value

A list with the following components:

Score

A numeric vector containing the values of the Pearson estimating function for the dispersion parameters.

Sensitivity

A matrix giving the sensitivity (expected Jacobian) of the Pearson estimating function. Returned only if compute_sensitivity = TRUE.

Variability

A matrix giving the variability of the Pearson estimating function. Returned only if compute_variability = TRUE.

Extra

A list of intermediate quantities used in the computation, mainly products involving derivatives of the covariance matrix.

Author(s)

Wagner Hugo Bonat

Source

Bonat, W. H. and Jørgensen, B. (2016). Multivariate covariance generalized linear models. Journal of the Royal Statistical Society: Series C, 65, 649–675.


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