time_series_forecast
Forecast future values from historical time-series data using automated ARIMA/SARIMA modeling, returning predictions, 95% confidence intervals, and an historical/forecast plot.
Instructions
time_series_forecast —— 时序组 · 时间序列预测(工具 17,简化实现)。
docstring = agent 使用说明书,与 statlab_mcp/docs/design/06_timeseries.md 同步维护。
参数: file_path (str): 本地数据文件(csv/tsv/xlsx/json) date_col / value_col (str): 日期列与数值列 horizon (int): 预测步数,1 <= horizon <= 样本量*50%(超限中文报错)
口径: auto_arima(pmdarima,stepwise=True, random_state=42, max_order=8)自动定阶; 季节可估判定(FFT 主频 period 且 n>=2*period)-> SARIMA 否则 ARIMA 并注明; 五项统一前置由 _common._prepare_series 完成(插值/聚合/时区等均入 metadata); 输出预测值 + 95% CI(predict(return_conf_int=True))+ 历史/预测图(image 顶层); 常数列退化为均值预测并注明。
示例: time_series_forecast("samples/timeseries.csv", date_col="date", value_col="value", horizon=14) inline 数据: 本工具支持可选 inline_data 参数(v1.2.0 起):与 file_path 二选一, 支持 records 数组或 {"header": [...], "rows": [[...], ...]} 对象两种形态; 规模上限/类型域/data_source 来源标注见 statlab_mcp/docs/SPEC.md 第 12 节。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| horizon | No | ||
| date_col | No | ||
| file_path | No | ||
| value_col | No | ||
| inline_data | No |