postprob: Compute posterior model probabilities for given BIC values

View source: R/BIC_orderconstraints.R

postprobR Documentation

Compute posterior model probabilities for given BIC values

Description

postprob computes posterior model probabilities based on given bic-values assuming prior probabilities specified as priorprob.

Usage

postprob(bic, priorprob = 1)

Arguments

bic

A vector of length greater than 1 containing BIC-values of the models of interest.

priorprob

A vector containing the prior probabilities of the models. The vector does not have to be normalized. The default setting gives equal prior probabilities.

Value

A vector of posterior model probabilities

Examples



# compute bic of an order-constrained model
salfit <- glm(mpg ~ gear + qsec + vs + am, family = gaussian, data = mtcars.standardized)
bic_oc1 <- bic_oc(salfit, constraints = "am > vs > qsec")
# compute bic of the complement of this order-constrained model
bic_oc2 <- bic_oc(salfit, constraints = "am > vs > qsec", complement = TRUE)
postprob(c(bic_oc1[[1]],bic_oc2[[1]]))


jomulder/BICpack documentation built on Oct. 24, 2023, 10:30 p.m.