k-sys/covid-19

Issues When Adapted to Smaller Datasets

ryancherrmann opened this issue · 1 comments

When attempting to adapt the code to run for localized data of two locations, the Gaussian filter cutoff rips out data from the location with small numerical changes in cases, making Rt impossible to compute. I continue to get the following error, regardless of the parameters tweaked in attempts to compensate for the smaller data set:

/home/nbuser/anaconda3_501/lib/python3.6/site-packages/ipykernel/main.py:52: RuntimeWarning: divide by zero encountered in log

For def prepare_cases, I had to set cutoff=1. Any larger value results in no data for the state 'FS' in the data set. The larger state 'TC' does not experience this problem, and behaves normally with cutoff=2.

Any permutation of modifications to center, std, and min_periods parameters inside new_cases.rolling() does not rectify the situation.

Is there any way around this? Is the Gaussian filter not suitable for this small dataset? What I don't understand is I was successfully able to run the code against data that I had on Friday. Unfortunately, I am unable to attach a Jupyter Notebook with my code. Thanks for any help you can provide!

Solved by amplifying case numbers and changing data from active cases (which can produce negative changes in cases.diff()) to total confirmed cases.