logMargLikeOR1 | R Documentation |
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.
logMargLikeOR1(y, x, b0, B0, d0, D0, postMeanbeta,
postMeandelta, betadraws, deltadraws, tune, Dhat, p, verbose)
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. |
This function computes the logarithm of marginal likelihood in the OR1 model using the MCMC outputs from complete and reduced runs.
Returns an estimate of log marginal likelihood
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
mvnpdf, dnorm, Gibbs sampling, Metropolis-Hastings algorithm
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
# -559.73
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.