This module takes a date time series and returns: (a) the underlaying linear trend and (b) the times where there is a change in the trend
Project description
ChangePointDetector
This module returns change points in a date time series, using Kalman filters and EVT as described in https://www.robots.ox.ac.uk/~sjrob/Pubs/LeeRoberts_EVT.pdf
- from ChangePointDetector import ChangePointDetector
- Prepare your time series as data plus Panda dates
- Create the necessary Kalman representation by creating a "session" object by calling the ChangePoint class, e.g.:
Session=ChangePointDetector.ChangePointDetectorSession(data,dates).
- 'SeasonalityPeriods' is an optional input, e.g if your data is sequential months, 12 = calendar month seasonality
- 'ForecastPeriods' is another optional input, indicating how many periods to forecast. Default = 3
- Determine the changepoints by running the ChangePointDetectorFunction on your "session", e.g. Results=Session.ChangePointDetectorFunction()
This will return a "Results" object that contains the following:
- ChangePoints. This is a list of 0s and 1s the length of the data, where 1s represent changepoints
- Prediction. This is the Kalman smoothed actuals, plus a 3 period forecast. Note no forecast will be made if there is a changepoint in the last 3 dates
- PredictionVariance. Variance of the smoothed actuals and forecast
- ExtendedDates. These are the original dates plus 3 exta for the forecast (if a forecast has been made)
- Trend. This is the linear change factor
- TrendVariance. Variance of the trend
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for ChangePointDetectorEVT-0.0.12.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38151623a2dc0adc73af8b9e89629735d4c0a209285026609b97ee34c9daa6ca |
|
MD5 | 3c1d59db1fddf4f0506130709d5f41f2 |
|
BLAKE2b-256 | ecd75240d4d994db6b8463b49a92fcf2e14153cf8269385bb2a05913d27ee771 |
Close
Hashes for ChangePointDetectorEVT-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1b44418971714529d8ca57b04d507cc72a949c21a4af061ade0842f762b83d6 |
|
MD5 | b80dc738f299201354e2fcfd224a84bd |
|
BLAKE2b-256 | 38b047240b6d16353649acde15796c69a3878a0773350dadf3e819a2906ae7e8 |