Computational Model Library

NearshoreABM: production network formation under infrastructure constraints and financial frictions (1.0.0)

NearshoreABM simulates whether a region captures the production linkages that nearshoring makes available, or fails to capture them because physical infrastructure and credit supply bind first.

The model runs over the 32 Mexican states at quarterly frequency. Multinational anchor firms decide whether to enter and where to locate, following Melitz selection on heterogeneous productivity under trade-policy uncertainty. Domestic supplier firms decide whether to formalise and whether to invest in quality, and may or may not obtain a contract with an anchor. A banking sector allocates a finite regional credit supply according to observed default risk, serving anchor firms before suppliers.

Electricity and water capacity enter production as non-linear congestion penalties with an engineering-based threshold, so the response of output to demand growth is discontinuous rather than proportional: below the threshold there is no penalty at all, between threshold and capacity the penalty grows quadratically, and above capacity it decays exponentially. Congestion is rivalrous within the quarter, which makes the order of production economically meaningful rather than incidental.

Regional export levels, the spatial distribution of activity, supply chain depth, and the domestic value added ratio are all emergent. In particular, the crowding of credit toward large anchor firms is not a programmed rule: it follows from a finite regional pool being allocated in a fixed order.

The model is initialised from an observed 2017 state panel rather than from a stylised configuration, and its parameters are separated into three categories: estimated from data by panel fixed effects, Double ML and stochastic frontier analysis; taken from published literature with the citation recorded; or not identifiable from available data and therefore subject to sensitivity analysis rather than point calibration. That separation exists to keep the model from being tuned toward its own conclusion.

Release Notes

First public release of NearshoreABM (v1.0.0).

Requirements

Julia 1.10+; tested on 1.12.3 with Agents.jl 7.0.1. Versions are pinned in Manifest.toml, so Pkg.instantiate() reproduces the environment the results came from. The optional dashboard also needs GLMakie and an OpenGL context; the headless scripts do not.

Running it

julia --project=. -e 'using Pkg; Pkg.instantiate()'
julia --project=. scripts/run_baseline.jl 32 42

Arguments are quarters and seed, defaulting to 32 and 42. A run takes about ten seconds. Behaviour is controlled entirely through ParameterSet, documented in src/parameters.jl and classified by provenance.

Inputs

Three supplied files: a state-quarter panel (only the starting quarter is read, to set regional initial conditions), stochastic-frontier efficiency scores, and estimated elasticities. The loader searches upward for a data directory, so no path editing is needed whether the release is downloaded whole or unpacked with code and data as siblings.

Outputs

run_baseline.jl writes one row per quarter to results/baseline_<seed>.csv: exports, employment, firm counts, the Gini of exports across states, the export-weighted DVA ratio, and cumulative entries, exits and defaults. generate_outputs.jl reproduces the distributed results: twenty baseline runs plus sweeps over bank risk aversion and guarantee coverage.

Reproducibility

A run is fully determined by its seed; identical seeds give byte-identical files, verified as part of this release. Seed 42 over 32 quarters gives exports 1.182e7 USD, 214 anchors, 5213 suppliers, Gini 0.5243, DVA 0.2996.

Two behaviours are deliberate: updating within a quarter is asynchronous because congestion is rivalrous within the step, and credit reaching suppliers is zero at the calibrated parameters because anchors absorb the entire regional supply, which is the model’s central finding.

Associated Publications

Platas-López, A.; Cruz-Mejía, O. Production network formation under infrastructure constraints and financial frictions: A calibrated agent-based model. Manuscript under review, Journal of Economic Interaction and Coordination, 2026.

NearshoreABM: production network formation under infrastructure constraints and financial frictions 1.0.0

NearshoreABM simulates whether a region captures the production linkages that nearshoring makes available, or fails to capture them because physical infrastructure and credit supply bind first.

The model runs over the 32 Mexican states at quarterly frequency. Multinational anchor firms decide whether to enter and where to locate, following Melitz selection on heterogeneous productivity under trade-policy uncertainty. Domestic supplier firms decide whether to formalise and whether to invest in quality, and may or may not obtain a contract with an anchor. A banking sector allocates a finite regional credit supply according to observed default risk, serving anchor firms before suppliers.

Electricity and water capacity enter production as non-linear congestion penalties with an engineering-based threshold, so the response of output to demand growth is discontinuous rather than proportional: below the threshold there is no penalty at all, between threshold and capacity the penalty grows quadratically, and above capacity it decays exponentially. Congestion is rivalrous within the quarter, which makes the order of production economically meaningful rather than incidental.

Regional export levels, the spatial distribution of activity, supply chain depth, and the domestic value added ratio are all emergent. In particular, the crowding of credit toward large anchor firms is not a programmed rule: it follows from a finite regional pool being allocated in a fixed order.

The model is initialised from an observed 2017 state panel rather than from a stylised configuration, and its parameters are separated into three categories: estimated from data by panel fixed effects, Double ML and stochastic frontier analysis; taken from published literature with the citation recorded; or not identifiable from available data and therefore subject to sensitivity analysis rather than point calibration. That separation exists to keep the model from being tuned toward its own conclusion.

Release Notes

First public release of NearshoreABM (v1.0.0).

Requirements

Julia 1.10+; tested on 1.12.3 with Agents.jl 7.0.1. Versions are pinned in Manifest.toml, so Pkg.instantiate() reproduces the environment the results came from. The optional dashboard also needs GLMakie and an OpenGL context; the headless scripts do not.

Running it

julia --project=. -e 'using Pkg; Pkg.instantiate()'
julia --project=. scripts/run_baseline.jl 32 42

Arguments are quarters and seed, defaulting to 32 and 42. A run takes about ten seconds. Behaviour is controlled entirely through ParameterSet, documented in src/parameters.jl and classified by provenance.

Inputs

Three supplied files: a state-quarter panel (only the starting quarter is read, to set regional initial conditions), stochastic-frontier efficiency scores, and estimated elasticities. The loader searches upward for a data directory, so no path editing is needed whether the release is downloaded whole or unpacked with code and data as siblings.

Outputs

run_baseline.jl writes one row per quarter to results/baseline_<seed>.csv: exports, employment, firm counts, the Gini of exports across states, the export-weighted DVA ratio, and cumulative entries, exits and defaults. generate_outputs.jl reproduces the distributed results: twenty baseline runs plus sweeps over bank risk aversion and guarantee coverage.

Reproducibility

A run is fully determined by its seed; identical seeds give byte-identical files, verified as part of this release. Seed 42 over 32 quarters gives exports 1.182e7 USD, 214 anchors, 5213 suppliers, Gini 0.5243, DVA 0.2996.

Two behaviours are deliberate: updating within a quarter is asynchronous because congestion is rivalrous within the step, and credit reaching suppliers is zero at the calibrated parameters because anchors absorb the entire regional supply, which is the model’s central finding.

Version Submitter First published Last modified Status
1.0.0 Alejandro Platas López Thu Aug 20 01:45:46 2026 Thu Aug 20 01:45:46 2026 Published

Discussion

This website uses cookies and Google Analytics to help us track user engagement and improve our site. If you'd like to know more information about what data we collect and why, please see our data privacy policy. If you continue to use this site, you consent to our use of cookies.
Accept