-
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
estimate r from initial R #923
Conversation
it seems like there are some issues when accumulating to weekly |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if eada335 is merged into main:
|
This is now ready for initial review but it might require a bit more testing (and doc updates / news item etc) before releasing it in the wild. A few observations so far
|
I see this in epinowcast as well. Precisely what is happening is not clear to me. |
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.
t a high level I think this looks good and it seems reasonable to rescale initial infections I think. A few comments and questions about output changes. I have just site read so far so need to have a play with the models.
I now see the same error locally on a linux box. Pretty sure it's unrelated to touchstone or package code but why exactly it happens is a mystery to me, too (as the action goes from success to failure with nearly identical logs, i.e. same package versions, same runner version etc.). |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 75628ff is merged into main:
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 0449171 is merged into main:
|
I think this is good to go - potentially of interest to @SamuelBrand1 @seabbs I had to introduce a truncation step to avoid numeric overflows when the first value of R came very close to zero. EpiNow2/inst/stan/functions/rt.stan Line 103 in dba0c2e
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if dba0c2e is merged into main:
|
This is how benchmark results would change (along with a 95% confidence interval in relative change) if dba0c2e is merged into main:
|
Just looking now. Did you compare this approach to padding the initial guess as in theory fmax should be a bit of a no no? |
Padding how? You mean add a small number? I looked at this one but it would be expected to be slower because you now always start in the "wrong" place -- what would you expect the issue to be with fmax? It's not applied to anything being sampled. real r = (R - 1) / (R * mean_gt + 1); |
Yes that definitely is the tradeoff so I am not clear it is worth it. It is being applied to something being sampled though, the first R index. |
The last two comments tell you the speed difference between the two versions. I also remember seeing more fitting failures (initial conditions leading to NaN) with that version but could check again. Do you have any other suggestion? |
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 6a36058 is merged into main:
|
Overall seems indistinguishable from stochasticity at the used sample size (n = 5)
Don't see these upon checking again - perhaps got muddled up with other rstan issues. I'm just updating the snapshots to see if checks pass then, in which case I'd be happy to go with this version. |
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.
Do you have any other suggestion?
Aside from the padding you are trying no not really.
I'm just updating the snapshots to see if checks pass then, in which case I'd be happy to go with this version.
I really don't feel strongly especially if there is no real difference.
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 really like this. I've checked back against the Julia code and agree it aligns. Running locally all seems basically the same as the version on main which is good.
In terms of the padding vs max I don't feel very strongly and agree there is a bit of a tradeoff
The only thing that is missing which could come in a follow up PR is unit tests of the R to r functions in a similar vein to the julia code and the original issue with the test approach
This reverts commit 6a36058.
This is how benchmark results would change (along with a 95% confidence interval in relative change) if 35740e5 is merged into main:
|
Description
This PR closes #920. For now it's using the existing estimate for initial number of infections. As an initial step I'm interested in how doing this affects performance and/or recovery of estimates.
Initial submission checklist
devtools::test()
anddevtools::check()
).devtools::document()
).lintr::lint_package()
).After the initial Pull Request