- Home
- Skills
- Meleantonio
- Awesome Econ Ai Stuff
- General Equilibrium Model Builder
general-equilibrium-model-builder_skill
- HTML
156
GitHub Stars
2
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill meleantonio/awesome-econ-ai-stuff --skill general-equilibrium-model-builder- index.md14.5 KB
- SKILL.md14.5 KB
Overview
This skill builds, analyzes, and numerically solves Walrasian general equilibrium models for pure exchange economies, combining theory derivations and ready-to-run Julia code. It supports model setup, existence and welfare results, excess-demand formulation, and a Julia solver that finds equilibrium prices and allocations. The focus is on transparent, reproducible workflows for economists, teachers, and students.
How this skill works
The skill asks for number of goods, number of consumers, utility specifications, endowments, and desired output (theory, code, or both). It formulates consumers' utility maximization problems, derives Marshallian demands, constructs the excess demand function z(p), and defines Walrasian equilibrium as market clearing plus utility maximization. For computation it produces Julia code that parameterizes positive prices, uses NLsolve with automatic differentiation, and returns equilibrium prices and allocations. It also includes checks: market clearing, Walras' Law, and Pareto efficiency diagnostics (MRS checks).
When to use it
- Formalizing a pure-exchange GE model for research or a paper
- Generating classroom examples and lecture notes for micro theory
- Numerically solving for equilibrium prices and allocations in small models
- Performing welfare analysis and checking Pareto efficiency
- Running comparative statics for endowment or preference changes
Best practices
- Always normalize one price (numeraire) to remove homogeneity indeterminacy
- Verify market clearing and Walras' Law numerically after solving
- Check for corner solutions and handle zero consumption carefully
- Try multiple initial guesses if the nonlinear solver fails to converge
- Use diagnostics (MRS equality, value of excess demand) to assess efficiency and numerical accuracy
Example use cases
- Create a 2×2 Cobb–Douglas example, derive equilibrium conditions, and generate Julia code to solve it
- Compare equilibrium allocations when one consumer's endowment shifts (comparative statics)
- Teach students Walras' Law, First and Second Welfare Theorems using a concrete computational example
- Plot an Edgeworth box with endowment, budget lines, contract curve, and equilibrium point using Julia plotting
FAQ
The provided Julia code implements Cobb–Douglas preferences with Marshallian demands and tools for 2-good MRS checks. Other preference types (CES, Leontief) are outlined but need additional demand routines to be implemented.
How does the solver ensure strictly positive prices?
Prices are parameterized in log-space and exponentiated; one good is fixed as the numeraire (p1=1) so all solved prices remain strictly positive and homogeneity is handled.