API reference

KITE.KITE — Module
KITE

Quantitative 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.

source

Models

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.

source
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.

source
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, a Dict keyed 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 driver

See also fossil_use, resource_price_change.

source
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 k
source

Baselines

KITE.KiteBaseline — Type
KiteBaseline

A 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 (or 0 for inactive sectors), k the input and j the 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 multiplier 1 + 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.

source
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 country d's sector-k use of sector-j goods bought from o. Normalised to sum to one over o.
  • π_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}
source
KITE.calibrate — Function
calibrate(; countries, sectors, π, γ, β, θ, X, α = nothing, τ = nothing, ζ = nothing,
            anchor = :expenditure, final_demand = :residual, kwargs...) -> KiteBaseline

Build 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:

  1. Y[o, j] = Σ_d π · X / (τ ζ) and ID[d, k] = Σ_j input_share · Y.
  2. F = X − ID is residual final demand. Where a cell is negative (inventory decumulation and MRIO adjustment items), it is clipped to zero, X is reset to ID + F⁺, and the step is repeated until F ≥ 0 everywhere. This converges geometrically.
  3. α = F / Σ_j F — final-absorption shares that reproduce observed final demand by construction.
  4. VA = Σ_j β · Y, R from the policy wedges, I = Σ_j F, and the trade balance closes the income identity as D = VA + R − I.

Keyword Arguments

  • countries, sectors: label vectors of length N and J.
  • π: (N, N, J) [o, d, j] trade shares. Columns are renormalised to sum to one.
  • γ: (N, J, J) [d, k, j] intermediate shares, k input and j output. Renormalised to sum to one over k (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; see NEWS.md.)
  • X: (N, J) expenditure. Required when anchor = :expenditure.
  • α: (N, J) final-absorption shares. Only used when final_demand = :given.
  • τ, ζ: (N, N, J) tariff and export tax/subsidy multipliers; default to no policy.
  • anchor::Symbol = :expenditure: :expenditure holds X fixed (recommended, and what the shipped baseline uses); :value_added instead holds published VA fixed and solves jointly for X, letting expenditure move.
  • VA, D: (N) published value added and trade surplus. Used when anchor = :value_added; ignored otherwise (both are then implied).
  • final_demand::Symbol = :residual: :residual derives α as above; :given uses 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: 1 prints a one-line calibration summary.

Examples

b = calibrate(; countries, sectors, π, γ, β, θ, X)
residuals(b)   # (goods_market = 2.6e-16, expenditure = 0.0, income = 0.0)
source
KITE.residuals — Function
residuals(b::KiteBaseline) -> NamedTuple

Maximum 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.

source
KITE.load_baseline — Function
load_baseline(; year = 2022, check = true) -> KiteBaseline

Load 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 one
source
KITE.read_baseline_csv — Function
read_baseline_csv(dir; verbose = 1, kwargs...) -> KiteBaseline

Read 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):

filecolumns
trade_share.csvorigin, destination, sector, value
intermediate_share.csvcountry, input, output, value
factor_share.csvcountry, sector, value
expenditure.csvcountry, sector, value
trade_elasticity.csvsector, 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)
source
KITE.read_baseline_binary — Function
read_baseline_binary(dir; check = true) -> KiteBaseline

Read 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.

source
KITE.write_baseline_binary — Function
write_baseline_binary(b::KiteBaseline, dir) -> String

Write 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.

source
KITE.baseline_from_long — Function
baseline_from_long(tables::AbstractDict; kwargs...) -> KiteBaseline

Assemble 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.

source

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 at b.τ).
  • ζ′::Array{Float64,3}: (N, N, J) counterfactual export tax/subsidy (starts at b.ζ).
  • κ̂::Array{Float64,3}: (N, N, J) non-tariff-barrier change (starts at 1).
  • ẑ::Matrix{Float64}: (N, J) productivity change (starts at 1); divides input cost.
  • L̂::Vector{Float64}: (N) labour-supply change (starts at 1).
  • coalition::Vector{Bool}: (N) coalition membership, used by ChowdhryHinzKaminWanner2022 only (starts all false).
  • 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.

source
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")
source
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 embargo
source
KITE.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.

source
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.

source
KITE.set_population! — Function
set_population!(sc, b, value; country = :all, mode = :set)

Set the exogenous labour-supply change L̂.

source
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"])
source

Solving

KITE.update_equilibrium — Function
update_equilibrium(model, baseline, scenario = Scenario(baseline); kwargs...) -> KiteResult
update_equilibrium(model, baseline, scenario, settings::SolverSettings) -> KiteResult

Solve 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)
source
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.

source
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 output Y′.
  • 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: :iterative runs the warm-started expenditure fixed point; :direct forms and factorises the NJ × NJ linear system instead. The two agree to round-off; :direct is 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_added holds Σ 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, under trade_balance_rule = :zero or :fixed_global_share. Under :fixed the 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: 0 silent, 1 a progress line per solve, 2 per-iteration trace.

Examples

update_equilibrium(CaliendoParro2015(), b, sc; tolerance = 1e-8, vfactor = 0.3)
update_equilibrium(CaliendoParro2015(), b, sc, SolverSettings(inner_solver = :direct))
source
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 for CaliendoParro2015).
  • converged::Bool, criterion::Float64, iterations::Int, inner_iterations::Int, elapsed::Float64
  • ext: model-specific extras, nothing for models that produce none. Mahlkow & Wanner puts the natural-resource rental prices here; read them with resource_price_change.

Use results to turn this into tidy DataFrames.

source

Results

KITE.results — Function
results(r::KiteResult; level = :country, kwargs...) -> DataFrame

Tidy 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 USA
source
KITE.country_results — Function
country_results(r::KiteResult) -> DataFrame

One 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).

source
KITE.sector_results — Function
sector_results(r::KiteResult) -> DataFrame

One row per country-sector: price_change (P̂), input_cost_change (ĉ), expenditure, production (nominal and real), and the trade elasticity used.

source
KITE.bilateral_results — Function
bilateral_results(r::KiteResult; drop_zeros = true, countries = :all, sectors = :all) -> DataFrame

One 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.

source
KITE.welfare_change — Function
welfare_change(r::KiteResult) -> Vector{Float64}

Change in real income, Î_d / P̂_d. Values above one are welfare gains.

source
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.

source
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}.

source
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].

source
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].

source
KITE.trade_flows — Function
trade_flows(r::KiteResult) -> NamedTuple

Bilateral 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].

source
KITE.trade_aggregates — Function
trade_aggregates(r::KiteResult) -> NamedTuple

Country-level fob exports and imports, (exports, exports_new, imports, imports_new).

source
KITE.fossil_use — Function
fossil_use(r::KiteResult{MahlkowWanner2023}) -> DataFrame

Real 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.

source
KITE.resource_price_change — Function
resource_price_change(r::KiteResult{MahlkowWanner2023}) -> DataFrame

Change in the rental price of each primary fossil-fuel resource, by country and sector.

source

Index