Learn R Programming

scoringRules (version 0.9.2)

GDP data: Data and forecasts for US GDP growth

Description

Historical data and forecast distributions for the growth rate of US gross domestic product (GDP). The forecasts are generated from a Bayesian Markov Switching model as described in Section 5 of Krueger et al (2016).

Arguments

Format

gdp is a data frame which contains the real-time data set used in Section 5 of KLTG (2016), with the following columns:

  • dt - date in question (e.g., "2013Q2" for the second quarter of 2013)

  • vint - data vintage (i.e., the date at which the realization was recorded); same format as dt

  • val - value of the GDP growth rate

gdp_mcmc is a list, whereby each element is a data frame. gdp_mcmc$forecasts contains the simulated forecast distributions. There are 20 columns (corresponding to quarters 2008:Q1 to 2012:Q4) and 20,000 rows (corresponding to simulation draws). gdp_mcmc$actuals contains the actual observations. There are 20 columns (again corresponding to quarterly dates) and a single row.

Details

The realizations in gdp_mcmc$actuals are also contained in gdp, based on the second available vintage for each date. For example, gdp_mcmc$actuals$X2008Q1 is the entry in gdp for which dt == "2008Q1" and vint == "2008Q3".

References

Krueger, F., S. Lerch, T.L. Thorarinsdottir and T. Gneiting (2016), ``Probabilistic forecasting and comparative model assessment based on Markov Chain Monte Carlo output'', working paper, Heidelberg Institute for Theoretical Studies, available at http://arxiv.org/abs/1608.06802.

Examples

Run this code
# NOT RUN {
# Load data
data(gdp_mcmc)

# Histogram of forecast draws for 2012Q4
hist(gdp_mcmc$forecasts[, "X2012Q4"], main = "Forecast draws for 2012:Q4", xlab = "Value")

# Add vertical line at realizing value
abline(v = gdp_mcmc$actuals[, "X2012Q4"], lwd = 3)

# }

Run the code above in your browser using DataLab