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.17.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | cf2e0717b5e6e746e8fbca547c3c37c3dec006c4f18eb770c0b7c54d96bb4731 |
|
MD5 | 6bfd0b401d2d646b821bd112a1886270 |
|
BLAKE2b-256 | 4278bb5e7e5cca52bd0bebe9ce7f0fc825d670c3be0a128a55dc6a1c17b56687 |
Close
Hashes for ChangePointDetectorEVT-0.0.17-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a1c44852af4a3cd3901ad348bfce326ba1b10568af3fe3b6fe610a8cc3d9b92d |
|
MD5 | 86ba71083edd228be810f225ad84b549 |
|
BLAKE2b-256 | 788d2891fc43512a9c1d6f0a8c64a0c1ddedb2a33627cf6f712860fec1c6ceb2 |