Multi-Agent-Based Macroeconomic Modelling

Macroeconomic modelling emerged at the end of the 20th century and by the first decade of the 21st century it had been widely accepted. However, the financial crisis of 2007 followed by the real economy crisis exposed the weaknesses of dynamic stochastic general equilibrium models (DSGE) and agent-based models became favoured. Agent-based models – better reflecting reality– assume that individuals are capable of learning from past experiences. In economics, aggregation is considered to be fundamental in the analysis of macroeconomic processes, leading to question such as: How can processes describing macroeconomics and related indicators be obtained from results generated from decisions made at a microeconomic level? Is the applied method appropriate? Are synergy possibilities considered? This study attempts to provide answers to these questions.


BRIEF DESCRIPTION OF THE MULTI-AGENT MODELLING
In reality, societal actors with independent entities have social, economic and other interactions with one other in social processes. The interactions developed in relationships shape actors and, ultimately, societies. In agent-based modelling the investigated system consists of numerous small units, so-called agents, who act as decision makers. The system behaviour depends on actors' behaviour, which means that the behaviour is not predefined at a system level. In systems of this type, operations and learning processes are decentralised and 'dispersed' across agent networks. Major characteristics of multi-agent models are as follows (Vág, 2007):  Agents are controlled from a decentralised place rather than from a centralised one.  Agents have limited information; consequently, they are boundedly rational when they make decisions.  Factors influencing decisions are also decentralised.  Agents constantly interact with each other and their interactions determine the system structure. Agent-based models can be grouped in a number of ways. The grouping depends on the methods of identification of the problems to be solved, the agents and the networks. The process characteristics to be modelled determine the model properties to be applied, that is the model architecture. Agents' behaviours -considering the specificities of the modelled system -are expressed by determined functions. Due to the supposed bounded rationality, both agents' properties and the functions expressing their behaviour change, because agents are units that are capable of learning. Consequently, the mechanism of their decision-making and the outcomes also changes. Also, during simulations the actors' behaviour develops and changes depending on their interactions and the characteristics of the environment.
In this modelling form, it is also important to define how higher, meso-and macro-level processes and events evolve from interactions between agents. In agent-based analyses emergent phenomena and synergy effects can be accepted and interpreted. Emergent means that at a system level effects that cannot be derived directly from individual decision algorithms are observed; that is, a new feature emerges in the old structure that does not have this new feature. In cases with synergy effects, a whole is greater than the sum of its parts; in other words, a team working together will produce better results than if each member of the team performs a particular activity individually.
The role of multi-agent models among even forecasting methods is consistently increasing. This process makes it easier for heterogeneous individuals to form a modelled community. If individuals' behaviour is simulated, not only the inner mental characteristics but also the environmental influences need to be considered (Vág, 2007).

CHARACTERISTICS OF THE MULTI-AGENT-BASED MACROECONOMIC MODEL
The fundamental aim of an economic analysis is to determine the confrontation of market demand and market supply considering consumer behaviour and corporate behaviour and to determine the demand and supply function in formal situations. This happens when macroeconomic processes are described (Hardwick et al., 1994).
In my previous studies I dealt with current trends in macroeconomic modelling (Karajz, 2016) and specific features of agent-based macroeconomic modelling (Karajz, 2015). In order to investigate the macroeconomic balance and its changes and fluctuations, it is critical to determine the factors affecting aggregate demand and aggregate supply. In conventional macroeconomic models, different economic sectors consist of homogenous (typical) actors (households, companies). In this context aggregation is a simple technical task.
The application of analytical models assuming dynamic and rational expectations was a major milestone in the development of macroeconomic models. The explanatory and predictive powers of analytical modelsbecause of the assumption of rational expectations -were limited. In contrast, multi-agent models are characterised by bounded rationality (possibility for 'unpredictable behaviour') and it is easier to make more accurate predictions for future events that are difficult to forecast.
In multi-agent macroeconomic models, actors are heterogeneous and have different characteristics, abilities and competencies. Each actor is boundedly rational, which means that their decisions are not always rational. An economic agent is capable of learning (for example, imitating others) and adopting the acquired knowledge to make decisions. Since there is a lack of perfection, unexpected and imperfect events may occur (for example, strikes, panics, etc.) (Hosszú & Mérő, 2017).
As noted above, by applying multi-agent models, it is possible -contrary to models used in conventional economics that assume rational decision-makers and institutions -to provide a more realistic representation. It goes without saying that demand-side and supply-side factors in multi-agent models type need to be extensively investigated. They are as follows: 1. Factors affecting the aggregate demand:  household consumption demand  corporate investments  government demand  export demand 2. Actors determining aggregate supply are divided into two groups, which are as follows:  manufacturing units meeting domestic demands  exporting manufacturers It is essential to divide the supply side into two groups because the domestic inflation is affected only by the behaviour of domestic manufacturers and not by the behaviour of export manufacturers. This methodological division makes it possible to use the model for forecasting inflation.
The next part of this study deals with the characteristics of economic actors responsible for the demand-side and supply-side factors that are required for effective modelling in a multi-agent macroeconomic model.

