Speeding up OccBin Monte Carlo simulations

I am running Monte Carlo simulations for welfare analysis in an OccBin model, with T = 1200 periods and N = 2000 simulations. In each simulation, I generate a sequence of 1200 random shocks in a separate .m file, feed them into the .mod files, and let the solver compute the piecewise solution period by period. I repeat the exercise 2000 times.

The issue is that this is extremely slow. Even for a standard Taylor rule with the ZLB, the simulations take a very long time. For an average inflation targeting rule with the ZLB, the full exercise would take roughly 5–7 days. This seems very inefficient for a welfare analysis that requires many repetitions.

I was considering a shortcut: solve the model once for a full sequence of shocks, extract the policy functions for each regime, and then reuse them whenever the economy is in the same regime. The idea was that, conditional on the regime, the policy functions might be the same regardless of the exact shock realization.

However, I am not sure this is valid. My concern is that the regime-specific policy functions may still depend on shock history through expectations, even in a linearized model.

Is there a valid way to avoid resolving the model in every period of every Monte Carlo simulation when using OccBin? More generally, what is the standard way to make this type of exercise computationally feasible?

Any advice would be much appreciated.

policy are already stored for every regime encountered, so this should not help.

maybe there could be other options you could try, for example set those two options like

options_occbin_.simul.max_check_ahead_periods=40;
options_occbin_.simul.check_ahead_periods=40;

to avoid yesting excessively long zlb spell durations. thsi may already speed-up.