DESCRIPTION
These programs performs Monte Carlo simulations for the univariate local level model used as example in the paper (section 6.2.2). 
In order to replicate the simulations in the paper, please, execute the program S622_main.m adjusting T (the sample size) and hypothesis (the data generating process).
To replicate the results for HAC variance calculations execute S622_main_hac.m after S622_main.m has concluded.
To replicate the results for bootstrap critical value calculations execute S622_main_bootstrap.m after S622_main.m has concluded.

The model is given by:
y_t = x_t + v_t
x_t = c + x_(t-1) + sqrt(gamma_x)*f_t
v_t = sqrt(gamma_v)*e_t
(f_t,e_t)' are N[0(2,1),I(2)] under the null.

The user should set:
- Calibration of the parameters c and q = gx/gv,
It is always assumed that gx = 1 for the purpose of simulation;
- Number o Monte Carlo replicas S and sample size T;
- Distribution of the innovations hypothesis,
hypothesis == 0: null, (f_t,e_t)' is N(0(2,1),I(2)),
hypothesis == 1: alternative, (f_t,e_t)' is t(0(2,1),I(2),nu),
hypothesis == 2: alternative, f_t is t(0,1,nu) and e_t is N(0,1),
hypothesis == 3: alternative, f_t is N(0,1) and e_t is t(0,1,nu),
hypothesis == 4: alternative, f_t and e_t are t(0,1,nu) each,
hypothesis == 5: alternative, (f_t,e_t)' is t(0(2,1),I(2),nu,beta),
hypothesis == 6: alternative, f_t is t(0,1,nu,beta) and e_t is N(0,1),
hypothesis == 7: alternative, f_t is N(0,1) and e_t is t(0,1,nu,beta),
hypothesis == 8: alternative, f_t and e_t are t(0,1,nu,beta) each.
Degrees of freedom nu and direction of asymmetry beta should also be set.

The programs will compute and save:
- ML estimators and asymptotic variances of estimators,
- Scores with respect to the shape parameters,
- Asymptotic variances of the scores,
- Test statistics.

The programs will create files with names:
- estimate_'T'_'H'.mat, containing data and ML estimates,
- score_'T'_'H'.mat, shape parameter scores,
- stderr_'T'_'H'.mat, containing asymptotic variances of scores,
- test_'T'_'H'.mat, containing the test statistics.
- hac_'T'.mat, containing the HAC-based test statistics.
- bootstrap_'T'.mat, containing the test statistic over simulated bootstrap samples.
- critical_'T'.mat, containing the bootstrap critical values.
- bootstrap_test_'T'_'H'.mat, containing the bootstrap-based tests.
'T' is replaced by the sample size and 'H' by the hypothesis of the simulations.

INFORMATION
Authors: Almuzara, Amengual, Sentana.
Date: January 2016. Revised: November 2018.
