Skip to content

Commit c37b991

Browse files
authored
Merge pull request #9 from cmu-delphi/fcast-revision2
Forecast paper Revision 2
2 parents a9cb917 + df45cb1 commit c37b991

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1505
-1284
lines changed

common/covidcast.bib

Lines changed: 233 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ @misc{EvalcastR
567567
@book{Hyndman:2018,
568568
author = {Hyndman, Rob J and Athanasopoulos, George},
569569
publisher = {OTexts},
570-
title = {Forecasting: {P}rinciples and Practice},
570+
title = {Forecasting: Principles and Practice},
571571
year = {2018}}
572572

573573
@misc{ForecastHub,
@@ -970,4 +970,236 @@ @article{Bilinski:2021
970970
number = {6},
971971
pages = {1825--1828},
972972
Bdsk-Url-1 = {https://doi.org/10.1007/s11606-021-06633-8},
973+
}
974+
975+
976+
%% Pile of Forecast Refs
977+
978+
%% Real Time Data
979+
980+
981+
@article{faust2009a,
982+
author = {Faust, Jon and Wright, Jonathan H.},
983+
journal = {Journal of Business and Economic Statistics},
984+
pages = {468---479},
985+
title = {Comparing Greenbook and Reduced Form Forecasts using a Large Realtime Dataset},
986+
volume = {27},
987+
year = {2009}}
988+
989+
@article{diebold1991a,
990+
author = {Diebold, Francis X. and Rudebusch, Glenn D.},
991+
journal = {Journal of the American Statistical Association},
992+
pages = {603---610},
993+
title = {Forecasting Output With the Composite Leading Index: A Real-Time Analysis},
994+
volume = {86},
995+
year = {1991}}
996+
997+
@article{patterson1995a,
998+
author = {Patterson, K.D.},
999+
journal = {International Journal of Forecasting},
1000+
pages = {395---405},
1001+
title = {Forecasting the Final Vintage of Real Personal Disposable Income: A State Space Approach},
1002+
volume = {11},
1003+
year = {1995}}
1004+
1005+
@incollection{croushore2011a,
1006+
author = {Croushore, Dean},
1007+
booktitle = {The Oxford Handbook of Economic Forecasting},
1008+
editor = {Hendry, David F. and Clements, Michael P.},
1009+
pages = {247---267},
1010+
publisher = {Oxford University Press},
1011+
title = {Forecasting with real-time data vintages},
1012+
year = {2011}}
1013+
1014+
@incollection{croushore2006a,
1015+
address = {Amsterdam},
1016+
author = {Croushore, Dean},
1017+
booktitle = {Handbook of Economic Forecasting},
1018+
editor = {Elliott, Graham and Granger, Clive W.J. and Timmermann, Allan},
1019+
pages = {961--972},
1020+
publisher = {North-Holland},
1021+
title = {Forecasting with Real-Time Macroeconomic Data},
1022+
year = {2006}}
1023+
1024+
@incollection{harvey1983a,
1025+
address = {Washington, D.C},
1026+
author = {Harvey, A.C. and McKenzie, C.R. and Blake, D.P.C. and Desai, M.J.},
1027+
booktitle = {Applied Time Series Analysis of Economic Data},
1028+
editor = {Zellner, Arnold},
1029+
pages = {329---347},
1030+
publisher = {U.S. Department of Commerce},
1031+
title = {Irregular Data Revisions},
1032+
type = {Economic Research Report ER-5,},
1033+
year = {1983}}
1034+
1035+
@article{mankiw1986a,
1036+
author = {Mankiw, N.Gregory and Shapiro, Matthew D.},
1037+
journal = {Survey of Current Business},
1038+
pages = {20--25},
1039+
volume = {66},
1040+
title = {News or Noise: An Analysis of GNP Revisions},
1041+
year = {1986}}
1042+
1043+
@article{trivellato1986a,
1044+
author = {Trivellato, Ugo and Rettore, Enrice},
1045+
journal = {Journal of Business and Economic Statistics},
1046+
pages = {445---453},
1047+
title = {Preliminary Data Errors and Their Impact on the Forecast Error of Simultaneous-Equations Models},
1048+
volume = {4},
1049+
year = {1986}}
1050+
1051+
@article{clark2009a,
1052+
author = {Clark, Todd E. and McCracken, Michael W.},
1053+
journal = {Journal of Business and Economic Statistics},
1054+
pages = {441---454},
1055+
title = {Tests of Equal Predictive Ability with Real-Time Data},
1056+
volume = {27},
1057+
year = {2009}}
1058+
1059+
@article{koenig2003a,
1060+
author = {Koenig, Evan and Dolmas, Sheila and Piger, Jeremy},
1061+
journal = {Review of Economics and Statistics},
1062+
pages = {618---628},
1063+
title = {The Use and Abuse of `Real-Time' Data in Economic Forecasting},
1064+
volume = {85},
1065+
year = {2003}}
1066+
1067+
@article{howrey1978a,
1068+
author = {Howrey, E.Philip},
1069+
journal = {Review of Economics and Statistics},
1070+
pages = {193---200},
1071+
title = {The Use of Preliminary Data in Econometric Forecasting},
1072+
volume = {60},
1073+
year = {1978}}
1074+
1075+
% Leadingness
1076+
1077+
@article{yeats1972a,
1078+
author = {Yeats, A.J.},
1079+
journal = {Business Economics},
1080+
pages = {7---11},
1081+
title = {An Alternative Approach to the Identification of Leading Indicators},
1082+
volume = {7},
1083+
year = {1972}}
1084+
1085+
@article{emerson1996a,
1086+
author = {Emerson, R.A. and Hendry, D.F.},
1087+
journal = {Journal of Forecasting},
1088+
pages = {271---291},
1089+
title = {An evaluation of forecasting using leading indicators},
1090+
volume = {15},
1091+
year = {1996}}
1092+
1093+
@article{koch1988a,
1094+
author = {Koch, P. and Rasche, R.H.},
1095+
journal = {Journal of Business and Economic Statistics},
1096+
pages = {167---187},
1097+
title = {An examination of the commerce department leading-indicator approach'},
1098+
volume = {6},
1099+
year = {1988}}
1100+
1101+
@incollection{sargent1977a,
1102+
author = {Sargent, Thomas and Sims, Christopher},
1103+
booktitle = {New Methods in Business Cycle Research},
1104+
pages = {45--109},
1105+
publisher = {Federal Reserve Bank of Minneapolis},
1106+
title = {Business cycle modeling without pretending to have too much a priori economic theory},
1107+
year = {1977}}
1108+
1109+
@article{engle1987a,
1110+
author = {Engle, Robert F. and Granger, Clive W.J.},
1111+
journal = {Econometrica},
1112+
pages = {251--276},
1113+
volume = {55},
1114+
title = {Co-integration and error correction: Representation, estimation, and testing},
1115+
year = {1987}}
1116+
1117+
@incollection{shiskin1968a,
1118+
address = {New York},
1119+
author = {Shiskin, J. and Moore, G.},
1120+
booktitle = {Supplement to National Bureau Report One},
1121+
pages = {1--8},
1122+
publisher = {NBER},
1123+
title = {Composite Indexes of Leading, Coinciding and Lagging Indicators, 1948--1967},
1124+
year = {1968}}
1125+
1126+
@article{granger1969a,
1127+
author = {Granger, Clive W.J.},
1128+
journal = {Econometrica},
1129+
pages = {424---438},
1130+
title = {Investigating causal relations by econometric models and cross-spectral methods},
1131+
volume = {37},
1132+
year = {1969}}
1133+
1134+
@book{lahiri1991a,
1135+
author = {Lahiri, K. and Moore, G.H.},
1136+
publisher = {Cambridge University Press},
1137+
title = {Leading economic indicators: New approaches and forecasting records},
1138+
year = {1992}}
1139+
1140+
@article{koopmans1947a,
1141+
author = {Koopmans, T.C.},
1142+
journal = {Review of Economics and Statistics},
1143+
pages = {161---179},
1144+
title = {Measurement without theory},
1145+
volume = {29},
1146+
year = {1947}}
1147+
1148+
@article{StockWatson1989,
1149+
author = {Stock, James H. and Watson, Mark W.},
1150+
journal = {NBER Macroeconomics Annual},
1151+
pages = {351---394},
1152+
title = {New Indexes of Coincident and Leading Economic Indicators},
1153+
volume = {4},
1154+
year = {1989}}
1155+
1156+
@article{diebold1989a,
1157+
author = {Diebold, F.X. and Rudebusch, G.D.},
1158+
journal = {Journal of Business},
1159+
pages = {369---391},
1160+
title = {Scoring the leading indicators'},
1161+
volume = {62},
1162+
year = {1989}}
1163+
1164+
@book{mitchell1938a,
1165+
address = {New York},
1166+
author = {Mitchell, W. and Burns, A.F.},
1167+
publisher = {NBER Bulletin 69},
1168+
title = {Statistical Indicators of Cyclical Revivals},
1169+
year = {1938}}
1170+
1171+
@article{auerbach1982a,
1172+
author = {Auerbach, A.J.},
1173+
journal = {Review of Economics and Statistics},
1174+
pages = {589---595},
1175+
title = {The index of leading indicators: Measurement without theory thirty-five years later'},
1176+
volume = {64},
1177+
year = {1982}}
1178+
1179+
@article{hamilton1996a,
1180+
author = {Hamilton, James D. and Perez-Quiros, Gabriel},
1181+
journal = {The Journal of Business},
1182+
pages = {27---49},
1183+
title = {What Do the Leading Indicators Lead?},
1184+
volume = {69},
1185+
year = {1996}}
1186+
1187+
@article{ioannidis2020a,
1188+
author = {Ioannidis, J.P.A. and Cripps, S. and Tanner, M.A.},
1189+
title = {Forecasting for COVID-19 has failed},
1190+
year = {2020},
1191+
volume = {10},
1192+
doi = {10.1016/j.ijforecast.2020.08.004},
1193+
journal = {International Journal of Forecasting}
1194+
}
1195+
1196+
@article{chakraborty2018know,
1197+
title={What to know before forecasting the flu},
1198+
author={Chakraborty, Prithwish and Lewis, Bryan and Eubank, Stephen and Brownstein, John S and Marathe, Madhav and Ramakrishnan, Naren},
1199+
journal={PLoS computational biology},
1200+
volume={14},
1201+
number={10},
1202+
pages={e1005964},
1203+
year={2018},
1204+
publisher={Public Library of Science San Francisco, CA USA}
9731205
}
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
library(evalcast)
2+
library(covidcast)
3+
library(tidyverse)
4+
library(aws.s3)
5+
Sys.setenv("AWS_DEFAULT_REGION" = "us-east-2")
6+
s3bucket <- get_bucket("forecast-eval")
7+
8+
9+
# Point to the data Addison sent
10+
ours <- readRDS(here::here("data", "results_honest_states.RDS"))
11+
baseline <- ours %>% filter(forecaster == "Baseline") %>%
12+
select(-forecaster) %>% rename(strawman_wis = wis)
13+
14+
# these are epiweek / num
15+
bpreds <- s3readRDS("predictions_cards.rds", s3bucket) %>%
16+
filter(forecaster == "COVIDhub-baseline",
17+
signal == "confirmed_incidence_num",
18+
forecast_date < "2021-01-01",
19+
ahead %in% 1:4,
20+
!(geo_value %in% c("as", "gu", "pr", "vi", "mp", "us")))
21+
22+
# trying with the prop signal, since that's what we use
23+
actuals <- covidcast_signal("jhu-csse", "confirmed_7dav_incidence_prop",
24+
end_day = "2021-02-01", geo_type = "state",
25+
as_of = "2021-05-18") %>%
26+
select(geo_value, time_value, value) %>%
27+
rename(target_end_date = time_value, actual = value)
28+
29+
# Population / 100,000
30+
pop <- covidcast::state_census %>% select(ABBR, POPESTIMATE2019) %>%
31+
mutate(geo_value = tolower(ABBR), POPESTIMATE2019 = POPESTIMATE2019 / 1e5) %>%
32+
select(-ABBR)
33+
34+
# Scale epiweek total to daily prop
35+
bpreds2 <- left_join(bpreds, pop) %>%
36+
mutate(value = value / (7 * POPESTIMATE2019)) %>%
37+
select(-POPESTIMATE2019, -incidence_period)
38+
39+
# Score the Hub Baseline
40+
bscores <- evaluate_predictions(bpreds2, actuals,
41+
grp_vars = c("ahead", "forecast_date", "geo_value"),
42+
err_measures = list(wis = weighted_interval_score))
43+
44+
comb <- left_join(bscores %>%
45+
# submissions made on Monday with Sunday target
46+
mutate(ahead = ahead * 7 - 2,
47+
forecast_date = target_end_date - ahead) %>%
48+
select(forecast_date, target_end_date, geo_value, wis),
49+
baseline %>%
50+
select(forecast_date, target_end_date, geo_value, strawman_wis),
51+
by = c("geo_value", "forecast_date", "target_end_date")) %>%
52+
filter(!is.na(strawman_wis), !is.na(wis))
53+
54+
55+
56+
57+
ggplot(comb, aes(wis, strawman_wis, color = geo_value)) +
58+
geom_point() +
59+
theme_bw() +
60+
theme(legend.position = "none") +
61+
geom_abline(intercept =0, slope = 1) +
62+
scale_x_log10() +
63+
scale_y_log10() +
64+
xlab("WIS of COVIDhub-baseline") +
65+
ylab("WIS or our baseline") +
66+
coord_equal()
67+
68+
ncomb <- comb %>%
69+
mutate(ahead = target_end_date - forecast_date) %>%
70+
pivot_longer(contains("wis"), names_to = "forecaster") %>%
71+
group_by(forecaster, ahead) %>%
72+
summarise(wis = Mean(value), geo_wis = GeoMean(value)) %>%
73+
mutate(forecaster = recode(forecaster, wis = "Hub", strawman_wis = "Ours")) %>%
74+
pivot_longer(contains("wis"))
75+
ggplot(ncomb, aes(as.character(ahead), value, fill = forecaster)) +
76+
geom_col(position = "dodge") +
77+
facet_wrap(~name)
78+

0 commit comments

Comments
 (0)