Learn R Programming

INLAvaan (version 0.2.4)

vcov: Variance-Covariance Matrix for INLAvaan Models

Description

Extract the posterior variance-covariance matrix of model parameters from a fitted INLAvaan model.

Usage

# S4 method for INLAvaan
vcov(object, type = c("lavaan", "theta"), ...)

Value

A square numeric matrix.

Arguments

object

An object of class INLAvaan.

type

Character. "lavaan" (default) returns the posterior covariance matrix of the model parameters computed from posterior samples (matching lavaan output). "theta" returns the Laplace approximation covariance in the internal parameterisation.

...

Currently unused.

See Also

summary(), coef(), standardisedsolution()

Examples

Run this code
# \donttest{
HS.model <- "
  visual  =~ x1 + x2 + x3
  textual =~ x4 + x5 + x6
  speed   =~ x7 + x8 + x9
"
utils::data("HolzingerSwineford1939", package = "lavaan")
fit <- acfa(HS.model, HolzingerSwineford1939, std.lv = TRUE, nsamp = 100,
            test = "none", verbose = FALSE)

# Default: posterior covariance of lavaan parameters
vcov(fit)

# Internal parameterisation (Laplace approximation)
vcov(fit, type = "theta")
# }

Run the code above in your browser using DataLab