time-series-analysis
Skill0 starsChanged 4 months agoMITView on GitHub
當用戶需要對時間序列資料執行 STL 趨勢分解、ADF/KPSS 平穩性檢驗、ACF/PACF、ARIMA/ETS 建模與 h 步預測(含 80/95% 信賴區間)、STL 殘差異常點偵測、以及多變量 VAR 模型(Granger 因果 + 冲激響應 IRF),並要求交付 Word 格式 (.docx) 報告時觸發。用於銷售/流量預測、金融序列建模、系統監控異常偵測、多序列因果分析等場景。 EN: Use for time-series work — STL decomposition, ADF / KPSS stationarity, ACF / PACF, ARIMA / ETS forecasts with 80/95% intervals, anomaly detection on STL residuals, and multivariate VAR with Granger causality + IRF. Word report. Trigger phrases: "forecast this series", "ARIMA on my sales data", "detect anomalies in the time series", "VAR / Granger causality".
6 other projects use a version of this.
Adopted by
Most recently taken up by
- chaakresh/claude-skillstheir own version, first seen Sep 7, 2026
- wookat/ai-research-skillstheir own version, first seen Jul 15, 2026
- sp1e/claude-skillstheir own version, first seen Jun 9, 2026
- xjtulyc/awesome-rosetta-skillstheir own version, first seen Mar 17, 2026
- brainbytes-dev/everything-claude-tradingtheir own version, first seen Mar 14, 2026
- ffsshhttiikk/opencode-agents-skillstheir own version, first seen Feb 28, 2026
Other versions6 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 6
- xjtulyc/awesome-rosetta-skills★ 34same name
- brainbytes-dev/everything-claude-trading★ 19same name
- ffsshhttiikk/opencode-agents-skills★ 2same name
- wookat/ai-research-skills★ 2same name
- sp1e/claude-skills★ 1same name
- chaakresh/claude-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository9 other files it gives its agents.
- advanced-data-analyticsSkill
- data-preparationSkill
- factor-analysisSkill
- factorial-anovaSkill
- inference-decisionSkill
- literature-reviewSkill
- multivariate-analysisSkill
- regression-analyticsSkill
- survival-analysisSkill
The file
Files
Skill: time-series-analysis
時間序列分析(STL / ARIMA / ETS / Anomaly / VAR)與 Word 報告匯出。
Metadata
- Description: 對時間序列資料執行 STL 分解 + 平穩性檢驗、ARIMA/ETS 建模與預測、STL 殘差異常點偵測、多變量 VAR 模型與 Granger 因果檢驗;輸出趨勢/季節/殘差分解圖、ACF/PACF、預測圖 + CI、異常點標註圖、IRF 冲激響應圖。
- Version: 1.0.0
- Entrypoint:
orchestrator.py(CLI:--source {local,sql,hadoop}+--time <col>+--analysis {decompose,arima,anomaly,var}+ 對應模式參數) - Related:
- 假設檢驗:
advanced-data-analytics - 迴歸建模:
regression-analytics - 因素分析:
factor-analysis - 多因子 ANOVA:
factorial-anova - 多變量分析(PCA/Cluster/MANOVA):
multivariate-analysis - 生存分析:
survival-analysis
- 假設檢驗:
資料規格
時間序列資料每列代表一個時間點的觀測值:
| 欄位 | 型別 | 說明 |
--time | 日期/時間戳 | 觀測時間;需可被 pd.to_datetime 解析(例如 2024-01-15、2024-01-15 12:30:00) |
--value | 數值 | 單變量分析(decompose/arima/anomaly)的目標序列 |
--values | 多個數值欄位 | VAR 多變量分析需 ≥2 個序列 |
資料會被自動按 --time 升序排序;含 NA 的列會被 listwise 刪除。
Analysis Modes
1. decompose — STL 分解與平穩性檢驗
- 輸入:
--time+--value+--freq(可選) - 決策流程:
ts()構造時序物件(依--freq或自動推斷週期長度)- STL 分解:趨勢 (trend) + 季節 (seasonal) + 殘差 (remainder)
- 平穩性檢驗:
- ADF (Augmented Dickey-Fuller):
tseries::adf.test,p<0.05 → 拒絕單根 → 平穩 - KPSS:
tseries::kpss.test,p>0.05 → 未拒絕平穩 → 平穩
- ADF (Augmented Dickey-Fuller):
- ACF / PACF:
forecast::ggAcf/forecast::ggPacf
- 輸出:
- 分解表(trend / seasonal / remainder 前 20 筆)
- ADF / KPSS 統計量與 p 值 + 平穩性判定
- 分解圖
decompose.png - ACF/PACF 併圖
acf_pacf.png
2. arima — ARIMA / ETS 建模與預測
- 輸入:
--time+--value+--freq(可選)+--h(預測步數,預設 12)+--engine {arima,ets}(預設arima) - 決策流程:
arima引擎 →forecast::auto.arima(自動選 (p,d,q)(P,D,Q)m,允許 seasonal)ets引擎 →forecast::ets(自動選誤差 / 趨勢 / 季節結構)- 模型摘要:階數 / AIC / BIC / σ²
- 殘差診斷:
Box.test(Ljung-Box);p>0.05 → 殘差為白噪聲、模型已捕捉結構 - 預測:
forecast::forecast(fit, h=h),輸出點估計 + 80% / 95% 信賴區間
- 輸出:
- 模型階數與資訊準則表
- 係數表(含 SE、z、p)
- Ljung-Box 殘差檢驗表
- 預測表(h 步預測值 + 80/95 CI)
- 預測圖
forecast.png(歷史 + 預測 + 兩層陰影) - 殘差圖
residuals.png(殘差時序 + ACF)
3. anomaly — STL 殘差異常點偵測
- 輸入:
--time+--value+--freq(可選) - 決策流程:
- 對原序列做 STL 分解
forecast::tsoutliers找 IQR 型異常殘差- 對每個異常點回填 observed / expected / residual
- 輸出:
- 異常點總數與比例
- 異常點明細表(time / observed / expected / residual)
- 標註圖
anomaly.png(原序列 + 異常點紅色標記)
4. var — 多變量 VAR 與 Granger 因果
- 輸入:
--time+--values Y1 Y2 [Y3 ...]+--freq(可選)+--h(IRF 步數,預設 12) - 決策流程:
ts(cbind(...))構造多變量時序vars::VARselect(lag.max=10)由 AIC / BIC / HQ 決定最佳 lagvars::VAR(p=selected)拟合lmtest::grangertest兩兩檢驗 Y_i 是否 Granger-cause Y_jvars::irf(n.ahead=h)冲激響應
- 輸出:
- VARselect 表(AIC / BIC / HQ / FPE 建議的 lag)
- Granger 因果 p 值矩陣(含顯著標記)
- IRF 圖
var_irf.png(k×k 網格,每格一個 shock→response 曲線 + CI 陰影)
Output Location
預設輸出目錄:./outcome-temp/
fetched_data.csv:資料快照TimeSeries_Report.docx:Word 報告decompose.png/acf_pacf.png:decompose 模式forecast.png/residuals.png:arima 模式anomaly.png:anomaly 模式var_irf.png:var 模式
Workflow (SOP)
- fetch: schema 校驗(time 可轉時間戳、value/values 為數值、無零方差)+ 排序 + listwise 刪除 NA + 週期自動推斷
- execute: 依 analysis mode 分派到對應 R body
- render: 依 analysis mode 動態組裝章節
- 交付:
.docx落地在 output-dir
Constraints
--time需可pd.to_datetime;不能有大量重複時間戳- decompose/arima/anomaly:
--value為連續數值、非常數 - var:
--values至少 2 個、每個都連續數值 - 若時間戳非等距且未指定
--freq,直接報錯(避免 STL 崩潰或給出誤導性結果) --freq未指定時,依 median time diff 自動推斷:hourly=24 / daily=7 / weekly=52 / monthly=12 / quarterly=4 / yearly=1- Listwise deletion:
[time, value(s)]任一為 NA 的列丟棄
Dependencies
- Python 3.10+:
pandas numpy sqlalchemy python-docx openpyxl pyhive thrift thrift-sasl pure-sasl - R 4.x:
- 必要:
ggplot2 jsonlite forecast tseries urca - VAR 專用:
vars lmtest - 可選:
showtext sysfonts(CJK 字型)
- 必要:
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

