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
Once Issue #208) in epiprocess is addressed (by removing the problematic tibble::as_tibble() %>% line from the slide function for an archive in epiprocess), we get the following error when trying to use percent_cli as a covariate in arx_epi_forecaster():
Error in mapply(.f, .x, .y, MoreArgs = list(...), SIMPLIFY = FALSE) :
zero-length inputs cannot be mixed with those of non-zero length
Below is an example to reproduce this error (run after the related epiprocess issue is fixed):
library(epipredict)
library(epiprocess)
library(covidcast)
library(data.table)
library(dplyr)
library(tidyr)
library(ggplot2)
y <- covidcast_signals(
c("doctor-visits", "jhu-csse"),
c("smoothed_adj_cli", "confirmed_7dav_incidence_prop"),
start_day = "2020-06-01",
end_day = "2021-12-01",
issues = c("2020-06-01", "2021-12-01"),
geo_type = "state",
geo_values = c("ca", "fl"))
z <- y[[1]] %>%
select(geo_value, time_value, version = issue, percent_cli = value) %>%
as_epi_archive()
z <- epix_merge(
z, y[[2]] %>%
select(geo_value, time_value, version = issue, case_rate = value) %>%
as_epi_archive(), sync = "locf")
fc_time_values <- seq(as.Date("2020-08-01"), as.Date("2021-12-01"),
by = "1 month")
ahead = 7
# Old arx_forecaster works fine with percent_cli
z %>% epix_slide(fc = arx_forecaster(x = percent_cli, y = case_rate,
key_vars = geo_value, time_value = time_value,
args = arx_args_list(ahead = ahead)),
n = 120, ref_time_values = fc_time_values)
# New forecaster - error in mapply()
z %>%
epix_slide(function(x, ...)
arx_epi_forecaster(x, outcome = "case_rate",
predictors = c("case_rate", "percent_cli"),
args = arx_args_list(ahead = ahead))$predictions %>%
select(-c(geo_value, time_value)),
n = 120, ref_time_values = fc_time_values, new_col_name = "fc")
Please look into what is causing this error and what we can do to fix it. Possibly related to the abundance of missing values in percent_cli.
I haven’t looked into this much, but here are some initial thoughts: The error looks like it traces back to the call of map2 in line #109 of layer_residual.quantiles.R. And if one of the inputs is zero, then the mapply() function (which map2 uses) gives such an error… So are there alternatives to map2 that may be useful here? Or is there something more fundamentally wrong?
The text was updated successfully, but these errors were encountered:
Once Issue #208) in epiprocess is addressed (by removing the problematic
tibble::as_tibble() %>%
line from the slide function for an archive in epiprocess), we get the following error when trying to usepercent_cli
as a covariate inarx_epi_forecaster()
:Below is an example to reproduce this error (run after the related epiprocess issue is fixed):
Please look into what is causing this error and what we can do to fix it. Possibly related to the abundance of missing values in
percent_cli
.I haven’t looked into this much, but here are some initial thoughts: The error looks like it traces back to the call of
map2
in line #109 of layer_residual.quantiles.R. And if one of the inputs is zero, then themapply()
function (whichmap2
uses) gives such an error… So are there alternatives tomap2
that may be useful here? Or is there something more fundamentally wrong?The text was updated successfully, but these errors were encountered: