Skip to main content

时间序列预测 MCP (Model Context Protocol) - 提供 AR、MA、ARIMA、GARCH、指数平滑五种时间序列预测能力

Project description

Time Series Forecast MCP

时间序列预测 MCP (Model Context Protocol),提供五种时间序列预测模型:

  • AR: 自回归模型
  • MA: 移动平均模型
  • ARIMA: 自回归积分移动平均模型(支持自动选参)
  • GARCH: 广义自回归条件异方差模型(波动率预测)
  • EXPONENTIAL_SMOOTHING: 指数平滑模型(支持季节性)

安装

pip install time-series-forecast-mcp

使用

作为 MCP 服务启动

python -m time_series_forecast_mcp

或使用 fastmcp CLI:

fastmcp run server.py:mcp

工具列表

list_forecast_models

列出支持的时间序列预测模型及适用场景说明。

forecast_time_series

对历史时间序列进行预测。

参数:

  • model_type: AR / MA / ARIMA / GARCH / EXPONENTIAL_SMOOTHING
  • series: 历史观测值,按时间升序排列
  • horizon: 向前预测步数(默认 12)
  • p: AR 阶数或 ARIMA/GARCH 的 p(可选)
  • d: ARIMA 差分阶数(可选)
  • q: MA 阶数或 ARIMA/GARCH 的 q(可选)
  • seasonal_period: 季节周期,仅 EXPONENTIAL_SMOOTHING 使用(可选)
  • confidence_level: 置信水平,默认 0.95

返回:

  • forecast: 点预测
  • lower_bound / upper_bound: 置信区间
  • model_info: 模型参数与 AIC/BIC 等信息
  • diagnostics: 样本量等诊断信息

依赖

  • fastmcp >= 2.0.0
  • numpy >= 1.24.0
  • pandas >= 2.0.0
  • statsmodels >= 0.14.0
  • arch >= 7.0.0
  • scipy >= 1.10.0

许可证

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

time_series_forecast_mcp-0.1.0.tar.gz (9.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

time_series_forecast_mcp-0.1.0-py3-none-any.whl (10.1 kB view details)

Uploaded Python 3

File details

Details for the file time_series_forecast_mcp-0.1.0.tar.gz.

File metadata

File hashes

Hashes for time_series_forecast_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 57159eb0a21edcf2030726a879c18182fb77920d826c2f21bc60c5939e793324
MD5 c6dfa467b552cbee22389680174ccee5
BLAKE2b-256 b04b66924480d99f76bb970ef310cffaa4fc62ea7abffca5084361e9b59b01db

See more details on using hashes here.

File details

Details for the file time_series_forecast_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for time_series_forecast_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 59f651e8c0ee92daf7403bd080c0bd1a2f8f5e41df9fa2735588d9a47148e261
MD5 a12389b0901b43d98632ad80562ced18
BLAKE2b-256 f9de19a87ed8d2d0eae35fec149207bcf116eed11c60153ae3d474533db0d82f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page