SciRS2 Series
Production-ready time series analysis module for the SciRS2 scientific computing library (v0.1.0). Following the SciRS2 POLICY, this Stable Release provides comprehensive, tested, and optimized tools for analyzing, decomposing, and forecasting time series data with feature parity to leading Python libraries, zero-warning code quality, and ecosystem consistency through scirs2-core abstractions.
Features
Core Capabilities:
- Advanced Decomposition: STL, TBATS, SSA, STR, Multi-seasonal decomposition, Robust variants
- State-of-the-Art Forecasting: ARIMA/SARIMA, Auto-ARIMA, Exponential Smoothing (ETS), Holt-Winters
- Comprehensive Analysis: Autocorrelation, partial autocorrelation, cross-correlation functions
- Change Point & Anomaly Detection: PELT, CUSUM, Bayesian online detection, multiple anomaly methods
- Feature Engineering: 60+ statistical, frequency, and complexity features with automated selection
- Transformations: Box-Cox, differencing, normalization, stationarity tests
- State-Space Models: Kalman filtering, structural time series, dynamic linear models
- Causality Analysis: Granger causality, transfer entropy, causal impact analysis
- Dimensionality Reduction: PCA, functional PCA, symbolic approximation
- Clustering & Classification: Time series clustering, DTW-based methods, shapelet discovery
Production Features:
- Zero-warning Codebase: All clippy warnings resolved, production-ready code quality
- Comprehensive Testing: 137 unit tests, 43 doc tests, 100% core functionality coverage
- Performance Optimized: SIMD acceleration, parallel processing, memory-efficient algorithms
- Rust Ecosystem Integration: Full ndarray support, compatible with scientific Rust ecosystem
Installation
Stable Release - Production Ready
Add the following to your Cargo.toml:
[]
= "0.1.2"
Recommended for Production: Enable performance optimizations:
[]
= { = "0.1.2", = ["parallel", "simd"] }
= { = "0.1.2", = ["parallel", "simd"] }
Available Features:
parallel: Multi-threaded processing for large datasetssimd: SIMD acceleration for numerical operationscaching: Advanced caching for repeated computations
Usage
Basic usage examples:
use ;
use CoreResult;
use array;
// Create a simple time series
Components
Time Series Utilities
Functions for time series analysis:
use ;
Decomposition
Methods for time series decomposition:
use ;
Forecasting
Time series forecasting methods:
use ;
Feature Extraction
Functions for extracting features from time series:
use ;
Advanced Features
STL Decomposition
Seasonal-Trend decomposition using LOESS (STL):
use stl_decompose;
use Array1;
// Sample time series
let data = from_vec;
// STL decomposition parameters
let period = 12; // For monthly data
let robust = true;
let seasonal_degree = 1;
let seasonal_jump = 1;
let seasonal_window = 13;
let trend_degree = 1;
let trend_jump = 1;
let trend_window = 21;
let inner_iter = 2;
let outer_iter = 1;
// Perform STL decomposition
let decomposition = stl_decompose.unwrap;
println!;
println!;
println!;
ARIMA Forecasting
Autoregressive Integrated Moving Average (ARIMA) model:
use arima_forecast;
use Array1;
// Sample time series
let data = from_vec;
// ARIMA parameters
let p = 1; // AR order
let d = 1; // Differencing order
let q = 1; // MA order
// Forecast horizon
let steps = 10;
// Perform ARIMA forecast
let = arima_forecast.unwrap;
println!;
println!;
Contributing
See the CONTRIBUTING.md file for contribution guidelines.
License
This project is dual-licensed under:
You can choose to use either license. See the LICENSE file for details.