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.11.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a80a2ae2f4a08e7ceaeb9f4fce785da9833890483c146396022dfe5889634cee |
|
MD5 | 2e271d647330f1aced80a46c19e918a6 |
|
BLAKE2b-256 | 30709011dcbe3de08cb9c422fd23688c16a10637cf46039ce49dc8ae56461199 |
Close
Hashes for ChangePointDetectorEVT-0.0.11-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 15f23071e2c278b1b50759e346f1a7ed7edfc8b64c21b0819c4d7eafa2503968 |
|
MD5 | c0901ebbe71ecc84d911162b353b1608 |
|
BLAKE2b-256 | a6dd053a15f1073d7fe586a57328249cb00fc8468d6ab99e3cd609f72c374cee |