Stats
Actions
Tags
From ueaiworkflow
Explain econ models/tools — GTAP, GEMPACK, regression (Stata/R), DID, IO — at undergrad level. Names actual command syntax, file paths, error messages. Triggers at stage 02 or /ueai-stage 02.
How this skill is triggered — by the user, by Claude, or both
Slash command
/ueaiworkflow:ueai-model-explainThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
| Tool | Typical artefact | Where errors live |
| Tool | Typical artefact | Where errors live |
|---|---|---|
GEMPACK (tablo.exe, gemsim.exe, runGTAP.exe) | .tab (model), .cmf (command), .sl4 (solution), .har (header array) | .log and console |
| GTAP database 11 | base data .har, parameters .prm | runGTAP window |
| Stata | .do, .dta, .smcl log | _rc return code |
| R / RStudio | .R, .Rmd, .RData | console traceback |
| Python (pandas, statsmodels, linearmodels) | .py, .ipynb | traceback |
LaTeX (TeX Live, tabular, booktabs, estout) | .tex → .pdf | .log |
| Excel + Power Query | .xlsx | (light) |
A filled 02_model/model_notes.md with:
GEMPACK 12.0, Stata 18 SE).! tariff-shock.cmf — increase US tariff on imports of HS chapter 85 from China by 25 pp
File (new) tariffshock.sl4 ;
File (new) tariffshock.har ;
File rwsbase.har ;
File rwspara.har ;
Verbal Description = "US 25pp tariff on imports of electronics from China, 2017 base" ;
Auxiliary files = tariffshock ;
Method = Gragg ;
Steps = 3 6 9 ;
subintervals = 3 ;
automatic accuracy = yes ;
Shock tms("Electronics", "China", "USA") = 25 ;
Common errors:
*** Could not open file XXX.har → check cd was set to the model folder.*** Model is not square → forgot to close a Variable or Equation block in the .tab.*** Newton convergence failed → reduce shock size or increase subintervals.* did-tariff.do
use evidence/data/firm_panel.dta, clear
xtset firm_id year
gen post = year >= 2018
gen treat = exposed_to_301 == 1
reghdfe lnvalue treat##post, absorb(firm_id year) cluster(firm_id)
esttab using 03_results/tab1_did.tex, replace booktabs se star(* 0.10 ** 0.05 *** 0.01)
Use Leontief inverse $(I-A)^{-1}$. In Stata: mata: L = luinv(I-A). In Python:
import numpy as np
L = np.linalg.inv(np.eye(n) - A)
# 模型与工具
项目题目:{{TOPIC}}
对应课程:{{COURSE}}
研究问题:{{QUESTION}}
## 本阶段任务
记录工具命令、模型设定、报错处理和输出解释。
## AI辅助记录
- 使用时间:...
- 使用工具:...
- 使用提示词:prompts/model-gtap-gempack.md(或 model-regression.md)
### 工具与版本
- GEMPACK 12.0 / GTAP database 11
- TeX Live 2023, latexmk
### 输入文件
- 02_model/tariff-shock.cmf
- 02_model/runGTAP.bat
- evidence/data/comtrade_ch_us_2018-2024.csv
### 核心命令
```cmf
! tariff-shock.cmf
File (new) tariffshock.sl4 ;
...
Shock tms("Electronics", "China", "USA") = 25 ;
tariffshock.sl4 — solutiontariffshock.har — updated headers; relevant headers: qgdp, qxw, EVCould not open file rwsbase.har → 检查工作目录;cd D:\GTAP\base 后再运行。Newton convergence failed → Steps = 3 6 9 12 增加细分步数。
## What you DO NOT do
- Do not invent coefficients or numbers — those come from stage 03 after the model actually runs.
- Do not write a multi-equation derivation unless explicitly asked.
- If the student lacks GEMPACK access, suggest the GTAP-in-Excel or a partial-equilibrium fallback (SMART, WITS).
npx claudepluginhub allblueuk/ueaiworkflowCreates, edits, and optimizes skills for Claude Code, including drafting, evaluating with test prompts, iterating on performance, and improving skill descriptions for better triggering accuracy.