FirmsPayDividends#
- class bamengine.events.revenue.FirmsPayDividends[source]#
Bases:
EventFirms distribute dividends from positive profits to households.
Profitable firms (net_profit > 0) pay dividends. Unprofitable firms retain all losses. Dividends are distributed equally to all households, maintaining stock-flow consistency in the model.
Algorithm
For each firm i:
If \(NP_i > 0\) (profitable): - Dividends: \(Div_i = \delta \times NP_i\) - Retained: \(RP_i = (1 - \delta) \times NP_i\) - Pay dividends: \(A_i \leftarrow A_i - Div_i\)
Else (unprofitable): - Retained: \(RP_i = NP_i\) (retain all losses) - No dividends paid
For households:
Total dividends distributed equally: \(div_j = \sum Div_i / N_H\)
Household savings increased: \(SA_j \leftarrow SA_j + div_j\)
Mathematical Notation
\[ \begin{align}\begin{aligned}\text{If } NP_i > 0:\\\quad Div_i = \delta \times NP_i\\\quad RP_i = (1 - \delta) \times NP_i\\\quad A_i \leftarrow A_i - Div_i\\\text{Else:}\\\quad RP_i = NP_i\\\text{Dividend distribution to households:}\\\quad div_j = \frac{\sum_i Div_i}{N_H} \quad \forall j\\\quad SA_j \leftarrow SA_j + div_j\end{aligned}\end{align} \]where \(\delta\) = dividend payout ratio (config), \(N_H\) = number of households.
Examples
>>> import bamengine as be >>> sim = be.Simulation.init(n_firms=100, seed=42) >>> initial_funds = sim.bor.total_funds.copy() >>> initial_savings = sim.cons.savings.copy() >>> event = sim.get_event("firms_pay_dividends") >>> event.execute(sim)
Check total dividends paid:
>>> import numpy as np >>> profitable = sim.bor.net_profit > 0 >>> dividends = sim.config.delta * sim.bor.net_profit[profitable] >>> total_dividends = dividends.sum() >>> total_dividends 420.0
Verify funds decreased by dividends:
>>> funds_decrease = initial_funds - sim.bor.total_funds >>> np.allclose(funds_decrease[profitable], dividends) True
Verify household savings increased:
>>> savings_increase = sim.cons.savings - initial_savings >>> np.allclose(savings_increase.sum(), total_dividends) True
Notes
This event must execute after FirmsValidateDebtCommitments (need net_profit).
Net worth is NOT updated here (happens in bankruptcy phase).
Dividend payout ratio δ typically 0.1-0.3 (10-30% of profits).
Modeling Note: Equal distribution of dividends to all households is a simplification that avoids introducing a separate “capitalist” role. Since all households share the same consumption function based on savings ratios, the specific distribution pattern does not meaningfully affect aggregate consumption dynamics. What matters for model validity is stock-flow consistency: dividends debited from firms are credited to households. The Shareholder role tracks per-period dividends for metric adjustment (e.g., buffer-stock MPC correction).
See also
FirmsValidateDebtCommitmentsCalculates net_profit
bamengine.events._internal.firms_pay_dividendsImplementation
- execute(sim)[source]#
Execute the event’s logic.
Mutates simulation state in-place. This method must be implemented by all Event subclasses.
- Parameters:
sim (
Simulation) – The simulation instance containing all state and configuration.- Returns:
All mutations are in-place.
- Return type:
Examples
Implement execute in a custom event:
>>> from bamengine import event, ops >>> >>> @event ... class CustomPricingEvent: ... def execute(self, sim): ... prod = sim.get_role("Producer") ... # Apply 10% markup to all prices ... new_prices = ops.multiply(prod.price, 1.1) ... ops.assign(prod.price, new_prices)
Access configuration and RNG:
>>> @event ... class StochasticEvent: ... def execute(self, sim): ... shock = sim.config.h_rho ... random_values = sim.rng.uniform(0, shock, size=sim.n_firms) ... # Use random_values in calculations
Notes
The execute method receives full Simulation access, including: - All roles: sim.get_role(“RoleName”) or sim.prod, sim.wrk, etc. - Configuration: sim.config - RNG: sim.rng - Economy state: sim.ec
- __init__()#
- name = 'firms_pay_dividends'#