Skip to contents

Variance-covariance matrix for a fitted longitudinal GAMLSS-copula model

Usage

# S3 method for class 'gamlss.longitudinal'
vcov(
  object,
  par = NA,
  sep_d2 = TRUE,
  numderiv = FALSE,
  method = c("analytical", "numderiv", "analytical_only", "sandwich"),
  progress = interactive(),
  h = 1e-04,
  cluster = NULL,
  sandwich_h = 1e-05,
  sandwich_adjust = TRUE,
  sandwich_bread_method = c("analytical", "numderiv", "analytical_only"),
  ...
)

Arguments

object

A fitted gamlss.longitudinal object.

par

Optional parameter list for evaluating uncertainty away from the fitted coefficients.

sep_d2

Logical legacy argument retained for compatibility.

numderiv

Logical; use the numerical Hessian path.

method

Character; variance-covariance method to use. "analytical" (default) uses the semi-analytical Hessian from R/hessian-analytical.R. "numderiv" uses full finite-difference numerical second derivatives as a slower reference path. "sandwich" uses a cluster-robust sandwich estimator for fixed coefficients, with clusters defaulting to subjects. The legacy numderiv logical argument is still accepted and maps to method = "numderiv" when TRUE.

progress

Logical; show progress bars for slow Hessian calculations.

h

Numeric finite-difference step used by the analytical Hessian helper.

cluster

Optional cluster labels for method = "sandwich". Defaults to the fitted subject identifiers.

sandwich_h

Numeric finite-difference step used for sandwich cluster score contributions.

sandwich_adjust

Logical; apply a finite-sample cluster correction to sandwich covariance estimates.

sandwich_bread_method

Character; Hessian method used for the sandwich bread.

...

Additional arguments, currently unused.

Value

A list containing variance-covariance matrices and standard errors.