-
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
Problem processing data #2
Comments
Response from Thomas Obadia: If memory serves right, The ML method assumes Poisson distribution of secondary cases and the likelihood is written as such. When running some debug, here’s what I run into (after toying around):
A few thoughts: there’s no need to pass the result to Here’s what I’m able to reach, with a very quick attempt and using under-the-hood method instead of the
Note that it’s a very quick attempt and the generation time is taken completely at random. I did read a few early CDC reports that provided some estimates of the Generation Time, but they were really early in the epidemic and there’s probably better data now. Hence why I passed |
Thanks for following-up here and tidying up my answer a bit, makes life easier! The code just above was a quick attempt directly calling under-the-hood functions. Here there are two key issues, ultimately:
As a side issue, the trail of zeros at the beginning of the incidence count vector also makes the function difficult to evaluate and should be discarded. The "user-friendly" version of my code above can be simplified as:
Note that the optimized GT disitrbution can then be found in
|
Happy to, and thanks so much for the help! That code works in my hands too (see Google Colab notebook I just made a PR for). I'm wondering whether it would be worth adding some cleanup functions to the package to make data compatible with the R0 estimation functions. Also adding specific errors if the data simply isn't appropriate for R0 estimation. Ideas include:
If you'd like, I can share a larger COVID dataset that isn't as well-behaved as the column I sent, and we can try to add functions that address the problems. Up to you, but happy to help! |
I like the idea of an external cleanup/inspect function that would warn the user if some specific edge cases are encountered. That could be a function not called as part of any estimation routine, e.g. some |
That sounds great! Let me know if there's anything I can do to help :) |
Ran into another issue with processing this dataset: I had initially (mistakenly) been feeding the accumulated case numbers into
|
Amazing, you've been digging this much more than I have been over the past few days. Baby + normal work + maintaining code from years ago = challenging. But I'll get there! I'm planning to fit all we've discussed here into a Ideas:
|
Yeah, I'm amazed you've been able to respond at all! This sounds great—then I'll try to break |
Hi @tobadia, just wanted to check in to see how things are going with this. No rush, and thanks again for your help! |
Hey @rchurt, |
No problem, and thanks for finding time given how busy you are! |
Hey @rchurt ! I had in mind calculating the slope of the data with increasing number of points, but I don't think it'd help much there. Please go ahead and install the devel version with the following (requires the In the end, inspect.data() doesn't return anything: it just yields warnings in which suggestions are made. I'll enhance the phrasing with your feedback and possibly that from other users. Once this thing is decently shaped, I'll merge it into the master branch and move on to more thorough updates. There's a lot of cleanup to do for displaying graphics, which will be the next big thing. |
Awesome! Let me play around with this and get back to you. In the meantime, here are the raw and processed data you mentioned. Thanks! |
Hi @tobadia, Sorry for the basic question, but when I try to do the above, I get the error: To reproduce my problem exactly, you can open a new R notebook in Colab and run:
Have you run into this before? |
Indeed. Fixed, I had forgotten that methods should be exported in the NAMESPACE. Should be working with the most recent commit. |
Hi @tobadia, |
Hey @rchurt The code below does work in the Google collab notebook (I had never used this before and it looks like a very nice way to distribute repliable examples!)
That should do the trick. Now, onto breaking things :) |
I have some data that I’m trying to run through the
estimate.R
function, and I keep getting the error:Error in uniroot(fit.epid, lower = res.R$maximum, upper = log(range[2]), : f.lower = f(lower) is NA
.I’m running
check.incid
and using the output of that as the input toestimate.R
. Specifically, I combine the output ofcheck.incid
into a named vector. I've saved one example as a csv and attached it. This is what I’m using as the input toestimate.R
. You’ll notice that some numbers are fractional—this is because this vector is an average of case numbers across multiple counties.I’m guessing that the vector isn’t being formatted quite right by
check.incid
. Do you have any suggestions?Thanks in advance,
Rob
cases_averaged.csv.zip
The text was updated successfully, but these errors were encountered: