-
Notifications
You must be signed in to change notification settings - Fork 0
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
Issue 15: add VAR and season specific intercept #21
base: main
Are you sure you want to change the base?
Conversation
…thub.com/epiforecasts/cityforecasts into 15-add-VAR-and-season-specific-intercept
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't really have a basis for comparison but this seems fine.
Note that the use of a log link means that the season/location specific intercept becomes a multiplier of the seasonal variation I believe
I tried back testing on January 21st, just to see if the forecasts looked reasonable, and they are quite dispersed (as they are above for the 2025-02-18 example, as well). I think we probably need to interrogate the priors a bit more (as you mentioned, I think my intercept prior might be wrong, though I don't think that is what would be driving this dispersion here). |
My assumption is that its model misspecification due to not allowing for seasonal changes Also given that data point that forecast does not seem totally wild to me |
I think part of the issue here could be having a seasonal intercept at all whilst still having just the one VAR across all seasons. The motivation would be if there is a clear lack of continuity between different seasons that goes beyond the usual variance. Having a look at your plot above this doesn't seem to be the case but its hard to be clear. I think you would need this intercept if you were going to start treating seasons as independent (i.e. time starts at the beginning of the season for the AR process ) or if yes there is a massive between season jump that is outside the expected AR variance. I would potentially test each feature a bit on their own before bringing them together |
@@ -105,15 +111,14 @@ if (config$targets[index] == "ILI ED visits" && config$regions_to_fit[index] == | |||
# Shared smooth of day of week | |||
s(day_of_week, k = 3), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a note for another time but are you gam.checking k?
@@ -92,6 +97,7 @@ if (config$targets[index] == "ILI ED visits" && config$regions_to_fit[index] == | |||
trend_formula = ~ | |||
# Hierarchical intercepts capture variation in average count | |||
s(trend, bs = "re") + | |||
s(trend, season, bs = "re") + |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does this introduce an intercept for trend on its own (i.e is it a duplicate of line 99). I find the syntax very confusing personally. The way to check is to look at the output I think
This PR addresses #15. It is still a WIP, though hoping to get something merged for the forecast submissions for next Tuesday.
Here are some example forecasts and other outputs from this model.





My next steps are to make sure the model in the stan code is consistent with the maths written here, as I have gotten myself confused in the past few days...