Growth+ (R&D) Extension#
Based on Section 3.8 of Delli Gatti et al. (2011)
The Growth+ extension adds endogenous productivity growth via R&D investment. Profitable firms invest a fraction of their profits in R&D, and their labor productivity grows stochastically based on R&D intensity. This creates persistent firm-level heterogeneity and aggregate productivity growth.
Quick Start#
import bamengine as bam
from extensions.rnd import RND
sim = bam.Simulation.init(seed=42)
sim.use(RND)
results = sim.run(n_periods=1000, collect=True)
Role Fields#
Field |
Description |
|---|---|
|
R&D share of profits (0 to |
|
Expected productivity gain (\(\mu\)), derived from sigma and profit |
|
Actual productivity gain drawn from exponential distribution each period |
|
Financial fragility metric (wage bill / net worth) |
Events#
Event |
Hook |
Description |
|---|---|---|
|
after |
Compute R&D share \(\sigma\) and intensity \(\mu\) from profits and fragility |
|
after |
Draw productivity increment from \(\text{Exp}(\mu)\) and add to labor productivity |
|
after |
Reduce net profit by \((1 - \sigma)\) factor before dividends |
Configuration#
Parameter |
Default |
Description |
|---|---|---|
|
0.0 |
Minimum R&D share (for highly fragile firms) |
|
0.1 |
Maximum R&D share (for financially healthy firms) |
|
-1.0 |
Decay rate for sigma as a function of fragility |
Expected behavior: Rising average labor productivity over time, increasing firm size heterogeneity, and a positive long-run growth trend in output.
API Reference#
R&D extension for endogenous productivity growth.
This extension implements Section 3.8 of Delli Gatti et al. (2011), adding endogenous productivity growth through R&D investment.
Usage:
from extensions.rnd import RND
sim = bam.Simulation.init(**config)
sim.use(RND)
results = sim.run()
Or manually:
from extensions.rnd import RnD, RND_EVENTS, RND_CONFIG
sim = bam.Simulation.init(**config)
sim.use_role(RnD)
sim.use_events(*RND_EVENTS)
sim.use_config(RND_CONFIG)
results = sim.run()
- Components:
RnD: Role tracking R&D investment and productivity increments
FirmsComputeRnDIntensity: Event computing R&D share and intensity
FirmsApplyProductivityGrowth: Event applying productivity gains
FirmsDeductRnDExpenditure: Event adjusting net profit for R&D expenditure
RND_EVENTS: List of all R&D event classes for use with
sim.use_events()RND_CONFIG: Default R&D parameters for use with
sim.use_config()RND: Pre-built
Extensionbundle forsim.use()RND_COLLECT: Suggested data-collection config for
sim.run(collect=...)
- class extensions.rnd.RnD(sigma, rnd_intensity, productivity_increment, fragility)[source]#
R&D state for Growth+ extension.
Tracks R&D investment decisions and productivity increments for firms.
- Parameters:
sigma (
Float) – R&D share of profits (0.0 to 0.1). Higher values mean more investment in R&D. Decreases with financial fragility.rnd_intensity (
Float) – Expected productivity gain (mu). Scale parameter for the exponential distribution from which actual gains are drawn.productivity_increment (
Float) – Actual productivity increment (z) drawn each period. Added to labor_productivity.fragility (
Float) – Financial fragility metric (W/A = wage_bill / net_worth). High fragility leads to lower R&D investment.
- sigma#
- rnd_intensity#
- productivity_increment#
- fragility#
- name = 'RnD'#
- class extensions.rnd.FirmsComputeRnDIntensity[source]#
Compute R&D share and intensity for firms.
Calculates: - fragility = wage_bill / net_worth - sigma = sigma_min + (sigma_max - sigma_min) * exp(sigma_decay * fragility) - mu = sigma * net_profit / (price * production)
Requires extension parameters: sigma_min, sigma_max, sigma_decay Firms with non-positive profits have sigma = 0 (no R&D).
Note: This event is positioned after ‘firms_validate_debt_commitments’ (before ‘firms_pay_dividends’) via the
@event(after=...)hook so that R&D deducts from net profit before dividend distribution. Apply withsim.use_events(*RND_EVENTS).- name = 'firms_compute_rnd_intensity'#
- class extensions.rnd.FirmsApplyProductivityGrowth[source]#
Apply productivity growth based on R&D.
For firms with positive R&D intensity (mu > 0): - Draw z from Exponential(scale=mu) - Update: labor_productivity += z
This implements equation 3.15 from Macroeconomics from the Bottom-up.
Note: This event is positioned after ‘firms_compute_rnd_intensity’ via the
@event(after=...)hook. Apply withsim.use_events(*RND_EVENTS).- name = 'firms_apply_productivity_growth'#
- class extensions.rnd.FirmsDeductRnDExpenditure[source]#
Adjust net profit for R&D expenditure.
Modifies net profit before dividend distribution: - new_net_profit = old_net_profit * (1 - sigma)
This implements the (1-sigma) factor in equation 3.16. By reducing net_profit before
firms_pay_dividends, dividends correctly equal delta * (1-sigma) * pi, matching book Section 3.8.Note: This event is positioned after ‘firms_apply_productivity_growth’ via the
@event(after=...)hook. Apply withsim.use_events(*RND_EVENTS).- name = 'firms_deduct_rn_d_expenditure'#
R&D role definition for Growth+ extension.
This module defines the RnD role that tracks R&D investment decisions and productivity increments for firms.
- class extensions.rnd.role.RnD(sigma, rnd_intensity, productivity_increment, fragility)[source]#
R&D state for Growth+ extension.
Tracks R&D investment decisions and productivity increments for firms.
- Parameters:
sigma (
Float) – R&D share of profits (0.0 to 0.1). Higher values mean more investment in R&D. Decreases with financial fragility.rnd_intensity (
Float) – Expected productivity gain (mu). Scale parameter for the exponential distribution from which actual gains are drawn.productivity_increment (
Float) – Actual productivity increment (z) drawn each period. Added to labor_productivity.fragility (
Float) – Financial fragility metric (W/A = wage_bill / net_worth). High fragility leads to lower R&D investment.
- sigma#
- rnd_intensity#
- productivity_increment#
- fragility#
- name = 'RnD'#
R&D events for Growth+ extension.
This module provides the three custom events for the Growth+ scenario from section 3.8 of Delli Gatti et al. (2011).
The extension adds endogenous productivity growth via R&D investment: - Firms invest a portion of profits in R&D (sigma = RnD share) - R&D intensity determines expected productivity gains - Productivity increments are drawn from exponential distribution - Higher financial fragility leads to lower R&D investment
Key Equations#
Productivity Evolution (Equation 3.15):
Where \(z_t \sim \text{Exponential}(\mu)\) represents the productivity increment drawn from an exponential distribution with scale parameter \(\mu\).
R&D Intensity (expected productivity gain):
R&D Share (parameterized):
Net Worth Evolution (Equation 3.16):
- class extensions.rnd.events.FirmsComputeRnDIntensity[source]#
Compute R&D share and intensity for firms.
Calculates: - fragility = wage_bill / net_worth - sigma = sigma_min + (sigma_max - sigma_min) * exp(sigma_decay * fragility) - mu = sigma * net_profit / (price * production)
Requires extension parameters: sigma_min, sigma_max, sigma_decay Firms with non-positive profits have sigma = 0 (no R&D).
Note: This event is positioned after ‘firms_validate_debt_commitments’ (before ‘firms_pay_dividends’) via the
@event(after=...)hook so that R&D deducts from net profit before dividend distribution. Apply withsim.use_events(*RND_EVENTS).- name = 'firms_compute_rnd_intensity'#
- class extensions.rnd.events.FirmsApplyProductivityGrowth[source]#
Apply productivity growth based on R&D.
For firms with positive R&D intensity (mu > 0): - Draw z from Exponential(scale=mu) - Update: labor_productivity += z
This implements equation 3.15 from Macroeconomics from the Bottom-up.
Note: This event is positioned after ‘firms_compute_rnd_intensity’ via the
@event(after=...)hook. Apply withsim.use_events(*RND_EVENTS).- name = 'firms_apply_productivity_growth'#
- class extensions.rnd.events.FirmsDeductRnDExpenditure[source]#
Adjust net profit for R&D expenditure.
Modifies net profit before dividend distribution: - new_net_profit = old_net_profit * (1 - sigma)
This implements the (1-sigma) factor in equation 3.16. By reducing net_profit before
firms_pay_dividends, dividends correctly equal delta * (1-sigma) * pi, matching book Section 3.8.Note: This event is positioned after ‘firms_apply_productivity_growth’ via the
@event(after=...)hook. Apply withsim.use_events(*RND_EVENTS).- name = 'firms_deduct_rn_d_expenditure'#
See also
Model Extensions for writing custom extensions
Growth+ validation:
python -m validation.scenarios.growth_plus