Household consumption demand
For measuring the aggregate consumption demand, a representative household is considered in the dynamic stochastic general equilibrium (DSGE) models discussed in the introduction. Because of the representative household assumption, households in the models are homogenous and do not represent the household sectors with heterogeneous composition existing in practice.
First, let us examine the three most popular consumption theories from this aspect. In his book A foglalkoztatás, a kamat és a pénz általános elmélete (The General Theory of Employment, Interest and Money) Keynes (1965) resolves the problem in a simple way at first sight. He expresses the present consumption as a function of present income (C=C(Y)). In the short term if there is a change in income, the willingness to consume (consumption rate) also changes and the consumption limit willingness remains stable. Also, the amount of consumption depends on the amount of income, objective circumstances, subjective needs of individuals and psychological willingness and habits (Keynes, 1965). He lists six objective and eight subjective causes altogether. If this idea is elaborated further and external and internal factors are considered, Keynes in his theory assumes a household sector comprised of heterogeneous consumers.
Modigliani's life-cycle hypothesis (Modigliani, 1988) assumes individuals who maximize profit and allocate resources in time. Resources are made up of the organisation income and the possible inherited wealth. He states that the present consumption depends on the wealth accumulated during a life cycle rather than on the present earnings. Modigliani's basic model has a number of stringent requirements that are unrealistic (his failure to consider inherited wealth or his assumption of a zero interest rate).
Friedman formulated his Permanent Income hypothesis in 1957. He expresses the consumption model with an equation system consisting of three equations. He assumes that the expected future income affects the development of the current consumption (Friedman, 1986).
= ( , , ) (1) = + (2) = + (3) Permanent consumption ( ) depends on the permanent income ( ) (Equation 1). Also, this consumption may be affected by the interest rate (i), the ratio of wealth to income (w) and the variable determining willingness to consume (u). He breaks up the current income ( ) into two components: a permanent component ( ) and a transitory component ( ) (Equation 2). Permanent income is considered as the annual average of the expected long-term income. The transitory component of income is unexpected and may be either positive or negative or may mean an income decrease or an income increase. Similarly to income, the actual consumption is also comprised of a permanent component and a transitory component (Equation 3).
What conclusions can be drawn from the above three hypotheses for a multi-agent model in terms of consumption? In the Keynesian theory -even if in a hidden form -an idea of a heterogeneous consumption sector is formulated, because objective and subjective factors affect the consumption rate and the limit willingness value even at an individual level. In Modigliani's life-cycle hypothesis the relationship between wealth and consumption is worth focusing on. The role of wealth of particular consumers also plays an import role in multi-agent modelling. Most DSGE models -wrongly -derive aggregate consumption demand from representative consumer behaviour. However, in real life situations households with different financial backgrounds react to processes of real economy or economic policy that affect their income positions quite differently. Agentbased modelling allows us to model these types of situations.
In this world full of uncertainties it seems natural that consumers react to temporary and unexpected income changes. Friedman's Permanent Income hypothesis divides the income into two large groups and distinguishes between expected income and unexpected income. This grouping enables us to make a distinction between the effects of two different types of income on consumption. In multi-agent modelling this distinction can be applied in order to investigate the efficacy of different measures of the economic policy.
As for the behaviour of households, it can be stated that the key components of heterogeneity in the multi-agent macroeconomic model are as follows:  subjective factors related to consumer preferences (reserve accumulation, intertemporal decision making, inheritance, etc.)  objective factors affecting the amount of income (becoming unemployed, impacts of economic policies on income, etc.), and  financial position.
The degree of consumer sensitivity to the above factors and the degree these factors affect consumption willingness are summarised in the indicator of carefulness.

Corporate investment demands
The demand for capital goods depends on companies in an economy. An investment function can be derived from profit maximisation conditions of the corporate sector. The size of the investment depends on the marginal efficiency of capital, which is finally the interest rate. Investment decisions are characterised by uncertainties. Uncertainties are closely related to future investment returns. Objective and subjective components affect the expected value of the return as in the case of consumption. Objective components encompass measures of economic policies and technical and engineering developments, among others. Subjective components include investors' attitude to risks and their subjective appraisals of the economic environment for the investment. These factors enable us to determine the investment level individually or in categorised groups in multi-agent models.

Government demands
Since government demands depend on the actual economic policy in macroeconomic models, they are not very affected by uncertainty effect factors. In agent-based models they are considered as exogenous variables.

Export demand
In conventional models in cases of an aggregate foreign sector, the demand depends on the economic climate and the relative prices of goods compared to prices of export products and to international prices. When a multi-agent analysis is conducted, these two factors are defined at a level of a specific country and not at world economic level in order to achieve more efficient modelling. The foreign sector heterogeneity is comprised of different economic environments prevailing in different countries and different price rates, more precisely, different price levels. In other words, the real GDP and the real exchange rate of a specific country determine a specific foreign actor's demand for export.

Factors Affecting Aggregate Supply
The predictive power of multi-agent models, perhaps due to its methodology, is stronger than of DSGE models. It seems obvious that model properties and model architecture need to be appropriately determined since this is a crucial prerequisite for an accurate prediction. From the national economic perspective, forecasting inflation accurately is critical. This is the reason why the manufacturing sector needs to be divided into at least two groups. The first group comprises manufacturing companies producing goods for the domestic market, while the second group encompasses companies producing goods for foreign markets. Since the companies belonging to the first group considerably influence inflation and the companies belonging to the second group do not affect inflation, the latter is not investigated.

Domestic manufacturing sector
A 'better' model can be built if companies producing goods for the domestic market are further divided into subsectors depending on their effect on inflation (energy sector, food sector, etc.). Another important aspect in establishing a heterogeneous manufacturing sector is the classification of companies based on pricing methods. The degree of price rigidity is determined by parameterising or by calculating the weighted average.
The most widely used parameterising method is Calvo pricing, where Calvo parameters are provided in advance. The parameters show the probability that a company will change its prices in a given period of time (Váry, 2015).
There is another method where members of a specific corporate sector are grouped by their price flexibility or price stickiness. The company share as a weighting factor can be used to calculate price levels.

Additional Model Features
The major criticism of DSGE models is that they failed to predict the 2008 economic crisis, the imminent danger, and to explain the reasons why this crisis really broke out and how deep the structural tensions were that moved and still move the processes. These models just describe the surface phenomena.
The basic methodological reason for this is that they laid emphasis on analysing business cycles and neglected financial cycles. Financial cycles are longer and more volatile than traditional business cycles. Excessive credit outflows can be observed in the boom period, which finally leads to bubbles in the real estate and/or security markets. The bubble burst is followed by a financial crisis and a prolonged real economic recession.
The current task of macroeconomic modelling is to build models based on new methodologies and modify the existing models so that they can manage the boom and bust cycles simultaneously. This is a difficult and complex task. There have been partial successes in this respect after the crisis, but a specific model integrating all aspects has not yet been developed.
In multi-agent based models, financial cycles must be taken into account in order to increase their forecasting capacity. Bubble formation is based on the accelerator principle. Because of the accelerator effect, investmentdriven income growth encourages further investing and borrowing, whose burdens keep falling and lead to a credit bubble.
The output of agent-based models describing economic phenomena is the result of the activities of cooperating models. Model actors are like real people who, using the right decision algorithms, would be able to produce an output similar to reality. Thus, computer simulations are used to analyse the interaction of a large number of heterogeneous economic operators of these models. The bottom-up approach allows building aggregate macromodels from micro-level elements. Since the assumptions are very close to real behaviour and economic environment, they yield more plausible results (Schneider 2010).
The models do not assume absolute equilibrium conditions. This is not 'pre-programmed'. What needs to be investigated in the models is that whether equilibrium conditions for a given set of operating rules occur and whether markets have equilibrium properties. A key issue for macroeconomic models is whether they comply with Lucas' critique on the issue of the effectiveness of economic policy measures (Lucas, 1976). Since agentbased models are simulation models, the principle of rational expectations cannot be taken into account in their case. However, this deficiency can be overcome by proper interpretation and algorithmisation of the learning processes. Economic fluctuations can also be simulated through parameter settings as long as a significant negative shock is not considered.

