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
I found some bugs when trying to run modeltools::quantgen_forecaster(). First issue I'm raising here, so not sure if better to put them together or to separate.
df must be a list, if not line 152 (call to covidcast::aggregate_signals()) will fail. This is a problem if df is the returned object from covidcast::covidcast_signals() where only one signal was retrieved. In that case, the returned object from covidcast_signals() is not a list.
There are a few ways to fix this. Checking if df is a list and if not, make it so is probably the best solution.
Reproducible example:
df <- covidcast::covidcast_signal(data_source = "usa-facts",
signal = "confirmed_7dav_incidence_prop",
start_day = "2020-08-01",
end_day = "2020-08-15")
modeltools::quantgen_forecaster(
df,
forecast_date = "2020-08-16",
signals = tibble::tibble(
data_source = c("usa-facts"),
signal = c("confirmed_7dav_incidence_prop")
),
incidence_period = "day",
ahead = 0,
n = 15,
verbose = TRUE,
lambda = 0)
#Error in covidcast::aggregate_signals(df, dt = dt, format = "wide") :
# If `x` is a `covidcast_signal` data frame, then `dt` must be a vector.
The code below results in an error:
# Same df as in Bug 1
df <- covidcast::covidcast_signal(data_source = "usa-facts",
signal = "confirmed_7dav_incidence_prop",
start_day = "2020-08-01",
end_day = "2020-08-15")
# Same call as in Bug 1 except for `df` argument
modeltools::quantgen_forecaster(
list(df),
forecast_date = "2020-08-16",
signals = tibble::tibble(
data_source = c("usa-facts"),
signal = c("confirmed_7dav_incidence_prop")
),
incidence_period = "day",
ahead = 0,
n = 15,
verbose = TRUE,
lambda = 0)
# ahead = 0Error in apply(x, 2, mean) : dim(X) must have a positive length
This error goes away when I specify lags = c(0, 3), or even lags = 1. But when I include these lags options, the function call never terminates and I have to restart RStudio.
The geo_type argument is not used anywhere in the function and should probably be removed.
The text was updated successfully, but these errors were encountered:
I found some bugs when trying to run
modeltools::quantgen_forecaster()
. First issue I'm raising here, so not sure if better to put them together or to separate.df
must be a list, if not line 152 (call tocovidcast::aggregate_signals()
) will fail. This is a problem ifdf
is the returned object fromcovidcast::covidcast_signals()
where only one signal was retrieved. In that case, the returned object fromcovidcast_signals()
is not a list.There are a few ways to fix this. Checking if
df
is a list and if not, make it so is probably the best solution.Reproducible example:
This error goes away when I specify
lags = c(0, 3)
, or evenlags = 1
. But when I include theselags
options, the function call never terminates and I have to restart RStudio.geo_type
argument is not used anywhere in the function and should probably be removed.The text was updated successfully, but these errors were encountered: