report agent based modeling(musat valentina nicoleta)

6

Click here to load reader

Upload: crucozbaur

Post on 29-May-2017

213 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Report Agent Based Modeling(Musat Valentina Nicoleta)

Report

Introduction to Agent Based Modeling

Student: Musat Valentina Nicoleta

Page 2: Report Agent Based Modeling(Musat Valentina Nicoleta)

The main topic of the lecture was the Agent Based Model (ABM), a model that simulates the

interaction between a number of heterogeneous agents, and between the agents and the environment.

The most important steps that need to be followed in order to do an ABM are: the starting

point, in which the heterogeneous agents are presented; theory, in which the behavioral rules are

stated; codification, based on rules used in order to write the code lines and validation, which includes

the calibration of the parameters, running of the simulation, analysis of the emerging properties of the

model and their comparison with the real world phenomenon

In macroeconomic ABM, the interaction of heterogeneous agents allows to compute aggregate

variables from the bottom up. Furthermore, through ABM, the model can be compared to the real

empirical evidence (cross sectional), and at macroeconomic level as well.

The characteristics of MABM are the autocatalytic process, the externalities (spillover effects)

and the non-linearities, due to interaction.

Several models were shown during the presentation:

MABM Mark 0

This model includes agents like households and firms; the market is the goods and labor market and the

simplest version assumes that there are only consumption goods and only labor is used for the

production of the consumption goods (no capital).

For more sophisticated versions, investment goods can be included, in order to obtain consumption

goods, investment goods and labor are used, and the workers` skills and the qualities of the investment

goods bring a contribution to the growth.

MABM Mark 1

The model includes agents like households, firms, banks; the market consists of goods, labor, credits,

and deposits. The simple version assumes that only consumption goods exist and only labor is used in

order to produce the consumption goods, while the sophisticated version assumes that there exist

investment goods and consumption goods; investment and labor is used in order to produce the

consumption goods.

MBU

This model includes households having roles like: supply labor, buying consumption goods, holding

deposits; firms: demanding labor, producing and selling consumption goods, demanding bank loans; and

banks having roles like: receiving deposits, offering loans to firms.

The market consists of: labor market, consumption goods’ market, bank loans and deposits market.

The behaviour: agents will adopt rules of thumb, their behaviour changes adaptively, the market is fully

decentralized and characterized by continuous search and matching process, and the transactions can

occur at “false prices”.

Next, the focus was shifted to the financial accelerator, a financial theory that stresses out that a

small change in financial markets can lead to a large change in economic conditions and create a

feedback. In cases in which firms face financial gaps, there are two ways through which the gap can be

covered:

Page 3: Report Agent Based Modeling(Musat Valentina Nicoleta)

1. internal finance, through net worth and profit

2. external finance, through credits and new equities

But, taking into consideration the information asymmetry between lenders and borrowers, the

lenders cannot access the information on investment opportunities of the borrowers. The premium

increases with the borrower`s financial fragility (like leverage, which is total loans/total equities) and a

change in the monetary policy (for example an increase in the risk-free rate) reduces the capacity of

accumulating internal sources and amplifies the shock.

Supply of labor, search& matching process

It was assumed that we have H workers, each one supplying inelastically one unit of

labour/period (quarters). A person that is not employed will look for a job, through visits at companies,

but assuming that there exist transaction costs imposed by the visits, it means that the unemployed

worker will search just in a sample of the economy, in a finite number of firms(2 in this case).

The unemployed person’s best option will be the firm that offers the highest wage, and once the

unemployed finds a job, he signs a labor contract (8 quarters in this case). If a contract has expired the

person will be considered unemployed, and he/she will search for a job first inside, and then outside the

company.

A worker can be fired, due to firm`s activity reduction or lack of money for the payment of the

salary, but there are no hiring/firing costs.

Consumption

It is assumed that the worker will receive a wage which will be deposited at a bank. The

propensity to consume out of wealth is spent on consumption goods, and the marginal propensity to

consume out of wealth is decreasing with wealth.

If a worker becomes unemployed, he will consume out of his deposits (dissaving) and since in

the model there are no loans present, the consumption will get frozen in the model. For more

sophisticated models, loans to households and refinancing can be included.

Capitalists (owners of the firms)

There is a number of F capitalists, that receive dividends from the firm when it makes profit

(after paying the interest and loan), the dividends being further deposited at the bank. The propensity to

consume out of wealth is spend on consumption goods, and the marginal propensity to consume out of

wealth is decreasing with wealth. If the capitalists do not receive dividends, they will dissave, so their

consumption will become frozen.

Search and matching on the goods market

The consumers (workers and capitalists) will visit firms that sell goods, but taking into

consideration the transactional costs that make the search more costly, only a finite number of firms will

be visited. If the most preferred firm is in short supply, the rest will be covered by the following best

option. If the consumer is not satisfied at all, he will end up saving involuntarily.

Page 4: Report Agent Based Modeling(Musat Valentina Nicoleta)

Firms

Having the production output , using only labor , and having linear technology =α ,

the firm knows its status quo q=( ) and the average price of all the firms. The firm doesn`t know

