Structural Experiments#

Section 3.10.2 of Delli Gatti et al. (2011)

Structural experiments test the model’s mechanisms rather than sweeping parameter values. Two experiments are implemented.

PA (Preferential Attachment) Experiment#

Tests the effect of consumer loyalty on economic dynamics by disabling the “rich get richer” mechanism:

  1. Phase 1: Run internal validity with consumer_matching="random" (PA off)

  2. Phase 2: Run Z-sweep with PA off

  3. Optional baseline: Run internal validity with PA on for comparison

Expected findings from the book:

  • GDP volatility drops sharply

  • Deep crises disappear

  • Wages/prices become lagging or acyclical

  • AR persistence drops from ~0.8 to ~0.4

  • Firm size distribution becomes more uniform

from validation.robustness import (
    run_pa_experiment,
    print_pa_report,
    plot_pa_gdp_comparison,
    plot_pa_comovements,
)

pa = run_pa_experiment(n_seeds=20, n_periods=1000, include_baseline=True)
print_pa_report(pa)
plot_pa_gdp_comparison(pa, show=True)
plot_pa_comovements(pa, show=True)

Entry Neutrality Experiment#

Tests whether automatic firm entry artificially drives recovery by imposing heavy profit taxation without redistribution:

  • Sweeps profit_tax_rate from 0% to 90%

  • Uses the Taxation Extension extension

  • Expected finding: Monotonic degradation of economic performance, confirming that the business cycle is genuinely endogenous

from validation.robustness import (
    run_entry_experiment,
    print_entry_report,
    plot_entry_comparison,
)

entry = run_entry_experiment(n_seeds=20, n_periods=1000)
print_entry_report(entry)
plot_entry_comparison(entry, show=True)

Result Structures#

PAExperimentResult:

  • pa_off_validity: Internal validity with PA off

  • pa_off_z_sweep: Z-sweep sensitivity with PA off

  • baseline_validity: Optional PA-on baseline for comparison

EntryExperimentResult:

  • tax_sweep: Tax rate sweep results

API Reference#

Structural experiments (Section 3.10.2).

Implements two structural experiments that test model mechanisms:

  1. Preferential Attachment (PA) experiment: Disable consumer loyalty and show that volatility drops and deep crises vanish. Then sweep Z with PA off.

  2. Entry neutrality experiment: Apply heavy profit taxation without redistribution to increase bankruptcies, confirming that the automatic firm entry mechanism does NOT artificially drive recovery.

class validation.robustness.structural.PAExperimentResult(pa_off_validity, pa_off_z_sweep, baseline_validity=None)[source]#

Result of the preferential attachment experiment (Section 3.10.2).

Variables:
  • pa_off_validity (InternalValidityResult) – Internal validity with PA disabled (consumer_matching=”random”).

  • pa_off_z_sweep (SensitivityResult) – Z-sweep sensitivity with PA disabled.

  • baseline_validity (InternalValidityResult or None) – Optional baseline (PA on) for comparison.

pa_off_validity#
pa_off_z_sweep#
baseline_validity = None#
class validation.robustness.structural.EntryExperimentResult(tax_sweep)[source]#

Result of the entry neutrality experiment (Section 3.10.2).

Variables:

tax_sweep (SensitivityResult) – Sensitivity analysis sweeping profit_tax_rate.

tax_sweep#
validation.robustness.structural.run_pa_experiment(n_seeds=20, n_periods=1000, burn_in=500, n_workers=10, verbose=True, include_baseline=True, setup_hook=None, collect_config=None, **config_overrides)[source]#

Run the preferential attachment experiment (Section 3.10.2).

Phase 1: Run internal validity with PA disabled to show volatility drops and deep crises vanish.

Phase 2: Run Z-sweep sensitivity with PA disabled.

Optionally runs baseline (PA on) for comparison.

Parameters:
  • n_seeds (int) – Number of random seeds.

  • n_periods (int) – Simulation periods per seed.

  • burn_in (int) – Burn-in periods to discard.

  • n_workers (int) – Parallel workers.

  • verbose (bool) – Print progress.

  • include_baseline (bool) – Also run baseline (PA on) for comparison.

  • setup_hook (callable or None) – Global setup hook (e.g. Growth+ R&D).

  • collect_config (dict or None) – Custom collection config.

  • **config_overrides – Additional config overrides.

Return type:

PAExperimentResult

validation.robustness.structural.run_entry_experiment(n_seeds=20, n_periods=1000, burn_in=500, n_workers=10, verbose=True, setup_hook=None, collect_config=None, **config_overrides)[source]#

Run the entry neutrality experiment (Section 3.10.2).

Sweeps profit_tax_rate from 0% to 90% to show monotonic degradation, confirming that the automatic firm entry mechanism does NOT artificially drive recovery.

Parameters:
  • n_seeds (int) – Number of random seeds.

  • n_periods (int) – Simulation periods per seed.

  • burn_in (int) – Burn-in periods to discard.

  • n_workers (int) – Parallel workers.

  • verbose (bool) – Print progress.

  • setup_hook (callable or None) – Global setup hook (e.g. Growth+ R&D).

  • collect_config (dict or None) – Custom collection config.

  • **config_overrides – Additional config overrides.

Return type:

EntryExperimentResult