- aftercovid.preprocess.ts_moving_average(series, n=7, center=True)¶
Computes the moving average of a differential series. The function handles nan as well. The outputs does not contain any nan unless there are too many consecutive nans.
series – timeseries
n – window
center – centered average
moving average (of same size)
- aftercovid.preprocess.ts_normalise_negative_values(series, n=7, extreme=4)¶
series is a differential series which should not have any negative values. The function removes unexpected high value and negative value. These extremes are replaced by a local average. The function handles nan as well. The outputs does not contain any nan unless there are too many consecutive nans.
series – differential values
n – moving average
extreme – removes extreme values, if the series is higher or lower than its moverage * th or / th
Returns a series with no decreasing values (only growing). Data are sometimes normalized and show negative values but the past remains unchanged. This functions decreases past values until the series is growing.
series – series