epiforecasts / covidregionaldata

An interface to subnational and national level COVID-19 data. For all countries supported, this includes a daily time-series of cases. Wherever available we also provide data on deaths, hospitalisations, and tests. National level data is also supported using a range of data sources as well as linelist data and links to intervention data sets.
https://epiforecasts.io/covidregionaldata/
Other
37 stars 18 forks source link

Add negative spreading #331

Closed seabbs closed 2 years ago

seabbs commented 3 years ago

At the moment our processing defaults to setting negatives to zero. Another option to consider is spreading negative counts either into the future or into the past.

An implementation of future spreading for a vector is here: https://github.com/epiforecasts/covid-rt-brazil-subregional/blob/master/R/utils.R

This could be generalised into a function for either direction (forward or back) and to accept data frames (with grouping potentially assumed in our current workflow).

joseph-palmer commented 3 years ago

What is negative spreading? Not a concept I've come across before

seabbs commented 3 years ago

Sorry if unclear so all it is another approach for handling negative cases with the idea that they come from earlier in time or in the past. The most basic way to do that is to just loop over the dates and set them to 0 until you have replaced the number that were originally negative.

joseph-palmer commented 3 years ago

How do you envision this? Like having the function from the link in processing.R and then have an option to use negative spreading adding to DataClass as a field?

seabbs commented 3 years ago

I was thinking of it as an optional function that you would use instead of replacing negatives with 0 as some people don't like that assumption/they may know the data better.

joseph-palmer commented 3 years ago

Cool, I will wirte up a PR and we can go from there

github-actions[bot] commented 3 years ago

This issue has been flagged as stale due to lack of activity

seabbs commented 3 years ago

@joseph-palmer any progress on this? Happy to push back out to any takers if no time?

joseph-palmer commented 3 years ago

Appologies, not got much time at the moment! I will try and free up some time to work more on the package.

seabbs commented 3 years ago

no pressure at all to do so - can just unpin you as the assignee :)

github-actions[bot] commented 3 years ago

This issue has been flagged as stale due to lack of activity