Expand description
Time series analysis and forecasting.
This module provides algorithms for analyzing and forecasting time series data:
- ARIMA (Auto-Regressive Integrated Moving Average)
- Differencing for stationarity
- Basic forecasting metrics
§Design Principles
Following the Toyota Way and aprender’s quality standards:
- Zero
unwrap()calls (Cloudflare-class safety) - Result-based error handling with
AprenderError - Comprehensive test coverage (≥95%)
- Pure Rust implementation
§Quick Start
use aprender::time_series::ARIMA;
use aprender::primitives::Vector;
// Time series data (e.g., monthly sales)
let data = Vector::from_slice(&[10.0, 12.0, 13.0, 15.0, 14.0, 16.0, 18.0, 17.0]);
// Create ARIMA(1, 1, 1) model
let mut model = ARIMA::new(1, 1, 1);
// Fit model to data
model.fit(&data).expect("fit should succeed");
// Forecast next 3 periods
let forecast = model.forecast(3).expect("forecast should succeed");
println!("Forecasted values: {:?}", forecast);§References
- Box, G. E. P., & Jenkins, G. M. (1976). “Time Series Analysis: Forecasting and Control.”
- Hyndman, R. J., & Athanasopoulos, G. (2018). “Forecasting: Principles and Practice.”
Structs§
- ARIMA
- ARIMA (Auto-Regressive Integrated Moving Average) model.