logMargLikelihood_or2: Marginal likelihood for ordinal quantile model with 3...

Description Usage Arguments Details Value References See Also Examples

View source: R/ORII.R

Description

This function computes the logarithm of marginal likelihood for ordinal quantile model with 3 outcomes using Gibbs output from the complete and reduced runs.

Usage

1
2
logMargLikelihood_or2(y, x, b0, B0, n0, d0, postMeanbeta, postMeansigma,
btildeStore, BtildeStore, gamma, p)

Arguments

y

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

x

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

b0

prior mean for normal distribution to sample β.

B0

prior variance for normal distribution to sample β

n0

prior for shape parameter to sample σ from inverse gamma distribution.

d0

prior for scale parameter to sample σ from inverse gamma distribution.

postMeanbeta

a vector with mean of sampled β for each covariate.

postMeansigma

a vector with mean of sampled σ.

btildeStore

a storage matrix for posterior mean of β.

BtildeStore

a storage matrix for posterior variance of β.

gamma

one and only cut-point other than 0.

p

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

Details

Function computes the logarithm of marginal likelihood for ordinal model with 3 outcomes using a Gibbs sampling procedure.

Value

Returns a scalar for logarithm of marginal likelihood

References

Rahman, M. A. (2016). “Bayesian Quantile Regression for Ordinal Models.” Bayesian Analysis, 11(1): 1-24. DOI: 10.1214/15-BA939

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

Greenberg, E. (2012). “Introduction to Bayesian Econometrics.” Cambridge University Press, Cambridge. DOI: 10.1017/CBO9780511808920

See Also

dinvgamma, mvnpdf, dnorm, Gibbs sampling

Examples

1
2
3
4
5
6
7
8
9
set.seed(101)
data("data25j3")
x <- data25j3$x
y <- data25j3$y
k <- dim(x)[2]
output <- quantreg_or2(y = y, x = x, B0 = 10*diag(k),
mcmc = 50, p = 0.25, display = FALSE)
# output$logMargLikelihood
#   -404.57

bqror documentation built on Nov. 22, 2021, 1:07 a.m.