MMCLRTest {MSTest} | R Documentation |
Maximized Monte Carlo Likelihood Ratio Test
Description
This function performs the Maximized Monte Carlo likelihood ratio test (MMC-LRT) proposed in Rodriguez-Rondon & Dufour (2022).
Usage
MMCLRTest(Y, p, k0, k1, control = list())
Arguments
Y |
Series to be tested. Must be a ( |
p |
Number of autoregressive lags. Must be greater than or equal to 0. |
k0 |
Number of regimes under null hypothesis. Must be greater than or equal to 1. |
k1 |
Number of regimes under alternative hypothesis. Must be greater than |
control |
List with test procedure options including:
|
Value
List of class LMCLRTest
(S3
object) with attributes including:
mdl_h0: List with restricted model attributes. See
Nmdl
,ARmdl
,VARmdl
,HMmdl
,MSARmdl
, orMSVARmdl
documentation for return values.mdl_h0: List with unrestricted model attributes. See
HMmdl
,MSARmdl
, orMSVARmdl
documentation for return values.LRT_0: Value of test statistic from observed data.
LRN: A (
N x 1
) vector of test statistics from data simulated under the null hypothesis.pval: P-value of Local Monte Carlo Likelihood Ratio Test.
LRN_cv: Vector with 90%, 95%, and 99% Monte Carlo critical values (from vector
LRN
).control: List with test procedure options used.
References
Rodriguez-Rondon, Gabriel and Jean-Marie Dufour. 2022. "Simulation-Based Inference for Markov Switching Models” JSM Proceedings, Business and Economic Statistics Section: American Statistical Association.
Rodriguez-Rondon, Gabriel and Jean-Marie Dufour. 2023. “Monte Carlo Likelihood Ratio Tests for Markov Switching Models.” Unpublished manuscript.
Examples
set.seed(1234)
# Define DGP of MS AR process
mdl_ms2 <- list(n = 200,
mu = c(5,10),
sigma = c(1,4),
phi = c(0.5),
k = 2,
P = rbind(c(0.90, 0.10),
c(0.10, 0.90)))
# Simulate process using simuMSAR() function
y_ms_simu <- simuMSAR(mdl_ms2)
# Set test procedure options
mmc_control = list(N = 19,
burnin = 100,
converge_check = NULL,
eps = 0.1,
CI_union = TRUE,
silence = FALSE,
threshold_stop = 0.05 + 1e-6,
type = "pso",
maxit = 100,
mdl_h0_control = list(const = TRUE,
getSE = TRUE),
mdl_h1_control = list(msmu = TRUE,
msvar = TRUE,
getSE = TRUE,
method = "EM",
maxit = 300,
use_diff_init = 1))
MMCtest <- MMCLRTest(y_ms_simu$y, p = 1 , k0 = 1 , k1 = 2, mmc_control)
summary(MMCtest)