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

sigma

R&D share of profits (0 to sigma_max), decreasing with financial fragility

rnd_intensity

Expected productivity gain (\(\mu\)), derived from sigma and profit

productivity_increment

Actual productivity gain drawn from exponential distribution each period

fragility

Financial fragility metric (wage bill / net worth)

Events#

Event

Hook

Description

FirmsComputeRnDIntensity

after firms_validate_debt_commitments

Compute R&D share \(\sigma\) and intensity \(\mu\) from profits and fragility

FirmsApplyProductivityGrowth

after firms_compute_rnd_intensity

Draw productivity increment from \(\text{Exp}(\mu)\) and add to labor productivity

FirmsDeductRnDExpenditure

after firms_apply_productivity_growth

Reduce net profit by \((1 - \sigma)\) factor before dividends

Configuration#

Parameter

Default

Description

sigma_min

0.0

Minimum R&D share (for highly fragile firms)

sigma_max

0.1

Maximum R&D share (for financially healthy firms)

sigma_decay

-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 Extension bundle for sim.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 with sim.use_events(*RND_EVENTS).

execute(sim)[source]#

Execute R&D intensity computation.

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 with sim.use_events(*RND_EVENTS).

execute(sim)[source]#

Execute productivity growth.

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 with sim.use_events(*RND_EVENTS).

execute(sim)[source]#

Execute R&D expenditure deduction.

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):

\[\alpha_{t+1} = \alpha_t + z_t\]

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):

\[\mu = \sigma \cdot \frac{\pi}{p \cdot Y}\]

R&D Share (parameterized):

\[\sigma = \sigma_{min} + (\sigma_{max} - \sigma_{min}) \cdot \exp(k \cdot \text{fragility})\]

Net Worth Evolution (Equation 3.16):

\[A_t = A_{t-1} + (1-\sigma)(1-\delta)\pi_{t-1}\]
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 with sim.use_events(*RND_EVENTS).

execute(sim)[source]#

Execute R&D intensity computation.

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 with sim.use_events(*RND_EVENTS).

execute(sim)[source]#

Execute productivity growth.

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 with sim.use_events(*RND_EVENTS).

execute(sim)[source]#

Execute R&D expenditure deduction.

name = 'firms_deduct_rn_d_expenditure'#

See also