Monte Carlo simulation: general model with correlated random coefficients and
cross-sectional heteroskedasticity


Drivers
-------
Each driver generates the data, estimates the model with every predictor, and
writes the point and density forecast tables.

run_general_mc.m
    Main experiment, normal v_it. modrun 201.
run_general_mc_skewed_shocks.m
    Same experiment with skewed v_it, so the normal likelihood is
    misspecified. modrun 202.
run_general_mc_joint_lambda_sigma.m
    Robustness check. The eight predictors plus a ninth with a joint MGLR_x
    prior on (lambda_i, l_i). modrun 203.
run_general_mc_heterogeneous_ar1.m
    Robustness check. The eight predictors plus a ninth with heterogeneous
    persistence beta_i. modrun 204.
plot_mcmc_diagnostics.m
    Trace plots for beta, sigma_i^2 and lambda_i from a saved draw file
    in results/. Set modrun, i_sim and i_est at the top; the default is the
    main experiment, first repetition, Heterosk-NP-C.

The full experiment is n_sim = 100 repetitions, each drawing 10,000 MCMC
iterations per predictor with the first 5,000 discarded as burn-in.

The two robustness tables in the paper come from a single repetition, so run
those drivers with is_par = 0. The modrun tag prefixes every output file, so
the four drivers never overwrite each other.


Predictors
----------
Each predictor matches a label in the paper. The sampler folders all expose
the same entry point, np_link.m, so a driver selects a predictor by adding the
corresponding folder to the path.

oracle.m                 knows the true parameters and distributions
oracle_mixture_shocks.m  oracle when v_it follows a normal mixture
homog.m                  Homog
homosk_np_c/             Homosk-NP-C
heterosk_flat.m          Heterosk-Flat
heterosk_param.m         Heterosk-Param
heterosk_np_disc/        Heterosk-NP-disc
heterosk_np_r/           Heterosk-NP-R
heterosk_np_c/           Heterosk-NP-C
heterosk_np_c_joint/     Heterosk-NP-C with a joint prior on (lambda_i, l_i)
heterosk_np_c_ar1/       Heterosk-NP-C with heterogeneous persistence beta_i

The Monte Carlo drivers cover Oracle through NP-C, the rows of the general
model table. oracle_mixture_shocks.m is used only in the skewed experiment.
The last two folders are the extra predictors in the robustness checks.

Every sampler folder holds the same two files. np_link.m sets up the priors
and the starting values, and np_mcmc.m carries out the MCMC steps.

heterosk_np_disc/ and heterosk_np_r/ run np_mcmc.m compiled. Both ship an Apple
silicon np_mcmc_mex, and build_np_mcmc_mex.m in the folder rebuilds it through
MATLAB Coder on any other platform. Without a build np_link.m falls back to
np_mcmc.m, which is slower and, since the compiled and interpreted paths draw
from the random stream differently, does not reproduce a run draw for draw. The
remaining folders always run np_mcmc.m as it stands and get their speed from
invChol_mex, which the drivers pick up from ../tools/invChol.


Output
------
All files go to results/. NNN is the driver's modrun.

Tables
    modrunNNNispar*_dfcst.txt        LPS
    modrunNNNispar*_pfcst.txt        MSE
Figures
    none from the drivers. plot_mcmc_diagnostics.m writes
    modrunNNN_sim*_est*_beta.png, _sigma2.png and _lambda.png from a
    saved draw file.
.mat
    modrunNNN.mat                    workspace
    modrunNNN_sim*_est*.mat          draws for every predictor except Homog
