Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Test plan