@wentorai/research-plugins 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +204 -0
- package/curated/analysis/README.md +64 -0
- package/curated/domains/README.md +104 -0
- package/curated/literature/README.md +53 -0
- package/curated/research/README.md +62 -0
- package/curated/tools/README.md +87 -0
- package/curated/writing/README.md +61 -0
- package/index.ts +39 -0
- package/mcp-configs/academic-db/ChatSpatial.json +17 -0
- package/mcp-configs/academic-db/academia-mcp.json +17 -0
- package/mcp-configs/academic-db/academic-paper-explorer.json +17 -0
- package/mcp-configs/academic-db/academic-search-mcp-server.json +17 -0
- package/mcp-configs/academic-db/agentinterviews-mcp.json +17 -0
- package/mcp-configs/academic-db/all-in-mcp.json +17 -0
- package/mcp-configs/academic-db/apple-health-mcp.json +17 -0
- package/mcp-configs/academic-db/arxiv-latex-mcp.json +17 -0
- package/mcp-configs/academic-db/arxiv-mcp-server.json +17 -0
- package/mcp-configs/academic-db/bgpt-mcp.json +17 -0
- package/mcp-configs/academic-db/biomcp.json +17 -0
- package/mcp-configs/academic-db/biothings-mcp.json +17 -0
- package/mcp-configs/academic-db/catalysishub-mcp-server.json +17 -0
- package/mcp-configs/academic-db/clinicaltrialsgov-mcp-server.json +17 -0
- package/mcp-configs/academic-db/deep-research-mcp.json +17 -0
- package/mcp-configs/academic-db/dicom-mcp.json +17 -0
- package/mcp-configs/academic-db/enrichr-mcp-server.json +17 -0
- package/mcp-configs/academic-db/fec-mcp-server.json +17 -0
- package/mcp-configs/academic-db/fhir-mcp-server-themomentum.json +17 -0
- package/mcp-configs/academic-db/fhir-mcp.json +19 -0
- package/mcp-configs/academic-db/gget-mcp.json +17 -0
- package/mcp-configs/academic-db/google-researcher-mcp.json +17 -0
- package/mcp-configs/academic-db/idea-reality-mcp.json +17 -0
- package/mcp-configs/academic-db/legiscan-mcp.json +19 -0
- package/mcp-configs/academic-db/lex.json +17 -0
- package/mcp-configs/ai-platform/Adaptive-Graph-of-Thoughts-MCP-server.json +17 -0
- package/mcp-configs/ai-platform/ai-counsel.json +17 -0
- package/mcp-configs/ai-platform/atlas-mcp-server.json +17 -0
- package/mcp-configs/ai-platform/counsel-mcp.json +17 -0
- package/mcp-configs/ai-platform/cross-llm-mcp.json +17 -0
- package/mcp-configs/ai-platform/gptr-mcp.json +17 -0
- package/mcp-configs/browser/decipher-research-agent.json +17 -0
- package/mcp-configs/browser/deep-research.json +17 -0
- package/mcp-configs/browser/everything-claude-code.json +17 -0
- package/mcp-configs/browser/gpt-researcher.json +17 -0
- package/mcp-configs/browser/heurist-agent-framework.json +17 -0
- package/mcp-configs/data-platform/4everland-hosting-mcp.json +17 -0
- package/mcp-configs/data-platform/context-keeper.json +17 -0
- package/mcp-configs/data-platform/context7.json +19 -0
- package/mcp-configs/data-platform/contextstream-mcp.json +17 -0
- package/mcp-configs/data-platform/email-mcp.json +17 -0
- package/mcp-configs/note-knowledge/ApeRAG.json +17 -0
- package/mcp-configs/note-knowledge/In-Memoria.json +17 -0
- package/mcp-configs/note-knowledge/agent-memory.json +17 -0
- package/mcp-configs/note-knowledge/aimemo.json +17 -0
- package/mcp-configs/note-knowledge/biel-mcp.json +19 -0
- package/mcp-configs/note-knowledge/cognee.json +17 -0
- package/mcp-configs/note-knowledge/context-awesome.json +17 -0
- package/mcp-configs/note-knowledge/context-mcp.json +17 -0
- package/mcp-configs/note-knowledge/conversation-handoff-mcp.json +17 -0
- package/mcp-configs/note-knowledge/cortex.json +17 -0
- package/mcp-configs/note-knowledge/devrag.json +17 -0
- package/mcp-configs/note-knowledge/easy-obsidian-mcp.json +17 -0
- package/mcp-configs/note-knowledge/engram.json +17 -0
- package/mcp-configs/note-knowledge/gnosis-mcp.json +17 -0
- package/mcp-configs/note-knowledge/graphlit-mcp-server.json +19 -0
- package/mcp-configs/reference-mgr/arxiv-cli.json +17 -0
- package/mcp-configs/reference-mgr/arxiv-search-mcp.json +17 -0
- package/mcp-configs/reference-mgr/chiken.json +17 -0
- package/mcp-configs/reference-mgr/claude-scholar.json +17 -0
- package/mcp-configs/reference-mgr/devonthink-mcp.json +17 -0
- package/mcp-configs/registry.json +447 -0
- package/openclaw.plugin.json +21 -0
- package/package.json +61 -0
- package/skills/analysis/dataviz/color-accessibility-guide/SKILL.md +230 -0
- package/skills/analysis/dataviz/geospatial-viz-guide/SKILL.md +218 -0
- package/skills/analysis/dataviz/interactive-viz-guide/SKILL.md +287 -0
- package/skills/analysis/dataviz/network-visualization-guide/SKILL.md +195 -0
- package/skills/analysis/dataviz/publication-figures-guide/SKILL.md +238 -0
- package/skills/analysis/dataviz/python-dataviz-guide/SKILL.md +195 -0
- package/skills/analysis/econometrics/causal-inference-guide/SKILL.md +197 -0
- package/skills/analysis/econometrics/iv-regression-guide/SKILL.md +198 -0
- package/skills/analysis/econometrics/panel-data-guide/SKILL.md +274 -0
- package/skills/analysis/econometrics/robustness-checks/SKILL.md +250 -0
- package/skills/analysis/econometrics/stata-regression/SKILL.md +117 -0
- package/skills/analysis/econometrics/time-series-guide/SKILL.md +235 -0
- package/skills/analysis/statistics/bayesian-statistics-guide/SKILL.md +221 -0
- package/skills/analysis/statistics/hypothesis-testing-guide/SKILL.md +210 -0
- package/skills/analysis/statistics/meta-analysis-guide/SKILL.md +206 -0
- package/skills/analysis/statistics/nonparametric-tests-guide/SKILL.md +221 -0
- package/skills/analysis/statistics/power-analysis-guide/SKILL.md +240 -0
- package/skills/analysis/statistics/sem-guide/SKILL.md +231 -0
- package/skills/analysis/statistics/survival-analysis-guide/SKILL.md +195 -0
- package/skills/analysis/wrangling/missing-data-handling/SKILL.md +224 -0
- package/skills/analysis/wrangling/pandas-data-wrangling/SKILL.md +242 -0
- package/skills/analysis/wrangling/questionnaire-design-guide/SKILL.md +234 -0
- package/skills/analysis/wrangling/text-mining-guide/SKILL.md +225 -0
- package/skills/domains/ai-ml/computer-vision-guide/SKILL.md +213 -0
- package/skills/domains/ai-ml/deep-learning-papers-guide/SKILL.md +200 -0
- package/skills/domains/ai-ml/llm-evaluation-guide/SKILL.md +194 -0
- package/skills/domains/ai-ml/prompt-engineering-research/SKILL.md +233 -0
- package/skills/domains/ai-ml/reinforcement-learning-guide/SKILL.md +254 -0
- package/skills/domains/ai-ml/transformer-architecture-guide/SKILL.md +233 -0
- package/skills/domains/biomedical/clinical-research-guide/SKILL.md +232 -0
- package/skills/domains/biomedical/clinicaltrials-api/SKILL.md +177 -0
- package/skills/domains/biomedical/epidemiology-guide/SKILL.md +200 -0
- package/skills/domains/biomedical/genomics-analysis-guide/SKILL.md +270 -0
- package/skills/domains/business/market-analysis-guide/SKILL.md +112 -0
- package/skills/domains/business/strategic-management-guide/SKILL.md +154 -0
- package/skills/domains/chemistry/computational-chemistry-guide/SKILL.md +266 -0
- package/skills/domains/chemistry/retrosynthesis-guide/SKILL.md +215 -0
- package/skills/domains/cs/algorithms-complexity-guide/SKILL.md +194 -0
- package/skills/domains/cs/dblp-api/SKILL.md +129 -0
- package/skills/domains/cs/software-engineering-research/SKILL.md +218 -0
- package/skills/domains/ecology/biodiversity-data-guide/SKILL.md +296 -0
- package/skills/domains/ecology/conservation-biology-guide/SKILL.md +198 -0
- package/skills/domains/ecology/gbif-api/SKILL.md +158 -0
- package/skills/domains/ecology/inaturalist-api/SKILL.md +173 -0
- package/skills/domains/economics/behavioral-economics-guide/SKILL.md +239 -0
- package/skills/domains/economics/development-economics-guide/SKILL.md +181 -0
- package/skills/domains/economics/fred-api/SKILL.md +189 -0
- package/skills/domains/education/curriculum-design-guide/SKILL.md +144 -0
- package/skills/domains/education/learning-science-guide/SKILL.md +150 -0
- package/skills/domains/finance/financial-data-analysis/SKILL.md +152 -0
- package/skills/domains/finance/quantitative-finance-guide/SKILL.md +151 -0
- package/skills/domains/geoscience/climate-science-guide/SKILL.md +158 -0
- package/skills/domains/geoscience/gis-remote-sensing-guide/SKILL.md +129 -0
- package/skills/domains/humanities/digital-humanities-guide/SKILL.md +181 -0
- package/skills/domains/humanities/philosophy-research-guide/SKILL.md +148 -0
- package/skills/domains/law/courtlistener-api/SKILL.md +213 -0
- package/skills/domains/law/legal-research-guide/SKILL.md +250 -0
- package/skills/domains/math/linear-algebra-applications/SKILL.md +227 -0
- package/skills/domains/math/numerical-methods-guide/SKILL.md +236 -0
- package/skills/domains/math/oeis-api/SKILL.md +158 -0
- package/skills/domains/pharma/clinical-pharmacology-guide/SKILL.md +165 -0
- package/skills/domains/pharma/drug-development-guide/SKILL.md +177 -0
- package/skills/domains/physics/computational-physics-guide/SKILL.md +300 -0
- package/skills/domains/physics/nasa-ads-api/SKILL.md +150 -0
- package/skills/domains/physics/quantum-computing-guide/SKILL.md +234 -0
- package/skills/domains/social-science/social-research-methods/SKILL.md +194 -0
- package/skills/domains/social-science/survey-research-guide/SKILL.md +182 -0
- package/skills/literature/discovery/citation-alert-guide/SKILL.md +154 -0
- package/skills/literature/discovery/conference-proceedings-guide/SKILL.md +142 -0
- package/skills/literature/discovery/literature-mapping-guide/SKILL.md +175 -0
- package/skills/literature/discovery/paper-tracking-guide/SKILL.md +211 -0
- package/skills/literature/discovery/rss-paper-feeds/SKILL.md +214 -0
- package/skills/literature/discovery/semantic-scholar-recs-guide/SKILL.md +164 -0
- package/skills/literature/fulltext/doaj-api/SKILL.md +120 -0
- package/skills/literature/fulltext/interlibrary-loan-guide/SKILL.md +163 -0
- package/skills/literature/fulltext/open-access-guide/SKILL.md +183 -0
- package/skills/literature/fulltext/pmc-oai-api/SKILL.md +184 -0
- package/skills/literature/fulltext/preprint-servers-guide/SKILL.md +128 -0
- package/skills/literature/fulltext/repository-harvesting-guide/SKILL.md +207 -0
- package/skills/literature/fulltext/unpaywall-api/SKILL.md +113 -0
- package/skills/literature/metadata/altmetrics-guide/SKILL.md +132 -0
- package/skills/literature/metadata/citation-network-guide/SKILL.md +236 -0
- package/skills/literature/metadata/crossref-api/SKILL.md +133 -0
- package/skills/literature/metadata/datacite-api/SKILL.md +126 -0
- package/skills/literature/metadata/doi-resolution-guide/SKILL.md +168 -0
- package/skills/literature/metadata/h-index-guide/SKILL.md +183 -0
- package/skills/literature/metadata/journal-metrics-guide/SKILL.md +188 -0
- package/skills/literature/metadata/opencitations-api/SKILL.md +128 -0
- package/skills/literature/metadata/orcid-api/SKILL.md +136 -0
- package/skills/literature/metadata/orcid-integration-guide/SKILL.md +178 -0
- package/skills/literature/search/arxiv-api/SKILL.md +95 -0
- package/skills/literature/search/biorxiv-api/SKILL.md +123 -0
- package/skills/literature/search/boolean-search-guide/SKILL.md +199 -0
- package/skills/literature/search/citation-chaining-guide/SKILL.md +148 -0
- package/skills/literature/search/database-comparison-guide/SKILL.md +100 -0
- package/skills/literature/search/europe-pmc-api/SKILL.md +120 -0
- package/skills/literature/search/google-scholar-guide/SKILL.md +182 -0
- package/skills/literature/search/mesh-terms-guide/SKILL.md +164 -0
- package/skills/literature/search/openalex-api/SKILL.md +134 -0
- package/skills/literature/search/pubmed-api/SKILL.md +130 -0
- package/skills/literature/search/scientify-literature-survey/SKILL.md +203 -0
- package/skills/literature/search/semantic-scholar-api/SKILL.md +134 -0
- package/skills/literature/search/systematic-search-strategy/SKILL.md +214 -0
- package/skills/research/automation/ai-scientist-guide/SKILL.md +228 -0
- package/skills/research/automation/data-collection-automation/SKILL.md +248 -0
- package/skills/research/automation/research-workflow-automation/SKILL.md +266 -0
- package/skills/research/deep-research/meta-synthesis-guide/SKILL.md +174 -0
- package/skills/research/deep-research/research-cog/SKILL.md +153 -0
- package/skills/research/deep-research/scoping-review-guide/SKILL.md +217 -0
- package/skills/research/deep-research/systematic-review-guide/SKILL.md +250 -0
- package/skills/research/funding/figshare-api/SKILL.md +163 -0
- package/skills/research/funding/grant-writing-guide/SKILL.md +233 -0
- package/skills/research/funding/nsf-grant-guide/SKILL.md +206 -0
- package/skills/research/funding/open-science-guide/SKILL.md +255 -0
- package/skills/research/funding/zenodo-api/SKILL.md +174 -0
- package/skills/research/methodology/action-research-guide/SKILL.md +201 -0
- package/skills/research/methodology/experimental-design-guide/SKILL.md +236 -0
- package/skills/research/methodology/grad-school-guide/SKILL.md +182 -0
- package/skills/research/methodology/grounded-theory-guide/SKILL.md +171 -0
- package/skills/research/methodology/mixed-methods-guide/SKILL.md +208 -0
- package/skills/research/methodology/qualitative-research-guide/SKILL.md +234 -0
- package/skills/research/methodology/scientify-idea-generation/SKILL.md +222 -0
- package/skills/research/paper-review/paper-reading-assistant/SKILL.md +266 -0
- package/skills/research/paper-review/peer-review-guide/SKILL.md +227 -0
- package/skills/research/paper-review/rebuttal-writing-guide/SKILL.md +185 -0
- package/skills/research/paper-review/scientify-write-review-paper/SKILL.md +209 -0
- package/skills/tools/code-exec/jupyter-notebook-guide/SKILL.md +178 -0
- package/skills/tools/code-exec/python-reproducibility-guide/SKILL.md +341 -0
- package/skills/tools/code-exec/r-reproducibility-guide/SKILL.md +236 -0
- package/skills/tools/code-exec/sandbox-execution-guide/SKILL.md +221 -0
- package/skills/tools/diagram/mermaid-diagram-guide/SKILL.md +269 -0
- package/skills/tools/diagram/plantuml-guide/SKILL.md +397 -0
- package/skills/tools/diagram/scientific-illustration-guide/SKILL.md +225 -0
- package/skills/tools/document/anystyle-api/SKILL.md +199 -0
- package/skills/tools/document/grobid-pdf-parsing/SKILL.md +294 -0
- package/skills/tools/document/markdown-academic-guide/SKILL.md +217 -0
- package/skills/tools/document/pdf-extraction-guide/SKILL.md +321 -0
- package/skills/tools/knowledge-graph/knowledge-graph-construction/SKILL.md +306 -0
- package/skills/tools/knowledge-graph/ontology-design-guide/SKILL.md +214 -0
- package/skills/tools/knowledge-graph/rag-methodology-guide/SKILL.md +325 -0
- package/skills/tools/ocr-translate/formula-recognition-guide/SKILL.md +367 -0
- package/skills/tools/ocr-translate/handwriting-recognition-guide/SKILL.md +211 -0
- package/skills/tools/ocr-translate/latex-ocr-guide/SKILL.md +204 -0
- package/skills/tools/ocr-translate/multilingual-research-guide/SKILL.md +234 -0
- package/skills/tools/scraping/academic-web-scraping/SKILL.md +326 -0
- package/skills/tools/scraping/api-data-collection-guide/SKILL.md +301 -0
- package/skills/tools/scraping/web-scraping-ethics-guide/SKILL.md +250 -0
- package/skills/writing/citation/bibtex-management-guide/SKILL.md +246 -0
- package/skills/writing/citation/citation-style-guide/SKILL.md +248 -0
- package/skills/writing/citation/reference-manager-comparison/SKILL.md +208 -0
- package/skills/writing/citation/zotero-api/SKILL.md +188 -0
- package/skills/writing/composition/abstract-writing-guide/SKILL.md +188 -0
- package/skills/writing/composition/discussion-writing-guide/SKILL.md +194 -0
- package/skills/writing/composition/introduction-writing-guide/SKILL.md +194 -0
- package/skills/writing/composition/literature-review-writing/SKILL.md +196 -0
- package/skills/writing/composition/methods-section-guide/SKILL.md +185 -0
- package/skills/writing/composition/response-to-reviewers/SKILL.md +215 -0
- package/skills/writing/composition/scientific-writing-guide/SKILL.md +152 -0
- package/skills/writing/latex/bibliography-management-guide/SKILL.md +206 -0
- package/skills/writing/latex/latex-drawing-guide/SKILL.md +234 -0
- package/skills/writing/latex/latex-ecosystem-guide/SKILL.md +240 -0
- package/skills/writing/latex/math-typesetting-guide/SKILL.md +231 -0
- package/skills/writing/latex/overleaf-collaboration-guide/SKILL.md +211 -0
- package/skills/writing/latex/tikz-diagrams-guide/SKILL.md +211 -0
- package/skills/writing/polish/academic-translation-guide/SKILL.md +175 -0
- package/skills/writing/polish/academic-writing-refiner/SKILL.md +143 -0
- package/skills/writing/polish/ai-writing-humanizer/SKILL.md +178 -0
- package/skills/writing/polish/grammar-checker-guide/SKILL.md +184 -0
- package/skills/writing/polish/plagiarism-detection-guide/SKILL.md +167 -0
- package/skills/writing/templates/beamer-presentation-guide/SKILL.md +263 -0
- package/skills/writing/templates/conference-paper-template/SKILL.md +219 -0
- package/skills/writing/templates/thesis-template-guide/SKILL.md +200 -0
- package/skills/writing/templates/thesis-writing-guide/SKILL.md +220 -0
- package/src/tools/arxiv.ts +131 -0
- package/src/tools/crossref.ts +112 -0
- package/src/tools/openalex.ts +174 -0
- package/src/tools/pubmed.ts +166 -0
- package/src/tools/semantic-scholar.ts +108 -0
- package/src/tools/unpaywall.ts +58 -0
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: fred-api
|
|
3
|
+
description: "Federal Reserve Economic Data API for US economic indicators"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "🔍"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "economics"
|
|
9
|
+
keywords: ["microeconomics", "macroeconomics", "econometrics", "development economics"]
|
|
10
|
+
source: "https://fred.stlouisfed.org/docs/api/fred/"
|
|
11
|
+
requires:
|
|
12
|
+
env: ["FRED_API_KEY"]
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
# FRED API Guide
|
|
16
|
+
|
|
17
|
+
## Overview
|
|
18
|
+
|
|
19
|
+
FRED (Federal Reserve Economic Data) is a database maintained by the Research Division of the Federal Reserve Bank of St. Louis. It contains over 800,000 economic time series from dozens of national and international sources, covering macroeconomic indicators, financial markets, employment, trade, monetary policy, and more.
|
|
20
|
+
|
|
21
|
+
The FRED API provides programmatic access to this extensive economic data repository. Researchers can retrieve time series observations, search for data series by keyword or category, explore release schedules, and access vintage (real-time) data for historical analysis. The data spans decades and in some cases centuries, making it invaluable for longitudinal economic research.
|
|
22
|
+
|
|
23
|
+
Economists, financial analysts, policy researchers, data scientists, and academic institutions rely on the FRED API for econometric modeling, macroeconomic forecasting, policy analysis, and teaching. It is one of the most widely used economic data APIs in academic research and is cited in thousands of peer-reviewed publications.
|
|
24
|
+
|
|
25
|
+
## Authentication
|
|
26
|
+
|
|
27
|
+
Authentication requires a free API key from the Federal Reserve Bank of St. Louis.
|
|
28
|
+
|
|
29
|
+
1. Register for an account at https://fredaccount.stlouisfed.org/login/secure/
|
|
30
|
+
2. Request an API key at https://fredaccount.stlouisfed.org/apikeys
|
|
31
|
+
3. Include the key as the `api_key` query parameter in all requests
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
curl "https://api.stlouisfed.org/fred/series?series_id=GDP&api_key=YOUR_KEY&file_type=json"
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
API keys are free and available to anyone who registers. There is no fee or approval process.
|
|
38
|
+
|
|
39
|
+
## Core Endpoints
|
|
40
|
+
|
|
41
|
+
### series: Retrieve Series Metadata
|
|
42
|
+
|
|
43
|
+
Get metadata about a specific economic data series, including title, frequency, units, seasonal adjustment, and date range.
|
|
44
|
+
|
|
45
|
+
- **URL**: `GET https://api.stlouisfed.org/fred/series`
|
|
46
|
+
- **Parameters**:
|
|
47
|
+
|
|
48
|
+
| Parameter | Type | Required | Description |
|
|
49
|
+
|------------|--------|----------|--------------------------------------------|
|
|
50
|
+
| series_id | string | Yes | FRED series identifier (e.g., `GDP`) |
|
|
51
|
+
| api_key | string | Yes | Your FRED API key |
|
|
52
|
+
| file_type | string | No | Response format: `json` or `xml` (default) |
|
|
53
|
+
|
|
54
|
+
- **Example**:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
curl "https://api.stlouisfed.org/fred/series?series_id=UNRATE&api_key=YOUR_KEY&file_type=json"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
- **Response**: Returns `seriess` array with `id`, `title`, `observation_start`, `observation_end`, `frequency`, `units`, `seasonal_adjustment`, `notes`, and `popularity` ranking.
|
|
61
|
+
|
|
62
|
+
### observations: Retrieve Time Series Data
|
|
63
|
+
|
|
64
|
+
Fetch actual data points (observations) for a specific economic series over a date range.
|
|
65
|
+
|
|
66
|
+
- **URL**: `GET https://api.stlouisfed.org/fred/series/observations`
|
|
67
|
+
- **Parameters**:
|
|
68
|
+
|
|
69
|
+
| Parameter | Type | Required | Description |
|
|
70
|
+
|--------------------|--------|----------|----------------------------------------------------|
|
|
71
|
+
| series_id | string | Yes | FRED series identifier |
|
|
72
|
+
| api_key | string | Yes | Your FRED API key |
|
|
73
|
+
| observation_start | string | No | Start date in YYYY-MM-DD format |
|
|
74
|
+
| observation_end | string | No | End date in YYYY-MM-DD format |
|
|
75
|
+
| frequency | string | No | Aggregation: `d`, `w`, `m`, `q`, `a` |
|
|
76
|
+
| aggregation_method | string | No | `avg`, `sum`, `eop` (end of period) |
|
|
77
|
+
| file_type | string | No | `json` or `xml` |
|
|
78
|
+
|
|
79
|
+
- **Example**:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
curl "https://api.stlouisfed.org/fred/series/observations?series_id=GDP&observation_start=2020-01-01&api_key=YOUR_KEY&file_type=json"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
- **Response**: Returns `observations` array with `date` and `value` for each observation period.
|
|
86
|
+
|
|
87
|
+
### category: Browse Data Categories
|
|
88
|
+
|
|
89
|
+
Navigate the hierarchical FRED category system to discover available data series organized by topic.
|
|
90
|
+
|
|
91
|
+
- **URL**: `GET https://api.stlouisfed.org/fred/category`
|
|
92
|
+
- **Parameters**:
|
|
93
|
+
|
|
94
|
+
| Parameter | Type | Required | Description |
|
|
95
|
+
|-------------|--------|----------|-----------------------------------------------|
|
|
96
|
+
| category_id | int | Yes | Category ID (0 for root) |
|
|
97
|
+
| api_key | string | Yes | Your FRED API key |
|
|
98
|
+
| file_type | string | No | `json` or `xml` |
|
|
99
|
+
|
|
100
|
+
- **Example**:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
curl "https://api.stlouisfed.org/fred/category/children?category_id=0&api_key=YOUR_KEY&file_type=json"
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
- **Response**: Returns `categories` array with `id`, `name`, and `parent_id` for child categories.
|
|
107
|
+
|
|
108
|
+
### releases: Track Data Release Schedules
|
|
109
|
+
|
|
110
|
+
Retrieve information about data releases, which group related series that are published together.
|
|
111
|
+
|
|
112
|
+
- **URL**: `GET https://api.stlouisfed.org/fred/releases`
|
|
113
|
+
- **Parameters**:
|
|
114
|
+
|
|
115
|
+
| Parameter | Type | Required | Description |
|
|
116
|
+
|------------|--------|----------|---------------------------------------|
|
|
117
|
+
| api_key | string | Yes | Your FRED API key |
|
|
118
|
+
| file_type | string | No | `json` or `xml` |
|
|
119
|
+
|
|
120
|
+
- **Example**:
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
curl "https://api.stlouisfed.org/fred/releases?api_key=YOUR_KEY&file_type=json"
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
- **Response**: Returns `releases` array with `id`, `name`, `press_release`, `link`, and release notes.
|
|
127
|
+
|
|
128
|
+
## Rate Limits
|
|
129
|
+
|
|
130
|
+
The FRED API enforces rate limits that vary by usage. Standard limits allow approximately 120 requests per minute. Exceeding the limit returns HTTP 429 responses. For bulk data retrieval, consider using the FRED Excel add-in or downloading bulk files from https://fred.stlouisfed.org/. Academic users can contact FRED for elevated limits if needed.
|
|
131
|
+
|
|
132
|
+
## Common Patterns
|
|
133
|
+
|
|
134
|
+
### Retrieve and Plot GDP Data
|
|
135
|
+
|
|
136
|
+
Fetch quarterly GDP observations for macroeconomic analysis:
|
|
137
|
+
|
|
138
|
+
```python
|
|
139
|
+
import requests
|
|
140
|
+
|
|
141
|
+
params = {
|
|
142
|
+
"series_id": "GDP",
|
|
143
|
+
"api_key": "YOUR_KEY",
|
|
144
|
+
"file_type": "json",
|
|
145
|
+
"observation_start": "2015-01-01"
|
|
146
|
+
}
|
|
147
|
+
resp = requests.get("https://api.stlouisfed.org/fred/series/observations", params=params)
|
|
148
|
+
data = resp.json()
|
|
149
|
+
|
|
150
|
+
for obs in data["observations"]:
|
|
151
|
+
print(f"{obs['date']}: ${obs['value']}B")
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
### Compare Multiple Economic Indicators
|
|
155
|
+
|
|
156
|
+
Build a multi-series dataset for econometric analysis:
|
|
157
|
+
|
|
158
|
+
```python
|
|
159
|
+
import requests
|
|
160
|
+
|
|
161
|
+
series_ids = ["UNRATE", "CPIAUCSL", "FEDFUNDS", "GDP"]
|
|
162
|
+
api_key = os.environ["FRED_API_KEY"]
|
|
163
|
+
|
|
164
|
+
for sid in series_ids:
|
|
165
|
+
resp = requests.get("https://api.stlouisfed.org/fred/series/observations", params={
|
|
166
|
+
"series_id": sid,
|
|
167
|
+
"api_key": api_key,
|
|
168
|
+
"file_type": "json",
|
|
169
|
+
"observation_start": "2020-01-01",
|
|
170
|
+
"frequency": "m"
|
|
171
|
+
})
|
|
172
|
+
obs = resp.json()["observations"]
|
|
173
|
+
print(f"{sid}: {len(obs)} monthly observations retrieved")
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
### Search for Series by Keyword
|
|
177
|
+
|
|
178
|
+
Discover available data series on a specific topic:
|
|
179
|
+
|
|
180
|
+
```bash
|
|
181
|
+
curl "https://api.stlouisfed.org/fred/series/search?search_text=consumer+price+index&api_key=YOUR_KEY&file_type=json&limit=10"
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
## References
|
|
185
|
+
|
|
186
|
+
- Official API documentation: https://fred.stlouisfed.org/docs/api/fred/
|
|
187
|
+
- FRED homepage: https://fred.stlouisfed.org/
|
|
188
|
+
- Series search: https://fred.stlouisfed.org/docs/api/fred/series_search.html
|
|
189
|
+
- Category tree: https://fred.stlouisfed.org/docs/api/fred/category.html
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: curriculum-design-guide
|
|
3
|
+
description: "Systematic approaches to curriculum design using backward design and alignment"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "books"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "education"
|
|
9
|
+
keywords: ["curriculum design", "pedagogy", "education", "study methods", "backward design"]
|
|
10
|
+
source: "wentor"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Curriculum Design Guide
|
|
14
|
+
|
|
15
|
+
A structured skill for designing research-informed curricula using backward design, constructive alignment, and competency-based frameworks. Applicable to higher education course design, training program development, and educational research.
|
|
16
|
+
|
|
17
|
+
## Backward Design Framework
|
|
18
|
+
|
|
19
|
+
Understanding by Design (Wiggins & McTighe, 2005) reverses the traditional content-first approach:
|
|
20
|
+
|
|
21
|
+
### Stage 1: Identify Desired Results
|
|
22
|
+
|
|
23
|
+
Define what students should know, understand, and be able to do:
|
|
24
|
+
|
|
25
|
+
```yaml
|
|
26
|
+
course: "Introduction to Research Methods"
|
|
27
|
+
big_ideas:
|
|
28
|
+
- "Research is a systematic process of inquiry"
|
|
29
|
+
- "Methodology must align with research questions"
|
|
30
|
+
|
|
31
|
+
essential_questions:
|
|
32
|
+
- "How do we know what we know?"
|
|
33
|
+
- "What makes evidence credible?"
|
|
34
|
+
- "When should we use qualitative vs. quantitative methods?"
|
|
35
|
+
|
|
36
|
+
learning_outcomes:
|
|
37
|
+
- "Formulate testable research questions (Apply)"
|
|
38
|
+
- "Select appropriate research designs for given questions (Evaluate)"
|
|
39
|
+
- "Critically appraise published research methodology (Analyze)"
|
|
40
|
+
- "Design and defend a research proposal (Create)"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Stage 2: Determine Acceptable Evidence
|
|
44
|
+
|
|
45
|
+
Design assessments before planning instruction:
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
# Assessment blueprint generator
|
|
49
|
+
def create_assessment_blueprint(outcomes: list[str], bloom_levels: list[str],
|
|
50
|
+
weights: list[float]) -> dict:
|
|
51
|
+
"""
|
|
52
|
+
Generate an assessment blueprint mapping outcomes to
|
|
53
|
+
assessment types and weights.
|
|
54
|
+
"""
|
|
55
|
+
assessment_types = {
|
|
56
|
+
'Remember': 'quiz',
|
|
57
|
+
'Understand': 'reflection_paper',
|
|
58
|
+
'Apply': 'problem_set',
|
|
59
|
+
'Analyze': 'case_study',
|
|
60
|
+
'Evaluate': 'peer_review',
|
|
61
|
+
'Create': 'research_proposal'
|
|
62
|
+
}
|
|
63
|
+
blueprint = []
|
|
64
|
+
for outcome, level, weight in zip(outcomes, bloom_levels, weights):
|
|
65
|
+
blueprint.append({
|
|
66
|
+
'outcome': outcome,
|
|
67
|
+
'bloom_level': level,
|
|
68
|
+
'assessment_type': assessment_types.get(level, 'portfolio'),
|
|
69
|
+
'weight_pct': weight * 100
|
|
70
|
+
})
|
|
71
|
+
return {'blueprint': blueprint, 'total_weight': sum(weights) * 100}
|
|
72
|
+
|
|
73
|
+
outcomes = [
|
|
74
|
+
"Formulate research questions",
|
|
75
|
+
"Select research designs",
|
|
76
|
+
"Appraise methodology",
|
|
77
|
+
"Design research proposal"
|
|
78
|
+
]
|
|
79
|
+
levels = ['Apply', 'Evaluate', 'Analyze', 'Create']
|
|
80
|
+
weights = [0.15, 0.20, 0.25, 0.40]
|
|
81
|
+
print(create_assessment_blueprint(outcomes, levels, weights))
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Stage 3: Plan Learning Experiences
|
|
85
|
+
|
|
86
|
+
Sequence activities that build toward assessment readiness. Use the WHERETO framework:
|
|
87
|
+
|
|
88
|
+
- **W** -- Where are we going? Why?
|
|
89
|
+
- **H** -- Hook and hold interest
|
|
90
|
+
- **E** -- Equip with experience, tools, knowledge
|
|
91
|
+
- **R** -- Rethink, reflect, revise
|
|
92
|
+
- **E** -- Evaluate understanding
|
|
93
|
+
- **T** -- Tailor to individual needs
|
|
94
|
+
- **O** -- Organize for maximum engagement
|
|
95
|
+
|
|
96
|
+
## Constructive Alignment
|
|
97
|
+
|
|
98
|
+
Biggs' Constructive Alignment (1996) ensures coherence between intended learning outcomes (ILOs), teaching/learning activities (TLAs), and assessment tasks (ATs):
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
ILO: "Students will analyze case studies using SWOT framework"
|
|
102
|
+
|
|
|
103
|
+
+--> TLA: Workshop where students collaboratively analyze
|
|
104
|
+
| a real company case in small groups
|
|
105
|
+
|
|
|
106
|
+
+--> AT: Individual case analysis report (1500 words)
|
|
107
|
+
assessed with rubric mapping to ILO verbs
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Misalignment is the most common curriculum design failure. Audit each ILO to verify it has at least one matching TLA and one matching AT.
|
|
111
|
+
|
|
112
|
+
## Competency-Based Curriculum Mapping
|
|
113
|
+
|
|
114
|
+
For programs with multiple courses, create a curriculum map:
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
Competency | Course 1 | Course 2 | Course 3 | Course 4
|
|
118
|
+
------------------------|----------|----------|----------|--------
|
|
119
|
+
Research question design| I | D | M | A
|
|
120
|
+
Literature review | I | D | D | M
|
|
121
|
+
Data collection | - | I | D | M
|
|
122
|
+
Statistical analysis | - | I | D | A
|
|
123
|
+
Academic writing | I | D | D | A
|
|
124
|
+
|
|
125
|
+
Legend: I = Introduced, D = Developed, M = Mastered, A = Applied
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
Ensure every competency reaches at least "Mastered" level by program completion, and identify gaps where competencies are introduced but never developed further.
|
|
129
|
+
|
|
130
|
+
## Quality Assurance
|
|
131
|
+
|
|
132
|
+
Validate curriculum designs through:
|
|
133
|
+
|
|
134
|
+
1. External review by discipline experts and industry advisors
|
|
135
|
+
2. Student feedback surveys (mid-semester and end-of-semester)
|
|
136
|
+
3. Learning analytics -- track completion rates, grade distributions, and DFW rates
|
|
137
|
+
4. Periodic program-level assessment with rubric-scored capstone artifacts
|
|
138
|
+
|
|
139
|
+
Document all revisions in a curriculum changelog to maintain institutional memory and support accreditation reporting.
|
|
140
|
+
|
|
141
|
+
## References
|
|
142
|
+
|
|
143
|
+
- Wiggins, G., & McTighe, J. (2005). *Understanding by Design* (2nd ed.). ASCD.
|
|
144
|
+
- Biggs, J. (1996). Enhancing teaching through constructive alignment. *Higher Education*, 32(3), 347-364.
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: learning-science-guide
|
|
3
|
+
description: "Evidence-based learning science principles for educational research and practice"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "brain"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "education"
|
|
9
|
+
keywords: ["education", "pedagogy", "learning science", "curriculum design", "study methods", "cognitive load"]
|
|
10
|
+
source: "wentor"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Learning Science Guide
|
|
14
|
+
|
|
15
|
+
A comprehensive skill for applying evidence-based learning science principles to educational research, instructional design, and teaching practice. Grounded in cognitive psychology and educational neuroscience.
|
|
16
|
+
|
|
17
|
+
## Foundational Learning Theories
|
|
18
|
+
|
|
19
|
+
### Cognitive Load Theory (Sweller, 1988)
|
|
20
|
+
|
|
21
|
+
Working memory has limited capacity. Effective instruction manages three types of cognitive load:
|
|
22
|
+
|
|
23
|
+
| Load Type | Definition | Design Strategy |
|
|
24
|
+
|-----------|-----------|-----------------|
|
|
25
|
+
| Intrinsic | Complexity inherent to the material | Sequence from simple to complex; chunk information |
|
|
26
|
+
| Extraneous | Load from poor instructional design | Eliminate redundancy; use spatial contiguity |
|
|
27
|
+
| Germane | Load from schema construction | Use worked examples; encourage self-explanation |
|
|
28
|
+
|
|
29
|
+
```python
|
|
30
|
+
# Estimate cognitive load using element interactivity
|
|
31
|
+
def estimate_intrinsic_load(elements: list, interactions: list) -> str:
|
|
32
|
+
"""
|
|
33
|
+
elements: list of knowledge components
|
|
34
|
+
interactions: list of (element_i, element_j) tuples that must be
|
|
35
|
+
processed simultaneously
|
|
36
|
+
"""
|
|
37
|
+
interactivity = len(interactions) / max(len(elements), 1)
|
|
38
|
+
if interactivity < 0.3:
|
|
39
|
+
return "low intrinsic load - suitable for independent study"
|
|
40
|
+
elif interactivity < 0.7:
|
|
41
|
+
return "moderate intrinsic load - scaffold with worked examples"
|
|
42
|
+
else:
|
|
43
|
+
return "high intrinsic load - use fading strategy and segmenting"
|
|
44
|
+
|
|
45
|
+
# Example: teaching statistical regression
|
|
46
|
+
elements = ['variable', 'coefficient', 'intercept', 'residual', 'R-squared']
|
|
47
|
+
interactions = [('coefficient', 'variable'), ('intercept', 'residual'),
|
|
48
|
+
('coefficient', 'R-squared'), ('residual', 'R-squared')]
|
|
49
|
+
print(estimate_intrinsic_load(elements, interactions))
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Constructivism and Active Learning
|
|
53
|
+
|
|
54
|
+
Constructivist approaches emphasize that learners build knowledge through experience. Key active learning strategies with measured effect sizes (Freeman et al., 2014, PNAS):
|
|
55
|
+
|
|
56
|
+
- **Think-Pair-Share**: d = 0.41
|
|
57
|
+
- **Problem-Based Learning (PBL)**: d = 0.68
|
|
58
|
+
- **Peer Instruction (Mazur)**: d = 0.74
|
|
59
|
+
- **Inquiry-Based Labs**: d = 0.52
|
|
60
|
+
|
|
61
|
+
## Evidence-Based Study Methods
|
|
62
|
+
|
|
63
|
+
### Retrieval Practice
|
|
64
|
+
|
|
65
|
+
Testing is not just assessment -- it is a powerful learning tool (Roediger & Karpicke, 2006). Implement the testing effect:
|
|
66
|
+
|
|
67
|
+
```
|
|
68
|
+
Study Session Structure:
|
|
69
|
+
1. Initial encoding (read/watch) - 15 min
|
|
70
|
+
2. Free recall (close materials, write) - 10 min
|
|
71
|
+
3. Check accuracy and fill gaps - 5 min
|
|
72
|
+
4. Spaced retrieval after 1 day - 10 min
|
|
73
|
+
5. Spaced retrieval after 7 days - 10 min
|
|
74
|
+
6. Spaced retrieval after 30 days - 10 min
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### Spaced Repetition Algorithms
|
|
78
|
+
|
|
79
|
+
Implement optimal review scheduling:
|
|
80
|
+
|
|
81
|
+
```python
|
|
82
|
+
def next_review_interval(repetition: int, ease_factor: float = 2.5,
|
|
83
|
+
quality: int = 4) -> float:
|
|
84
|
+
"""
|
|
85
|
+
SM-2 inspired algorithm.
|
|
86
|
+
repetition: number of successful reviews
|
|
87
|
+
ease_factor: item difficulty (>= 1.3)
|
|
88
|
+
quality: response quality 0-5
|
|
89
|
+
"""
|
|
90
|
+
if quality < 3:
|
|
91
|
+
return 1 # reset to 1 day
|
|
92
|
+
if repetition == 0:
|
|
93
|
+
return 1
|
|
94
|
+
elif repetition == 1:
|
|
95
|
+
return 6
|
|
96
|
+
else:
|
|
97
|
+
interval = 6 * (ease_factor ** (repetition - 1))
|
|
98
|
+
# Adjust ease factor
|
|
99
|
+
new_ef = ease_factor + (0.1 - (5 - quality) * (0.08 + (5 - quality) * 0.02))
|
|
100
|
+
return round(interval, 1)
|
|
101
|
+
|
|
102
|
+
# Schedule for a moderately difficult concept
|
|
103
|
+
for rep in range(6):
|
|
104
|
+
days = next_review_interval(rep)
|
|
105
|
+
print(f"Review {rep + 1}: after {days} days")
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
### Interleaving and Desirable Difficulties
|
|
109
|
+
|
|
110
|
+
Research shows interleaved practice (mixing problem types) outperforms blocked practice for long-term retention (Rohrer & Taylor, 2007):
|
|
111
|
+
|
|
112
|
+
- Blocked: AAABBBCCC -> short-term gains, long-term forgetting
|
|
113
|
+
- Interleaved: ABCBACACB -> harder during practice, better retention
|
|
114
|
+
|
|
115
|
+
## Assessment Design
|
|
116
|
+
|
|
117
|
+
### Bloom's Taxonomy Alignment
|
|
118
|
+
|
|
119
|
+
Map learning objectives to assessment items across cognitive levels:
|
|
120
|
+
|
|
121
|
+
```yaml
|
|
122
|
+
remember:
|
|
123
|
+
verbs: [define, list, recall, identify]
|
|
124
|
+
assessment: "Multiple choice, matching"
|
|
125
|
+
understand:
|
|
126
|
+
verbs: [explain, summarize, compare, classify]
|
|
127
|
+
assessment: "Short answer, concept maps"
|
|
128
|
+
apply:
|
|
129
|
+
verbs: [solve, demonstrate, use, implement]
|
|
130
|
+
assessment: "Problem sets, simulations"
|
|
131
|
+
analyze:
|
|
132
|
+
verbs: [differentiate, organize, attribute, deconstruct]
|
|
133
|
+
assessment: "Case studies, data interpretation"
|
|
134
|
+
evaluate:
|
|
135
|
+
verbs: [judge, critique, justify, appraise]
|
|
136
|
+
assessment: "Peer review, rubric-based essays"
|
|
137
|
+
create:
|
|
138
|
+
verbs: [design, construct, produce, formulate]
|
|
139
|
+
assessment: "Research projects, portfolios"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
### Item Analysis
|
|
143
|
+
|
|
144
|
+
After administering assessments, compute item difficulty (p-value) and discrimination index to validate question quality. Target p-values between 0.30 and 0.70 and discrimination indices above 0.30 for optimal measurement.
|
|
145
|
+
|
|
146
|
+
## References
|
|
147
|
+
|
|
148
|
+
- Sweller, J. (1988). Cognitive load during problem solving. *Cognitive Science*, 12(2), 257-285.
|
|
149
|
+
- Freeman, S., et al. (2014). Active learning increases student performance in science. *PNAS*, 111(23), 8410-8415.
|
|
150
|
+
- Roediger, H. L., & Karpicke, J. D. (2006). Test-enhanced learning. *Psychological Science*, 17(3), 249-255.
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: financial-data-analysis
|
|
3
|
+
description: "Methods for acquiring, cleaning, and analyzing financial datasets for research"
|
|
4
|
+
metadata:
|
|
5
|
+
openclaw:
|
|
6
|
+
emoji: "money_with_wings"
|
|
7
|
+
category: "domains"
|
|
8
|
+
subcategory: "finance"
|
|
9
|
+
keywords: ["financial data", "stock analysis", "quantitative finance", "data pipeline", "financial API"]
|
|
10
|
+
source: "wentor"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Financial Data Analysis
|
|
14
|
+
|
|
15
|
+
A practical skill for sourcing, processing, and analyzing financial data in academic research contexts. Covers data acquisition from public APIs, cleaning workflows, and standard analytical techniques used in empirical finance research.
|
|
16
|
+
|
|
17
|
+
## Data Acquisition
|
|
18
|
+
|
|
19
|
+
### Public Financial Data Sources
|
|
20
|
+
|
|
21
|
+
| Source | Data Type | Access | Python Package |
|
|
22
|
+
|--------|-----------|--------|---------------|
|
|
23
|
+
| Yahoo Finance | Prices, fundamentals | Free | `yfinance` |
|
|
24
|
+
| FRED (St. Louis Fed) | Macroeconomic indicators | Free (API key) | `fredapi` |
|
|
25
|
+
| SEC EDGAR | Company filings (10-K, 10-Q) | Free | `sec-edgar-downloader` |
|
|
26
|
+
| WRDS (Wharton) | CRSP, Compustat, IBES | University subscription | `wrds` |
|
|
27
|
+
| Alpha Vantage | Real-time and historical prices | Free tier | `alpha_vantage` |
|
|
28
|
+
|
|
29
|
+
### Fetching Price Data
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
import yfinance as yf
|
|
33
|
+
import pandas as pd
|
|
34
|
+
|
|
35
|
+
def fetch_stock_data(tickers: list[str], start: str, end: str) -> pd.DataFrame:
|
|
36
|
+
"""
|
|
37
|
+
Fetch adjusted close prices for a list of tickers.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
tickers: List of ticker symbols (e.g., ['AAPL', 'MSFT'])
|
|
41
|
+
start: Start date (YYYY-MM-DD)
|
|
42
|
+
end: End date (YYYY-MM-DD)
|
|
43
|
+
Returns:
|
|
44
|
+
DataFrame with adjusted close prices
|
|
45
|
+
"""
|
|
46
|
+
data = yf.download(tickers, start=start, end=end, auto_adjust=True)
|
|
47
|
+
prices = data['Close'] if len(tickers) > 1 else data[['Close']]
|
|
48
|
+
prices.columns = tickers if len(tickers) > 1 else tickers
|
|
49
|
+
return prices
|
|
50
|
+
|
|
51
|
+
# Fetch 5 years of data
|
|
52
|
+
prices = fetch_stock_data(['AAPL', 'MSFT', 'GOOGL'], '2020-01-01', '2025-01-01')
|
|
53
|
+
print(prices.head())
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Macroeconomic Data from FRED
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
from fredapi import Fred
|
|
60
|
+
|
|
61
|
+
fred = Fred(api_key=os.environ["FRED_API_KEY"])
|
|
62
|
+
|
|
63
|
+
# Common series for finance research
|
|
64
|
+
series_ids = {
|
|
65
|
+
'GDP': 'GDP',
|
|
66
|
+
'CPI': 'CPIAUCSL',
|
|
67
|
+
'Fed_Funds_Rate': 'FEDFUNDS',
|
|
68
|
+
'Unemployment': 'UNRATE',
|
|
69
|
+
'10Y_Treasury': 'DGS10',
|
|
70
|
+
'VIX': 'VIXCLS'
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
macro_data = pd.DataFrame()
|
|
74
|
+
for name, sid in series_ids.items():
|
|
75
|
+
macro_data[name] = fred.get_series(sid, observation_start='2000-01-01')
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Data Cleaning Pipeline
|
|
79
|
+
|
|
80
|
+
Financial data requires careful cleaning before analysis:
|
|
81
|
+
|
|
82
|
+
```python
|
|
83
|
+
def clean_financial_data(df: pd.DataFrame) -> pd.DataFrame:
|
|
84
|
+
"""Standard cleaning pipeline for financial time series."""
|
|
85
|
+
cleaned = df.copy()
|
|
86
|
+
|
|
87
|
+
# 1. Handle missing values
|
|
88
|
+
missing_pct = cleaned.isnull().sum() / len(cleaned) * 100
|
|
89
|
+
print(f"Missing data:\n{missing_pct}")
|
|
90
|
+
|
|
91
|
+
# 2. Forward-fill for market holidays (max 5 days)
|
|
92
|
+
cleaned = cleaned.ffill(limit=5)
|
|
93
|
+
|
|
94
|
+
# 3. Remove remaining NaN rows
|
|
95
|
+
cleaned = cleaned.dropna()
|
|
96
|
+
|
|
97
|
+
# 4. Detect and flag outliers (>5 sigma daily returns)
|
|
98
|
+
returns = cleaned.pct_change()
|
|
99
|
+
z_scores = (returns - returns.mean()) / returns.std()
|
|
100
|
+
outliers = (z_scores.abs() > 5).any(axis=1)
|
|
101
|
+
print(f"Outlier days flagged: {outliers.sum()}")
|
|
102
|
+
|
|
103
|
+
# 5. Verify data integrity
|
|
104
|
+
assert cleaned.index.is_monotonic_increasing, "Index must be sorted"
|
|
105
|
+
assert not cleaned.duplicated().any(), "No duplicate rows allowed"
|
|
106
|
+
|
|
107
|
+
return cleaned
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
## Standard Financial Metrics
|
|
111
|
+
|
|
112
|
+
### Return Calculations
|
|
113
|
+
|
|
114
|
+
```python
|
|
115
|
+
def compute_returns(prices: pd.DataFrame) -> dict:
|
|
116
|
+
"""Compute standard return metrics."""
|
|
117
|
+
simple_returns = prices.pct_change().dropna()
|
|
118
|
+
log_returns = np.log(prices / prices.shift(1)).dropna()
|
|
119
|
+
|
|
120
|
+
annualized_return = simple_returns.mean() * 252
|
|
121
|
+
annualized_vol = simple_returns.std() * np.sqrt(252)
|
|
122
|
+
sharpe_ratio = annualized_return / annualized_vol
|
|
123
|
+
|
|
124
|
+
# Maximum drawdown
|
|
125
|
+
cumulative = (1 + simple_returns).cumprod()
|
|
126
|
+
rolling_max = cumulative.cummax()
|
|
127
|
+
drawdown = (cumulative - rolling_max) / rolling_max
|
|
128
|
+
max_drawdown = drawdown.min()
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
'annualized_return': annualized_return,
|
|
132
|
+
'annualized_volatility': annualized_vol,
|
|
133
|
+
'sharpe_ratio': sharpe_ratio,
|
|
134
|
+
'max_drawdown': max_drawdown
|
|
135
|
+
}
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Event Studies
|
|
139
|
+
|
|
140
|
+
A common methodology in empirical finance research:
|
|
141
|
+
|
|
142
|
+
1. Define the event window (e.g., [-5, +5] trading days around earnings announcement)
|
|
143
|
+
2. Estimate normal returns using the market model over the estimation window (e.g., [-250, -30])
|
|
144
|
+
3. Compute abnormal returns: AR = R_actual - R_expected
|
|
145
|
+
4. Aggregate cumulative abnormal returns (CAR) across firms
|
|
146
|
+
5. Test statistical significance using parametric (Patell test) and non-parametric (sign test) methods
|
|
147
|
+
|
|
148
|
+
Always report both raw and risk-adjusted results, and perform robustness checks with different estimation windows and benchmark models.
|
|
149
|
+
|
|
150
|
+
## Reproducibility
|
|
151
|
+
|
|
152
|
+
Store all data processing steps in version-controlled scripts. Use `pandas.DataFrame.to_parquet()` for efficient storage of intermediate datasets, and document data provenance including download dates, API versions, and any filters applied.
|