23 releases (8 breaking)

0.9.0 Jan 14, 2025
0.8.0 Dec 23, 2024
0.7.0 Nov 25, 2024
0.3.1 Jul 30, 2024
0.1.2 Feb 20, 2024

#11 in #forecasting

Download history 487/week @ 2024-10-24 79/week @ 2024-10-31 365/week @ 2024-11-07 124/week @ 2024-11-14 251/week @ 2024-11-21 35/week @ 2024-11-28 10/week @ 2024-12-05 16/week @ 2024-12-12 127/week @ 2024-12-19 18/week @ 2024-12-26 85/week @ 2025-01-02 127/week @ 2025-01-09 39/week @ 2025-01-16 3/week @ 2025-01-23 13/week @ 2025-01-30 14/week @ 2025-02-06

97 downloads per month
Used in augurs

MIT/Apache

20KB
208 lines

Seasonality detection for time series

augurs-seasons contains methods for detecting seasonality or periodicity in time series.

It currently contains implementations to do so using periodograms, similar to the seasonal Python package.

Usage

use augurs::seasons::{Detector, PeriodogramDetector};

# fn main() {
let y = &[
    0.1, 0.3, 0.8, 0.5,
    0.1, 0.31, 0.79, 0.48,
    0.09, 0.29, 0.81, 0.49,
    0.11, 0.28, 0.78, 0.53,
    0.1, 0.3, 0.8, 0.5,
    0.1, 0.31, 0.79, 0.48,
    0.09, 0.29, 0.81, 0.49,
    0.11, 0.28, 0.78, 0.53,
];
// Use the detector with default parameters.
let periods = PeriodogramDetector::default().detect(y);
assert_eq!(periods[0], 4);

// Customise the detector using the builder.
let periods = PeriodogramDetector::builder()
    .min_period(4)
    .max_period(8)
    .threshold(0.8)
    .build()
    .detect(y);
assert_eq!(periods[0], 4);
# }

Credits

This implementation is based heavily on the seasonal Python package. It also makes heavy use of the welch-sde crate.

License

Dual-licensed to be compatible with the Rust project. Licensed under the Apache License, Version 2.0 <http://www.apache.org/licenses/LICENSE-2.0> or the MIT license <http://opensource.org/licenses/MIT>, at your option.

Dependencies

~4.5MB
~87K SLoC