ineffactorOR1 {bqror}R Documentation

Inefficiency factor in the OR1 model

Description

This function calculates the inefficiency factor from the MCMC draws of (\beta, \delta) in the OR1 model (ordinal quantile model with 3 or more outcomes). The inefficiency factor is calculated using the batch-means method.

Usage

ineffactorOR1(x, betadraws, deltadraws, accutoff, maxlags, verbose)

Arguments

x

covariate matrix of size (n x k) including a column of ones with or without column names. This input is used to extract column names, if available, but not used in calculation.

betadraws

dataframe of the MCMC draws of \beta, size (k x nsim).

deltadraws

dataframe of the MCMC draws of \delta, size ((J-2) x nsim).

accutoff

cut-off to identify the number of lags and form batches, default is 0.05.

maxlags

maximum lag at which to calculate the acf, default is 400.

verbose

whether to print the final output and provide additional information or not, default is TRUE.

Details

Calculates the inefficiency factor of (\beta, \delta) using the batch-means method based on MCMC draws. Inefficiency factor can be interpreted as the cost of working with correlated draws. A low inefficiency factor indicates better mixing and an efficient algorithm.

Value

Returns a column vector of inefficiency factors for each component of \beta and \delta.

References

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

Chib, S. (2012), '"Introduction to simulation and MCMC methods."' In Geweke J., Koop G., and Dijk, H.V., editors, '"The Oxford Handbook of Bayesian Econometrics"', pages 183–218. Oxford University Press, Oxford. DOI: 10.1093/oxfordhb/9780199559084.013.0006

See Also

pracma, acf

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)
betadraws <- output$betadraws
deltadraws <- output$deltadraws
inefficiency <- ineffactorOR1(xMat, betadraws, deltadraws, 0.5, 400, TRUE)

# Summary of Inefficiency Factor:

#             Inef Factor
# beta_1        1.1008
# beta_2        3.0024
# beta_3        2.8543
# delta_1       3.6507
# delta_2       3.1784


[Package bqror version 1.7.0 Index]