Bugs/productivity growth#56
Conversation
…ng input targets -- deven fix
… simulation made to have ~0 inflation
Fix for production being constrained at initial levels even with TFP growth. Root cause: compute_limiting_intermediate_inputs_stock() and compute_limiting_capital_inputs_stock() calculated production limits WITHOUT applying the TFP multiplier. These limits constrain target_production, which capped actual production at initial levels regardless of TFP growth. Before fix: TFP grew 1309% but production only grew 82% (12.9% efficiency) After fix: TFP grew 843% and production grew 476% (61% efficiency) Also fix empty array handling in SimpleTFPGrowth to prevent test failures.
The limiting_intermediate_inputs and limiting_capital_inputs are now TFP-scaled in set_targets() (from PR #57). This removes the duplicate scaling in compute_production() to avoid applying TFP twice to the limiting stock constraint. Labour scaling is kept since it's not pre-scaled elsewhere.
Apply TFP multiplier to limiting inputs in set_targets()
The hurdle rate was not affecting investment decisions because the profitability formula was incorrectly comparing a present value (cost_reduction * (1+r)/r) against the candidate investment, which always resulted in the PV being 50-500x larger than the investment. Changes: - Add is_investment_profitable() method with correct formula from investment_decision.md: (I/V)^(1-α) ≤ φ * (1+r_h)/r_h - Use nominal production (price × physical production) for dimensional correctness - I/V must be dimensionless - Add firm_industries parameter to get firm-specific prices - Include unit costs check (zero unit costs = no savings possible) - Update TFP production tests to pass pre-scaled limiting inputs, reflecting that set_targets() now pre-scales these values Fixes #60
…ivity Fix hurdle_rate insensitivity in productivity investment planner
agurgone
left a comment
There was a problem hiding this comment.
Thanks for the fixes here — the PR clearly improves two important behaviors:
(1) hurdle-rate sensitivity now works, and
(2) TFP can propagate into target setting instead of being blocked by pre-TFP limits.
I do see a critical consistency issue in the SimpleTFPGrowth path:
Investment planning now uses nominal output V = p*y (budget/profitability), e.g. nominal_production = firm_prices * current_production.
But realized TFP growth still uses investment / production where production is physical quantity.
This means price levels affect how much investment is approved, but growth is applied on a different denominator. High-price sectors can get mechanically higher realized TFP growth for the same physical scale.
Code refs:
planner nominal logic: productivity_investment_planner.py (Simple/Optimal planners)
realized growth denominator: productivity_growth.py (SimpleTFPGrowth.compute_tfp_growth)
I’d suggest unifying the units end-to-end:
either compute growth from nominal intensity consistently, or
keep physical-output growth and convert/normalize investment accordingly before growth is applied.
Two additional issues:
In prepare_buying_goods, extra productivity demand is distributed by existing capital weights, not by planned_technical_investment composition, so intended vs purchased bundles can diverge.
Planner silently falls back to price=1 if firm_industries is missing; better to raise to avoid hidden behavioral changes.
Overall: direction is good, but I’d block merge until the denominator/unit consistency is resolved.
Generated by Codex on my request
|
Thanks @agurgone ! I'll try to propose something and get back to you asap |
This is meant to address a bug found by Deven Azevedo from SESIT @devenaz , who noticed that firms were not properly taking into account their productivity investment needs for purchasing when buying capital inputs. This is now fixed by adding that quantity to the target capital inputs for purchasing.
In addition to this I have added a test that makes sure that when running the simulation with the price setting parameters set to 0 (meaning inflation is pushed towards 0 by preventing firms from changing prices) then we do observe positive GDP growth when setting up exogenous TFP growth.