MCMCpanic10: MCMC PANIC (2010) Sample Moment and PAC tests for...

Description Usage Arguments Value References


This function performs the tests of PANIC (2010) with a Monte Carlo Markov chain based on a Gibbs sampler. One test estimates the pooled autoregressive coefficient, and one uses a sample moment. The sample moments test is based off of the modified Sargan-Bhargava test (PMSB) while the pooled autoregressive component is based on the Moon and Perron test as well a biased corrected pooled coefficient from PANIC (2004).


MCMCpanic10(x = NULL, nfac = NULL, k1 = NULL, criteria = NULL,
demean = FALSE, burn = 100, mcmc = 100, thin = 10,
verbose = 0, seed = NA, lambda.start = NA, psi.start = NA,
 l0 = 0, L0 = 0, a0 = 0.001, b0 = 0.001, std.var = TRUE,...)



An object of class xts holding the time series data


An integer speciyfing the maximum number of factors allowed while estimating the factor model.


an Integer that is the maximum lag allowed in the ADF test.


a character vector with values of either IC1, IC2, IC3, AIC1, BIC1, AIC3, BIC3, or eigen. Choosing eigen makes the number of factors equal to the number of columns whose sum of eigenvalues is less than or equal to .5.


logical argument. If TRUE, function performs tests on demeaned data. If FALSE, uses non-demeanded data generating process.


The number of burn in iterators for the sampler


The number of iterations in the sampler


The thinning interval used in the simulation. mcmc must be divisible by this value.


A positive integer which determines whether or not the progress of the sampler is printed to the screen. If verbose is greater than 0 the iteration number and the factor loadings and uniqueness are printed to the screen every verboseth iteration.


The seed for the random number generator.


Starting values for the factor loading matrix Lambda.


Starting values for the uniqueness


The means of the independent Normal prior on the factor loadings


A scalar or a matrix with the same dimensions as lambda. The precision (inverse variances) of the independent Normal prior on the factor loadings.


scalar or a k-vector. Controls the shape of the inverse Gamma prior on the uniqueness.


Controls the scale of the inverse Gamma prior on the uniqueness.


if TRUE the variables are rescaled to have zero mean and unit variance. Otherwise, the variables are rescaled to have zero mean, but retain their observed variances


extra parameters to be passed to MCMCfactanal


mcmc_tests An mcmc object containing the resamples of the test statistics. When demeaned, the results will be for model P, PMSB, Model C, and rho1. When not demeaned, the results will be for model A, model B, PMSB, rho1, and the pooled values on the idiosyncratic component of PANIC (2004).


Bai, Jushan, and Serena Ng. 'Panel Unit Root Tests With Cross-Section Dependence: A Further Investigation.' Econometric Theory 26.04 (2010): 1088-1114. Print.

Andrew D. Martin, Kevin M. Quinn, Jong Hee Park (2011). MCMCpack: Markov Chain Monte Carlo in R. Journal of Statistical Software. 42(9): 1-21. URL

Search within the PANICr package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.