# BAM: The Bottom-up Adaptive Macroeconomics Model

Modeling an economy with stable macro signals, that works as a benchmark for studying the effects of the agent activities, e.g. extortion, at the service of the elaboration of public policies..

Neo classical economy.

Model as a whole has the objective of generating adaptive behavior of the agents, without the imposition of an equation that governs the actions of the agents.

Firms can adapt in each period $t$ price or amount to supply (only one of the two strategies). Adaptation of each strategy depends on the condition of the firm (level of excessive supply / demand in the previous period) and/or the market environment (the difference between the individual price and the market price in the previous period).

Just firms has the objetive of maximizing their net worth.

Firms do not have learning, they present different responses to an environment that is constantly evolving.

Firms use both their own elements and the environment to make the prediction of the quantity to be produced or the price. As an internal element, it uses the excessive amount of supply / demand in the previous period; while the environment takes the differential of its price and the market.

Macroeconomic results come from continuous adaptive dispersed interactions of autonomous, heterogeneous and rationally bounded agents that coincide in an uncertain environment.

In addition to the sets of agents (consumers, producers and banks), groups of firms and consumers are selected as an emergent property of the simulation (rich and poor).

No input data were needed to represent process.

$L_&space;{it}&space;^&space;d&space;=&space;\frac&space;{Y_&space;{it}&space;^&space;d}&space;{\alpha_&space;{it}}$.

• $\xi_&space;{it}$ is a random term evenly distributed between $(0,&space;h&space;_&space;{\xi})$.

• At the beginning of each period, a firm has a net value $A_&space;{it}$. If total payroll to be paid $W_&space;{it}$ is greater than $A_&space;{it}$, firm asks for a $B_&space;{it}$ loan:

$B_&space;{it}&space;=&space;max&space;(W_&space;{it}&space;-&space;A_&space;{it},&space;0&space;)$

• For the loan search costs, it must be met that $H&space;

• In each period the $k$ -thmost bank can distribute a total amount of credit $C_k$ equivalent to a multiple of its patrimonial base:

$C_&space;{kt}&space;=&space;\frac&space;{E_&space;{kt}}{v}$,

• where $0&space; can be interpreted as the capital requirement coefficient. Therefore, the $v$ reciprocal represents the maximum allowed leverage by the bank.

• Bank offers credit $&space;C_&space;{k}&space;$, with its respective interest rate $r_&space;{it}&space;^&space;k$ and contract for 1 period.

• Payment scheme if $A_&space;{it&space;+&space;1}>&space;0$:

$B_&space;{it}&space;(1&space;+&space;r_&space;{it}&space;^&space;k)$

• If $A_&space;{it&space;+&space;1}&space;\leq&space;0$, bank retrieves

$R_&space;{it&space;+&space;1}$.

• Contractual interest rate offered by the bank $k$ to the firm $i$ is determined as a margin on a rate policy established by Central Monetary Authority $\bar{r}$:

$R_{it}^k=\bar{r}(1+\phi_{kt}\mu(\ell_{it}))$.

• Margin is a function of the specificity of the bank as possible variations in its operating costs and captured by the uniform random variable $\phi_{kt}$ in the interval $(0,h_\phi)$.

• Margin is also a function of the borrower’s financial fragility, captured by the term $\mu&space;(\ell_&space;{it})$, $\mu&space;^&space;{'}>&space;0$. Where

$\ell_&space;{it}&space;=&space;\frac&space;{B_&space;{it}}&space;{A_&space;{it}}$

is the leverage of borrower.

• Demand for credit is divisible, that is, if a single bank is not able to satisfy the requested credit, it can request in the remaining $H-1$ randomly selected banks.

• Each firm has an inventory of unsold goods $S_&space;{it}$, where excess supply $S_&space;{it}>&space;0$ or demand $S_&space;{it}&space;=&space;0$ is reflected.

• Deviation of the individual price from the average market price during the previous period is represented as:

$P_&space;{it-1}&space;-&space;P_&space;{t-1}$

• If deviation is positive $P_&space;{it-1}>&space;P_&space;{t-1}$, firm recognizes that its price is high compared to its competitors, and is induced to decrease the price or quantity to prevent a migration massive in favor of its rivals.

• Vice versa.

• In case of adjusting price to downside, this is bounded below $P_&space;{it}&space;^l$ to not be less than your average costs $P_&space;{it}&space;^&space;l&space;=&space;\frac&space;{W_&space;{it}&space;+&space;\sum\limits_k&space;r_&space;{kit}&space;B_&space;{kit}}&space;{Y_&space;{it}}$.

• Aggregate price $P_t$ is common knowledge (global variable), while inventory $S_&space;{it}$ and individual price $P_&space;{it}$ private knowledge child (local variables).

• Only the price or quantity to be produced can be modified. In the case of price, we have the following rule: \begin{aligned} P_{it}^s= ​ \begin{cases} ​ \text{max}[P_{it}^l, P_{it-1}(1+\eta_{it})] & \text{if S_{it-1}=0 and P_{it-1}<P }\\ ​ \text{max}[P_{it}^l, P_{it-1}(1-\eta_{it})] & \text{if S_{it-1}>0 and P_{it-1}\geq ​ P} ​ \end{cases}\end{aligned}

• $\eta_&space;{it}$ is a randomized term uniformly distributed in the range $(0,&space;h_&space;\eta)$ and $P_&space;{it}&space;^&space;l$ is the minimum price at which firm $i$ can solve its minimal costs at time $t$ (previously defined).

• In the case of quantities, these are adjusted adaptively according to the following rule:

\begin{aligned} D_{it}^e= ​ \begin{cases} ​ Y_{it-1}(1+\rho_{it}) & \text{if S_{it-1}=0 and P_{it-1}\geq P} \ ​ Y_{it-1}(1-\rho_{it}) & \text{if S_{it-1}>0 and P_{it-1}< P} ​ \end{cases}\end{aligned}

• $\rho_&space;{it}$ is a random term uniform distributed and bounded between $(0,&space;h_&space;\rho)$.

• Total income of households (workers/consumers) is the sum of the payroll paid to the workers (each household represents a worker) in $t$ and the dividends distributed to the shareholders in $t-1$.

• Wealth is defined as the sum of labor income plus the sum of all savings $SA$ of the past.

• Marginal propensity to consume $c$ is a decreasing function of the worker’s total wealth (higher the wealth lower the proportion spent on consumption) defined as:

$c_&space;{jt}&space;=&space;\frac&space;{1}&space;{1+&space;\left&space;[\text&space;{tanh}&space;\left&space;(\frac&space;{SA_&space;{jt}}&space;{SAt}&space;\right)\right]&space;^&space;\beta}$

• $SA_t$ is the average savings. $SA_&space;{jt}$ is the real saving of the $j$ -th consumer.

• The revenue $R_&space;{it}$ of a firm after the goods market closes is equal to:

$R_&space;{it}&space;=&space;P_&space;{it}&space;Y_&space;{it}$

• At the end of $t$ period, each firm computes benefits $\pi_&space;{it-1}$.

• If the benefits are positive, the shareholders of firms receive dividends:

$Div_&space;{it-1}&space;=&space;\delta&space;\pi_&space;{it-1}$.

• Residual, after discounting dividends, is added to net value inherited from previous period, $A_{it-1}$. Therefore, net worth of a profitable firm in $t$ is:

$A_{it}&space;=&space;A_{it-1}+\pi_{it-1}&space;-Div_{it-1}&space;\equiv&space;A_{it-1}+&space;(1-\delta)\pi_{it-1}$.

• If firm, say $f$, accumulates a net value $A_&space;{it}&space;<0$ goes bankrupt.

• Firm that goes bankrupt is replaced with another one of smaller size than the average of incumbent firms.

• Non-incumbent firms are those whose size is above and below 5%, is used to calculate a more robust estimator of the average.

• Bank’s capital

$E_{kt}=E_{kt-1}&space;+&space;\sum&space;\limits_&space;{i&space;\in&space;\Theta}&space;r_&space;{kit-1}&space;B_&space;{kit-1}&space;-BD_{kt-1}$.

• $\Theta$ is the bank’s loan portfolio, $BD_{kt-1}$ represents the portfolio of firms that go bankrupt.

• If a bank goes bankrupt, it is replaced with a copy of the surviving banks.

• Delli Gatti, D. et. al, (2011). Macroeconomics from the Bottom-up. Springer-Verlag Mailand, Milan.

This is a companion discussion topic for the original entry at https://www.comses.net/codebases/9dacc220-8d7f-4038-b618-92bb9b1333f0/releases/1.1.0/