exactly the demand for its products , which means that it doesn`t know the equilibrium position

A=( , ). From expectations on demand, the firm sets desired production at a level meant to meet the

expected demand =

Inventories

-if <

=> involuntary inventory, which means that the demand was overestimated

-if ≥

=> no inventory accumulation, which means that the demand has been

underestimated.

Taking into consideration the fact that the goods are non-storable, the firms cannot carry over goods

from one period to another.

Regarding the price and quantity decision, the firm has the possibility to receive two signals, one from

the competitors` price and the other from the inventories` stock.

If the firm decides to increase its production quantity, if its prices are higher than the competitors and

the inventories are equal to zero, then they will be required to increase their workforce as well.

Essentially, the firm has to compare the desired workforce with the actual workforce. If the desired

workforce is higher than the actual, then the firm will start to look for new employees whereas if the

desired workforce is smaller than the actual, the firm has to fire employees.

Another subject that was discussed was the minimum wage, which is a result of centralized bargaining

between trade unions and associations of employees, and also the result of the indexation of the wage

to inflation.

There are two cases, one in which the firm posts vacancies, which means that it is eager to pay a wage

higher than the minimum in order to attract new employees, and the second case in which there are no

vacancies, and the firm is satisfied with its level of workers, or it decides to fire employees.

The next subject discussed was the financial gap. If a firm wants to increase its production, post new

vacancies and it has decided upon the wage level, then the firm will need more resources. If the internal

resources are in short supply with respect to the wage bill, there are two possible outcomes: the first

one illustrates the firm able to entirely self-finance the wage bill, and the second scenario presents the

firm in need of a bank loan.

Searching and matching on the credit market assumes that firms in need of external funds will contact a

number of finite banks starting from the one that offers the lowest interest rate; and that the demand

for credit is divisible, so that is the first bank is in short supply, the rest will be covered from the

remaining banks. At the end, if the funds are still not sufficient to pay the wage, the firm will fire

redundant workers, thus, decreasing its production.

Page 5: Report Agent Based Modeling(Musat Valentina Nicoleta)

Regarding the banks, it was presented that they will offer a total amount of credits equal to a multiple of

its equity base or net worth. A bank will offer a standard debt contract which consists of an interest rate

and the corresponding installment. The interest rate is then determined by means of mark-up that

depend on the leverage of the firm and the cost structure of the lender (meant to help firms to

differentiate the lenders).Next, the bank sequences the borrowers’ application according to the leverage

(ascending) and satisfies them until the credit supply is exhausted.

About the profit & loss, in the case of the firm it has been said that if the earnings before interest are

high enough, the firm will be able to validate the debt commitments whereas in the case of the bank,

the profits coincide with the interest payments received, since there are no administrative costs.

The sequence of events is the following:

1. Each firm has to compute its net worth for period t+1, updating it in t with the retained profits.

There are two possible outcomes:

a) If the net worth is less than 0, the firm goes bankrupt and exits. This will lead to first, a

generation of a negative demand spillover for the other firms due to the loss of employment

and wage income and second, an alteration of the banks’ net worth, which will further

influence the amount of credit extended in the future.

It was assumed the bankrupt firm will be replaced by a new entrant whose initial condition is set

below the average size of the incumbent firms.

b) If the net worth is higher than 0, then the firm can proceed to the next steps.

2. The labour market opens

3. The credit market opens

4. Consumption goods’ market opens

5. The agents have to perform their accounting and (potential) survival (in case of firms and banks)

In the last part, the results were presented, more specific: the outline, the parameters (no. of

households, firms and banks, the time period, dividend payout ratio, the policy rate and so forth), the

collection of artificial data and running of the model, the analysis of robustness to changes in

parameters(Montecarlo methods), Philips curve, Beveridge curve and Okun’s law.

During the lab, we got acquainted with Matlab, that is used when considering models that contain

thousands of agents.

Topics covered:

I. Creating: vectors, row vectors, column vectors, a matrix with random 0 and 1, a matrix of

random numbers:(unit uniform distribution), a matrix from a normal distribution (includes

negative numbers), uniform distribution with integers, a distribution of numbers, knowing the

expected value of the distribution and the standard deviation

II. How to obtain the value of a specific element in a matrix, as well as the exception of the first

element

III. How to manipulate vectors and matrixes:

Page 6: Report Agent Based Modeling(Musat Valentina Nicoleta)

Delete a row of a matrix, a single element of a matrix, the first 3 rows until the end;

Add new row to the matrix, a new column and adding between the lines of the matrix;

IV. Sort functions

V. Find the max and min of the vector

VI. Adding , multiplying, power 2 of matrixes

VII. Functions: if, while, switch, for

VIII. Toy model for the goods market