-
Notifications
You must be signed in to change notification settings - Fork 33
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
Add option to accumulate observations #534
Conversation
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 99c3559 is merged into main:
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 7ee4d94 is merged into main:
|
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.
Really nice.
Enabling this would, I think, require some sort of that marks dates explicitly as missing vs. NA.
I think this would be my preferred option as it would be more general but I also think it can be addressed in its own review as it would be a superset of this PR.
My thought on how that would work is to have a new variable (accumulate
) that indicates which days should be summed.
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.
This all looks good and is a nice feature to have. Some reservations about the precise implementation but as flagged can be addressed by follow up work.
This means that for a someone who would like that data point to be considered it would be advantageous to add a dummy data point to the beginning of the data set. We could add an option to do that, or document it, or leave it unmentioned, or find another solution.
I think my preferred option here would be to add a message when this method is used? (i.e dropping the first data point and use a dummy if you wish).
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.
LGTM to me. I think the outstanding points are all for a new issues so if you agree we can resolve and merge?
Yes sounds good to me. |
See Line 484 in 528185b
Might be annoying but will remind us to implement a better solution if so. |
If things move over to |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 2a32f95 is merged into main:
|
Co-authored-by: Sam Abbott <[email protected]>
This is how benchmark results would change (along with a 95% confidence interval in relative change) if df1fdc8 is merged into main:
|
* add option to accumulate observations * accumulate in estimate_secondary model * add test for weekly accumulation * check there's data to fit initial growth model * ignore first observation when accumulating * document "na" argument * add news item * update obs_opts tests * make logical operator scalar * make NA option work with estimate_secondary * add tests * Apply suggestions from code review Co-authored-by: Sam Abbott <[email protected]> --------- Co-authored-by: Sam Abbott <[email protected]>
* add option to accumulate observations * accumulate in estimate_secondary model * add test for weekly accumulation * check there's data to fit initial growth model * ignore first observation when accumulating * document "na" argument * add news item * update obs_opts tests * make logical operator scalar * make NA option work with estimate_secondary * add tests * Apply suggestions from code review Co-authored-by: Sam Abbott <[email protected]> --------- Co-authored-by: Sam Abbott <[email protected]>
This PR adds an argument
na
toobs_opts
with an"accumulate"
option that adds any NA data points to the following data point in the inference. The idea is that this will allow fitting data at any time interval (e.g. weekly) including where spacing is irregular (e.g., monthly, or weekly where on some occasions data is reported a day later because of a holiday etc.).Two points for potential discussion are:
accumulate
the first data point is ignored as we don't know when we should start accumulating for that one. This means that for a someone who would like that data point to be considered it would be advantageous to add a dummy data point to the beginning of the data set. We could add an option to do that, or document it, or leave it unmentioned, or find another solution.I've updatedIt was necessary to updateestimate_secondary
to still work with the examples/tests but it doesn't work with NA values yet. This is for another issue/PR.estimate_secondary
in order to pass tests/checks. This now also works with NA values.Closes #531