if (FALSE) {
# Load data
data(gdp_mcmc)
# Histogram of forecast draws for 2012Q4
fc_draws <- gdp_mcmc$forecasts[, "X2012Q4"]
hist(fc_draws, main = "Forecast draws for 2012:Q4", xlab = "Value")
# Add vertical line at realizing value
rlz <- gdp_mcmc$actuals[, "X2012Q4"]
abline(v = rlz, lwd = 3)
# Compute CRPS for this forecast case
crps_sample(y = rlz, dat = fc_draws)
}
Run the code above in your browser using DataLab