DLMMCTest {MSTest} | R Documentation |
Maximized Monte Carlo moment-based test for Markov switching model
Description
This function performs the maximized Monte Carlo moment-based test for Markov switching autoregressive models proposed in Dufour & Luger (2017).
Usage
DLMMCTest(Y, p, control = list())
Arguments
Y |
Series to be tested |
p |
Number of autoregressive lags. |
control |
List with test procedure options including:
|
Value
List of class DLMCTest
(S3
object) with attributes including:
mdl_h0: List with restricted model attributes. This will be of class
ARmdl
ifp>0
orNmdl
otherwise (S3
objects). SeeARmdl
orNmdl
.theta_max_min: Value of nuisance parameters when min version of p-value is maximized as discussed in Dufour & Luger (2017) MMC procedure.
theta_max_prod: Value of nuisance parameters when prod version of p-value is maximized as discussed in Dufour & Luger (2017) MMC procedure.
theta_low: Lower bound on nuisance parameter values used when searching for maximum p-value.
theta_upp: Upper bound on nuisance parameter values used when searching for maximum p-value.
S0_min: A (
1 x 4
)) matrix containing the four moment-based test statistics defined in (11
) - (14
) in Dufour & Luger (2017) whentheta_min
is used.S0_prod: A (
1 x 4
)) matrix containing the four moment-based test statistics defined in (11
) - (14
) in Dufour & Luger (2017) whentheta_prod
is used.F0_min: Test statistic value for min version of Maximized Monte Carlo moment-based test.
F0_prod: Test statistic value for prod version of Maximized Monte Carlo moment-based test.
FN_min: A (
N x 1
) vector with simulated test statistics for min version of Maximized Monte Carlo moment-based test under null hypothesis.FN_prod: A (
N x 1
) vector with simulated test statistics for prod version of Maximized Monte Carlo moment-based test under null hypothesis.pval_min: Maximum p-value for min version of Maximized Monte Carlo moment-based test.
pval_prod: Maximum p-value for prod version of Local Monte Carlo moment-based test.
FN_min_cv: Vector with 90%, 95%, and 99% Monte Carlo critical values for min version of Local Monte Carlo moment-based test.
FN_prod_cv: Vector with 90%, 95%, and 99% Monte Carlo critical values for prod version of Local Monte Carlo moment-based test.
control: List with test procedure options used.
optim_min_output: List with optimization output for min version of Maximized Monte Carlo moment-based test.
optim_prod_output: List with optimization output for prod version of Maximized Monte Carlo moment-based test.
References
Dufour, J. M., & Luger, R. 2017. "Identification-robust moment-based tests for Markov switching in autoregressive models." Econometric Reviews, 36(6-9), 713-727.
Examples
set.seed(1234)
# load data used in Hamilton 1989 and extended data used in CHP 2014
y84 <- as.matrix(hamilton84GNP$GNP_logdiff)
y10 <- as.matrix(chp10GNP$GNP_logdiff)
# Set test procedure options
mmc_control <- list(N = 99,
simdist_N = 10000,
getSE = TRUE,
eps = 0.0000001,
CI_union = TRUE,
lambda = 100,
stationary_ind = TRUE,
optim_type = "GenSA",
silence = FALSE,
threshold_stop = 1,
type_control = list(maxit = 200))
# perform test on Hamilton 1989 data
mmc_gnp84 <- DLMMCTest(y84, p = 4, control = mmc_control)
summary(mmc_gnp84)