This function simulates the sample distribution under the null hypothesis using parallel workers.
LR_samp_dist_par(
mdl_h0,
k1,
N,
burnin,
Z,
mdl_h0_control,
mdl_h1_control,
workers,
seed = NULL,
predrawn_eps = NULL,
predrawn_state_rand = NULL
)vector of simulated LRT statistics
List with restricted model properties.
integer specifying the number of regimes under the alternative hypothesis.
integer specifying the number of replications.
integer specifying the number of observations to drop from beginning of simulation.
Exogenous regressors matrix or NULL.
List with controls/options used to estimate restricted model.
List with controls/options used to estimate unrestricted model.
Integer determining the number of parallel workers. If workers > N, the effective count is silently capped at N (more workers than simulations provides no speedup and can thin the pre-drawn buffer below its retry budget).
Optional integer seed for reproducible parallel RNG (L'Ecuyer-CMRG). Default is NULL (random but independent streams).
Optional list of pre-drawn standard normal matrices for fixed-error simulation (Dufour 2006, Prop. 4.2). Each element is a (T+burnin) x q matrix. Default is NULL (draw fresh innovations).
Optional matrix of pre-drawn U[0,1] for state transitions. Columns correspond to simulation draws. Default is NULL (only needed when null model has multiple regimes).
Rodriguez-Rondon, G., & Dufour, J.-M. 2026a. "Monte Carlo Likelihood-Ratio Tests for Markov Switching Models." Bank of Canada Staff Working Paper, No. 2026-23. doi: 10.34989/swp-2026-23.