EXAMPLES OF AGENT-BASED ECONOMIC MODELS
Several domestic and international agent-based economic models have emerged in the past decade. Hau et al. (2013) interpreted a traditional Marshall-Walras model on an agent basis. Their most important conclusion was that an increase in the number of players makes the operation of the market unstable even if the actors are assumed to be homogeneous. Váry (2015) described the market processes with an agent-based model where he assumed that prices were sticky. The purpose of his analysis was to prove that the effects of price stickiness in dynamic stochastic equilibrium models derive only from the specific assumptions of mainstream economics. The results confirmed this hypothesis because he observed completely different effects with a more realistic agent-based model.
Troitzsch (2012) also deals with agent-based modelling of markets. In his study he investigates whether market equilibrium is achieved if market participants are formed as separate heterogeneous entities and how this equilibrium is reached. Agents are buyers with different properties (willingness to pay) and sellers (expected revenue). Using the model he points out that prices and quantities increasingly oscillate around equilibrium values as the number of transactions increases.

COMPARISON OF AGENT-BASED MODELS WITH CONVENTIONAL MODELS
It is worth comparing the assumptions and model assumptions of traditional economics with those of agentbased modelling. Mainstream economic theories considered ideally-acted actors in basically equilibrium state. In real economic conditions dynamically changing situations and players having different characteristics cannot be interpreted with static methods and homogeneous entities. Based on the available research studies it can be claimed that the microeconomic soundness of dynamic models for the current mainstream is not sufficient because their microeconomics components are non-plausible empirically and they also have poor fit to aggregate data.
If the known features of the presented agent-based modelling are investigated, agent-based modelling differs from traditional modelling in the following areas:  agents representing economic operators able to gain experience (thinking) and to learn. Agents are provided with learning algorithms. The algorithms are identical for individuals in simple cases, but may vary from group to group in more complex models.  From the above it follows that the behaviour of the actors evolves over the course of the simulation and change, since their interactions with each other and the environmental characteristics also change. Formerly egotistical characters may become altruists, cooperate and collaborate.  The modelling of market processes is characterised by a bottom-up process. Self-organized markets emerge that are characterised by endogenous, internal development.  Agents are organically related to each other. Hence, economic relations and transactions are established, which involve costs. The models take into account transaction costs.  Existing institutions and organizations that are developing and constantly changing during interactions can be modelled. Also, it is worth comparing key features of neo-Keynesian models of models generally adopted in macroeconomic modelling with features of alternative agent-based models. Table 1 illustrates the assumptions, advantages and disadvantages of models.
In neo-Keynesian models sticky prices are generally assumed. Actors are rational. An important methodological character is that aggregates are formed and interpreted. These two defining qualities -heterogeneous actors and their interdependence -are characteristic of agent-based models. Let us investigate the advantages and disadvantages that result. The most significant difference is that neo-Keynesian models focus on balance, the effects of economic policy measures, whereas agent-based models tend to provide their "handlers" with new knowledge about modelled processes. As for the disadvantages, neo-kinetic models are characterized by excessive system dynamics and isolation from the environment, which are definitely flaws. The disadvantages of agent-based models are the partial impact assessment of changes and the high demand for computing. Of course, the latter may become less of a problem with technological changes -it may just be a matter of time.

CONCLUSIONS
The results of the study reveal that agent-based models are effective in modelling heterogeneity. The effect of changes in the behaviour of players and characteristics of the market environment can be clearly traced in the analysis.
Over the past four decades in macroeconomics, dynamic analytical models that assume rational expectations and based on neoclassical synthesisprimarily on the work of Robert Lucas -came to the forefront. Since these models have limited explanatory power and/or predictive power, agent-based models provide a real methodological alternative to them.