01 — Your first CGE#

Open In Colab

A CGE model solves many markets and accounting relationships at the same time. This notebook starts with the bundled Hosoe Standard CGE economy and stays at the economic level: solve, inspect quantities and prices, and read the declared closure.

%pip install -q "https://github.com/miraflor/CGE-core/releases/download/v0.8.0/cge_core-0.8.0-py3-none-any.whl"

Solve the benchmark#

StandardCGE.example() loads the bundled teaching SAM and the model already knows its canonical closure.

from cge_core import StandardCGE

base = StandardCGE.example().solve()
base.summary()

Read the economy#

Z is gross sector output, pq is the Armington composite-good price, and pf contains factor prices.

import pandas as pd

rows = []
for good in ("BRD", "MLK"):
    rows.append({
        "good": good,
        "gross_output_Z": base.value("Z", good),
        "composite_price_pq": base.value("pq", good),
        "imports_M": base.value("M", good),
        "exports_E": base.value("E", good),
        "household_demand_Xp": base.value("Xp", good),
    })

pd.DataFrame(rows)

Inspect the closure#

A CGE needs a price normalization and one redundant market-clearing condition must be omitted because of Walras’ law. In a bundled model these are model metadata, not boilerplate the learner has to reconstruct.

print("declared closure:", base.closure)
print("labor factor price / numeraire:", base.value("pf", "LAB"))

What just happened?#

The benchmark is not a forecast. It is the model-consistent equilibrium calibrated to the bundled SAM. The next notebook changes an exogenous policy assumption and resolves the entire economy.