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 |
x |
covariate matrix of size |
b0 |
prior mean for |
B0 |
prior covariance matrix for |
n0 |
prior shape parameter of inverse-gamma distribution for |
d0 |
prior scale parameter of inverse-gamma distribution for |
postMeanbeta |
posterior mean of |
postMeansigma |
posterior mean of |
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