API reference
KITE.KITE — Module
KITEQuantitative multi-sector Ricardian general-equilibrium trade models, solved in changes ("exact hat algebra"). A Julia translation of the public R package KITE (Kiel Institute Trade Policy Evaluation). Please cite the model suite as Hinz, Mahlkow & Wanner (2025); see CITATION.bib.
Core models:
CaliendoParro2015— Caliendo & Parro (2015), the multi-sector Ricardian core with input-output linkages, tariffs, non-tariff barriers and export taxes/subsidies.ChowdhryHinzKaminWanner2022— adds sanction-coalition transfers that equalise the welfare cost across coalition members.
Workflow:
using KITE
b = load_baseline(year = 2022) # or read_baseline_csv(dir)
sc = Scenario(b)
set_tariff!(sc, b, 1.25; from = "CHN", to = "USA", mode = :multiply)
r = update_equilibrium(CaliendoParro2015(), b, sc)
results(r; level = :country)A KiteBaseline is model-consistent by construction — calibrate enforces the goods-market, expenditure and income identities, so a no-change scenario reproduces the baseline exactly. See update_equilibrium for the solver and its settings.
See NEWS.md and the "Differences from the R implementation" section of the manual for how this port relates to the public R package.
Models
KITE.KiteModel — Type
KiteModelAbstract supertype for KITE model variants. Concrete subtypes are singletons that select the solver's wage-update and transfer behaviour by multiple dispatch: CaliendoParro2015 and ChowdhryHinzKaminWanner2022.
KITE.CaliendoParro2015 — Type
CaliendoParro2015()Multi-sector Ricardian model with input-output linkages of Caliendo & Parro (2015). The wage iterate is updated from labour-market clearing, ŵ_o ← (Σ_j β_o^j Y_o^{j′}) / (w_o L_o), log-dampened by vfactor and normalised so world value added is the numéraire.
Supports tariffs, non-tariff barriers, export taxes/subsidies, and exogenous productivity and labour-supply shocks.
KITE.ChowdhryHinzKaminWanner2022 — Type
ChowdhryHinzKaminWanner2022()Extends CaliendoParro2015 with the sanction-coalition transfer scheme of Chowdhry, Hinz, Kamin & Wanner (2022/2024). Transfers T among coalition members S satisfy
Σ_{d ∈ S} T_d = 0 and Î_d / P̂_d equal for all d ∈ S,so every member bears the same proportional welfare cost. The wage iterate is updated from the trade-balance excess-demand function rather than from labour-market clearing.
Set the coalition with set_coalition!. With an empty coalition the model solves the same equilibrium as CaliendoParro2015.
KITE.MahlkowWanner2023 — Type
MahlkowWanner2023(b::KiteBaseline; primary = String[], secondary = Pair[],
resource_share = 0.5)Carbon/energy extension of CaliendoParro2015 after Mahlkow & Wanner (2023).
Keyword Arguments
primary: sector codes of primary fossil fuels — those extracting a natural resource in fixed supply. Each earns a rent whose price is solved for alongside wages.secondary: pairs"secondary" => "primary"linking each secondary fuel to its complementary primary fuel, e.g.["C19" => "B06"]for refined petroleum and crude oil. Secondary sectors use that fuel in fixed proportion (Leontief) to the rest of their input bundle.resource_share: the share of a primary sector's value added accruing to the natural resource rather than to labour, in(0, 1). Accepts a scalar, aDictkeyed by sector code, or a full(N, J)matrix of shares. The remaining value added is labour income.
With primary and secondary both empty this solves exactly the same equilibrium as CaliendoParro2015.
Examples
model = MahlkowWanner2023(b;
primary = ["B05", "B06"], # coal, oil and gas extraction
secondary = ["C19" => "B06"], # refined petroleum ← crude oil
resource_share = 0.6)
r = update_equilibrium(model, b, sc)
fossil_use(r) # real secondary-fuel use, the emissions driverSee also fossil_use, resource_price_change.
KITE.AntrasChor2018 — Type
AntrasChor2018()Global-value-chain extension of CaliendoParro2015 after Antràs & Chor (2018), in which sourcing patterns differ across using sectors and between intermediate and final use.
Requires a GVCBaseline rather than a plain KiteBaseline. With use-independent sourcing it solves exactly the same equilibrium as CaliendoParro2015.
Examples
g = GVCBaseline(b; π_use = π_use, π_fin = π_fin)
r = update_equilibrium(AntrasChor2018(), g, sc)
r.ext.P̂_use # (N, J, J) price index of sector-j goods used by sector kBaselines
KITE.KiteBaseline — Type
KiteBaselineA calibrated, model-consistent initial equilibrium: N countries, J sectors, the behavioural shares, the policy levels, and a set of mutually consistent nominal levels.
Consistency means the three equilibrium identities hold at the baseline itself,
Y[o, j] = Σ_d π[o, d, j] · X[d, j] / (τ[o, d, j] · ζ[o, d, j]) (goods market)
X[d, k] = α[d, k] · I[d] + Σ_j input_share[d, k, j] · Y[d, j] (expenditure)
I[d] = VA[d] + R[d] − D[d], VA[d] = Σ_j β[d, j] · Y[d, j] (income)and the inner constructor rejects data that violates them. This invariant is what makes a no-change scenario reproduce the baseline exactly, in a single iteration. Use calibrate to build one from raw data and residuals to inspect the three identity errors.
Fields
N::Int,J::Int: number of countries and sectors.countries::Vector{String},sectors::Vector{String}: labels, in array order.π::Array{Float64,3}:(N, N, J)[o, d, j]trade shares;Σ_o π[:, d, j] = 1.γ::Array{Float64,3}:(N, J, J)[d, k, j]intermediate input shares;Σ_k γ[d, :, j] = 1(or0for inactive sectors),kthe input andjthe output sector.input_share::Array{Float64,3}:(N, J, J)[d, k, j] = (1 − β[d, j]) · γ[d, k, j].α::Matrix{Float64}:(N, J)final-absorption shares;Σ_j α[d, :] = 1.β::Matrix{Float64}:(N, J)value-added share of gross output, in(0, 1).θ::Vector{Float64}:(J)trade elasticities (Fréchet shape),> 0.τ::Array{Float64,3}:(N, N, J)tariff multiplier1 + rate,≥ 1.ζ::Array{Float64,3}:(N, N, J)export tax (> 1) or subsidy (< 1) multiplier.X::Matrix{Float64},Y::Matrix{Float64}:(N, J)expenditure and gross output.I::Vector{Float64}:(N)total final absorption (income).R::Vector{Float64}:(N)net tariff revenue plus export tax/subsidy receipts.VA::Vector{Float64}:(N)value added,= Σ_j β[d, j] · Y[d, j].D::Vector{Float64}:(N)trade surplus, subtracted from income;Σ_d D ≈ 0.
Non-tariff barriers appear only as the change κ̂ in a Scenario, never in levels, so there is no κ field.
KITE.GVCBaseline — Type
GVCBaseline(b::KiteBaseline; π_use = nothing, π_fin = nothing, verbose = 1)A baseline with use-specific sourcing, for AntrasChor2018.
π_use::Array{Float64,4}:(N, N, J, J)[o, d, j, k], the share of countryd's sector-kuse of sector-jgoods bought fromo. Normalised to sum to one overo.π_fin::Array{Float64,3}:(N, N, J)[o, d, j], the same for final consumption.
Omit both to build the use-independent case, in which every column equals the aggregate b.π — useful as a reference point, since it reproduces CaliendoParro2015 exactly.
Supplying genuine use-specific shares changes the goods-market condition, so gross output is re-solved to be consistent with them, holding final absorption I fixed. Value added, policy revenue and the trade balance follow, exactly as in calibrate. The field base then holds an ordinary, fully consistent KiteBaseline whose π is the expenditure-weighted average of the use-specific shares — so every results helper keeps working, and running CaliendoParro2015 on it gives the aggregate-sourcing counterfactual to compare against.
Fields
base::KiteBaseline,π_use::Array{Float64,4},π_fin::Array{Float64,3}
KITE.calibrate — Function
calibrate(; countries, sectors, π, γ, β, θ, X, α = nothing, τ = nothing, ζ = nothing,
anchor = :expenditure, final_demand = :residual, kwargs...) -> KiteBaselineBuild a model-consistent KiteBaseline from raw shares and levels.
The equilibrium identities over-determine raw MRIO data, so something has to give. calibrate holds the behavioural shares (π, γ, β, θ) and the observed expenditure X fixed, and lets final demand and the trade balance absorb the inconsistency:
Y[o, j] = Σ_d π · X / (τ ζ)andID[d, k] = Σ_j input_share · Y.F = X − IDis residual final demand. Where a cell is negative (inventory decumulation and MRIO adjustment items), it is clipped to zero,Xis reset toID + F⁺, and the step is repeated untilF ≥ 0everywhere. This converges geometrically.α = F / Σ_j F— final-absorption shares that reproduce observed final demand by construction.VA = Σ_j β · Y,Rfrom the policy wedges,I = Σ_j F, and the trade balance closes the income identity asD = VA + R − I.
Keyword Arguments
countries,sectors: label vectors of lengthNandJ.π:(N, N, J)[o, d, j]trade shares. Columns are renormalised to sum to one.γ:(N, J, J)[d, k, j]intermediate shares,kinput andjoutput. Renormalised to sum to one overk(a column of zeros, for an inactive sector, is left alone).β:(N, J)value-added shares, clipped into(clip_β, 1 − clip_β).θ:(J)trade elasticities in the standard convention — largerθmeans more responsive trade. (The R implementation inverts this; seeNEWS.md.)X:(N, J)expenditure. Required whenanchor = :expenditure.α:(N, J)final-absorption shares. Only used whenfinal_demand = :given.τ,ζ:(N, N, J)tariff and export tax/subsidy multipliers; default to no policy.anchor::Symbol = :expenditure::expenditureholdsXfixed (recommended, and what the shipped baseline uses);:value_addedinstead holds publishedVAfixed and solves jointly forX, letting expenditure move.VA,D:(N)published value added and trade surplus. Used whenanchor = :value_added; ignored otherwise (both are then implied).final_demand::Symbol = :residual::residualderivesαas above;:givenuses the suppliedαand reports how far the resulting baseline sits from the data.clip_negative::Bool = true: clip negative trade shares (supply-use balancing items) to zero before renormalising, reporting how many and how much.clip_β::Float64 = 1e-4: bound keepingβstrictly inside(0, 1).tolerance::Float64 = 1e-12,max_iterations::Int = 1000: balancing-loop controls.verbose::Int = 1:1prints a one-line calibration summary.
Examples
b = calibrate(; countries, sectors, π, γ, β, θ, X)
residuals(b) # (goods_market = 2.6e-16, expenditure = 0.0, income = 0.0)KITE.residuals — Function
residuals(b::KiteBaseline) -> NamedTupleMaximum relative violation of the three equilibrium identities at the baseline:
goods_market—Y[o, j] = Σ_d π[o, d, j] · X[d, j] / (τ[o, d, j] · ζ[o, d, j])expenditure—X[d, k] = α[d, k] · I[d] + Σ_j input_share[d, k, j] · Y[d, j]income—I[d] = VA[d] + R[d] − D[d]
A baseline built by calibrate returns values at round-off. The KiteBaseline constructor refuses to build anything larger than its atol.
KITE.load_baseline — Function
load_baseline(; year = 2022, check = true) -> KiteBaselineLoad a shipped, pre-calibrated baseline.
The 2022 vintage covers 81 countries and 50 sectors, built from the OECD ICIO 2025 SML tables, CEPII MAcMap-HS6 2019 tariffs and the Fontagné et al. (2022) trade elasticities. It is downloaded on first use as a lazy artifact and cached thereafter.
Resolution order: the KITE_BASELINE_DIR environment variable, then a locally built data/kite_baseline_<year> directory in the package, then the registered artifact. The first two make it possible to work with a freshly built baseline before it has been published.
Examples
b = load_baseline()
r = update_equilibrium(CaliendoParro2015(), b) # no-change benchmark: every hat is oneKITE.read_baseline_csv — Function
read_baseline_csv(dir; verbose = 1, kwargs...) -> KiteBaselineRead a baseline from long-format CSV files in dir and calibrate it.
Expected files, each with its index columns plus value (the same schema as the R package's initial conditions):
| file | columns |
|---|---|
trade_share.csv | origin, destination, sector, value |
intermediate_share.csv | country, input, output, value |
factor_share.csv | country, sector, value |
expenditure.csv | country, sector, value |
trade_elasticity.csv | sector, value |
tariff.csv (optional) | origin, destination, sector, value |
export_subsidy.csv (optional) | origin, destination, sector, value |
consumption_share.csv (optional) | country, sector, value |
value_added.csv, trade_balance.csv (optional) | country, value |
Tables may be sparse: absent cells take a documented fill (0 for shares and expenditure, 1 for tariffs and export subsidies) and the number filled is reported. Extra keyword arguments go to calibrate.
Examples
b = read_baseline_csv("dev/data/2022")
b = read_baseline_csv(dir; anchor = :value_added, verbose = 0)KITE.write_baseline — Function
write_baseline(b::KiteBaseline, dir; drop_zeros = true) -> StringWrite b to long-format CSV files in dir, the inverse of read_baseline_csv. Zero trade shares are omitted by default, since read_baseline_csv fills them back in. Returns dir.
KITE.read_baseline_binary — Function
read_baseline_binary(dir; check = true) -> KiteBaselineRead a baseline written by write_baseline_binary. The stored levels are already model-consistent, so no calibration is performed; check = false skips the invariant test.
KITE.write_baseline_binary — Function
write_baseline_binary(b::KiteBaseline, dir) -> StringWrite b as column-major little-endian Float64 blobs plus a meta.toml describing the dimensions and layout. This is the format inside the shipped artifact; use write_baseline for a human-readable, portable copy.
KITE.baseline_from_long — Function
baseline_from_long(tables::AbstractDict; kwargs...) -> KiteBaselineAssemble and calibrate a baseline from long-format tables, keyed by the same names the R package uses. Each value is a NamedTuple/DataFrame-like object with the index columns plus value.
Required: trade_share (origin, destination, sector), intermediate_share (country, input, output), factor_share (country, sector), expenditure (country, sector), trade_elasticity (sector). Optional: tariff, export_subsidy (default no policy), consumption_share (only used with final_demand = :given), value_added, trade_balance (only used with anchor = :value_added).
Extra keyword arguments are forwarded to calibrate.
Scenarios
KITE.Scenario — Type
Scenario(b::KiteBaseline; label = "scenario")A counterfactual policy experiment, held as dense arrays of the same shape as the baseline and initialised to no change. Mutate it with set_tariff!, set_ntb!, set_export_subsidy!, set_productivity!, set_population! and set_coalition!.
Fields
τ′::Array{Float64,3}:(N, N, J)counterfactual tariff multiplier (starts atb.τ).ζ′::Array{Float64,3}:(N, N, J)counterfactual export tax/subsidy (starts atb.ζ).κ̂::Array{Float64,3}:(N, N, J)non-tariff-barrier change (starts at1).ẑ::Matrix{Float64}:(N, J)productivity change (starts at1); divides input cost.L̂::Vector{Float64}:(N)labour-supply change (starts at1).coalition::Vector{Bool}:(N)coalition membership, used byChowdhryHinzKaminWanner2022only (starts allfalse).label::String: a description carried through to results.
Fields are dense rather than nothing-able so the solver has no branches in its hot loop; uniformly-unchanged arrays are detected once and skipped wholesale.
KITE.set_tariff! — Function
set_tariff!(sc, b, value; from = :all, to = :all, sector = :all, mode = :set)Set counterfactual tariffs on flows from from to to in sector.
value is a multiplier: 1.25 is a 25% ad-valorem tariff, 1.0 is free trade. mode selects how it is combined with what is already there — :set overwrites, :multiply scales the existing multiplier, :add adds to the ad-valorem rate.
Selectors take :all, a country/sector code, or a vector of codes.
Examples
set_tariff!(sc, b, 1.25; from = "CHN", to = "USA") # 25% across all sectors
set_tariff!(sc, b, 1.10; from = "CHN", to = "USA", sector = "C26", mode = :multiply)
set_tariff!(sc, b, 1.05; from = ["DEU", "FRA"], to = "GBR")KITE.set_ntb! — Function
set_ntb!(sc, b, value; from = :all, to = :all, sector = :all, mode = :set)Set the non-tariff-barrier change κ̂ on the selected flows. 1.0 is no change, values above one raise iceberg trade costs. Sanctions shocks estimated from a gravity regression enter here, as exp(-δ̂ / θ).
Examples
set_ntb!(sc, b, 1.5; from = "RUS", to = :all) # 50% higher trade costs on Russian exports
set_ntb!(sc, b, 1e6; from = "RUS", to = "USA") # prohibitive: an embargoKITE.set_export_subsidy! — Function
set_export_subsidy!(sc, b, value; from = :all, to = :all, sector = :all, mode = :set)Set the counterfactual export tax (> 1) or subsidy (< 1) multiplier ζ′ on the selected flows, where the origin from is the country levying or paying it.
KITE.set_productivity! — Function
set_productivity!(sc, b, value; country = :all, sector = :all, mode = :set)Set the exogenous productivity change ẑ. Values above one lower input costs.
KITE.set_population! — Function
set_population!(sc, b, value; country = :all, mode = :set)Set the exogenous labour-supply change L̂.
KITE.set_coalition! — Function
set_coalition!(sc, b, countries)Define the sanctioning coalition for ChowdhryHinzKaminWanner2022. Members share the welfare cost equally through transfers that net to zero within the coalition. Replaces any previous membership.
Examples
set_coalition!(sc, b, ["USA", "DEU", "FRA", "GBR"])Solving
KITE.update_equilibrium — Function
update_equilibrium(model, baseline, scenario = Scenario(baseline); kwargs...) -> KiteResult
update_equilibrium(model, baseline, scenario, settings::SolverSettings) -> KiteResultSolve for the counterfactual equilibrium in changes ("exact hat algebra").
model is CaliendoParro2015 or ChowdhryHinzKaminWanner2022; baseline is a model-consistent KiteBaseline; scenario holds the policy shock. Keyword arguments are forwarded to SolverSettings.
The solver iterates on the wage change ŵ. Each outer iteration updates input costs, sectoral price indices and trade shares, then solves the expenditure/output block to convergence, and finally revises ŵ. Because the baseline satisfies the equilibrium identities exactly, a no-change scenario converges in a single iteration with every hat equal to one.
Examples
r = update_equilibrium(CaliendoParro2015(), b) # no-change benchmark
r = update_equilibrium(CaliendoParro2015(), b, sc; tolerance = 1e-8)
r = update_equilibrium(ChowdhryHinzKaminWanner2022(), b, sc; vfactor = 0.1)update_equilibrium(::AntrasChor2018, g::GVCBaseline, sc = Scenario(g.base); kwargs...)Solve the Antràs–Chor global-value-chain equilibrium. Takes a GVCBaseline; everything else works as in the base update_equilibrium.
The returned KiteResult reports aggregate quantities in its usual fields — π′ is the expenditure-weighted average sourcing share and P̂ the final-consumption price index — so every results helper applies unchanged. The use-specific detail is in r.ext: π_use′, π_fin′ and P̂_use.
KITE.caliendo_parro_2015 — Function
caliendo_parro_2015(baseline, scenario = Scenario(baseline); kwargs...) -> KiteResultConvenience wrapper for update_equilibrium with CaliendoParro2015.
KITE.chowdhry_hinz_kamin_wanner_2022 — Function
chowdhry_hinz_kamin_wanner_2022(baseline, scenario = Scenario(baseline); kwargs...) -> KiteResultConvenience wrapper for update_equilibrium with ChowdhryHinzKaminWanner2022.
KITE.SolverSettings — Type
SolverSettings(; kwargs...)Numerical settings for update_equilibrium. Options are validated once, on construction. The settings are stored in the returned KiteResult, so a run is fully reproducible from its own output.
Keyword Arguments
tolerance::Float64 = 1e-6: outer-loop convergence tolerance, applied to the wage changeŵ.inner_tolerance::Float64 = 1e-10: inner-loop tolerance, applied to gross outputY′.max_iterations::Int = 1000: outer-loop iteration cap.max_inner_iterations::Int = 10_000: inner-loop iteration cap.vfactor::Float64 = 0.2: dampening factor for the wage update, in(0, 1]. Lower values are more stable but slower; raise it for well-behaved scenarios.convergence::Symbol = :root_mean_square: how the criterion is computed. One of:root_mean_square,:aggregate,:element_wise,:sample.trade_balance_rule::Symbol = :fixed: how the trade balance adjusts in the counterfactual. One of:fixed,:fixed_country_share,:fixed_global_share,:zero.inner_solver::Symbol = :iterative::iterativeruns the warm-started expenditure fixed point;:directforms and factorises theNJ × NJlinear system instead. The two agree to round-off;:directis much more expensive but useful as an independent check.require_inner_convergence::Bool = true: refuse to declare outer convergence while the inner loop is still short of its tolerance.numeraire::Union{Symbol,String} = :world_value_added::world_value_addedholdsΣ VA′fixed; a country code fixes that country's wage. Real quantities are invariant to this choice only when the trade balance scales with the price level — that is, undertrade_balance_rule = :zeroor:fixed_global_share. Under:fixedthe deficit is an exogenous nominal quantity, so it anchors the price level and the numéraire genuinely matters; this is a property of the model, not of the solver.verbose::Int = 1:0silent,1a progress line per solve,2per-iteration trace.
Examples
update_equilibrium(CaliendoParro2015(), b, sc; tolerance = 1e-8, vfactor = 0.3)
update_equilibrium(CaliendoParro2015(), b, sc, SolverSettings(inner_solver = :direct))KITE.KiteResult — Type
KiteResult{M<:KiteModel}The solved counterfactual equilibrium returned by update_equilibrium. Changes carry a hat, counterfactual levels a prime.
Fields
model::M,baseline::KiteBaseline,scenario::Scenario,settings::SolverSettingsŵ::Vector{Float64}:(N)wage change.ĉ::Matrix{Float64},P̂::Matrix{Float64}:(N, J)input-cost and price-index change.π′::Array{Float64,3}:(N, N, J)counterfactual trade shares.X′::Matrix{Float64},Y′::Matrix{Float64}:(N, J)expenditure and gross output.I′,VA′,D′,T′::Vector{Float64}:(N)income, value added, trade balance, transfers (T′is all zeros forCaliendoParro2015).converged::Bool,criterion::Float64,iterations::Int,inner_iterations::Int,elapsed::Float64ext: model-specific extras,nothingfor models that produce none. Mahlkow & Wanner puts the natural-resource rental prices here; read them withresource_price_change.
Use results to turn this into tidy DataFrames.
Results
KITE.results — Function
results(r::KiteResult; level = :country, kwargs...) -> DataFrameTidy results at one of three levels of aggregation.
:country— one row per country: trade, prices, income, production, welfare.:sector— one row per country-sector: prices, input costs, expenditure, production.:bilateral— one row per origin-destination-sector: trade shares and flows.
Extra keyword arguments are forwarded to country_results, sector_results or bilateral_results.
Examples
results(r) # country level
results(r; level = :sector)
results(r; level = :bilateral, countries = "USA") # only flows touching the USAKITE.country_results — Function
country_results(r::KiteResult) -> DataFrameOne row per country. Columns ending in _new are counterfactual levels, _change are ratios of counterfactual to baseline.
Key columns: welfare_change (Î/P̂), real_wage_change (ŵ/P̂), price_index_change, wage_change, income/income_new/income_change, exports/imports and their counterparts, tariff_revenue, export_subsidy_costs, production_total, value_added, trade_balance, transfer, and weight (baseline value-added share, for aggregating welfare).
KITE.sector_results — Function
sector_results(r::KiteResult) -> DataFrameOne row per country-sector: price_change (P̂), input_cost_change (ĉ), expenditure, production (nominal and real), and the trade elasticity used.
KITE.bilateral_results — Function
bilateral_results(r::KiteResult; drop_zeros = true, countries = :all, sectors = :all) -> DataFrameOne row per origin-destination-sector: trade shares, gross flows (tariff-inclusive) and fob flows (producer revenue), at baseline and counterfactual.
The full table has N²J rows — 328,050 for the shipped 2022 baseline — so drop_zeros defaults to true and omits pairs with no baseline trade. countries filters on either side of the flow.
KITE.welfare_change — Function
welfare_change(r::KiteResult) -> Vector{Float64}Change in real income, Î_d / P̂_d. Values above one are welfare gains.
KITE.real_wage_change — Function
real_wage_change(r::KiteResult) -> Vector{Float64}Change in the real wage, ŵ_d / P̂_d.
KITE.price_index — Function
price_index(r::KiteResult; weights = nothing) -> Vector{Float64}Aggregate price-index change under arbitrary expenditure weights, Π_j (P̂_d^j)^{w_d^j}.
weights defaults to the baseline final-absorption shares α, reproducing price_index_change. Pass an (N, J) matrix — household consumption shares, say — to report a price index over a different bundle. Rows are renormalised to sum to one.
KITE.price_index_change — Function
price_index_change(r::KiteResult) -> Vector{Float64}Change in the aggregate consumer price index, P̂_d = Π_j (P̂_d^j)^{α_d^j}.
KITE.tariff_revenue — Function
tariff_revenue(r::KiteResult) -> (baseline, counterfactual)Tariff revenue collected by each destination, Σ_{o,j} (τ−1)/τ · π[o,d,j] · X[d,j].
KITE.export_subsidy_costs — Function
export_subsidy_costs(r::KiteResult) -> (baseline, counterfactual)Net export tax receipts (positive) or subsidy costs (negative) borne by each origin, Σ_{m,j} (ζ−1)/(τ ζ) · π[d,m,j] · X[m,j].
KITE.trade_flows — Function
trade_flows(r::KiteResult) -> NamedTupleBilateral trade at baseline and counterfactual, gross (tariff-inclusive expenditure) and fob (producer revenue, deflated by τ·ζ).
Returns (flow, flow_new, fob, fob_new), each (N, N, J) indexed [o, d, j].
KITE.trade_aggregates — Function
trade_aggregates(r::KiteResult) -> NamedTupleCountry-level fob exports and imports, (exports, exports_new, imports, imports_new).
KITE.fossil_use — Function
fossil_use(r::KiteResult{MahlkowWanner2023}) -> DataFrameReal use of each secondary fossil fuel, by country — the quantity that drives emissions in Mahlkow & Wanner (2023).
Nominal absorption of a secondary fuel is deflated by its own price index, so use_change is (X′/P̂) / X: a value above one means the country burns more of that fuel. Multiply by an emission factor to obtain a carbon account.
Columns: country, sector, use, use_new, use_change.
KITE.resource_price_change — Function
resource_price_change(r::KiteResult{MahlkowWanner2023}) -> DataFrameChange in the rental price of each primary fossil-fuel resource, by country and sector.
Index
KITE.KITEKITE.AntrasChor2018KITE.CaliendoParro2015KITE.ChowdhryHinzKaminWanner2022KITE.GVCBaselineKITE.KiteBaselineKITE.KiteModelKITE.KiteResultKITE.MahlkowWanner2023KITE.ScenarioKITE.SolverSettingsKITE.baseline_from_longKITE.bilateral_resultsKITE.calibrateKITE.caliendo_parro_2015KITE.chowdhry_hinz_kamin_wanner_2022KITE.country_resultsKITE.export_subsidy_costsKITE.fossil_useKITE.load_baselineKITE.price_indexKITE.price_index_changeKITE.read_baseline_binaryKITE.read_baseline_csvKITE.real_wage_changeKITE.residualsKITE.resource_price_changeKITE.resultsKITE.sector_resultsKITE.set_coalition!KITE.set_export_subsidy!KITE.set_ntb!KITE.set_population!KITE.set_productivity!KITE.set_tariff!KITE.tariff_revenueKITE.trade_aggregatesKITE.trade_flowsKITE.update_equilibriumKITE.welfare_changeKITE.write_baselineKITE.write_baseline_binary