Posterior summaries (mean, SD, equal-tailed credible interval) of the identified coefficient and covariance draws.
Usage
# S3 method for class 'choicer_mnp'
summary(object, prob = 0.95, print_asc = 20L, ...)Arguments
- object
A choicer_mnp object.
- prob
Probability mass of the equal-tailed credible interval (default 0.95).
- print_asc
Which alternative-specific constants (ASCs) to print: a non-negative whole number prints the first that many (default
20L),TRUEprints all andFALSEnone. A character vector selects ASCs by their alternatives' labels asas.character()writes them, not by coefficient names, so integer-coded alternatives are selected withc("3", "5"); an empty vector selects none. Rows keep their table order, every other row is printed, and a notice reports how many ASCs are shown and hidden. Only printing is limited: the returned object keeps every row. For hierarchical Bayes summaries the ASCs are the alternative effects (deltaandxi).- ...
Additional arguments (ignored).
Value
A summary.choicer_mnp object (list with coefficient and Sigma posterior tables plus metadata).
Examples
# \donttest{
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))]
#> id alt x1 x2
#> <int> <int> <num> <num>
#> 1: 1 1 1.37095845 -0.004620768
#> 2: 1 2 -0.56469817 0.760242168
#> 3: 1 3 0.36312841 0.038990913
#> 4: 2 1 0.63286260 0.735072142
#> 5: 2 2 0.40426832 -0.146472627
#> ---
#> 296: 99 2 -0.47733551 0.160327395
#> 297: 99 3 -0.16626149 -0.433641942
#> 298: 100 1 0.86256338 1.537412419
#> 299: 100 2 0.09734049 -2.170246577
#> 300: 100 3 -1.62561674 1.027004619
dt[, choice := 0L]
#> id alt x1 x2 choice
#> <int> <int> <num> <num> <int>
#> 1: 1 1 1.37095845 -0.004620768 0
#> 2: 1 2 -0.56469817 0.760242168 0
#> 3: 1 3 0.36312841 0.038990913 0
#> 4: 2 1 0.63286260 0.735072142 0
#> 5: 2 2 0.40426832 -0.146472627 0
#> ---
#> 296: 99 2 -0.47733551 0.160327395 0
#> 297: 99 3 -0.16626149 -0.433641942 0
#> 298: 100 1 0.86256338 1.537412419 0
#> 299: 100 2 0.09734049 -2.170246577 0
#> 300: 100 3 -1.62561674 1.027004619 0
dt[, choice := sample(c(1L, rep(0L, J - 1))), by = id]
#> id alt x1 x2 choice
#> <int> <int> <num> <num> <int>
#> 1: 1 1 1.37095845 -0.004620768 0
#> 2: 1 2 -0.56469817 0.760242168 0
#> 3: 1 3 0.36312841 0.038990913 1
#> 4: 2 1 0.63286260 0.735072142 0
#> 5: 2 2 0.40426832 -0.146472627 1
#> ---
#> 296: 99 2 -0.47733551 0.160327395 0
#> 297: 99 3 -0.16626149 -0.433641942 0
#> 298: 100 1 0.86256338 1.537412419 0
#> 299: 100 2 0.09734049 -2.170246577 0
#> 300: 100 3 -1.62561674 1.027004619 1
fit <- run_mnprobit(dt, "id", "alt", "choice", c("x1", "x2"),
mcmc = list(R = 300, burn = 100))
#> MCMC run time 0h:0m:0.01s
summary(fit)
#> Bayesian Multinomial Probit (MNP) model
#>
#> Parameter Mean SD 2.5% Median 97.5%
#> x1 0.063026 0.081881 -0.075582 0.048243 0.236581
#> x2 0.025470 0.068834 -0.114687 0.030377 0.160373
#> ASC_2 -0.304236 0.147291 -0.556418 -0.306093 -0.018311
#> ASC_3 -0.282557 0.192143 -0.707430 -0.255709 0.040163
#>
#> Covariance of utility differences (Sigma, identified scale):
#> Parameter Mean SD 2.5% Median 97.5%
#> Sigma_11 1.000000 0.000000 1.000000 1.000000 1.000000
#> Sigma_21 -0.451340 0.317582 -1.023424 -0.472345 0.075129
#> Sigma_22 1.755649 1.832053 0.299792 1.239454 8.500831
#>
#> Posterior mean Sigma:
#> w_2 w_3
#> w_2 1.00000 -0.451340
#> w_3 -0.45134 1.755649
#>
#> Base alternative: 1
#> Draws kept: 200 (R = 300, burn = 100, thin = 1, seed = 726215586)
#> N: 100 | Parameters: 4
#> Sampling time: 0.01 s
#> Identification: per-draw normalization by sigma_11 (McCulloch-Rossi 1994).
# }