### OxiDiviner Quick Start Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md The fastest way to get started with the OxiDiviner library, providing a basic introduction to its functionalities. ```rust // quick_start.rs // Fastest way to get started with OxiDiviner ``` -------------------------------- ### Run Quick Start Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Executes the improved quick start example to demonstrate the basic usage and setup of OxiDiviner. ```Bash cargo run --example quick_start_improved ``` -------------------------------- ### OxiDiviner Improved Quick Start Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md An enhanced version of the quick start example, incorporating validation and comparison functionalities. ```rust // quick_start_improved.rs // Enhanced quick start with validation and comparison ``` -------------------------------- ### Run OxiDiviner Quick API Test Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/examples/README.md Demonstrates one-line forecasting functions and auto model selection for rapid prototyping. Recommended as a starting point for understanding basic concepts. ```bash cargo run --example quick_test ``` -------------------------------- ### Run OxiDiviner Examples with Cargo Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Demonstrates how to execute OxiDiviner examples from the project root or the examples directory using Cargo commands. ```bash # From the project root directory cargo run --example # Or from the examples directory cargo run --bin ``` -------------------------------- ### Build OxiDiviner Project Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/examples/README.md Builds the OxiDiviner project. This step is optional as examples will build automatically when run. ```bash cargo build ``` -------------------------------- ### Quick ARIMA Forecasting Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Provides examples of using the Quick API for ARIMA forecasting, showing both the default ARIMA(1,1,1) and custom parameter configurations. ```rust use oxidiviner::quick; // Default ARIMA(1,1,1) let forecast = quick::arima(data.clone(), 10)?; // Custom parameters ARIMA(2,1,2) let forecast = quick::arima_with_config(data, 10, Some((2, 1, 2)))?; ``` -------------------------------- ### Run OxiDiviner Examples with Release Optimization Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/examples/README.md Executes OxiDiviner examples with release optimizations enabled for better performance. ```bash cargo run --example --release ``` -------------------------------- ### Rustic ML Oxidiviner Quick Start Improved Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md A comprehensive showcase of the Oxidiviner API, providing an improved starting point for new users. This example covers essential functionalities and workflows. ```rust /* * Example: quick_start_improved.rs * Description: Complete API showcase * Command: cargo run --bin quick_start_improved */ // Placeholder for actual Rust code fn main() { println!("Running quick_start_improved example..."); // Full API demonstration } ``` -------------------------------- ### Rustic ML Oxidiviner Quick Test Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Demonstrates basic API functionality of the Oxidiviner library. This example serves as a starting point for understanding the core features. ```rust /* * Example: quick_test.rs * Description: Basic API functionality test * Command: cargo run --example quick_test */ // Placeholder for actual Rust code fn main() { println!("Running quick_test example..."); // Actual Oxidiviner API calls would go here } ``` -------------------------------- ### Run Simple Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Executes a minimal working example of OxiDiviner's core functionality. This serves as a quick start for understanding the library's basic operations. ```Bash cargo run --bin simple_demo ``` -------------------------------- ### Rust Example for Adaptive Configuration System Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/docs/step1_completion_report.md A working example demonstrating the features of the enhanced adaptive configuration system, including performance validation and real-time quality monitoring simulation. ```Rust use rustic_ml_oxidiviner::adaptive::config::{AdaptiveConfig, AdaptiveParameters, ModelSelectionStrategy}; use rustic_ml_oxidiviner::adaptive::monitoring::QualityMonitor; use std::time::Instant; fn main() { // --- Configuration Creation --- let start_config = Instant::now(); let config = AdaptiveConfig { forecast_config: ForecastConfig { /* ... */ }, adaptive_parameters: AdaptiveParameters { learning_rate: 0.01, adaptation_window_size: 10, confidence_threshold: 0.5, frequency_limit: 20, }, regime_config: RegimeConfig { /* ... */ }, quality_thresholds: QualityThresholds { /* ... */ }, model_selection_strategy: ModelSelectionStrategy::Ensemble(vec![("arima".to_string(), 0.7), ("lstm".to_string(), 0.3)]), }; let duration_config = start_config.elapsed(); println!("Configuration created in: {:?}", duration_config); assert!(duration_config.as_micros() < 1000); // --- Quality Monitoring Simulation --- let monitor = QualityMonitor { /* ... */ }; let forecast_data = ForecastData { /* ... */ }; // Simulate forecast data let start_monitor = Instant::now(); let metrics = monitor.assess_quality(&forecast_data); let duration_monitor = start_monitor.elapsed(); println!("Quality assessed in: {:?}", duration_monitor); assert!(duration_monitor.as_micros() < 5); // --- Serialization Example --- let serialized_config = serde_json::to_string(&config).unwrap(); println!("Serialized Config: {}", serialized_config); // --- Integration Example --- // let mut adaptive_system = AdaptiveBuilder::new().with_forecast_config(config.forecast_config).build().unwrap(); // adaptive_system.run_forecast(&forecast_data); println!("\nExample completed successfully."); } // Placeholder structs and enums #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ForecastConfig { /* ... */ } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AdaptiveParameters { /* ... */ } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct RegimeConfig { /* ... */ } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct QualityThresholds { /* ... */ } #[derive(Debug, Clone, Serialize, Deserialize)] pub enum ModelSelectionStrategy { FixedModel(String), PerformanceBased, RegimeDependent(HashMap), Ensemble(Vec<(String, f64)>) } #[derive(Debug, Clone)] pub struct ForecastData { /* ... */ } impl QualityMonitor { // Dummy implementation for example pub fn assess_quality(&self, _forecast_data: &ForecastData) -> QualityMetrics { QualityMetrics { /* ... */ } } } #[derive(Debug, Clone)] pub struct QualityMetrics { /* ... */ } use std::collections::HashMap; use serde::{Serialize, Deserialize}; use serde_json; ``` -------------------------------- ### Create and Use ARIMA Model Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Provides a code example for creating, fitting, and forecasting with an Autoregressive Integrated Moving-Average (ARIMA) model in OxiDiviner. ```rust use oxidiviner::models::autoregressive::ARIMAModel; // Create ARIMA(p,d,q) model let mut model = ARIMAModel::new(2, 1, 1, true)?; model.fit(&data)?; let forecast = model.forecast(10)?; ``` -------------------------------- ### Backtesting for Model Performance in Rust Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Illustrates how to backtest a model's performance using historical data with the `backtest` function. This example shows setting a rolling window size and forecast horizon, and then accessing performance metrics such as hit rate and directional accuracy. ```rust use oxidiviner::core::validation::backtest; let bt_results = backtest(&model, &data, 252, 10)?; // 1-year window, horizon=10 println!("Hit rate: {}%", bt_results.hit_rate * 100.0); println!("Directional accuracy: {}%", bt_results.directional_accuracy * 100.0); ``` -------------------------------- ### Run OxiDiviner Exponential Smoothing Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/examples/README.md Demonstrates Simple Exponential Smoothing (SES), Holt's Linear Method, and Holt-Winters for business forecasting and demand planning. Includes parameter tuning and model comparison for seasonal data. ```bash cargo run --example exponential_smoothing_example ``` -------------------------------- ### Higher-Order Markov Model in Rust Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Shows how to implement a HigherOrderMarkovModel, allowing for regime transitions that depend on previous states. This example demonstrates initializing a second-order model (2 regimes, order 2) and calculating transition probabilities based on historical regimes. ```rust use oxidiviner::models::regime_switching::HigherOrderMarkovModel; // Create second-order model let mut model = HigherOrderMarkovModel::new(2, 2)?; // 2 regimes, order 2 model.fit(&data)?; // Get transition probabilities conditional on past regimes let prob = model.transition_probability(1, 0, 1)?; // P(S_t=1|S_{t-1}=0,S_{t-2}=1) ``` -------------------------------- ### OxiDiviner Basic GARCH Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Provides a basic example of GARCH (Generalized Autoregressive Conditional Heteroskedasticity) volatility modeling. ```rust // basic_garch_example.rs // Standard GARCH volatility modeling ``` -------------------------------- ### Test Examples Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Executes all example files as tests to verify their correctness and ensure they function as intended. ```Bash cargo test --examples ``` -------------------------------- ### OxiDiviner OHLCV Forecasting Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Demonstrates how to work with OHLCV (Open-High-Low-Close-Volume) financial data for forecasting tasks. ```rust // ohlcv_forecasting_example.rs // Working with OHLCV (Open-High-Low-Close-Volume) financial data ``` -------------------------------- ### Run OxiDiviner ARIMA Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/examples/README.md Demonstrates ARIMA model configuration, fitting, parameter estimation, diagnostics, and future forecasting. Best for non-stationary time series with trends and autocorrelation. Integrates with the Quick API. ```bash cargo run --example arima_example ``` -------------------------------- ### Run OxiDiviner GARCH Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/examples/README.md Demonstrates GARCH(p,q) volatility modeling for financial risk management, including Value at Risk (VaR) calculations, options pricing, and stress testing. Best for financial time series and volatility forecasting. ```bash cargo run --example garch_example ``` -------------------------------- ### Run OxiDiviner Moving Average Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/examples/README.md Shows Simple Moving Average with different window sizes for sales forecasting. Compares performance across noise levels and optimizes window size. Best for smoothing noisy data and baseline forecasting. ```bash cargo run --example moving_average_example ``` -------------------------------- ### Run OxiDiviner AutoRegressive (AR) Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/examples/README.md Illustrates AR(p) model fitting and forecasting, including order selection, coefficient interpretation, and autocorrelation modeling. Best for data with linear autocorrelation patterns. ```bash cargo run --example ar_example ``` -------------------------------- ### OxiDiviner Standard Interface Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Demonstrates the standardized forecasting interface provided by the OxiDiviner library. ```rust // standard_interface_demo.rs // Demonstrates the standardized forecasting interface ``` -------------------------------- ### Rustic ML Oxidiviner Simple API Demo Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Illustrates basic usage patterns of the Oxidiviner API. This example is ideal for beginners to understand fundamental operations. ```rust /* * Example: simple_api_demo.rs * Description: Basic usage patterns * Command: cargo run --bin simple_api_demo */ // Placeholder for actual Rust code fn main() { println!("Running simple_api_demo example..."); // Basic API usage demonstration } ``` -------------------------------- ### Kalman Filter for State Space Models in Rust Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Provides an example of using the KalmanFilter for state space modeling, specifically the local level model. It covers initialization, fitting the model to data, retrieving filtered states and their covariances, and performing forecasts with uncertainty estimates. ```rust use oxidiviner::models::state_space::KalmanFilter; // Create local level model let mut kf = KalmanFilter::new_local_level(0.1, 0.1)?; kf.fit(&data)?; // Get filtered states let states = kf.filtered_states()?; let state_covs = kf.filtered_state_covariances()?; // Forecast with uncertainty let (forecast, forecast_cov) = kf.forecast_with_covariance(10)?; ``` -------------------------------- ### OxiDiviner SABR Volatility Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Demonstrates industry-standard SABR volatility surface modeling for FX and rates. ```rust // sabr_volatility_demo.rs // Industry-standard FX and rates volatility surface modeling ``` -------------------------------- ### OxiDiviner Optimization Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Explores advanced parameter optimization techniques, including Bayesian, Genetic, and Simulated Annealing methods. ```rust // optimization_demo.rs // Advanced parameter optimization techniques (Bayesian, Genetic, Simulated Annealing) ``` -------------------------------- ### Rustic ML Oxidiviner Basic GARCH Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Covers basic GARCH, GJR-GARCH, and EGARCH models for volatility modeling. This example is fundamental for understanding conditional heteroskedasticity. ```rust /* * Example: basic_garch_example.rs * Description: GARCH, GJR-GARCH, EGARCH * Command: cargo run --bin basic_garch_example */ // Placeholder for actual Rust code fn main() { println!("Running basic_garch_example..."); // Basic GARCH, GJR-GARCH, EGARCH models } ``` -------------------------------- ### Rustic ML Oxidiviner Moving Average Demo Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Illustrates the implementation of Moving Average (MA) models. This example is useful for time series smoothing and analysis. ```rust /* * Example: ma_demo.rs * Description: MA model implementation * Command: cargo run --bin ma_demo */ // Placeholder for actual Rust code fn main() { println!("Running ma_demo example..."); // MA model implementation } ``` -------------------------------- ### Rustic ML Oxidiviner ETS Demo Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Provides a basic demonstration of Error-Trend-Seasonal (ETS) models. This example serves as an introduction to ETS modeling. ```rust /* * Example: ets_demo.rs * Description: Error-Trend-Seasonal models * Command: cargo run --bin ets_demo */ // Placeholder for actual Rust code fn main() { println!("Running ets_demo example..."); // Basic ETS model demonstration } ``` -------------------------------- ### Rustic ML Oxidiviner Standard Interface Demo Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Demonstrates traditional API usage patterns within the Oxidiviner library. This example is useful for users accustomed to standard interface designs. ```rust /* * Example: standard_interface_demo.rs * Description: Traditional API usage * Command: cargo run --bin standard_interface_demo */ // Placeholder for actual Rust code fn main() { println!("Running standard_interface_demo example..."); // Traditional API usage demonstration } ``` -------------------------------- ### Rustic ML Oxidiviner Enhanced API Demo Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Showcases all levels of API functionality within the Oxidiviner library. This example is useful for users who want to explore the full capabilities. ```rust /* * Example: enhanced_api_demo.rs * Description: All API levels demonstrated * Command: cargo run --example enhanced_api_demo */ // Placeholder for actual Rust code fn main() { println!("Running enhanced_api_demo example..."); // Comprehensive Oxidiviner API usage demonstration } ``` -------------------------------- ### OxiDiviner API Improvements Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Highlights advanced API features and the use of builder patterns within the OxiDiviner library. ```rust // api_improvements_demo.rs // Advanced API features and builder patterns ``` -------------------------------- ### OxiDiviner ES Models Comparison Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Compares the performance and characteristics of different Exponential Smoothing (ES) models. ```rust // es_models_comparison.rs // Comparison of different ES models ``` -------------------------------- ### Rustic ML Oxidiviner API Improvements Demo Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Highlights enhanced API features within the Oxidiviner library. This example is for users familiar with the library looking to leverage new capabilities. ```rust /* * Example: api_improvements_demo.rs * Description: Enhanced API features * Command: cargo run --bin api_improvements_demo */ // Placeholder for actual Rust code fn main() { println!("Running api_improvements_demo example..."); // Demonstration of enhanced API features } ``` -------------------------------- ### Rustic ML Oxidiviner OHLCV Data Processor Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Demonstrates handling of financial data, specifically OHLCV. This example covers essential data processing steps for financial time series analysis. ```rust /* * Example: data_processor.rs * Description: Financial data handling * Command: cargo run --bin ohlcv_data_processor */ // Placeholder for actual Rust code fn main() { println!("Running ohlcv_data_processor example..."); // Financial data processing for OHLCV } ``` -------------------------------- ### Rustic ML Oxidiviner ES Models Comparison Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Compares different Exponential Smoothing (ES) models and provides guidance on selecting the appropriate model for a trading strategy. This example is valuable for quantitative trading. ```rust /* * Example: es_models_comparison.rs * Description: Trading strategy guide * Command: cargo run --bin es_models_comparison */ // Placeholder for actual Rust code fn main() { println!("Running es_models_comparison example..."); // ES models comparison for trading strategies } ``` -------------------------------- ### OxiDiviner Advanced Diagnostics Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Provides comprehensive model diagnostics and validation tools for time series analysis. ```rust // advanced_diagnostics_demo.rs // Comprehensive model diagnostics and validation ``` -------------------------------- ### Rustic ML Oxidiviner Stock Volatility Analysis Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Demonstrates risk management and Value at Risk (VaR) calculations using stock volatility analysis. This example is crucial for financial risk assessment. ```rust /* * Example: stock_volatility_analysis.rs * Description: Risk management & VaR * Command: cargo run --bin stock_volatility_analysis */ // Placeholder for actual Rust code fn main() { println!("Running stock_volatility_analysis example..."); // Stock volatility analysis for risk management } ``` -------------------------------- ### OxiDiviner Stock Volatility Analysis Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Performs real-world stock volatility analysis using GARCH models. ```rust // stock_volatility_analysis.rs // Real-world stock volatility analysis ``` -------------------------------- ### OxiDiviner Autoregressive Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Offers comprehensive demonstrations of Autoregressive (AR), ARIMA, and SARIMA models. ```rust // autoregressive_demo.rs // Comprehensive AR/ARIMA/SARIMA demonstrations ``` -------------------------------- ### OxiDiviner VAR Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Demonstrates the application of Vector Autoregression (VAR) models for multivariate time series. ```rust // var_demo.rs // Vector Autoregression models ``` -------------------------------- ### OxiDiviner Advanced GARCH Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Explores advanced GARCH variants, including GJR-GARCH, EGARCH, and GARCH-in-Mean models. ```rust // advanced_garch_demo.rs // Advanced GARCH variants (GJR, EGARCH, GARCH-M) ``` -------------------------------- ### OxiDiviner Simple Exponential Smoothing Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Implements the Simple Exponential Smoothing (SES) model for time series forecasting. ```rust // ses_demo.rs // Simple Exponential Smoothing ``` -------------------------------- ### Create and Use ARMA Model Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Explains how to create, fit, and forecast using an Autoregressive Moving-Average (ARMA) model in OxiDiviner. ```rust use oxidiviner::models::autoregressive::ARMAModel; // Create ARMA(p,q) model let mut model = ARMAModel::new(2, 1, true)?; model.fit(&data)?; let forecast = model.forecast(10)?; ``` -------------------------------- ### Run OxiDiviner Enhanced API Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/examples/README.md Showcases a unified API for multiple models, batch processing, builder pattern usage, model comparison, and financial data handling. Suitable for production-ready workflows. ```bash cargo run --example enhanced_api_demo ``` -------------------------------- ### Bash Script for Project Setup/Execution Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/docs/step1_completion_report.md Example bash commands that might be used for building, testing, or running the Rust project. ```Bash # Build the project cargo build --release # Run tests cargo test # Run the example cargo run --example step1_adaptive_config_example # Clean the project cargo clean # Check code formatting rustfmt --check src/ tests/ examples/ # Check for clippy lints clippy-driver src/ tests/ examples/ ``` -------------------------------- ### Model Diagnostics in Rust Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Demonstrates how to obtain diagnostic statistics for a fitted model using the `ModelDiagnostics` struct. The example shows how to calculate and print common information criteria like AIC and BIC, as well as the log-likelihood of the model. ```rust use oxidiviner::core::diagnostics::ModelDiagnostics; let diag = ModelDiagnostics::new(&model, &data)?; println!("AIC: {}", diag.aic()); println!("BIC: {}", diag.bic()); println!("Log-likelihood: {}", diag.log_likelihood()); ``` -------------------------------- ### Gaussian Copula Model in Rust Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Details the use of the GaussianCopulaModel for modeling dependencies between multiple financial assets. The example covers model creation for a specified number of assets, fitting the model to multivariate return data, and simulating joint scenarios. ```rust use oxidiviner::models::copula::GaussianCopulaModel; // Create model for 3 assets let mut model = GaussianCopulaModel::new(3)?; model.fit(&multivariate_returns)?; // Generate joint scenarios let scenarios = model.simulate(1000)?; // 1000 scenarios ``` -------------------------------- ### Import OxiDiviner Modules Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Demonstrates common import patterns for using OxiDiviner, including importing all prelude types, specific modules, or only the Quick API. ```rust // Most common - imports all main types use oxidiviner::prelude::*; // Specific modules use oxidiviner::{quick, api, batch}; use oxidiviner::models::autoregressive::ARIMAModel; // Quick API only use oxidiviner::quick; ``` -------------------------------- ### Student's t-Copula Model in Rust Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Explains how to utilize the TCopulaModel for capturing tail dependence in financial data, particularly useful for modeling extreme events. The example shows initialization with specified degrees of freedom, fitting the model, and calculating tail dependence coefficients. ```rust use oxidiviner::models::copula::TCopulaModel; // Create t-copula with 5 degrees of freedom let mut model = TCopulaModel::new(3, 5.0)?; model.fit(&multivariate_returns)?; // Get tail dependence coefficients let tail_dep = model.tail_dependence_coefficient(0, 1)?; ``` -------------------------------- ### OxiDiviner Enhanced Regime-Switching Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/examples/README.md Showcases multivariate regime detection and higher-order dependencies for multiple assets, portfolio analysis, and complex temporal patterns. Includes duration-dependent models and cross-asset correlation analysis. ```rust // enhanced_regime_switching_demo.rs // Multivariate regime detection across multiple assets (stocks, bonds, commodities) // Portfolio regime analysis with risk metrics and correlation switching // Higher-order dependencies and complex temporal patterns // Duration-dependent models and regime persistence analysis // Cross-asset correlation regime analysis with crisis vs normal market detection // Model comparison and selection framework ``` -------------------------------- ### Basic Markov Switching Model in Rust Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Demonstrates how to initialize, fit, and use a basic 2-regime Markov Switching Model for financial returns data. It shows how to retrieve regime probabilities, identify the most likely regime, and generate forecasts. ```rust use oxidiviner::models::regime_switching::MarkovSwitchingModel; // Two-regime model (e.g., bull/bear) let mut model = MarkovSwitchingModel::new(2)?; model.fit(&returns_data)?; // Get regime probabilities let probs = model.regime_probabilities()?; let current_regime = model.most_likely_regime()?; // Forecast with regime switching let forecast = model.forecast(10)?; ``` -------------------------------- ### Adaptive Forecaster Example Demonstration Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/multi_parameter_adaptive_implementation_plan.md A working demonstration of the Unified Adaptive Forecaster, showcasing its end-to-end adaptive forecasting pipeline, including fitting, forecasting, and adaptive behavior. ```Rust // examples/step4_adaptive_forecaster_example.rs use oxidiviner::adaptive::forecaster::AdaptiveForecaster; fn main() { println!("--- Unified Adaptive Forecaster Example ---"); // Initialize the forecaster let mut forecaster = AdaptiveForecaster::new(); // Example data for fitting let training_data = vec![10.0, 12.0, 11.0, 13.0, 15.0, 14.0]; println!("Fitting forecaster with data: {:?}", training_data); forecaster.fit(&training_data); // Example input for forecasting let forecast_input = vec![16.0]; println!("Generating forecast for input: {:?}", forecast_input); let forecasts = forecaster.forecast(&forecast_input); println!("Generated forecasts: {:?}", forecasts); println!("--- Example Complete ---"); } ``` -------------------------------- ### Cross-Validation for Model Evaluation in Rust Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Shows how to perform cross-validation using the `cross_validate` function to assess model performance on unseen data. The example demonstrates setting up k-fold cross-validation and accessing metrics like Mean Absolute Error (MAE) and Root Mean Squared Error (RMSE). ```rust use oxidiviner::core::validation::cross_validate; let cv_results = cross_validate(&model, &data, 5, 10)?; // 5-fold CV, horizon=10 println!("CV MAE: {}", cv_results.mae); println!("CV RMSE: {}", cv_results.rmse); ``` -------------------------------- ### Archimedean Copula Model in Rust Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Demonstrates the application of ArchimedeanCopulaModel for modeling various forms of dependency, including tail dependence using specific copula families like Clayton. The example shows creating a Clayton copula, fitting it to bivariate data, and generating dependent uniform variates. ```rust use oxidiviner::models::copula::{ArchimedeanCopulaModel, ArchimedeanType}; // Create Clayton copula for lower tail dependence let mut model = ArchimedeanCopulaModel::new(2, ArchimedeanType::Clayton)?; model.fit(&bivariate_returns)?; // Generate dependent uniform variates let uniforms = model.generate_uniforms(1000)?; ``` -------------------------------- ### Core Regime Detection API Usage Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/docs/step2_completion_report.md Demonstrates the fundamental steps for creating, configuring, fitting, and detecting regimes using the Oxidiviner library. It highlights the use of `AdaptiveConfig` and `RegimeDetector` for historical data analysis and real-time classification. ```rust use oxidiviner::adaptive::{AdaptiveConfig, RegimeDetector}; // Create and configure detector let config = AdaptiveConfig::default(); let mut detector = RegimeDetector::new(config)?; // Fit to historical data detector.fit(&historical_data)?; // Real-time detection let result = detector.detect_regime(new_value)?; println!("Regime: {:?}, Confidence: {:.1}%", result.current_regime, result.confidence * 100.0); ``` -------------------------------- ### Rustic ML Oxidiviner ETS Model Complete Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Offers a comprehensive example of Error-Trend-Seasonal (ETS) models, covering various configurations and applications. This example is for in-depth ETS analysis. ```rust /* * Example: ets_model_complete.rs * Description: Comprehensive ETS example * Command: cargo run --bin ets_model_complete */ // Placeholder for actual Rust code fn main() { println!("Running ets_model_complete example..."); // Complete ETS model example } ``` -------------------------------- ### Quick Moving Average Forecasting Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Illustrates using the Quick API for moving average forecasting, with options for default or custom window sizes. ```rust // Default window size (5) let forecast = quick::moving_average(data.clone(), 10, None)?; // Custom window size let forecast = quick::moving_average(data, 10, Some(7))?; ``` -------------------------------- ### Rust Test Suite for Adaptive Configuration Source: https://github.com/rustic-ml/oxidiviner/blob/main/oxidiviner/docs/step1_completion_report.md The comprehensive test suite for the adaptive configuration system, covering configuration creation, validation, serialization, integration, and performance. ```Rust #[cfg(test)] mod tests { use super::*; use crate::adaptive::config::{AdaptiveConfig, AdaptiveParameters, ModelSelectionStrategy}; use crate::adaptive::monitoring::QualityMonitor; use serde_json; #[test] fn test_config_creation_and_validation() { let params = AdaptiveParameters { learning_rate: 0.05, adaptation_window_size: 30, confidence_threshold: 0.85, frequency_limit: 5, }; let config = AdaptiveConfig { forecast_config: ForecastConfig { /* ... */ }, adaptive_parameters: params, regime_config: RegimeConfig { /* ... */ }, quality_thresholds: QualityThresholds { /* ... */ }, model_selection_strategy: ModelSelectionStrategy::FixedModel("arima".to_string()), }; // Add assertions to validate the created config assert_eq!(config.adaptive_parameters.learning_rate, 0.05); // ... more assertions } #[test] fn test_serialization_roundtrip() { let params = AdaptiveParameters { learning_rate: 0.1, adaptation_window_size: 50, confidence_threshold: 0.9, frequency_limit: 10, }; let config = AdaptiveConfig { forecast_config: ForecastConfig { /* ... */ }, adaptive_parameters: params, regime_config: RegimeConfig { /* ... */ }, quality_thresholds: QualityThresholds { /* ... */ }, model_selection_strategy: ModelSelectionStrategy::PerformanceBased, }; let serialized = serde_json::to_string(&config).unwrap(); let deserialized: AdaptiveConfig = serde_json::from_str(&serialized).unwrap(); // Assert that the deserialized config matches the original assert_eq!(config.adaptive_parameters.learning_rate, deserialized.adaptive_parameters.learning_rate); // ... more assertions } #[test] fn test_quality_monitoring_fallback() { let monitor = QualityMonitor { /* ... */ }; let forecast_data = ForecastData { /* ... */ }; // Assume some data causing low quality let metrics = monitor.assess_quality(&forecast_data); // Assert that fallback is triggered if quality is below threshold // assert!(monitor.should_fallback(&metrics)); // Hypothetical method } #[test] fn test_integration_with_existing_components() { // Test the integration of AdaptiveBuilder with other OxiDiviner components // let adaptive_config = AdaptiveBuilder::new()...build().unwrap(); // assert!(integration_works(&adaptive_config)); // Hypothetical function unimplemented!("Integration test not fully implemented"); } #[test] fn test_performance_overhead() { // Benchmark the performance of configuration creation and monitoring // let start = std::time::Instant::now(); // ... perform operation ... // let duration = start.elapsed(); // assert!(duration.as_micros() < 1000); // Example: less than 1ms unimplemented!("Performance test not fully implemented"); } // Placeholder structs and enums used in tests #[derive(Debug, Clone, Serialize, Deserialize)] pub struct ForecastConfig { /* ... */ } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct AdaptiveParameters { /* ... */ } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct RegimeConfig { /* ... */ } #[derive(Debug, Clone, Serialize, Deserialize)] pub struct QualityThresholds { /* ... */ } #[derive(Debug, Clone, Serialize, Deserialize)] pub enum ModelSelectionStrategy { FixedModel(String), PerformanceBased } #[derive(Debug, Clone)] pub struct ForecastData { /* ... */ } impl QualityMonitor { // Dummy implementation for testing pub fn assess_quality(&self, _forecast_data: &ForecastData) -> QualityMetrics { QualityMetrics { /* ... */ } } } #[derive(Debug, Clone)] pub struct QualityMetrics { /* ... */ } } ``` -------------------------------- ### Quick Model Comparison Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Shows how to use the Quick API's `compare_models` function to evaluate and compare the performance of all available forecasting models on the provided data. ```rust // Compare all available models let comparisons = quick::compare_models(timestamps, values, 10)?; for (model_name, forecast) in comparisons { println!("{}: {:?}", model_name, &forecast[..3]); } ``` -------------------------------- ### Rustic ML Oxidiviner Holt-Winters Demo Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Illustrates the Holt-Winters model for seasonal time series forecasting. This example is essential for data with both trend and seasonality. ```rust /* * Example: holt_winters_demo.rs * Description: Seasonal forecasting * Command: cargo run --bin holt_winters_demo */ // Placeholder for actual Rust code fn main() { println!("Running holt_winters_demo example..."); // Holt-Winters seasonal forecasting } ``` -------------------------------- ### Create and Fit SARIMA Model Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Demonstrates how to initialize a SARIMA model with specified orders and seasonality, fit it to data, and generate forecasts. Requires specifying p, d, q, P, D, Q, s, and whether to include seasonality. ```rust use oxidiviner::models::autoregressive::SARIMAModel; // Create SARIMA(p,d,q)(P,D,Q)s model let mut model = SARIMAModel::new(1, 1, 1, 1, 1, 1, 12, true)?; model.fit(&data)?; let forecast = model.forecast(24)?; ``` -------------------------------- ### Rustic ML Oxidiviner ETS Model Demo Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Demonstrates the fundamental functionality of Error-Trend-Seasonal (ETS) models. This example is suitable for understanding core ETS operations. ```rust /* * Example: ets_model_demo.rs * Description: Basic ETS functionality * Command: cargo run --bin ets_model_demo */ // Placeholder for actual Rust code fn main() { println!("Running ets_model_demo example..."); // Basic ETS functionality demonstration } ``` -------------------------------- ### Create and Fit GARCH Model Source: https://github.com/rustic-ml/oxidiviner/blob/main/docs/user_guide.md Illustrates how to initialize and use a GARCH(1,1) model for modeling volatility. It requires specifying the p and q orders and fitting the model to return data. Forecasts for volatility are then generated. ```rust use oxidiviner::models::garch::GARCHModel; // GARCH(1,1) model let mut model = GARCHModel::new(1, 1, None)?; model.fit(&returns_data)?; let volatility_forecast = model.forecast(10)?; ``` -------------------------------- ### Rustic ML Oxidiviner SES Model Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Details the implementation of the Simple Exponential Smoothing (SES) model. This example is useful for understanding the internal workings of SES. ```rust /* * Example: ses_model_example.rs * Description: SES implementation details * Command: cargo run --bin ses_model_example */ // Placeholder for actual Rust code fn main() { println!("Running ses_model_example..."); // SES model implementation details } ``` -------------------------------- ### Rustic ML Oxidiviner AutoRegressive Demo Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Demonstrates AutoRegressive (AR), ARIMA, SARIMA, and VAR models. This example is comprehensive for understanding autoregressive time series modeling. ```rust /* * Example: autoregressive_demo.rs * Description: AR, ARIMA, SARIMA, VAR * Command: cargo run --bin autoregressive_demo */ // Placeholder for actual Rust code fn main() { println!("Running autoregressive_demo example..."); // AR, ARIMA, SARIMA, VAR model demonstrations } ``` -------------------------------- ### Rustic ML Oxidiviner Holt Demo Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Demonstrates the Holt Linear Trend model for time series forecasting. This example is suitable for data exhibiting a trend but no seasonality. ```rust /* * Example: holt_demo.rs * Description: Holt Linear Trend model * Command: cargo run --bin holt_demo */ // Placeholder for actual Rust code fn main() { println!("Running holt_demo example..."); // Holt Linear Trend model demonstration } ``` -------------------------------- ### Rustic ML Oxidiviner AR Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Demonstrates AutoRegressive (AR) model comparison. This example is useful for understanding how past values influence current values in a time series. ```rust /* * Example: ar_example.rs * Description: AutoRegressive model comparison * Command: cargo run --example ar_example */ // Placeholder for actual Rust code fn main() { println!("Running ar_example..."); // AR model comparison code } ``` -------------------------------- ### Rustic ML Oxidiviner ARIMA Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Covers ARIMA (AutoRegressive Integrated Moving Average) forecasting and evaluation. This example is essential for stationary and non-stationary time series analysis. ```rust /* * Example: arima_example.rs * Description: ARIMA forecasting & evaluation * Command: cargo run --example arima_example */ // Placeholder for actual Rust code fn main() { println!("Running arima_example..."); // ARIMA forecasting and evaluation logic } ``` -------------------------------- ### Run Basic Working Demo Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Executes a demo showcasing OxiDiviner's core functionality. This example provides a clear illustration of the library's essential features. ```Bash cargo run --bin basic_working_demo ``` -------------------------------- ### Rustic ML Oxidiviner ES Parameter Tuning Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Focuses on optimizing parameters for Exponential Smoothing (ES) models. This example is essential for enhancing the accuracy and performance of ES forecasts. ```rust /* * Example: es_parameter_tuning.rs * Description: Parameter optimization * Command: cargo run --bin es_parameter_tuning */ // Placeholder for actual Rust code fn main() { println!("Running es_parameter_tuning example..."); // ES parameter optimization } ``` -------------------------------- ### Rustic ML Oxidiviner SES Parameter Tuning Example Source: https://github.com/rustic-ml/oxidiviner/blob/main/README.md Focuses on optimizing the alpha parameter for Simple Exponential Smoothing (SES) models. This example is crucial for improving forecasting accuracy. ```rust /* * Example: ses_parameter_tuning.rs * Description: Alpha parameter optimization * Command: cargo run --bin ses_parameter_tuning */ // Placeholder for actual Rust code fn main() { println!("Running ses_parameter_tuning example..."); // SES alpha parameter optimization } ```