Skip to content
Replication material for: 'Factor-based forecasting in the presence of outliers: Are factors better selected and estimated by the median than the mean?'
TeX R
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app
.gitignore
LICENSE
README.md

README.md

Replication material for: 'Factor-based forecasting in the presence of outliers: Are factors better selected and estimated by the median than the mean?'

Johannes Tang Kristensen.

Link to the paper


This repository contains the material necessary to replicate the empirical application in: 'Factor-based forecasting in the presence of outliers: Are factors better selected and estimated by the median than the mean?' The code is a partial re-write of the code originally released with the paper. Since the original version of the code changes in the KFAS package has caused the code for the Kalman-filter-based benchmark model included in the paper to break. I have, therefore, not included that model here. However, the original code for the model can be found at the link above.

Required packages

The forecastexp package is required for the estimation and the macrods package provides the data functions:

library('devtools')
install_github('johannestang/forecastexp')
install_github('johannestang/macrods')

In addition the following packages should be installed : pryr, and xtable, both available from CRAN.

Note: Total runtime is approximately 5 hours when using a 20 core machine (2 E5-2680 v2 CPUs @ 2.8 GHz).

/app

  • forecastapp.R estimates the models and produces all output.
  • simple.R function for forecasting using simple means/medians.
  • FRED.rda the dataset.
You can’t perform that action at this time.