logMargLikeOR1 {bqror} | R Documentation |
Marginal likelihood in the OR1 model
Description
This function computes the logarithm of marginal likelihood in the OR1 model (ordinal quantile model with 3 or more outcomes) using the MCMC outputs from the complete and reduced runs.
Usage
logMargLikeOR1(y, x, b0, B0, d0, D0, postMeanbeta,
postMeandelta, betadraws, deltadraws, tune, Dhat, 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 |
d0 |
prior mean for |
D0 |
prior covariance matrix for |
postMeanbeta |
posterior mean of |
postMeandelta |
posterior mean of |
betadraws |
a dataframe with all the sampled values for |
deltadraws |
a dataframe with all the sampled values for |
tune |
tuning parameter to adjust the MH acceptance rate. |
Dhat |
negative inverse Hessian from the maximization of log-likelihood. |
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 OR1 model using the MCMC outputs from 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 to 1321, 1995. DOI: 10.1080/01621459.1995.10476635
Chib, S., and Jeliazkov, I. (2001). '"Marginal likelihood from the Metropolis-Hastings output."' Journal of the American Statistical Association, 96(453):270'-'281, 2001. DOI: 10.1198/016214501750332848
See Also
mvnpdf, dnorm, Gibbs sampling, Metropolis-Hastings algorithm
Examples
set.seed(101)
data("data25j4")
y <- data25j4$y
xMat <- data25j4$x
k <- dim(xMat)[2]
J <- dim(as.array(unique(y)))[1]
b0 <- array(rep(0, k), dim = c(k, 1))
B0 <- 10*diag(k)
d0 <- array(0, dim = c(J-2, 1))
D0 <- 0.25*diag(J - 2)
output <- quantregOR1(y = y, x = xMat, b0, B0, d0, D0,
burn = 10, mcmc = 40, p = 0.25, tune = 1, accutoff = 0.5, maxlags = 400, verbose = FALSE)
# output$logMargLike
# -554.61