Skip to content

Commit 549f7d5

Browse files
committed
fix: remove population scaling from nssp
1 parent ec181d3 commit 549f7d5

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

scripts/covid_hosp_prod.R

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@ if (!g_backtest_mode) {
4646
g_linear <- function(epi_data, ahead, extra_data, ...) {
4747
forecaster_baseline_linear(epi_data, ahead, ..., residual_tail = 0.97, residual_center = 0.097, no_intercept = TRUE)
4848
}
49+
g_linear_no_population_scale <- function(epi_data, ahead, extra_data, ...) {
50+
forecaster_baseline_linear(epi_data, ahead, ..., residual_tail = 0.97, residual_center = 0.097, no_intercept = TRUE, population_scale = FALSE)
51+
}
4952
g_climate_base <- function(epi_data, ahead, extra_data, ...) {
5053
climatological_model(
5154
epi_data,
@@ -100,6 +103,7 @@ g_windowed_seasonal_extra_sources <- function(epi_data, ahead, extra_data, ...)
100103
g_forecaster_params_grid <- tibble(
101104
id = c(
102105
"linear",
106+
"linear_no_population_scale",
103107
"windowed_seasonal",
104108
"windowed_seasonal_extra_sources",
105109
"climate_base",
@@ -108,6 +112,7 @@ g_forecaster_params_grid <- tibble(
108112
),
109113
forecaster = rlang::syms(c(
110114
"g_linear",
115+
"g_linear_no_population_scale",
111116
"g_windowed_seasonal",
112117
"g_windowed_seasonal_extra_sources",
113118
"g_climate_base",
@@ -120,6 +125,7 @@ g_forecaster_params_grid <- tibble(
120125
list(),
121126
list(),
122127
list(),
128+
list(),
123129
list()
124130
),
125131
param_names = list(
@@ -128,6 +134,7 @@ g_forecaster_params_grid <- tibble(
128134
list(),
129135
list(),
130136
list(),
137+
list(),
131138
list()
132139
)
133140
)
@@ -320,7 +327,8 @@ ensemble_targets <- tar_map(
320327
name = forecast_nhsn_full_filtered,
321328
command = {
322329
forecast_nhsn_full %>%
323-
filter(forecast_date == as.Date(forecast_date_int))
330+
filter(forecast_date == as.Date(forecast_date_int)) %>%
331+
filter(forecaster %nin% c("linear"))
324332
}
325333
),
326334
tar_target(

0 commit comments

Comments
 (0)