ineffactorOR1 | R Documentation |
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.
ineffactorOR1(x, betadraws, deltadraws, accutoff, maxlags, verbose)
x |
covariate matrix of size |
betadraws |
dataframe of the MCMC draws of |
deltadraws |
dataframe of the MCMC draws of |
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. |
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.
Returns a column vector of inefficiency factors for each component of \beta
and \delta
.
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
pracma, acf
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.