structure <-
polynomial_block(p = 1, order = 2, D = 0.95) +
harmonic_block(p = 1, period = 12, D = 0.975) +
noise_block(p = 1, R1 = 0.1) +
regression_block(
p = chickenPox$date >= as.Date("2013-09-1"),
# Vaccine was introduced in September of 2013
name = "Vaccine"
)
outcome <- Multinom(p = c("p.1", "p.2"), data = chickenPox[, c(2, 3, 5)])
fitted.data <- fit_model(structure * 2,
chickenPox = outcome
)
forecast(fitted.data, 24,
chickenPox = list(Total = rep(175, 24)), # Optional
Vaccine.1.Covariate = rep(TRUE, 24),
Vaccine.2.Covariate = rep(TRUE, 24)
)
Run the code above in your browser using DataLab