R/fit_hm.R

Defines functions fit_hm

# test_weather <- weather_preproc(ita_weather_history)
#
# health_events_data <- dplyr::left_join(
#       test_weather,
#       ita_events_history
# )



full_year <-
fit_hm <- function(events, polluts, data,
    par_grid = expand_4_pars_on(c(3, 5, 7))
      # list(best_par = c(k1 = 7, k2 = 7, k3 = 28, k4 = 7))
      # expand_4_pars_on(c(7, 28))
      # expand_4_pars_on(c(3, 5, 7))
) {
    # aggiungere il fattore `length(pargrid) *` se non si usa
    # **furrr** in `train_each_par`
    pb <- pb_len(length(polluts) * length(events))

    events %>%
        purrr::map(pollut_avg_event_model,
            polluts, par_grid, data, pb
        )
}
UBESP-DCTV/imthcm documentation built on Dec. 2, 2019, 9:26 a.m.