Source code for paper "A loss discounting framework for model averaging and selection in time series models"
The repository contains the python, R and matlab code for the ldf method as well as the reproducibe notebooks for the simulation and empirical studies presented in the paper.
https://sites.google.com/site/dimitriskorobilis/matlab/dynamic-bayesian-learning
https://www2.stat.duke.edu/~mw/mwsoftware/BPS/index.html
Code for DeCo "Time-varying combinations of predictive densities using nonlinear filtering" Billio et al. (2013)
http://www.francescoravazzolo.com/pages/DeCo.html
Note: the results of the competing models: BPS and DeCo are saved down as the runs take hours/days. The results can be replicated using authors' code linked above.
- In order to launch Jupyter environment press the binder icon above.
- Binder does not support reading from Git Large File Storage (LFS) so you will not be able to read the large .mat files.
- If you wish to read the large .mat files you need to clone the repo to your local PC
- Once in Jupyter environment navigate to the notebooks folder.
- The following notebook replicate sections of the paper:
- simulation_study.ipynb - replicates subsection 4.1 "Simulation study" in the paper. In particular,
cell 22
replicates Figure 1,cell 24
replicates Figure 3,cell 50
replicates Figure 2b,cell 54
replicates Figure 2a.
- simulation_study.ipynb - replicates subsection 4.1 "Simulation study" in the paper. In particular,
- FX_forecasts.ipynb and FX_investment.ipynb replicate subsection 4.2 "Foreign Exchange Forecasts"
- FX_forecasts.ipynb
cell 25
replicates Figure 4, 2 upper subfigures and cell 45 (small pool with cell 2 set topython log_lik = np.load(r"..//data//FX//uip_l1_save_loglik.npz")["x"]
and the large with cell 2python log_lik = np.load(r"..//data//FX//full_save_loglik.npz")["x"]
) - FX_forecasts.ipynb
cell 36
replicates Figure 5 (cell 2 set topython log_lik = np.load(r"..//data//FX//uip_l1_save_loglik.npz")["x"]
) - FX_investment.ipynb
cell 26
andcell 58
replicate Figure 6 - FX_investment.ipynb
cell 45
replicates Figure 8 - FX_investment.ipynb
cell 65
replicates Figure 7
- FX_forecasts.ipynb
- US_inflation.ipynb
cell 27
replicates Figure 9 in subsection "US Inflation Forecasts"