Git Product home page Git Product logo

bammodel's Introduction

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.

Adaptation

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
CP Propensity to consume of poorest people 1
CR Propensity to consume of richest people 0.5
h&xi Maximum growth rate of wages 0.05
H&eta Maximum growth rate of prices 0.1
H&rho Maximum growth rate of quantities 0.1
H&phi 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
Pt 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.

    equation-01.

  2. Desired production level eqn-02-a is equal to the expected demand eqn-02-b.

  3. Desired labor force (employees) eqn-03-a is

    eqn-03-b.

  4. Current number of employees eqn-04 is the sum of employees with and without a valid contract.

  5. Number of vacancies offered by firms eqn-05-a is

    eqn-05-b.

  6. eqn-06 is the minimum wage determined by law.

  7. If there are no vacancies eqn-07-a, wage offered is:

    eqn-07-b,

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

    eqn-08,

  9. eqn-09-a is a random term evenly distributed between eqn-09-b.

  10. At the beginning of each period, a firm has a net value eqn-10-a. If total payroll to be paid eqn-10-b is greater than eqn-10-c, firm asks for a eqn-10-d loan:

    eqn-10-e

  11. For the loan search costs, it must be met that eqn-11

  12. In each period the eqn-12-a -thmost bank can distribute a total amount of credit eqn-12-b equivalent to a multiple of its patrimonial base:

    eqn-12-c,

  13. where eqn-13-a can be interpreted as the capital requirement coefficient. Therefore, the eqn-13-b reciprocal represents the maximum allowed leverage by the bank.

  14. Bank offers credit eqn-14-a, with its respective interest rate eqn-14-b and contract for 1 period.

  15. Payment scheme if eqn-15-a:

    eqn-15-b

  16. If eqn-16-a, bank retrieves

    eqn-16-b.

  17. Contractual interest rate offered by the bank eqn-17-a to the firm eqn-17-b is determined as a margin on a rate policy established by Central Monetary Authority eqn-17-c:

    eqn-17-d.

  18. Margin is a function of the specificity of the bank as possible variations in its operating costs and captured by the uniform random variable eqn-18-a in the interval eqn-18-b.

  19. Margin is also a function of the borrower’s financial fragility, captured by the term eqn-19-a, eqn-19-b. Where

    eqn-19-c

    is the leverage of borrower.

  20. 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 eqn-20 randomly selected banks.

  21. Each firm has an inventory of unsold goods eqn-21-a, where excess supply eqn-21-b or demand eqn-21-c is reflected.

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

    eqn-22

  23. If deviation is positive eqn-23, 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.

  24. Vice versa.

  25. In case of adjusting price to downside, this is bounded below eqn-25-a to not be less than your average costs eqn-25-b.

  26. Aggregate price eqn-26-a is common knowledge (global variable), while inventory eqn-26-b and individual price eqn-26-c private knowledge child (local variables).

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

  28. eqn-28-a is a randomized term uniformly distributed in the range eqn-28-b and eqn-28-c is the minimum price at which firm eqn-28-d can solve its minimal costs at time eqn-28-e (previously defined).

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

  30. eqn-30-a is a random term uniform distributed and bounded between eqn-30-b.

  31. Total income of households (workers/consumers) is the sum of the payroll paid to the workers (each household represents a worker) in eqn-31-a and the dividends distributed to the shareholders in eqn-31-b.

  32. Wealth is defined as the sum of labor income plus the sum of all savings eqn-32 of the past.

  33. Marginal propensity to consume eqn-33-a is a decreasing function of the worker’s total wealth (higher the wealth lower the proportion spent on consumption) defined as:

    eqn-33-b

  34. eqn-34-a is the average savings. eqn-34-b is the real saving of the eqn-34-a -th consumer.

  35. The revenue eqn-35-a of a firm after the goods market closes is equal to:

    eqn-35-b

  36. At the end of eqn-36-a period, each firm computes benefits eqn-36-b.

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

    eqn-37-a.

  38. Residual, after discounting dividends, is added to net value inherited from previous period, eqn-38-a. Therefore, net worth of a profitable firm in eqn-38-a is:

    eqn-38-b.

  39. If firm, say eqn-39-a, accumulates a net value eqn-39-b goes bankrupt.

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

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

  42. Bank’s capital

    eqn-42-a.

  43. eqn-43-a is the bank’s loan portfolio, eqn-43-b represents the portfolio of firms that go bankrupt.

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.