-
Notifications
You must be signed in to change notification settings - Fork 3
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
Potential issue in log likelihood calculation #7
Comments
@thibautjombart I agree with the above issue spotted by @Gulfa - maybe worth having a look? |
I think this is now fixed by the recent PR: |
I don't think this is exactly fixed. The first lambda is now |
@annecori will confirm, but I think the first lambda is |
yes that's correct |
@Gulfa, can you check the most recent github version of earlyR to check if it's correct? |
I was trying to replicate the results of the ML estimate for R in this package without being successful. I have narrowed down the difference between my implementation and the one in this package to line 175 in get_R.R.
sum(stats::dpois(x[-1], lambda = R * x_lambdas, log = TRUE))
I might be misunderstand something, but I think that the length of x[-1] and x_lambdas are different in this line of code and the dpois function then recycles values from x[-1] which is shorter. From my understanding x_lambdas has one entry too many and the final element should be removed. I tried this in a fork and then the estimated value for R matched my python implementation. In the example in https://www.reconlearn.org/post/practical-ebola-reconstruction.html, this changes the estimated value of R from 1.286 to 1.336.
Happy to submit a PR from my fork if that would be helpful and I am not completely mistaken about this.
The text was updated successfully, but these errors were encountered: