compute_vcov function

Compute Approximated Variance Covariance Matrix

Compute Approximated Variance Covariance Matrix

Find the approximated variance covariance matrix of the parameters.

compute_vcov(obj)

Arguments

  • obj: a fitted object, either with fitCauchy or cauphylm.

Returns

The same object, with added vcov entry.

Details

This function computes the numerical Hessian of the likelihood at the optimal value using function hessian, and then uses its inverse to approximate the variance covariance matrix. It can be used to compute confidence intervals with functions confint.cauphylm

or confint.cauphyfit.

confint.cauphylm and confint.cauphyfit

internally call compute_vcov, but do not save the result. This function can be used to save the vcov matrix.

Examples

# Simulate tree and data set.seed(1289) phy <- ape::rphylo(20, 0.1, 0) dat <- rTraitCauchy(n = 1, phy = phy, model = "cauchy", parameters = list(root.value = 10, disp = 0.1)) # Fit the data, without computing the Hessian at the estimated parameters. fit <- fitCauchy(phy, dat, model = "cauchy", method = "reml", hessian = FALSE) # Precompute the vcov matrix fit <- compute_vcov(fit) # Approximate confidence intervals confint(fit)

See Also

fitCauchy, cauphylm, confint.cauphylm, confint.cauphyfit, vcov.cauphylm, vcov.cauphyfit

  • Maintainer: Paul Bastide
  • License: GPL (>= 3)
  • Last published: 2024-10-01