deviance_or1: Deviance Information Criteria for ordinal quantile model with...

Description Usage Arguments Details Value References See Also Examples

View source: R/ORI.R

Description

Function for computing the Deviance information criteria for ordinal quantile model with more than 3 outcomes.

Usage

1
deviance_or1(y, x, deltastore, burn, nsim, postMeanbeta, postMeandelta, beta, 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.

deltastore

MCMC draws of δ.

burn

number of discarded MCMC iterations.

nsim

total number of samples, including the burn-in.

postMeanbeta

mean value of β obtained from MCMC draws.

postMeandelta

mean value of δ obtained from MCMC draws.

beta

MCMC draw of coefficients, dimension is (k x nsim).

p

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

Details

Deviance is -2*(log likelihood) and has an important role in statistical model comparison because of its relation with Kullback-Leibler information criteria.

Value

Returns a list with components

DIC = 2*avgdDeviance - devpostmean

pd = avgdDeviance - devpostmean

devpostmean = -2*(logLikelihood)

.

References

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

Spiegelhalter, D. J., Best, N. G., Carlin, B. P. and Linde, A. (2002). “Bayesian Measures of Model Complexity and Fit.” Journal of the Royal Statistical Society B, Part 4: 583-639. DOI: 10.1111/1467-9868.00353

Gelman, A., Carlin, J. B., Stern, H. S., and Rubin, D. B. “Bayesian Data Analysis.” 2nd Edition, Chapman and Hall. DOI: 10.1002/sim.1856

See Also

decision criteria

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
set.seed(101)
data("data25j4")
x <- data25j4$x
y <- data25j4$y
k <- dim(x)[2]
J <- dim(as.array(unique(y)))[1]
D0 <- 0.25*diag(J - 2)
output <- quantreg_or1(y = y,x = x, B0 = 10*diag(k), D0 = D0,
mcmc = 40, p = 0.25, tune = 1, display = FALSE)
mcmc <- 40
deltastore <- output$delta
burn <- 0.25*mcmc
nsim <- burn + mcmc
postMeanbeta <- output$postMeanbeta
postMeandelta <- output$postMeandelta
beta <- output$beta
deviance <- deviance_or1(y, x, deltastore, burn, nsim,
postMeanbeta, postMeandelta, beta, p = 0.25)

# DIC
#   1375.329
# pd
#   139.1751
# devpostmean
#   1096.979

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

Related to deviance_or1 in bqror...