You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.Rmd
+20-15
Original file line number
Diff line number
Diff line change
@@ -116,7 +116,7 @@ Below the fold, we construct this dataset as an `epiprocess::epi_df` from JHU da
116
116
<details>
117
117
<summary> Creating the dataset using `{epidatr}` and `{epiprocess}` </summary>
118
118
This dataset can be found in the package as <TODO DOESN'T EXIST>; we demonstrate some of the typically ubiquitous cleaning operations needed to be able to forecast.
119
-
First we pull both jhu-csse cases and deaths from [`{epidatr}` package](https://cmu-delphi.github.io/epidatr/):
119
+
First we pull both jhu-csse cases and deaths from [`{epidatr}`](https://cmu-delphi.github.io/epidatr/) package:
As with basically any dataset, there is some cleaning that we will need to do to make it actually usable; we'll use some utilities from [`{epiprocess}`](https://cmu-delphi.github.io/epiprocess/) for this.
153
153
First, to eliminate some of the noise coming from daily reporting, we do 7 day averaging over a trailing window[^1]:
154
154
155
-
[^1]: This makes it so that any given day of the new dataset only depends on the previous week, which means that we avoid leaking future values when making a forecast.
155
+
[^1]: This makes it so that any given day of the processed timeseries only depends on the previous week, which means that we avoid leaking future values when making a forecast.
156
156
157
157
```{r smooth}
158
158
cases_deaths <-
@@ -193,7 +193,6 @@ of the states, noting the actual forecast date:
To make a forecast, we will use a "canned" simple auto-regressive forecaster to predict the death rate four weeks into the future using past (lagged) deaths and cases
221
+
To make a forecast, we will use a "canned" simple auto-regressive forecaster to predict the death rate four weeks into the future using lagged[^3] deaths and cases
222
+
223
+
[^3]: lagged by 3 in this context meaning using the value from 3 days ago.
In this case, we have used a number of different lags for the case rate, while
237
-
using zero, one and two weekly lags for the death rate (as predictors). `four_week_ahead` is both
238
-
a fitted model object which could be used any time in the future to create
239
-
different forecasts, as well as a set of predicted values (and prediction
240
-
intervals) for each location 28 days after the forecast date.
238
+
In this case, we have used 0-3 days, a week, and two week lags for the case
239
+
rate, while using only zero, one and two weekly lags for the death rate (as
240
+
predictors).
241
+
The result `four_week_ahead` is both a fitted model object which could be used
242
+
any time in the future to create different forecasts, as well as a set of
243
+
predicted values (and prediction intervals) for each location 28 days after the
244
+
forecast date.
241
245
Plotting the prediction intervals on our subset above[^2]:
242
246
243
247
[^2]: Alternatively, you could call `auto_plot(four_week_ahead)` to get the full collection of forecasts. This is too busy for the space we have for plotting here.
@@ -249,7 +253,7 @@ This is the same kind of plot as `processed_data_plot` above, but with the past
0 commit comments