View source: R/BIC_orderconstraints.R
postprob | R Documentation |
postprob
computes posterior model probabilities based on given bic
-values
assuming prior probabilities specified as priorprob
.
postprob(bic, priorprob = 1)
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. |
A vector of posterior model probabilities
# 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]]))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.