We're happy to announce UnrollingAverages.jl: a package aimed at deconvolving (or unrolling) moving averages of time series to get the original ones back.
In the following, by "original series" or "series" we are going to mean the time series we would like to reconstruct from its "moving average".
The package exports a single function called unroll
that, with a few simple arguments, is able to handle all the following scenarios.
Scenario 1
The initial values of the moving average provided are known.
In this scenario, the original series can be exactly reconstructed.
Scenario 2
The initial values of the moving average provided are not known, but it is known that the series is exclusively composed of natural numbers;
In this scenario, all possible natural series that correspond to the input moving average are returned.
Scenario 3
The initial values of the moving average provided are not known, and it is not true or known that the series is exclusively composed of natural numbers.
In this scenario, the original series cannot be reconstructed in general, so a pseudo-inverse approximation is returned.
Examples
A real-world custom application of this package can be found in the COVID-19 integrated surveillance data repository we maintain.
The output data has been stored here and contain the following information:
- Reconstructed daily time series of confirmed cases by date of diagnosis stratified by sex and age at the regional level;
- Reconstructed daily time series of symptomatic cases by date of symptoms onset stratified by sex and age at the regional level;
- Reconstructed daily time series of ordinary hospital admissions by date of admission stratified by sex and age at the regional level;
- Reconstructed daily time series of intensive hospital admissions by date of admission stratified by sex and age at the regional level;
- Reconstructed daily time series of deceased cases by date of death stratified by sex and age at the regional level.
For more details, please consider taking a look at the documentation.
Discussions, issues and PRs are always welcome!
References
- Pietro Monticone & Claudio Moroni (2022) InPhyT/COVID19-Italy-Integrated-Surveillance-Data. Zenodo
- Del Manso et al. (2020) COVID-19 integrated surveillance in Italy: outputs and related activities. Epidemiologia & Prevenzione
- Starnini et al. (2021) Impact of data accuracy on the evaluation of COVID-19 mitigation policies. Data & Policy, 3, E28.
Contacts
Author | GitHub | |
---|---|---|
Pietro Monticone | @pitmonticone | @PietroMonticone |
Claudio Moroni | @ClaudMor | @Claudio__Moroni |
Top comments (1)
Is this even legal?! π
Very cool work, congrats!