Replication files for:

Marek Jarocinski and Michele Lenza, An Inflation Predicting Measure of the Output Gap in the Euro Area,
Journal of Money, Credit and Banking, accepted on 20 November 2017

subfolder [data]
Content: Data in the ASCI format (*.csv) and in the matlab format (*.mat).
The following files contain real time data from 1985Q1 to 2015Q4, vintages from 2002Q3 to 2015Q4.
pp.csv - HICP excluding energy and unprocessed food
pe.csv - 6-to-10 years ahead inflation expectations
yy.csv - real GDP
in.scv - real private investment
im.csv - real imports
ex.csv - real exports
uu.csv - unemployment rate
cc.csv - consumer confidence
cu.csv - capacity utilization
po.csv - the price of oil
The following files contain data from 1985Q1 to 2015Q4, a single recent vintage
pc.csv - commodity price index, collected 2016q2
usd.csv - exchange rate usd per 1 euro, collected in 2016q2
pp16q4.csv - HICP excluding energy and unprocessed food from 1985Q1 to 2016q3, collected in 2016q4
Files in the matlab format:
datartd.mat contains pp,pe,yy,yy,in,im,ex,uu,cc,cu,po
other.mat contains pc,usd,pp16q4

subfolder [workm]
Content: Matlab programs to replicate the paper.
mod1.m, mod2.m,... etc - files that define the models: observables and priors. The last line of these files calls the estimation routines.
dfmpc6d.m - the main function that performs the estimation, given data and prior (see the documentation in dfmpc.pdf)
run_rec.m - loads the data, calls the estimating function for each vintage of the real time dataset and stores the results.
run_last.m - loads the data, calls the estimating function for with the last vintage data and stores the results
*** A remark about run_rec.m and run_last.m: Variable 'simul_type' defined in these files determines the length of the Gibbs sampler chain.
simul_type = 'test' -> Test mode to check if the files are working. Time: a few minutes.
simul_type = 'long' -> Chain length: 250,000. The run_rec with this setting takes about 15 hours on a standard pc.
kfsim.m - general purpose Kalman filter and simulation smoother based on Jarocinski (2015)
kfsim_nan.m - as above, allowing missing data (NaN) in the observables
kfsim_nan_sv.m - as above, with time-varying variances of the shocks
and other functions called by dfmpc6d, including some due to Gianni Amisano, Joshua Chan, John D'Errico and James P. Le Sage

main level [.]
Content: scripts that generate tables and plots from the saved results.
evalfore - forecast evaluations: creates tables with MSE and log predictive scores, and plots for Figures 2 and 5
plot_states - plots for Figures 3 and 10; run it twice: once with modid = 'mod4'; and once with modid = 'mod6c';
plot_fig1, etc... - generate the respective figures


Replicating the results in the paper.
1. Run each of the files 'mod...' in [workm]
2. (optional) Move the resulting '.mat' files to a new folder [results]
3. Run the scripts that generate tables and plots from the saved results.
