Description Usage Arguments Value Note Examples
fit ARIMA model to US data dropping one state
1 2 3 4 5 6 7 8 9 10 11 | Arima_drop_state(
src_us,
src_st,
state.in = "New York",
MAorder = 2,
Difforder = 1,
basedate = "2020-02-15",
lookback_days = 29,
ARorder = 0,
max_date = NULL
)
|
src_us |
tibble for national level data like that of enriched_jhu_data() |
src_st |
tibble for state level data like that of nytimes_state_data() |
state.in |
character(1) state name |
MAorder |
numeric(1) order of moving average component |
Difforder |
numeric(1) differencing order d of ARIMA(p,d,q) |
basedate |
character(1) used by lubridate::as_date to filter away all earlier records |
lookback_days |
numeric(1) only uses this many days from most recent in src |
ARorder |
order of autoregressive component |
max_date |
a date from which to start lookback ... defaults to NULL in which case the latest available date is used |
instance of S3 class Arima_sars2pack
Apparent discrepancies in counts in vicinity of April 15 between NYT and JHU for full US incidence lead us to employ the two sources for the example. If NYT alone is used, summing to obtain USA overall, the resulting USA incidence trend is extravagantly variable.
1 2 3 4 5 6 7 8 9 10 11 12 | ej = enriched_jhu_data()
usa_full = Arima_nation(ej)
plot(usa_full)
nyd = nytimes_state_data()
drny = Arima_drop_state(ej, nyd)
drny
plot(drny)
opar = par(no.readonly=TRUE)
par(mar=c(4,3,2,2), mfrow=c(1,2))
plot(usa_full, main="all states", ylim=c(17000,38000))
plot(drny, main="excluding NY", ylim=c(17000,38000))
par(opar)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.