DLMMCTest function

Maximized Monte Carlo moment-based test for Markov switching model

Maximized Monte Carlo moment-based test for Markov switching model

This function performs the maximized Monte Carlo moment-based test for Markov switching autoregressive models proposed in Dufour & Luger (2017).

DLMMCTest(Y, p, control = list())

Arguments

  • Y: Series to be tested

  • p: Number of autoregressive lags.

  • control: List with test procedure options including:

    • N: Integer determining the number of Monte Carlo simulations. Default is set to 99 as in paper.
    • simdist_N: Integer determining the number of simulations for CDF distribution approximation. Default is set to 10000.
    • getSE: Boolean indicator. If TRUE, standard errors for restricted model are estimated. If FALSE no standard errors are estimated. Default is TRUE.
    • eps: Fixed positive constant that does not depend on T used to determine lower and upper bounds on consistent set considered for nuisance parameter space.
    • CI_union: Boolean indicator determining if union between eps and confidence interval is used to determine lower and upper bound on consistent set considered for nuisance parameter space. If TRUE union is used and if FALSE only eps is used. Note that if standard errors obtained are not finite then only eps is used. Default is FALSE.
    • lambda: Numeric value for penalty on stationary constraint not being met. Default is 100.
    • stationary_ind: Boolean indicator determining if only stationary solutions should be considered if TRUE or any solution can be considered if FALSE. Default is TRUE.
    • phi_low: Vector with lower bound for autoregressive parameters when optimizing. Default is NULL.
    • phi_upp: Vector with upper bound for autoregressive parameters when optimizing. Default is NULL.
    • optim_type: String determining type of numerical optimization algorithm to use. Available options are: pso, GenSA, GA. Default is pso.
    • silence: Boolean indicator determining if optimization updates should be silenced if TRUE or not if FALSE. Default is FALSE.
    • threshold_stop: Numeric value determining the maximum possible p-value attainable. Default is 1.
    • maxit: Int determining the maximum number of function evaluations. Default is 1000.
    • optim_control: List containing other optimization options specific to the numerical optimization algorithm used. For other options see documentation of numerical algorithm chosen.

Returns

List of class DLMCTest (S3 object) with attributes including:

  • mdl_h0: List with restricted model attributes. This will be of class ARmdl if p\>0 or Nmdl otherwise (S3 objects). See ARmdl or Nmdl.
  • 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) when theta_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) when theta_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.

Examples

set.seed(1234) # load data used in Hamilton 1989 and extended data used in CHP 2014 y84 <- as.matrix(hamilton84GNP$GNP_gr) y10 <- as.matrix(chp10GNP$GNP_gr) # Set test procedure options mmc_control <- list(N = 99, simdist_N = 10000, getSE = TRUE, eps = 0, CI_union = TRUE, lambda = 100, stationary_ind = TRUE, optim_type = "GenSA", silence = FALSE, threshold_stop = 1, maxit = 200) # perform test on Hamilton 1989 data mmc_gnp84 <- DLMMCTest(y84, p = 4, control = mmc_control) summary(mmc_gnp84)

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.

  • Maintainer: Gabriel Rodriguez Rondon
  • License: GPL (>= 2)
  • Last published: 2025-02-24