logMargLikeOR2 {bqror}R Documentation

Marginal likelihood in the OR2 model

Description

This function computes the logarithm of marginal likelihood in the OR2 model (ordinal quantile model with exactly 3 outcomes) using the Gibbs output from the complete and reduced runs.

Usage

logMargLikeOR2(y, x, b0, B0, n0, d0, postMeanbeta, postMeansigma,
btildeStore, BtildeStore, gammacp2, p, verbose)

Arguments

y

observed ordinal outcomes, column vector of size (n x 1).

x

covariate matrix of size (n x k) including a column of ones with or without column names.

b0

prior mean for \beta.

B0

prior covariance matrix for \beta.

n0

prior shape parameter of inverse-gamma distribution for \sigma.

d0

prior scale parameter of inverse-gamma distribution for \sigma.

postMeanbeta

posterior mean of \beta from the complete Gibbs run.

postMeansigma

posterior mean of \delta from the complete Gibbs run.

btildeStore

a storage matrix for btilde from the complete Gibbs run.

BtildeStore

a storage matrix for Btilde from the complete Gibbs run.

gammacp2

one and only cut-point other than 0.

p

quantile level or skewness parameter, p in (0,1).

verbose

whether to print the final output and provide additional information or not, default is TRUE.

Details

This function computes the logarithm of marginal likelihood in the OR2 model using the Gibbs output from the complete and reduced runs.

Value

Returns an estimate of log marginal likelihood

References

Chib, S. (1995). '"Marginal likelihood from the Gibbs output."' Journal of the American Statistical Association, 90(432):1313'-'1321, 1995. DOI: 10.1080/01621459.1995.10476635

See Also

dinvgamma, mvnpdf, dnorm, Gibbs sampling

Examples

set.seed(101)
data("data25j3")
y <- data25j3$y
xMat <- data25j3$x
k <- dim(xMat)[2]
b0 <- array(rep(0, k), dim = c(k, 1))
B0 <- 10*diag(k)
n0 <- 5
d0 <- 8
output <- quantregOR2(y = y, x = xMat, b0, B0, n0, d0, gammacp2 = 3,
burn = 10, mcmc = 40, p = 0.25, accutoff = 0.5, maxlags = 400, verbose = FALSE)
# output$logMargLike
#   -404.57


[Package bqror version 1.7.0 Index]