vcov.gkwfit | R Documentation |
Extracts the variance-covariance matrix of the estimated parameters from a model
fitted by gkwfit
. This matrix is typically derived from the
inverse of the observed Hessian matrix calculated during fitting (requires
hessian = TRUE
in the gkwfit
call). This is an S3 method
for the generic vcov
function.
## S3 method for class 'gkwfit'
vcov(object, ...)
object |
An object of class |
... |
Additional arguments (currently ignored). |
A numeric matrix representing the variance-covariance matrix of the
estimated model parameters. Row and column names correspond to the parameter
names (e.g., "alpha"
, "beta"
, etc.). Returns NULL
or
raises a warning/error if the matrix is not available (e.g., if hessian=FALSE
was used or if the Hessian computation failed).
Lopes, J. E.
gkwfit
, vcov
, coef.gkwfit
, logLik.gkwfit
# Generate data and fit model (ensure hessian = TRUE for vcov)
set.seed(2203)
y <- rbkw(50, alpha = 2, beta = 3, gamma = 1.5, delta = 0.5)
fit <- gkwfit(data = y, family = "bkw", plot = FALSE, hessian = TRUE)
# Extract variance-covariance matrix
vcov_matrix <- vcov(fit)
print(vcov_matrix)
# Extract standard errors from the diagonal
std_errors <- sqrt(diag(vcov_matrix))
print(std_errors)
# Compare with standard errors from summary
summary_se <- summary(fit)$coefficients[, "Std. Error"]
all.equal(std_errors, summary_se)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.