Firm-Bank Macro ABM Model
How do heterogeneous firm balance sheets, bank lending networks, and capital buffer constraints turn idiosyncratic firm defaults into aggregate credit crunches and business-cycle fluctuations?
Understand the mathematics
Follow the same equations and assumptions one section at a time or in a continuous reading.
Hover or focus a symbol defined in this model to find its exact matches. Select it to keep the highlight; Escape clears the selection.
Odd+D Protocol: Model Specification
The ODD+D (Overview, Design concepts, Details + Decision-making) protocol is the standard documentation format for agent-based models, introduced by Grimm et al. (2006, 2010) and extended by Muller et al. (2013) for decision-making. The protocol is applied here to the firm-bank macro ABM family.
PURPOSE: The model investigates how heterogeneous firm balance sheets, bank lending networks, and capital buffer constraints generate endogenous business cycles, default cascades, and credit crunches that cannot be derived from representative-agent assumptions. The primary target audience is macroprudential regulators evaluating capital buffer calibrations and financial stability authorities assessing systemic risk from firm-bank network concentration.
ENTITIES, STATE VARIABLES, AND SCALES: The model contains four entity types. Firms ( to in research runs, 30 to 100 in toy demonstrations) carry state variables: net worth (continuous, can be negative at default), capital stock (continuous, positive), debt (continuous, non-negative), productivity parameter (continuous, positive), and profit rate (derived). Banks ( to ) carry: loan portfolio (vector of active credit links with outstanding amounts), equity capital (continuous, positive until failure), capital ratio (derived), deposit base (continuous, positive), and lending standard parameters (spread function, credit limit rule). The household/consumption sector (1 aggregate block) carries: aggregate income and consumption demand. The policy block carries: base interest rate, minimum capital ratio, and optional countercyclical buffer rule. The temporal scale is quarterly periods over 25 to 100 quarters. The bipartite network structure ( adjacency matrix) is a first-class state variable that evolves as firms enter and exit.
PROCESS OVERVIEW AND SCHEDULING: Each period proceeds in fixed order: (1) idiosyncratic productivity shocks arrive at the firm level, (2) firms compute desired investment and external financing needs, (3) the credit market operates - firms apply to banks, banks screen applications based on firm leverage and own capital position, interest rate spreads are set, credit is allocated or rationed, (4) firms produce using their capital stock, (5) goods are sold and revenues realized, (6) firms compute profits and service debt, (7) defaults are realized - insolvent firms (net worth below zero) or illiquid firms (cash flow insufficient for debt service) are flagged, (8) losses are allocated to creditor banks based on LGD and exposure, (9) bank capital is updated and failed banks are resolved, (10) the prudential regulator checks buffer rules and adjusts requirements, (11) the central bank updates the base rate, (12) firm entry and exit occur - bankrupt firms are removed and new firms enter with draws from the entry distribution. This ordering ensures that defaults are conditioned on current-period production outcomes and credit costs, not on stale values.
Firm net worth evolves by adding operating profit and subtracting debt service. When net worth falls below zero, the firm is insolvent and defaults. Rate convention: is quoted as an ANNUAL rate everywhere in this file (base rate plus spread) and the period is a quarter, so the interest actually debited each period is .
Firm profit: revenue (the goods-market price index times Cobb-Douglas output in capital with idiosyncratic productivity) minus the wage bill and capital depreciation. The price term is the same index the aggregate-demand step updates, and it is the only route by which a demand shortfall reaches firm balance sheets - a profit function without a price term would leave the goods market disconnected from default. The stochastic component enters through the productivity parameter .
Loan demand is the gap between desired capital stock and internal funds (net worth). Firms with sufficient net worth self-finance; those with a gap seek bank credit.
The firm-specific lending rate has three components: the base rate, a risk premium proportional to the firm's leverage ratio, and a capital-tightness surcharge that activates when the bank's capital ratio falls below the regulatory minimum.
Default trigger, in the single form used in every tab. INSOLVENCY is the stock condition: net worth below zero. ILLIQUIDITY is the flow condition: operating profit is not enough to pay the interest bill, i.e. . The two conditions are separate and either one is sufficient - illiquidity carries no net-worth side condition, and the illiquidity test is 'cannot cover interest', not 'loses more than the interest bill' (which is what would say, a far more extreme event that would almost never fire).
Bank 's equity change from defaults. The defaulting firm's remaining capital stock is seized and credited to the creditor bank, so the recovery has an actual asset behind it: it is , and the loss is the exposure net of that recovery. When the firm's capital fully backs the recovery this collapses to the familiar ; when the firm's capital has already been eroded, the bank loses more than LGD times exposure. Note this is a currency amount subtracted from equity (also a currency amount); the capital RATIO is recomputed afterwards as equity over risk-weighted assets.
Micro-foundation of the external finance premium
The spread term is the ABM analog of the Bernanke-Gertler-Gilchrist (1999) external finance premium. In the BGG model, the premium arises from costly state verification under asymmetric information. In the ABM, it is a calibrated behavioral rule that matches the same empirical pattern: firms with higher leverage pay more for credit. The advantage of the ABM is that the premium operates at the individual firm-bank pair level, not as an economy-wide average, so the distributional effects of credit tightening are captured.
Network formation: random vs. preferential attachment
The baseline model assigns firms to banks randomly with probabilities proportional to bank size. This produces a degree distribution where large banks have more connections, matching the empirical observation that credit networks are scale-free (a few large banks serve most firms). Variants use preferential attachment (firms more likely to connect to banks they have borrowed from before) or competitive matching (firms shop for the lowest rate across multiple banks). The network topology materially affects cascade dynamics: scale-free networks are robust to random shocks but fragile to targeted failures of hub banks.
Why both insolvency and illiquidity matter
Insolvency (negative net worth) captures the stock-based failure mode: accumulated losses have wiped out equity. Illiquidity (insufficient cash flow to service debt) captures the flow-based failure mode: a temporary productivity shock makes the firm unable to pay interest even though it still has positive net worth. Empirically, both channels matter - some firms fail because they are overleveraged (stock problem), others because they hit a bad quarter (flow problem). Models that use only insolvency undercount defaults during sharp but temporary downturns.
Transition checks
Agent update
The aggregate is computed after individual states are updated. If the rule is nonlinear or stochastic, the aggregate can change abruptly even when the plotted line connects adjacent periods.
Each point is an aggregate after one model update. The connecting line helps the eye, but the law is discrete.
Do not read the line as a continuous differential equation unless one is stated.
Cutoff and contagion
The indicator changes value discontinuously at . Aggregates inherit that discontinuity when enough agents sit near the cutoff.
A cutoff creates a kink or jump because the update rule changes at the threshold.
Do not force a smooth explanation onto a chart section driven by threshold crossing.
Variable timing
Agent state
Agent states update at dates. Abrupt aggregate movement can come from many small state changes applied at once.
Aggregate readout
The aggregate can jump when the distribution changes shape or many agents cross a boundary.
Threshold indicator
The indicator turns on at the cutoff. That creates a discontinuity in the micro rule and possibly the aggregate.