Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paste your results for one-week ahead forecasts of rotavirus in Berlin #1

Open
jbracher opened this issue Mar 15, 2022 · 3 comments
Open

Comments

@jbracher
Copy link
Collaborator

You can paste the return of colMeans(scores(owa)) here, if you like along with your control argument or a little piece of R code. See my example post below.

@jbracher
Copy link
Collaborator Author

jbracher commented Mar 15, 2022

Example:

library("hhh4addon")
data("rotaBE")

ctrl <- list(end = list(f = addSeason2formula(~0 + fe(1, unitSpecific = TRUE),
                                              S = 1)),
             ar = list(f = ~ 0 + fe(1, unitSpecific = TRUE)),
             family = "NegBin1",
             subset = 6:312)

fit <- hhh4(rotaBE, ctrl)
owa <- oneStepAhead(fit, tp = c(312, 363))
colMeans(scores(owa))
     logs       rps       dss       ses 
 1.931189  1.639351  3.139681 22.410975 

@bastistician
Copy link
Collaborator

library("hhh4addon")
data("rotaBE")

## let the power law act on (o+1) => AR is integrated in NE
rotaBE1 <- rotaBE
neighbourhood(rotaBE1) <- neighbourhood(rotaBE1) + 1

form1 <- ~ 0 + fe(1, unitSpecific = TRUE)
ctrl <- list(end = list(f = addSeason2formula(form1, S = 2)),
             ne = list(f = addSeason2formula(form1, S = 2),
                       weights = W_powerlaw(maxlag = max(neighbourhood(rotaBE1)))),
             family = "NegBinM", subset = 6:312)
fit <- hhh4(rotaBE1, ctrl)
plot(fit, total = TRUE)
owa <- oneStepAhead(fit, tp = c(312, 363))
colMeans(scores(owa))
     logs       rps       dss       ses 
 1.879683  1.587602  2.932538 21.733318 

Did anyone achieve something smaller?

I observed that some more complicated models do not converge at all time points during the rolling forecasts. One could use oneStepAhead(..., type="first") in that case, i.e. produce all forecasts from the initial fit at the beginning of the test period without re-fitting.

@jbracher
Copy link
Collaborator Author

library("hhh4addon")
data("rotaBE")

## let the power law act on (o+1) => AR is integrated in NE
rotaBE1 <- rotaBE
neighbourhood(rotaBE1) <- neighbourhood(rotaBE1) + 1

form1 <- ~ 0 + fe(1, unitSpecific = TRUE)
ctrl <- list(end = list(f = addSeason2formula(form1, S = 2)),
             ne = list(f = addSeason2formula(form1, S = 2),
                       weights = W_powerlaw(maxlag = max(neighbourhood(rotaBE1)))),
             family = "NegBinM", subset = 6:312)
fit <- profile_par_lag(rotaBE1, ctrl)
plot(fit, total = TRUE)
owa <- oneStepAhead_hhh4lag(fit, tp = c(312, 363))
colMeans(scores(owa))
#        logs       rps       dss       ses 
# 1.864334  1.550379  2.702720 20.628763

Just a little tweak ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants