Skip to content

Add realistic monetary initialization calibrated to NBP/KNF/MF 2024 and sectoral balances (S−I)+(G−T)+(X−M)=0 (Godley & Lavoie 2007)#36

Merged
speedcom merged 6 commits intomainfrom
fix/sfc-monetary-init
Mar 4, 2026
Merged

Add realistic monetary initialization calibrated to NBP/KNF/MF 2024 and sectoral balances (S−I)+(G−T)+(X−M)=0 (Godley & Lavoie 2007)#36
speedcom merged 6 commits intomainfrom
fix/sfc-monetary-init

Conversation

@speedcom
Copy link
Contributor

@speedcom speedcom commented Mar 4, 2026

Summary

  • Realistic monetary initialization calibrated to NBP/KNF/MF 2024 (bank capital, deposits, gov debt, bond holdings, mortgage stock, FX reserves)
  • Fix absorber bankId=-1 crash when bank fails with zero deposits
  • Stabilize BDP=0 macro dynamics: demand scaling, investment flow, fiscal smoothing
  • Add SFC Identity 14: sectoral balances (S−I)+(G−T)+(X−M)=0 (Godley & Lavoie 2007)
  • Fix integration test expected column count (190→197)

Test plan

  • 1221 unit tests pass
  • 14 integration tests pass (all mechanisms ON)
  • Smoke test BDP=0 (5 seeds) — no SFC failures
  • Smoke test BDP=500 full mechanisms (5 seeds) — no SFC failures

speedcom added 5 commits March 3, 2026 23:56
Add GdpRatio auto-scaling for 18 real-economy stock variables and
7 INIT_* env vars (bank deposits/loans/capital/bonds, NBP bonds,
gov debt, consumer loans) calibrated to Polish 2024 data.

Fix 5 SFC identity bugs: bankDep (#2) missing jstDepositChange in
multi-bank, ccStock (#11) bankruptcy double-counting + per-bank
principal tracking, bankCap (#1) capital destruction on failure,
consumer loan transfer in bank resolution, QE compression using
qeCumulative instead of legacy NBP holdings.
resolveFailures returns -1 when no newly-failed bank has deposits>0.
Fall back to healthiestBankId to prevent HH/firm bankId=-1.
SimConfig:
- Remove ScaleFactor, use GdpRatio for all flow variables (exports,
  FDI, EU transfers) — fixes demand/capacity mismatch with GUS dist
- GovBaseSpending: env-configurable, calibrated to 700 bln PLN/year
- GovFiscalRecyclingRate 0.85: recycle lagged tax+ZUS as demand
- GovAutoStabMult: counter-cyclical fiscal spending when u > NAIRU
- GovBenefitCoverage 0.15: aggregate-mode unemployment benefits
- NbpQe default true (NBP March 2020 precedent)
- Taylor params (alpha, beta, inertia, ceiling) env-configurable
- NbpMaxRateChange: optional rate change cap (disabled by default)
- ImportPropensity 0.40→0.22 (consumption imports only)
- DemInitialRetirees: auto 46% when ZUS enabled
- InformalSmoothing 0.92: EMA on cyclical adjustment
- EnergyCostReplace 0.30, InventoryCostReplace 0.10
- FofInvestWeights: sector distribution of GFCF demand

Simulation:
- Investment demand (I) in flow-of-funds: GDP = C + I + G + NX
- Demand spillover: excess demand shifts to sectors with slack
- Fiscal recycling + spending inertia (max 2%/month decline)
- Nominal spending floor in deflation (max(1, priceLevel))
- Aggregate unemployment benefits (automatic stabilizer)
- Union wage premium in aggregate HH income
- Output gap capped at ±0.30 (Taylor + Expectations)
- Informal economy EMA smoothing
- ZUS surplus recycled to government spending

Firm:
- Forced downsizing before bankruptcy (zwolnienia grupowe):
  Traditional and Hybrid firms shed up to 30% workers per month
  instead of instant bankruptcy — reduces cascade unemployment
- EnergyCostReplace, InventoryCostReplace in calcPnL

Main:
- Init gross investment at steady-state depreciation
- Init retirees when ZUS enabled without full demographics

SfcCheck:
- Investment net deposit flow in Identity 2 (bank deposits)
Godley & Lavoie (2007) macro identity. Computed in SfcCheck.validate
from 5 new MonthlyFlows fields (exports, totalImports, grossInvestment,
greenInvestment, inventoryChange). Diagnostic-only — does not block
passed flag since unit tests use partial flows.
@speedcom speedcom changed the title Realistic monetary init, BDP=0 stability, Identity 14 Add realistic monetary initialization calibrated to NBP/KNF/MF 2024 and sectoral balances (S−I)+(G−T)+(X−M)=0 (Godley & Lavoie 2007) Mar 4, 2026
@speedcom speedcom merged commit 8e7d723 into main Mar 4, 2026
1 check passed
@speedcom speedcom deleted the fix/sfc-monetary-init branch March 4, 2026 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant