vcov.choicer_mnp: Extract variance-covariance matrix from a choicer_mnp object

View source: R/methods.R

vcov.choicer_mnpR Documentation

Extract variance-covariance matrix from a choicer_mnp object

Description

Returns the posterior covariance matrix of the identified coefficient draws (computed eagerly at fit time; no Hessian is involved).

Usage

## S3 method for class 'choicer_mnp'
vcov(object, ...)

Arguments

object

A choicer_mnp object.

...

Additional arguments (ignored).

Value

Named posterior covariance matrix.

Examples


library(data.table)
set.seed(42)
N <- 100; J <- 3
dt <- data.table(id = rep(1:N, each = J), alt = rep(1:J, N))
dt[, `:=`(x1 = rnorm(.N), x2 = rnorm(.N))]
dt[, choice := 0L]
dt[, choice := sample(c(1L, rep(0L, J - 1))), by = id]
fit <- run_mnprobit(dt, "id", "alt", "choice", c("x1", "x2"),
                    mcmc = list(R = 300, burn = 100))
vcov(fit)


choicer documentation built on Sept. 5, 2026, 1:07 a.m.