| compute_vcov | R Documentation |
Find the approximated variance covariance matrix of the parameters.
compute_vcov(obj)
obj |
a fitted object, either with |
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.
The same object, with added vcov entry.
fitCauchy, cauphylm,
confint.cauphylm, confint.cauphyfit,
vcov.cauphylm, vcov.cauphyfit
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.