Token导航 LogoToken导航TokenDH.com
研究检索权限需确认clawhub未标认证来源可访问clear审计通过

econ-detrending-correlation-timeseries-detrending经济去趋势相关性时间序列去趋势

Agent Skill

econ-detrending-correlation-timeseries-detrending 用于查找、检索和筛选相关信息,适合在 OpenClaw 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

2,326

周安装

95

GitHub Stars

公开资料未说明

下载量

752
OpenClaw

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT-0

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:econ-detrending-correlation-timeseries-detrending(经济去趋势相关性时间序列去趋势)
来源仓库:https://github.com/wu-uk/econ-detrending-correlation-timeseries-detrending
安装命令:
openclaw skills install econ-detrending-correlation-timeseries-detrending
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 OpenClaw 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

ClawHubOpenClaw
openclaw skills install econ-detrending-correlation-timeseries-detrending

简介

提供宏观经济时间序列去趋势处理工具,用于消除数据中的长期趋势以进行相关性分析。

  • 适用于经济数据分析、时间序列建模和结构分解等研究型任务。
  • 通过 OpenClaw 安装并使用 clawhub 方式部署,需参考原始 README 了解输入格式与算法选项。
  • 使用前请确认数据格式、依赖库版本及是否允许运行计算密集型操作。
  • econ-detrending-correlation-timeseries-detrending 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

name
timeseries-detrending
description
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.

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 $\ au_t$ that minimizes:

$$\sum_{t=1}^{T}(y_t - \ au_t)^2 + \lambda \sum_{t=2}^{T-1}[(\ au_{t+1} - \ au_t) - (\ au_t - \ au_{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 FrequencyRecommended λRationale
Annual100Standard for yearly data
Quarterly1600Hodrick-Prescott (1997) recommendation
Monthly14400Ravn-Uhlig (2002) adjustment

Common mistake: Using λ=1600 (quarterly default) for annual data produces an overly smooth trend that misses important cyclical dynamics.

Python Implementation

from statsmodels.tsa.filters.hp_filter import hpfilter
import numpy as np

# Apply HP filter
# Returns: (cyclical_component, trend_component)
cycle, trend = hpfilter(data, lamb=100)  # For annual data

# For quarterly data
cycle_q, trend_q = hpfilter(quarterly_data, lamb=1600)

Important: The function parameter is lamb (not lambda, which is a Python keyword).

Log Transformation for Growth Series

Why Use Logs?

For most macroeconomic aggregates (GDP, consumption, investment), you should apply the natural logarithm before filtering:

  1. Multiplicative to Additive: Converts percentage changes to log differences
  2. Stabilizes Variance: Growth rates become comparable across time
  3. Economic Interpretation: Cyclical component represents percentage deviations from trend
  4. Standard Practice: Required for business cycle statistics that compare volatilities
import numpy as np

# Apply log transformation BEFORE HP filtering
log_series = np.log(real_series)
cycle, trend = hpfilter(log_series, lamb=100)

# The cycle now represents percentage deviations from trend
# e.g., cycle = 0.02 means 2% above trend

When NOT to Use Logs

  • Series that can be negative (net exports, current account)
  • Series already expressed as rates or percentages
  • Series with zeros

Complete Workflow for Detrending

Step-by-Step Process

  1. Load and clean data: Handle missing values, ensure proper time ordering
  2. Convert to real terms: Deflate nominal values using appropriate price index
  3. Apply log transformation: For positive level variables
  4. Apply HP filter: Use appropriate λ for data frequency
  5. Analyze cyclical component: Compute correlations, volatilities, etc.

Example: Business Cycle Correlation

import pandas as pd
import numpy as np
from statsmodels.tsa.filters.hp_filter import hpfilter

# Load real (inflation-adjusted) data
real_consumption = pd.Series(...)  # Real consumption expenditure
real_investment = pd.Series(...)   # Real fixed investment

# Log transformation
ln_consumption = np.log(real_consumption)
ln_investment = np.log(real_investment)

# HP filter with λ=100 for annual data
cycle_c, trend_c = hpfilter(ln_consumption, lamb=100)
cycle_i, trend_i = hpfilter(ln_investment, lamb=100)

# Compute correlation of cyclical components
correlation = np.corrcoef(cycle_c, cycle_i)[0, 1]
print(f"Business cycle correlation: {correlation:.4f}")

Dependencies

Ensure these packages are installed:

pip install statsmodels pandas numpy

The HP filter is in statsmodels.tsa.filters.hp_filter.

适合场景

01

OpenClaw 用户查找和安装 Skill 时

02

用户想查找某类 Agent Skill 时

03

需要根据任务场景推荐可安装能力包时

04

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

OpenClaw

78.3%
按下载量换算589

安全审计

VirusTotal

通过

ClawScan

通过

Static analysis

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills