# Overview

## Purpose

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..

## Entities, state variables, and scales

• Agents: Firms (also know as producers), workers (also know as consumers and households) and banks.

• Environment: Virtual or geographically characterized markets.

• Labor market.

• Goods market

• Credit market.

• State variables: Productivity, net worth, wage and loans.

## Process overview and scheduling

1. Firms calculate production based on expected demand.

2. A decentralized labor market opens.

3. A decentralized credit market opens.

4. Firms produce.

5. Market for goods open.

6. Firms will pay loan and dividends.

7. Firms and banks will survive or die.

8. Replacing of bankrupt firms/banks.

# Design concepts

### Basic Principles

Neo classical economy.

### Emergence

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

### Objectives

Just firms has the objetive of maximizing their net worth.

### Learning

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

### Prediction

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.

### Sensing

• Firms are able to perceive their produced quantity, their price and the market price, offered wages, profits, net value, their labor force and interest rate of randomly chosen banks.

• Workers/consumers perceive the size of firms visited in the previous period, prices published by the firms in actual period and wages offered by the firms.

• Banks are able to sense net value of potential borrower (firms) in order to calculate interest rate.

### Interaction

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

### Stochasticity

Elements that have random shocks are:

• Determination of wages (when vacancies are offered), wages-shock-xi.

• Determination of contractual interest rate offered by banks to
firms, interest-shock-phi.

• Strategy to set prices, price-shock-eta.

• Strategy to determine the quantity to produce, production-shock-rho.

### Collectives

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

### Observation

Along simulation are observed:

• Logarithm of real GDP.

• Unemployment rate.

• Annual inflation rate.

At end of simulation are computed:

• Distribution of the size of firms.

# Details

## Initialization

Parameter Parameter Value
I Consumers 500
J Producers 100
K Banks 10
T Periods 1000
C<sub>P</sub> Propensity to consume of poorest people 1
C<sub>R</sub> Propensity to consume of richest people 0.5
h<sub>&xi</sub> Maximum growth rate of wages 0.05
H<sub>&eta</sub> Maximum growth rate of prices 0.1
H<sub>&rho</sub> Maximum growth rate of quantities 0.1
H<sub>&phi</sub> Maximum amount of banks’ costs 0.1
Z Number of trials in the goods market 2
M Number of trials in the labor market 4
H Number of trials in the credit market 2
Minimum wage (set by a mandatory law) 1
P<sub>t<sub></sub></sub> Base price 1
&delta Fixed fraction to share dividends 0.15
Interest rate (set by the central monetary authority) 0.07

## Input data

No input data were needed to represent process.

## Submodels

1. Production with constant returns to scale and technological multiplier.

$Y_{it}&space;=&space;\alpha_&space;{it}&space;L_{it},&space;\alpha_{it}>&space;0$.

2. Desired production level $Y_&space;{it}&space;^&space;d$ is equal to the expected
demand $D_{it}^d$.

3. Desired labor force (employees) $L_&space;{it}&space;^&space;d$ is

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

1. Current number of employees $L_&space;{it}&space;^&space;0$ is the sum of employees with and without a valid contract.

2. Number of vacancies offered by firms $V_&space;{it}$ is

$V_&space;{it}&space;=&space;max&space;(L_&space;{it}&space;^&space;d&space;-&space;L_&space;{it}&space;^&space;0,&space;0)$.

3. $\hat&space;{w_t}$ is the minimum wage determined by law.

4. If there are no vacancies $V_&space;{it}&space;=&space;0$, wage offered is:

$w_&space;{it}&space;^&space;b&space;=&space;max&space;(\hat&space;{w_t},&space;w_&space;{it-1})$,

1. If number of vacancies is greater than 0, wage offered is:

$w_&space;{it}&space;^&space;b&space;=&space;max&space;(\hat&space;{w_t},&space;w_&space;{it-1}&space;(1+&space;\xi_&space;{it}))$,

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

2. 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;)$

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

4. 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}$,

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

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

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

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

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

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

9. 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}))$.

10. 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)$.

11. 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.

12. 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.

13. 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.

14. 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}$

15. 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.

16. Vice versa.

17. 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}}$.

18. 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).

19. 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}

20. $\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).

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}

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

23. 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$.

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

25. 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}$

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

27. 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}$

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

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

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

30. 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}$.

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

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

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

34. 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}$.

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

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

# Reference

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

#### Release Notes

1. Set configuration of parameters.
2. Click Setup with your prefered parameters.
3. Click Go
4. Simulation will stop at 1000 ticks.
5. Initial configuration of parameters gives an average economy, according to data from World Bank.