[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M737QEV638G85TM83NA8P7R6":3,"skill-same:01M737QEV638G85TM83NA8P7R6":47},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":15,"categories":16,"keywords":17,"publishedAt":18,"linkOnly":19,"markdownContent":20,"markdownBody":21,"frontMatter":22,"refName":23,"commitSha":24,"skillDirectory":25,"forksCount":26,"repositoryHtmlUrl":27,"repositoryHomepageUrl":28,"ownerHtmlUrl":29,"ownerBlogUrl":30,"ownerDescription":31,"updatedAt":32,"install":33,"resources":46},"01M737QEV638G85TM83NA8P7R6","skill-080",null,"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.","legendtkl\u002Fagentic-skill-router","legendtkl","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F2370761?v=4","01M71RR3WRQC40G964Q2GVDMND","01M737GJZQ9TF1VE3VM255EDAK",8,"MIT","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fexperiments\u002Fdci-compare\u002Fskillrouter-skills\u002Fskill-080\u002FSKILL.md",[],[],"2026-11-11 15:11:14",false,"---\nname: skill-080\ndescription: 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.\n---\n\n# Time Series Detrending for Macroeconomic Analysis\n\nThis skill provides guidance on decomposing economic time series into trend and cyclical components, a fundamental technique in business cycle analysis.\n\n## Overview\n\nEconomic time series like GDP, consumption, and investment contain both long-term trends and short-term fluctuations (business cycles). Separating these components is essential for:\n- Analyzing business cycle correlations\n- Comparing volatility across variables\n- Identifying leading\u002Flagging indicators\n\n## The Hodrick-Prescott (HP) Filter\n\nThe 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.\n\n### Mathematical Foundation\n\nGiven a time series $y_t$, the HP filter finds the trend $\\tau_t$ that minimizes:\n\n$$\\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$$\n\nWhere:\n- First term: Minimizes deviation of data from trend\n- Second term: Penalizes changes in the trend's growth rate\n- $\\lambda$: Smoothing parameter controlling the trade-off\n\n### Choosing Lambda (λ)\n\n**Critical**: The choice of λ depends on data frequency:\n\n| Data Frequency | Recommended λ | Rationale |\n|----------------|---------------|-----------|\n| Annual         | **100**       | Standard for yearly data |\n| Quarterly      | **1600**      | Hodrick-Prescott (1997) recommendation |\n| Monthly        | **14400**     | Ravn-Uhlig (2002) adjustment |\n\n**Common mistake**: Using λ=1600 (quarterly default) for annual data produces an overly smooth trend that misses important cyclical dynamics.\n\n### Python Implementation\n\n```python\nfrom statsmodels.tsa.filters.hp_filter import hpfilter\nimport numpy as np\n\n# Apply HP filter\n# Returns: (cyclical_component, trend_component)\ncycle, trend = hpfilter(data, lamb=100)  # For annual data\n\n# For quarterly data\ncycle_q, trend_q = hpfilter(quarterly_data, lamb=1600)\n```\n\n**Important**: The function parameter is `lamb` (not `lambda`, which is a Python keyword).\n\n## Log Transformation for Growth Series\n\n### Why Use Logs?\n\nFor most macroeconomic aggregates (GDP, consumption, investment), you should apply the natural logarithm **before** filtering:\n\n1. **Multiplicative to Additive**: Converts percentage changes to log differences\n2. **Stabilizes Variance**: Growth rates become comparable across time\n3. **Economic Interpretation**: Cyclical component represents percentage deviations from trend\n4. **Standard Practice**: Required for business cycle statistics that compare volatilities\n\n```python\nimport numpy as np\n\n# Apply log transformation BEFORE HP filtering\nlog_series = np.log(real_series)\ncycle, trend = hpfilter(log_series, lamb=100)\n\n# The cycle now represents percentage deviations from trend\n# e.g., cycle = 0.02 means 2% above trend\n```\n\n### When NOT to Use Logs\n\n- Series that can be negative (net exports, current account)\n- Series already expressed as rates or percentages\n- Series with zeros\n\n## Complete Workflow for Detrending\n\n### Step-by-Step Process\n\n1. **Load and clean data**: Handle missing values, ensure proper time ordering\n2. **Convert to real terms**: Deflate nominal values using appropriate price index\n3. **Apply log transformation**: For positive level variables\n4. **Apply HP filter**: Use appropriate λ for data frequency\n5. **Analyze cyclical component**: Compute correlations, volatilities, etc.\n\n### Example: Business Cycle Correlation\n\n```python\nimport pandas as pd\nimport numpy as np\nfrom statsmodels.tsa.filters.hp_filter import hpfilter\n\n# Load real (inflation-adjusted) data\nreal_consumption = pd.Series(...)  # Real consumption expenditure\nreal_investment = pd.Series(...)   # Real fixed investment\n\n# Log transformation\nln_consumption = np.log(real_consumption)\nln_investment = np.log(real_investment)\n\n# HP filter with λ=100 for annual data\ncycle_c, trend_c = hpfilter(ln_consumption, lamb=100)\ncycle_i, trend_i = hpfilter(ln_investment, lamb=100)\n\n# Compute correlation of cyclical components\ncorrelation = np.corrcoef(cycle_c, cycle_i)[0, 1]\nprint(f\"Business cycle correlation: {correlation:.4f}\")\n```\n\n## Dependencies\n\nEnsure these packages are installed:\n```bash\npip install statsmodels pandas numpy\n```\n\nThe HP filter is in `statsmodels.tsa.filters.hp_filter`.","# Time Series Detrending for Macroeconomic Analysis\n\nThis skill provides guidance on decomposing economic time series into trend and cyclical components, a fundamental technique in business cycle analysis.\n\n## Overview\n\nEconomic time series like GDP, consumption, and investment contain both long-term trends and short-term fluctuations (business cycles). Separating these components is essential for:\n- Analyzing business cycle correlations\n- Comparing volatility across variables\n- Identifying leading\u002Flagging indicators\n\n## The Hodrick-Prescott (HP) Filter\n\nThe 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.\n\n### Mathematical Foundation\n\nGiven a time series $y_t$, the HP filter finds the trend $\\tau_t$ that minimizes:\n\n$$\\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$$\n\nWhere:\n- First term: Minimizes deviation of data from trend\n- Second term: Penalizes changes in the trend's growth rate\n- $\\lambda$: Smoothing parameter controlling the trade-off\n\n### Choosing Lambda (λ)\n\n**Critical**: The choice of λ depends on data frequency:\n\n| Data Frequency | Recommended λ | Rationale |\n|----------------|---------------|-----------|\n| Annual         | **100**       | Standard for yearly data |\n| Quarterly      | **1600**      | Hodrick-Prescott (1997) recommendation |\n| Monthly        | **14400**     | Ravn-Uhlig (2002) adjustment |\n\n**Common mistake**: Using λ=1600 (quarterly default) for annual data produces an overly smooth trend that misses important cyclical dynamics.\n\n### Python Implementation\n\n```python\nfrom statsmodels.tsa.filters.hp_filter import hpfilter\nimport numpy as np\n\n# Apply HP filter\n# Returns: (cyclical_component, trend_component)\ncycle, trend = hpfilter(data, lamb=100)  # For annual data\n\n# For quarterly data\ncycle_q, trend_q = hpfilter(quarterly_data, lamb=1600)\n```\n\n**Important**: The function parameter is `lamb` (not `lambda`, which is a Python keyword).\n\n## Log Transformation for Growth Series\n\n### Why Use Logs?\n\nFor most macroeconomic aggregates (GDP, consumption, investment), you should apply the natural logarithm **before** filtering:\n\n1. **Multiplicative to Additive**: Converts percentage changes to log differences\n2. **Stabilizes Variance**: Growth rates become comparable across time\n3. **Economic Interpretation**: Cyclical component represents percentage deviations from trend\n4. **Standard Practice**: Required for business cycle statistics that compare volatilities\n\n```python\nimport numpy as np\n\n# Apply log transformation BEFORE HP filtering\nlog_series = np.log(real_series)\ncycle, trend = hpfilter(log_series, lamb=100)\n\n# The cycle now represents percentage deviations from trend\n# e.g., cycle = 0.02 means 2% above trend\n```\n\n### When NOT to Use Logs\n\n- Series that can be negative (net exports, current account)\n- Series already expressed as rates or percentages\n- Series with zeros\n\n## Complete Workflow for Detrending\n\n### Step-by-Step Process\n\n1. **Load and clean data**: Handle missing values, ensure proper time ordering\n2. **Convert to real terms**: Deflate nominal values using appropriate price index\n3. **Apply log transformation**: For positive level variables\n4. **Apply HP filter**: Use appropriate λ for data frequency\n5. **Analyze cyclical component**: Compute correlations, volatilities, etc.\n\n### Example: Business Cycle Correlation\n\n```python\nimport pandas as pd\nimport numpy as np\nfrom statsmodels.tsa.filters.hp_filter import hpfilter\n\n# Load real (inflation-adjusted) data\nreal_consumption = pd.Series(...)  # Real consumption expenditure\nreal_investment = pd.Series(...)   # Real fixed investment\n\n# Log transformation\nln_consumption = np.log(real_consumption)\nln_investment = np.log(real_investment)\n\n# HP filter with λ=100 for annual data\ncycle_c, trend_c = hpfilter(ln_consumption, lamb=100)\ncycle_i, trend_i = hpfilter(ln_investment, lamb=100)\n\n# Compute correlation of cyclical components\ncorrelation = np.corrcoef(cycle_c, cycle_i)[0, 1]\nprint(f\"Business cycle correlation: {correlation:.4f}\")\n```\n\n## Dependencies\n\nEnsure these packages are installed:\n```bash\npip install statsmodels pandas numpy\n```\n\nThe HP filter is in `statsmodels.tsa.filters.hp_filter`.",{"name":5,"description":7},"main","160b30f0b67c923077f886376fdfae1016a70702","experiments\u002Fdci-compare\u002Fskillrouter-skills\u002Fskill-080",2,"https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router","https:\u002F\u002Flegendtkl.github.io\u002Fagentic-skill-router\u002F","https:\u002F\u002Fgithub.com\u002Flegendtkl","http:\u002F\u002Fwww.legendtkl.com","No secret before debugging.\r\n","2026-06-04 14:02:56",{"source":8,"skillName":5,"commands":34,"prompt":44,"zipAvailable":45},[35,38,41],{"tool":36,"command":37},"npx","npx skills add legendtkl\u002Fagentic-skill-router --skill skill-080",{"tool":39,"command":40},"bunx","bunx skills add legendtkl\u002Fagentic-skill-router --skill skill-080",{"tool":42,"command":43},"pnpm","pnpm dlx skills add legendtkl\u002Fagentic-skill-router --skill skill-080","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fexperiments\u002Fdci-compare\u002Fskillrouter-skills\u002Fskill-080\u002FSKILL.md",true,[],[48,55,62,69,76,83],{"skillNo":49,"name":50,"nameZh":6,"description":51,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":52,"categories":53,"keywords":54,"publishedAt":18},"01M7384EP28XVSR2R0YGRS0GK9","foo","A test skill named foo","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Ffoo\u002FSKILL.md",[],[],{"skillNo":56,"name":57,"nameZh":6,"description":58,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":59,"categories":60,"keywords":61,"publishedAt":18},"01M7384DECF306RRRC16PZJTQ5","bar","飞书 — bar with quoted Chinese","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Ftests\u002Ffixtures\u002Fskills\u002Fbar\u002FSKILL.md",[],[],{"skillNo":63,"name":64,"nameZh":6,"description":65,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":66,"categories":67,"keywords":68,"publishedAt":18},"01M738491441AQ85E7GD7VVDTA","agentic-skill-router","First use any clearly matching enabled local\u002Fuser Agent Skill. If none matches, prefer this router for skill-shaped requests involving a named tool, API, service, CLI, platform, file format, dataset, or domain workflow, including when a generic built-in skill such as browser, Chrome, or web search also seems applicable; use built-ins directly only when explicitly requested or when the task is primarily live browsing, logged-in page operation, clicking, screenshotting, or current webpage inspection. Also use directly to audit, slim, disable, restore, or route locally installed Agent Skills across supported hosts. Examples include Vercel, Netlify, Cloudflare, Render, Playwright, Sentry, Linear, GitHub, OpenAI APIs, PDF, DOCX, PPTX, and spreadsheets.","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fskills\u002Fagentic-skill-router\u002FSKILL.md",[],[],{"skillNo":70,"name":71,"nameZh":6,"description":72,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":73,"categories":74,"keywords":75,"publishedAt":18},"01M738475HF7SXTP4HCPZJVZ8E","syn-video-trim","Skill for trimming and cutting clips in the context of video files. Use when the user's task is specifically about trimming and cutting clips.","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fexperiments\u002Fdci-compare\u002Fsynthetic-skills\u002Fsyn-video-trim\u002FSKILL.md",[],[],{"skillNo":77,"name":78,"nameZh":6,"description":79,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":80,"categories":81,"keywords":82,"publishedAt":18},"01M73845F4RD2AA6YHS1E3VQRB","syn-video-transcode","Skill for transcoding codecs and resolutions in the context of video files. Use when the user's task is specifically about transcoding codecs and resolutions.","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fexperiments\u002Fdci-compare\u002Fsynthetic-skills\u002Fsyn-video-transcode\u002FSKILL.md",[],[],{"skillNo":84,"name":85,"nameZh":6,"description":86,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":9,"repositoryNo":12,"starsCount":13,"licenseSpdxId":14,"licenseFileUrl":6,"sourceHtmlUrl":87,"categories":88,"keywords":89,"publishedAt":18},"01M73842YN17QSJETPZX6Z9DAG","syn-video-thumbnail","Skill for extracting thumbnails and frames in the context of video files. Use when the user's task is specifically about extracting thumbnails and frames.","https:\u002F\u002Fgithub.com\u002Flegendtkl\u002Fagentic-skill-router\u002Fblob\u002Fmain\u002Fexperiments\u002Fdci-compare\u002Fsynthetic-skills\u002Fsyn-video-thumbnail\u002FSKILL.md",[],[]]