model_weights: Get Posterior/NML Model Weights

View source: R/model_weights.R

model_weightsR Documentation

Get Posterior/NML Model Weights

Description

Computes the posterior model probabilities based on the log-marginal likelihoods/negative NML values.

Usage

model_weights(x, prior)

Arguments

x

vector or matrix of log-marginal probabilities or negative NML values (if matrix: one model per column)

prior

vector of prior model probabilities (default: uniform over models). The vector is normalized internally to sum to one.

Examples

logmarginal <- c(-3.4, -2.0, -10.7)
model_weights(logmarginal)

nml <- matrix(c(
  2.5, 3.1, 4.2,
  1.4, 0.3, 8.2
), nrow = 2, byrow = TRUE)
model_weights(-nml)

multinomineq documentation built on Nov. 22, 2022, 5:09 p.m.