--------------------------------------------------------------------------

This folder contains data and Matlab code to replicate the estimation in 
"Does real-time macroeconomic information help to predict interest rates?" 
by Alberto Caruso and Laura Coroneo, Journal of Money, Credit and Banking, 
Forthcoming

--------------------------------------------------------------------------

MAIN REPLICATION CODE

•   Main.m: run this code to estimate the 4 models presented in the paper 
(the only-yields model (OY), the only-yields model with surveys (OY_SPF), 
the macro-yields model in real-time (MY) and the macro-yields model in 
real-time with surveys (MY_SPF)) and reproduce Figure 5 in the paper.

--------------------------------------------------------------------------

DATA:

•   data_jan2012.txt: dataset of yields, real-time macroeconomic variables 
and surveys as available on Jan 2012

•   data_feb2012.txt: dataset of yields, real-time macroeconomic variables 
and surveys as available on Feb 2012

•   data_all.txt: full sample data for yields

Note: the analysis in the paper includes one additional macroeconomic 
variable (PMI Composite Index (NAPM), which can be dowloaded from 
Refinitiv using the code USCNFBUSQ).

--------------------------------------------------------------------------

MAIN ESTIMATION FUNCTION

•   MY_est.m: estimates the Macro-Yields model with surveys (and its variants) 
and produces forecasts for all the variables in the system

--------------------------------------------------------------------------

AUXILIARY FUNCTIONS:

•   initial.m: initialises all the state-space system parameters. 

•   Estep.m: computes the (expected) sufficient statistics for a single Kalman 
filter sequence.

•   runKF_tv.m: Kalman filter for stationary systems with time-varying system matrices and missing data.

•   restr_corr.m: perfoms the restricted maximization for the factor loadings.

•   em_converged.m: checks for convergence of the likelihood.

•   NS_fact.m: computes the Nelson and Siegel factors and loadings.

•   inpaint_nans.m: interpolates missing values.

•   standardise.m: standardises a T x N matrix of data.

--------------------------------------------------------------------------

Contact Author: Laura Coroneo
e-mail address: laura.coroneo@york.ac.uk
Release date: 24/10/22
