help@rskworld.in +91 93305 39277
RSK World
  • Home
  • Development
    • Web Development
    • Mobile Apps
    • Software
    • Games
    • Project
  • Technologies
    • Data Science
    • AI Development
    • Cloud Development
    • Blockchain
    • Cyber Security
    • Dev Tools
    • Testing Tools
  • About
  • Contact

Theme Settings

Color Scheme
Display Options
Font Size
100%
Back to Project
RSK World
statsmodels-statistical
/
examples
RSK World
statsmodels-statistical
Statistical Modeling with Statsmodels
examples
  • advanced_time_series_example.py1.4 KB
  • hypothesis_testing_example.py1.4 KB
  • model_selection_example.py1.5 KB
  • regression_example.py1.5 KB
  • time_series_example.py1.6 KB
advanced_time_series_example.py
examples/advanced_time_series_example.py
Raw Download
Find: Go to:
"""
Advanced Time Series Example

Author: RSK World
Website: https://rskworld.in
Email: help@rskworld.in
Phone: +91 93305 39277
"""

import numpy as np
import pandas as pd
import sys
import os

# Add parent directory to path
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from advanced_time_series import SARIMAModel, AutoARIMA, StationarityTests


def main():
    print("Advanced Time Series Example")
    print("=" * 70)
    
    # Generate sample seasonal data
    np.random.seed(42)
    dates = pd.date_range('2020-01-01', periods=200, freq='D')
    trend = np.linspace(0, 10, 200)
    seasonal = 5 * np.sin(2 * np.pi * np.arange(200) / 30)  # Monthly seasonality
    noise = np.random.randn(200) * 0.5
    data = pd.Series(trend + seasonal + noise, index=dates)
    
    # SARIMA model
    print("\nSARIMA Model:")
    print("=" * 70)
    sarima = SARIMAModel()
    sarima.fit(data, order=(1, 1, 1), seasonal_order=(1, 1, 1, 30))
    sarima.summary()
    
    # Auto ARIMA
    print("\n" + "=" * 70)
    print("Auto ARIMA Selection:")
    print("=" * 70)
    auto_arima = AutoARIMA()
    best_model = auto_arima.auto_select(data, max_p=2, max_d=1, max_q=2, seasonal=False)
    
    # Stationarity tests
    print("\n" + "=" * 70)
    print("Stationarity Tests:")
    print("=" * 70)
    StationarityTests.comprehensive_test(data)


if __name__ == "__main__":
    main()

57 lines•1.4 KB
python

About RSK World

Founded by Molla Samser, with Designer & Tester Rima Khatun, RSK World is your one-stop destination for free programming resources, source code, and development tools.

Founder: Molla Samser
Designer & Tester: Rima Khatun

Development

  • Game Development
  • Web Development
  • Mobile Development
  • AI Development
  • Development Tools

Legal

  • Terms & Conditions
  • Privacy Policy
  • Disclaimer

Contact Info

Nutanhat, Mongolkote
Purba Burdwan, West Bengal
India, 713147

+91 93305 39277

hello@rskworld.in
support@rskworld.in

© 2026 RSK World. All rights reserved.

Content used for educational purposes only. View Disclaimer