Observed since 21 Oct, 10:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Scientific AI-powered Time Series Research Library — HGR, Ensemble, AutoARIMA, Backtesting & AI Agent
AIForecastTS is a high-performance scientific library designed to bridge the gap between classical signal processing and modern machine learning for time series forecasting.
v1.0.0 is a major release introducing:
Traditional forecasting often fails by treating signal and noise as a monolithic entity. HGR operates on the principle of Dual-Component Decomposition:
The Resonance module assumes that every time series contains underlying periodicities driven by systemic cycles.
The residuals from the Resonance module ($y - y_{res}$) represent "Turbulence" — the chaotic, non-linear interactions.
The ensemble now combines 3 forecasting paradigms:
| Component | Paradigm | Strength |
|---|---|---|
| Prophet | Bayesian | Trend & seasonality |
| HGR | Physics-based | Frequency decomposition |
| AutoARIMA | Statistical | Classical Box-Jenkins |
Weight optimization uses 3D grid search on validation data. Falls back gracefully to 2-model ensemble if ARIMA fails.
aiforecastts.analytics)aiforecastts.backtesting)aiforecastts.visualization)aiforecastts.agents)Powered by Google Gemini, the agent generates structured scientific reports with:
pip install aiforecastts
For development:
pip install aiforecastts[dev]
import pandas as pd
from aiforecastts import TimeSeriesResearch
df = pd.read_csv("data.csv", index_col='date', parse_dates=True)
research = TimeSeriesResearch(df, target_col='value', model_type='hgr')
results = research.run_full_analysis(steps=14, return_ci=True)
print(results['forecast'][['hgr_forecast', 'ci_lower', 'ci_upper']])
print(results['stationarity'])
print(results['data_quality'])
research = TimeSeriesResearch(df, target_col='value', model_type='ensemble')
results = research.run_full_analysis(steps=7, treat_outliers=True)
print(results['forecast'][['prophet', 'hgr', 'arima', 'ensemble_forecast']])
print(results['model_summary'])
research = TimeSeriesResearch(df, target_col='value')
comparison = research.compare_models(model_types=['hgr', 'arima', 'ets'], steps=14)
print(comparison['comparison_table'])
research = TimeSeriesResearch(df, target_col='value', model_type='hgr')
bt_results = research.backtest(forecast_horizon=7, step_size=7, expanding=True)
print(f"Overall RMSE: {bt_results['overall_metrics']['RMSE']}")
print(f"Folds: {bt_results['n_folds']}")
bt_compare = research.backtest_compare(
model_types=['hgr', 'arima'],
forecast_horizon=7,
step_size=7,
)
print(bt_compare['comparison'])
from aiforecastts import ForecastPlotter
# Forecast plot with CI
ForecastPlotter.plot_forecast(
actual=df['value'],
forecast=results['forecast'],
title="HGR Forecast with Confidence Intervals",
show_last_n=60,
)
# Component decomposition
ForecastPlotter.plot_components(results['forecast'])
# Residual diagnostics
ForecastPlotter.plot_residual_diagnostics(y_true, y_pred)
# Backtest results
ForecastPlotter.plot_backtest_results(bt_results)
results = research.run_full_analysis(
agent_query="Analyze the resonance-turbulence interaction and assess forecast stability.",
api_key="YOUR_GEMINI_API_KEY",
steps=7,
)
print(results['agent_report'])
from aiforecastts import HarmonicGradientResonance, AutoARIMAModel, ExponentialSmoothingModel
# HGR with confidence intervals
hgr = HarmonicGradientResonance(top_k_frequencies=5, use_bayesian_resonance=True)
hgr.fit(df, 'value', auto_tune=True)
forecast = hgr.predict(steps=14, return_ci=True)
print(hgr.summary())
# AutoARIMA
arima = AutoARIMAModel(seasonal=True, m=7)
arima.fit(df, 'value')
forecast = arima.predict(steps=14, return_ci=True)
# Exponential Smoothing
ets = ExponentialSmoothingModel(trend='add', seasonal='add')
ets.fit(df, 'value')
forecast = ets.predict(steps=14)
| Class | Description |
|---|---|
HarmonicGradientResonance | HGR v2.0 with CI, Bayesian, auto-tune |
ScientificEnsemble | 3-model ensemble (Prophet + HGR + ARIMA) |
AutoARIMAModel | Auto-tuned ARIMA via pmdarima |
ExponentialSmoothingModel | Holt-Winters ETS |
| Class | Description |
|---|---|
DataProcessor | Cleaning, outliers, stationarity, normalization |
FeatureEngineer | Lag, rolling, technical, Fourier features |
ModelEvaluator | Metrics, diagnostics, model comparison |
| Class | Description |
|---|---|
TimeSeriesResearch | Main pipeline orchestrator |
Backtester | Walk-forward validation framework |
ForecastPlotter | Professional visualization |
AIForecastAgent | Gemini-powered analysis agent |
check_stationarity() now returns conclusion instead of is_stationaryScientificEnsemble now includes ARIMA by default (use include_arima=False for v0.3 behavior)If you use this library in your research, please cite it as:
Tuan, T. A. (2025). AIForecastTS: A Scientific Framework for Time Series Resonance & Turbulence Analysis. GitHub Repository. https://github.com/tuanthescientist/aiforecastts
Developed by Tran Anh Tuan - (AI Forecast) aiconsultant.org
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.0 | 2 Mar 2026 | 17 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Observed since 21 Oct, 10:43 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:3ff07d0e04595390ebcee49d9d1a8d71088843bd83363d94211309323dfef3b3