Agent skill · Data & Analytics

timeseries-detrending

Tools and techniques for detrending time series data in macroeconomic analysis. Use when working with economic time series that need to be decomposed into trend and cyclical components. Covers HP filter, log transformations for growth series, and correlation analysis of business cycles.

majiayu000github.com/majiayu000GitHub ↗
claude-codeMIT
Install
npx skills add majiayu000/claude-skill-registry --skill timeseries-detrending-benchflow-ai-skillsbench-2 --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 2
SKILL.md size: 5 KB
Bundled scripts: none
Path: skills/analysis/timeseries-detrending-benchflow-ai-skillsbench-2/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 534
Language: HTML

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# Time Series Detrending for Macroeconomic Analysis This skill provides guidance on decomposing economic time series into trend and cyclical components, a fundamental technique in business cycle analysis. ## Overview Economic time series like GDP, consumption, and investment contain both long-term trends and short-term fluctuations (business cycles). Separating these components is essential for: - Analyzing business cycle correlations - Comparing volatility across variables - Identifying leading/lagging indicators ## The Hodrick-Prescott (HP) Filter The HP filter is the most widely used method for detrending macroeconomic data. It decomposes a time series into a trend component and a cyclical component. ### Mathematical Foundation Given a time series $y_t$, the HP filter finds the trend $\tau_t$ that minimizes: $$\sum_{t=1}^{T}(y_t - \tau_t)^2 + \lambda \sum_{t=2}^{T-1}[(\tau_{t+1} - \tau_t) - (\tau_t - \tau_{t-1})]^2$$ Where: - First term: Minimizes deviation of data from trend - Second term: Penalizes changes in the trend's growth rate - $\lambda$: Smoothing parameter controlling the trade-off ### Choosing Lambda (λ) **Critical**: The choice of λ depends on data frequency: | Data

What's inside
Steps it walks through
  1. Overview
  2. The Hodrick-Prescott (HP) Filter
  3. Mathematical Foundation
  4. Choosing Lambda (λ)
  5. Python Implementation
  6. Log Transformation for Growth Series
  7. Why Use Logs?
  8. When NOT to Use Logs
  9. Complete Workflow for Detrending
  10. Step-by-Step Process
  11. Example: Business Cycle Correlation
  12. Dependencies
Ships with 1 file
  • metadata.json
Commands it runs
pip install statsmodels pandas numpy
More from claude-skill-registry
All skills →
About this skill
What does the timeseries-detrending skill do?

Tools and techniques for detrending time series data in macroeconomic analysis. Use when working with economic time series that need to be decomposed into trend and cyclical components. Covers HP filter, log transformations for growth series, and correlation analysis of business cycles.

How do I install it?

Run `npx skills add majiayu000/claude-skill-registry --skill timeseries-detrending-benchflow-ai-skillsbench-2 --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going