An agent-based macroeconomic model with interacting firms, socio-economic opinion formation and optimistic/pessimistic sales expectations

We propose a simple agent-based macroeconomic model in which firms hold heterogeneous sales expectations. A firm may either optimistically expect an increase in its sales or pessimistically expect the opposite. Whether a given firm is optimistic or pessimistic depends on macroeconomic conditions and the average mood prevailing within its social/local neighborhood. For instance, the probability of a firm taking an optimistic view increases not only during a boom but also with the number of its optimistic neighbors. We show that such an economy may give rise to co-evolving dynamics between the business cycle and the firms’ average sentiment.


Introduction
vividly illustrate that animal spirits are a major driver of the current global economic crisis. It seems indeed that a wave of extreme optimism triggered an immense bubble in the US housing market, and when that bubble burst around 2006/2007, many financial markets and entire economies around the world got into deep trouble. One reason why the economic downturn came with such a surprising force was that enormous numbers of people more or less collectively lost confidence. Fearing a major world economic crisis, the consumption behavior of private households and the production decisions taken by firms changed dramatically in numerous countries. Without question, the initial housing market boom and subsequent economic downturn were fueled by animal spirits. Of course, Akerlof and Shiller forcefully revive a crucial theme of Keynes (1936), who coined the term 'animal spirits' as early as over 70 years ago. Analyzing the Great Depression, Keynes concluded that fluctuations in economic activity are caused, to a considerable degree, by the behavior of agents who are subject to non-economic motives and non-rational behavior.
In this paper we do not present a complete picture of what led to the current economic trouble and the role played therein by animal spirits. Instead, our focus lies on a particular, yetwe think-quite important detail in the course of events: we are interested in the (recurrent and) spontaneous emergence of waves of optimism and pessimism among economic agents, and their macroeconomic consequences. There are several ways to approach such a challenging research question, the aforementioned more general type of analysis by Akerlof and Shiller (2008) and Keynes (1936) being one of them.
However, Farmer and Foley (2009) recently promoted the use of agent-based models as an alternative tool to understand how the economy, with all its complexities, really works 1 . Note that agent-based models are computerized simulations of a possibly large ensemble of heterogeneous boundedly rational and interacting agents. One advantage of such models is that they do not rely on the widely used but often misleading assumption of a representative, rational and (exclusively) utility maximizing agent. Fortunately, modern computers are able to keep track of the decisions made by a large number of different agents. These agents usually act independently of the state of the world, or how they perceive it, by following certain heuristics. For instance, agents may select rules with respect to their past performance and/or adapt their heuristics over time according to certain learning principles. Moreover, agent-based models can take institutional settings, such as market microstructures or regulatory frameworks, into account quite realistically. Contributions to the collective volumes of Tesfatsion and Judd (2006), Hens and Schenk-Hoppé (2009) and Rosser (2009) give an overview of the usefulness of this research direction. Agent-based financial market models apparently constitute the most developed applications in this area so far (e.g. Brock and Hommes 1998, Farmer 3 and Joshi 2002, LeBaron et al 1999, Lux and Marchesi 1999 2 . However, agent-based macroeconomic models are currently closing the gap quickly (Battiston et al 2007, Dawid et al 2009, Delli Gatti et al 2005, Haber 2008.
Against this backdrop, let us present a preview of the main building blocks and properties of our agent-based macroeconomic model. At the core of our model we have the sales expectations of heterogeneous firms. Each firm can take one of two views: it is either optimistic or pessimistic. If a firm is optimistic, it expects an increase in national income and thus in its sales. Otherwise, if a firm is pessimistic, it expects a contraction of the economy and consequently reduces its production. Whether a firm is optimistic or pessimistic depends on two factors. Firstly, the mood of a firm is influenced by the current state of the economy. For instance, a firm tends to be more optimistic during a boom. As business cycles show some kind of persistence, extrapolative expectations may indeed do a good job-at least such expectations are more often right than wrong. Secondly, the mood of a firm also depends on the mood of the firms it interacts with. For simplicity, firms are arranged on a square lattice and each firm has exactly four neighbors 3 . We assume that if the number of optimistic neighbors of a firm increases, the probability of this firm being optimistic also increases. It is well known that group pressure, to name just one cause, may lead to such herding behavior.
Simulations of our model analyze consequences of the bi-directional feedback relation between economic mood and national income. Let us suppose that the economy experiences a multi-period upswing. As a result, the number of optimistic firms increases, as does their production. Note that this process may have some kind of persistence. As national income increases, more and more firms become optimistic. As these firms optimistically increase their production, national income increases further. We can observe a similar phenomenon during a downswing, albeit in the other direction. Firms become pessimistic, decrease their production and thereby cause a reduction in national income, which, in turn, depresses even more firms. Once almost all firms are optimistic (pessimistic), national income has reached its maximum (minimum). Without a further upward (downward) steam, a few firms that autonomously change their opinion can reverse the course of the economy. As we will see, our model is able to generate continual business cycles and co-evolving opinion swings for a broad range of parameter values 4 .
In the last couple of years, several macroeconomic models with a similar spirit, that is an emphasis on heterogeneous expectations and socio-economic opinion formation, have been developed, and it is worthwhile mentioning a few of them here. Our paper is most closely related to those of Westerhoff and Hohnisch (2007) and Hohnisch and Westerhoff (2008). In the first paper, consumers switch between an optimistic and a pessimistic mode. In the second paper, the investment decisions of firms are sentiment-dependent. Both Keynesian-type approaches are able to generate business cycles and opinion swings 5 . However, interactions between agents occur entirely randomly, as in Kirman's (1993) seminal opinion formation model. 4 Franke (2008a) integrates animal spirits into a Goodwinian type of model and observes endogenous growth cycles. Interestingly, he is able to derive a deterministic equation that governs the evolution of the majority opinion of agents. Moreover, there are several examples in the literature in which microscopic models of opinion formation have shown their ability to match the dynamics of different business climate indices quite closely (Flieth and Foster 2002, Franke 2008b, Hohnisch et al 2005, Lux 2009). These models reveal that the evolution of a business sentiment, and thus also changes in individual attitudes, are influenced by social interactions.
In a somewhat broader sense, the works by Tuinstra and Wagener (2007), Berardi (2007), Branch and McGough (2009) and Lines and Westerhoff (2010) are also related to our line of research. In these macroeconomic models, agents display a boundedly rational learning behavior with respect to their expectation formation. For instance, agents who dynamically select between extrapolative and regressive prediction rules may prefer strategies that produce lower prediction errors. However, these models are usually set up as deterministic nonlinear difference equation systems to keep them analytically tractable. While this is an advantage, one may argue that the degree of realism of these models-in comparison to more developed agent-based models-is somewhat compromised. Let us conclude this brief survey by recalling that significant empirical evidence indicates that people are indeed boundedly rational (e.g. Kahneman et al 1986, Simon 1955, Smith 1991 and that they frequently rely on simple heuristics when having to forecast economic variables (e.g. Heemeijer et al 2009, Hommes et al 2005. Put differently, there is empirical support for the models' key behavioral assumptions. The remainder of this paper is organized as follows. In section 2, we develop a simple agent-based macroeconomic model in which the expectations of heterogeneous firms are influenced by an interactive socio-economic opinion formation process. In section 3, we work out how the model functions, based on a certain parameter setting. In section 4, we discuss the extend to which the dynamics of our model are robust with respect to parameter changes. In section 5, we modify the underlying network structure. It is also shown that the more realistic scale-free network of Barabási and Albert (1999) may give rise to business cycle dynamics. The last section concludes.

The model
In this section we present an agent-based macroeconomic model whose key feature is a bi-directional feedback process between the evolution of national income and the average sentiment of heterogeneous firms. The macroeconomic part of the model is presented in section 2.1 while its opinion formation part is developed in section 2.2.

The macroeconomic part of the model
Within our model, national income Y t at time step t is determined by the current production generated by the public and private sectors 6 . The public sector consists of one firm whereas there are N private firms. All firms produce the same product (or the same bundle of products) 5 so that national income can be written as where G t stands for the output of the public firm and Q 1 t , Q 2 t , . . . , Q N t denote the outputs of the private firms.
To simplify matters, the production quantity of the public firm is exogenously given as A simple extension of (2) would be the inclusion of a policy feedback term. For instance, a government might force the public sector to increase (decrease) its production during a recession (boom). Production generated by private firms depends on their sales expectations Q i,e t : the more (less) a firm expects to be able to sell, the higher (lower) is its output. For private firms i ∈ {1, 2, ..., N } we assume the proportional relation to be A rational for heuristic (3) is offered in the sequel 7 . Of course, the production generated by the public and each private firm has to be at least equal to or larger than zero. Sales expectations of private firms are heterogeneous and influenced by their current sentiments. A private firm's attitude is either optimistic or pessimistic, and we assume that an optimistic firm will expect higher sales than a pessimistic firm. The sales expectation of firm i ∈ {1, 2, ..., N } is formalized as where C t−1 is the total consumer demand for private goods observed in the last period and where X is a positive extrapolation parameter 8 . The interpretation of (4) is quite simple. Let us suppose that firm i is optimistic. Then firm i predicts that total demand for private goods will increase from C t−1 to C t−1 + X , from which it hopes to receive a share of 1/N . In the opposite case, the firm pessimistically believes that total demand for private goods will drop to C t−1 − X . As a result, its sales expectations are lower than in the optimistic state, the difference between the two forecasts being 2X/N . To finance the production generated by the public sector, the government collects income taxes. These goods are then provided free to the public, e.g. to unemployed or retired persons. Private households spend their remaining net income on private goods. Let 0 < tax < 1 be the income tax rate. The demand for private goods is determined by 7 As already mentioned, abundant empirical evidence suggests that people tend to follow simple heuristics in a complex world. Akerlof and Shiller (2008) also point out that many decisions by business managers are made on the basis of whether or not they have confidence. Jointly, (3) and (4) take this into account. 8 The extrapolative nature of (4) will become more obvious in conjunction with (10). There we postulate that the likelihood of a firm being optimistic is relatively high if national income and thus consumption expenditures increase. Hence, during a boom, firms tend to expect an increase in consumption.

6
Note that current consumption of private goods depends on the household's current net income and not on their past net income, as is sometimes assumed in related Keynesian-type models. Let us develop and interpret our model economy further. Similar to cobweb models, markets clear in every time step and goods are non-storable. As a result, the budget of the public sector is always balanced. To see this, note that national income, computed from the demand side, totals i.e. the income tax revenue exactly suffices to finance the production generated by the public sector. Furthermore, consumers do not save. Without savings there can be no investments, and indeed we have no capital stock in this model. Public and private firms exclusively rely on the production factor labor. What could be a rational for heuristic (3), i.e. the production decision of a firm? Suppose that all firms make a small, constant profit per production unit. Since the product is non-storable, any excess production would decrease the firm's profits. On the other hand, if production falls short of sales, profits are also not maximal. Therefore, a (risk-neutral) firm may indeed want to produce the quantity it expects to sell. Finally, the production costs of firms are equal to wage payments. Hence, the sum of wages and profits is again equal to national income, which is then immediately consumed. Of course, our macroeconomic framework is quite simple, yet it is consistent in itself.
Our setup allows us to derive further results with respect to the dynamical properties of our model. Let us denote by O t and P t the number of optimistic and pessimistic firms. Combining (1)-(5) and rearranging terms yields Accordingly, national income at time step t depends on national income at time step t − 1 and on the current difference between optimistic and pessimistic private firms. Moreover, the equilibrium value of national incomeȲ in terms of optimistic and pessimistic private firms can conveniently be expressed as Obviously, an increase (decrease) in the number of optimistic private firms drives this value up (down). For our later analysis it is also helpful to consider situations in which the number of optimistic and pessimistic private firms is temporarily fixed. The dynamical system (6) then becomes a first-order linear difference equation, and we can readily determine its properties. Overall, there are N + 1 possible combinations of O t and P t , and thus there are as many possible dynamical systems one can consider. Yet, for our needs, it is sufficient to focus on three extreme scenarios.
• Suppose first that the number of optimistic and pessimistic private firms is balanced (i.e. O t = P t ). In this case, the model's unique steady state (7) readsȲ * =Ḡ/tax. Since national income is equal to the product of a (larger than one) multiplier 1/tax and the constant production quantity of the public sector, this steady state is reminiscent of the well-known Keynesian multiplier solution. For instance, an increase inḠ drives the (steady state of this) economy upwards.

7
• Consider now that all private firms are optimistic (i.e. O t = N and P t = 0). Then the unique steady state becomesȲ H = (Ḡ + X )/tax. More optimistic private firms induce a higher steady-state equilibrium income andȲ H is its maximum value.
• Finally, if all private firms are pessimistic, the model's steady state drops toȲ L = (Ḡ − X )/tax. To maintain a positive steady state, we have to impose that the production of public goods is larger than the expected change in consumption (Ḡ > X ) 9 .
For fixed numbers of O t and P t , the unique steady state of (6) is always globally stable, and dynamics are characterized by a monotonic rapprochement. However, the number of optimistic and pessimistic private firms may vary over time. It is important to note that, due to the monotonic adjustment of national income towards its (temporary) steady-state value, any form of overshooting of the two extremesȲ H andȲ L is ruled out. Therefore, the dynamics are bounded withinȲ H andȲ L (presuming that initial values are also in this range) and the difference between these two values is given by twice the extrapolation parameter over the income tax rate (that is 2X/tax).

The opinion formation part of the model
To model the opinion formation of private firms, we first subdivide each macro time step t = 1, 2 . . . into τ = 1, 2 . . . , T micro time steps. In each micro time step, exactly one firm may change its attitude. Put differently, in each macro time step there may be up to T possible changes in opinion (although there are usually fewer because firms may stick to their opinion). In any case, it appears quite reasonable to introduce both macro and micro time steps. A macro time step may be a month or a quarter in our model (depending on the parameter setting), and there will obviously be more than one firm that reconsiders its attitude in such a time span, at least for economies with a moderate number of firms.
N private firms are arranged on a √ N times √ N square lattice with periodic boundary conditions in both the horizontal and vertical axis. Thus, the number of firms has to be a square number, and the periodic boundary conditions turn the shape of the lattice into a torus. Due to such a lattice structure, we can conveniently define that each firm has exactly four neighbors, one to the north, one to the east, one to the south and one to the west of its own location. In a given micro time step, we randomly pick one private firm and determine its current mood. A firm's opinion is influenced by two aspects: the macroeconomic situation of the economy (is the economy facing a boom or a recession?) and the average sentiment within the firm's social/local neighborhood (how many of its four neighbors are optimistic/pessimistic?).
The setup of the opinion formation part of our model is inspired by the Ising model, which is well known in physics 10 . Technically, the probability of a randomly selected firm i being optimistic at time step (t, τ ) is while the probability of this firm being pessimistic is where the state-dependent parameters α i t,τ and β i t,τ are and respectively. Note that probabilities (8) and (9) are always positive and add up to 1. Moreover, α and β are free positive parameters and #O i t,τ and #P i t,τ stand for the number of optimistic and pessimistic neighbors of firm i at time step (t, τ ), respectively.
The motivation for (8)-(11) is as follows. Firstly, the probability of a firm being optimistic (pessimistic) increases (decreases) with α i t,τ . This state-dependent parameter takes one of two values: it is positive when consumption (and thus national income) increases, and negative otherwise. Hence, during an upswing (downswing), a firm that reconsiders its opinion is more likely to be optimistic (pessimistic). Secondly, an increase in β i t,τ also increases the probability of a firm being optimistic. This state-dependent parameter captures the impact of the firm's social/local environment on its own mood. Since each firm has four neighbors and #O i t,τ and #P i t,τ stand for the number of optimistic and pessimistic neighbors of firm i, the term in brackets in (11) can be expressed as Obviously, the more optimistic neighbors a firm has, the larger the probability of it also being optimistic.
Via parameters α, β > 0 we can calibrate these two important effects. It is insightful to discuss our opinion formation setup with the help of numerical examples. The first line of table 1 presents all possible neighborhood combinations a firm may have, e.g. four optimistic and zero pessimistic or two optimistic and two pessimistic neighbors. The second line of table 1 displays the #O i t,τ − #P i t,τ statistic, i.e. the difference between the number of optimistic and pessimistic neighbors of firm i. Let us suppose that firm i has three optimistic and one pessimistic neighbors. Then the difference is +2. Note that this statistic can take positive and negative values. If firm i has only one optimistic neighbor, we obtain a value of −2.
The third line of table 1 contains the probabilities of firm i being optimistic for α = 1, β = 0.881 and C t > C t−1 (the probability of being pessimistic is just the converse probability,

N=2500
Number of private firms T = 2500 Micro time steps per macro time step tax = 0.5 Income tax ratē G = 0.5 Production of the public firm X = 2.5 Extrapolation parameter α = 1.0 Economic sentiment parameter β = 0.881 Social/local sentiment parameter and is not reported). The line below shows the same result but for a situation in which the economy contracts. Let us suppose first that consumption increases and that a firm has two optimistic and two pessimistic neighbors. Then the probability of being optimistic is about 73%. Hence, if the average local opinion of a firm is balanced and the economy is booming, the firm will most likely be optimistic. However, the probability of being optimistic increases when there are more optimists around. For instance, if all neighbors are optimistic, the probability of being optimistic increases up to 99%. Let us suppose now that consumption decreases. In a balanced neighborhood, prob(O i t,τ ) is about 27%. However, if three of the four neighbors are optimistic, this probability increases to 68%. If all neighbors are optimistic, it climbs to 93%. Accordingly, even if the economy is in decline, a firm may decide to be optimistic if its neighbors are optimistic. These examples illustrate the impact of the social/local neighborhood on the opinion formation of firms.
Of course, if α = 1 and β = 0, the neighbors' mood does not play a role, and the probability of being optimistic is about 73% if the economy is booming and 23% if it enters a recession (as in a balanced neighborhood situation). Finally, if α = 0 and β = 0.881, the economic situation is irrelevant to the firm's opinion formation 11 . The mood of a firm then only depends on the mood of its neighbors. If two neighbors are optimistic and the other two pessimistic, the probability of being optimistic is 50%. If all of them are optimistic, this probability increases up to 97%, irrespective of whether consumption increases or decreases. In the following, both sentiment parameters α and β are positive. The opinion formation of firms is therefore driven by current economic events and the prevailing average mood within a firm's network.

Emergence of business cycles and opinion swings
In this section, we explore how the model functions and show that our approach can generate comovements between the business cycle and the average opinion of private firms. But let us first present and discuss our leading parameter setting. In total, the model contains seven parameters; their meaning and numerical values are summarized in table 2. The first two parameters are clear. We consider 2500 private firms and there are 2500 micro time steps per macro time step. On average, each private firm re-evaluates its opinion once per macro time step. An income tax rate of 50% implies a multiplier of two. Since the output of public production is 50, national income converges towards 100 if the number of optimistic and pessimistic firms would freeze in a balanced state. Moreover, in an entirely depressed economy, national income may decrease to 95 while in a fully developed boom national income may rise to 105. Hence, the maximal amplitude we can theoretically observe comprises ten units of national income. The values of the two sentiment parameters are positive and the same as in section 2, where their meaning has already been clarified in detail. Figure 1 shows a typical simulation run. The top panel depicts the evolution of national income for 240 macro time steps. If we assume that a macro time step corresponds to one month, the simulation run comprises 20 years. The bottom panel presents the number of optimists, which we can regard as a proxy for a business sentiment index. Some results are immediately obvious. Firstly, we see quite regular business cycles. Secondly, there are major opinion swings. Thirdly, the business cycle is highly correlated with changes in the business sentiment index.
To help explain the dynamics, in figure 2 we present how the confidence of firms changes over time. The 20 panels present the dispersion of opinions on the underlying square lattice, where black boxes indicate optimistic private firms and white boxes pessimistic private firms. The first panel depicts the situation at macro time step 60. For each following panel we let four macro time steps elapse. Regarding one macro time step as one month, four macro time steps make up a quarter and the first four panels comprise a full year. In total, we thus see regular (quarterly) snapshots of firms' sentiment over five consecutive years.
The model functions as follows. Let us start at macro time step 60. Most firms are optimistic, and national income is at a relatively high level and clearly above 100. However, we observe that national income and the demand for private goods are decreasing. As a result, more and more firms become pessimistic. Since they expect a further decrease in their sales, they reduce their production, which, in turn, indeed decreases national income and demand for their goods. The growing pessimistic views among firms obviously become self-fulfilling. Within one-and-a-half years (that is six quarters and six panels later), almost all firms are pessimistic and production is close to its theoretical minimum valueȲ L .
What brings about the end of the recession, or what initiates the beginning of the next boom? Recall that national income approaches its 'temporary' steady-state value, say the theoretical minimum valueȲ L , in a monotonic way. At some point it will indeed be quite close to this value. However, some firms randomly change their opinion, i.e. they become optimistic and increase their production, which, in turn, leads to an increase in national income 12 . Once national income increases, a firm that reconsiders its attitude is likely to become optimistic. Again, we observe a self-reinforcing feedback process. As more and more firms become optimistic, production of private goods and, as a result, national income increase. This bidirectional feedback process continues until almost all firms are optimistic (say panel 12, after three years). Now, national income is close to its maximal upper valueȲ H . Given our parameter setting, the probability of a firm becoming pessimistic, although the economy is experiencing a boom and all its neighbors are optimistic, is about 1%. Hence, a few firms will become pessimistic, which suffices to trigger the next recession. Clearly, these pessimistic firms reduce their production, which simultaneously reduces national income and total demand for private firms. The recession begins, first slowly but then at an accelerated speed. Business cycles continue to exist-there are no forces in our model that are able to halt this process. Note also the clustering of optimistic and pessimistic firms: there are (temporal) local dominances for a certain mood (see, e.g., panels 3, 9 or 14).
Once again, we stress that Akerlof and Shiller (2008, p. 16) put forward a similar (informal) theory. According to their analysis, the economy is driven by both a Keynesian consumption multiplier and a confidence multiplier. To be precise, they argue that 'Changes in confidence will result in changes in income and confidence in the next round, and each of these changes will in turn affect income and confidence in yet further rounds.' In this sense, animal spirits may indeed trigger endogenous business cycles. Our model offers one way to formalize these mechanisms.

Sensitivity analysis
So far, we have explored the dynamics of our model for a given parameter setting. The question which naturally arises is how changes in the parameter setting will influence the dynamics, which is what we shall discuss in this section. In particular, we now systematically vary the two sentiment parameters α and β and the updating parameter T . These three parameters are the key parameters of our opinion formation setup.
Let us start with the economic sentiment parameter α. In the left two panels of figure 3, we see the development of national income and the number of optimistic private firms for α = 0.5, while in the right two panels, we see the same but for α = 1.5. The role played by α becomes immediately obvious. If α increases, the attitude of private firms depends more strongly on the macroeconomic course of the economy. We see in the right panels that the frequency of the business cycle and the business sentiment index increases. During an upswing (downswing), private firms now switch more eagerly to an optimistic (pessimistic) mood, which  then accelerates changes in national income. Of course, a low value of α slows down changes in majority opinion, and the length of business cycles is prolonged.
In the next experiment, we similarly vary the social/local sentiment parameter β. In the left panels of figure 4, the value of β has been decreased by 50%, while in the right panels it has been increased by 50% (the remaining parameters are as in our leading parameter setting). Now we see that if β increases, the dynamics become calmer. Since private firms pay more attention to the activities of firms in their neighborhood, the business sentiment index 'sticks' for longer periods in its extremes (a clear herding effect), which slows down the up and down movements of national income 13 . Note that if β decreases, not only does the frequency of cycles increase but also the amplitude of the business cycle and the sentiment index decrease somewhat. A lower value of β also indicates a more random opinion formation behavior among firms. The social/local neighborhood of a firm plays a lesser role and the probabilities of being optimistic or pessimistic are less extreme (i.e. they are closer to 50%). This obviously prevents the economy from reaching states in which income and sentiment are very high or very low. Yet, the key pattern of co-evolution between income and sentiment remains intact.
In figure 5, we show the dynamics of our model for different values of T . In the left panels we conduct 1250 opinion updates per macro time step (that is, on average only half of the private firms now update their opinion per macro time step). If there are fewer micro time steps per macro time step, a conversion from a rather pessimistic to a rather optimistic economy requires more time (measured, of course, in terms of macro time steps). In the right panels we have T = 3750 and, as a result, the frequency of the cycles is longer.   However, these experiments do not imply that the regularity of our dynamics will not break down eventually. To illustrate this we now assume more extreme values for parameters α and β. Figure 6 shows the dynamics of the model for α = 0 (left panels) and α = 2 (right panels). As can be seen, for α = 0 the business cycle has vanished. Clearly, regular fluctuations within our model require that the mood of the firms depends at least partially on what is going on in the economy. For α = 2 (twice the initial value), the cycles become more intense: the duration of booms and recessions increases while the transition between these two states accelerates (see figure 3).
The simulations depicted in figure 7 assume more extreme values for β. The left panels are derived on the basis of β = 0 and the right ones on the basis of β = 1.762. Apparently, the model still generates regular cycles even for β = 0, albeit less pronounced ones 14 . Oscillations of national income now range between 97.5 and 102.5, while the number of optimistic private firms is bounded between 650 and 1850. Note that the business cycle vanishes if β exceeds a certain critical upper level. For instance, if β is set to twice its initial value, both national income and the number of optimistic firms get stuck on either a very high or a very low level from which they can no longer escape. From an economic point of view, this can be quite dramatic. Suppose that the economy is in a recession and that the majority of firms are depressed. Strong social interactions leave firms pessimistic and preclude a recovery of the economy. Overall, we conclude from these experiments that our model is able to generate persistent business cycles and co-evolving swings in business sentiment for a broad range of parameter values. The duration and amplitude of cycles depend on parameters α, β and T . These parameters may, in principle, be used to calibrate the model dynamics more closely to real-world observations of our economic variables. Of course, the dynamics may become more irregular if parameters α, β and T are not constant but vary over time within certain bounds. Then the frequency and amplitude of cycles would be less constant. Different levels of amplitude may also be generated by assuming a time-varying extrapolation parameter. However, we leave these considerations for future research.

Business cycles and opinion swings on a scale-free network
The beauty of a square lattice network is its absolute simplicity. However, most real networks have a more complex structure (Albert and Barabási 2002). A network that has proven to be in line with many real networks is the scale-free network of Barabási and Albert (1999). The hallmarks of this network are growth and preferential attachment, meaning that the number of nodes of such a network increases over time and that the more connected a given node already is, the more likely it is that it receives even more connections during the network's growth process. In this section, we explore whether our approach may still give rise to regular business cycle dynamics when firms are connected in the form of the Barabási-Albert network. Clearly, all other building blocks of our model remain as they are, i.e. we only modify the underlying network structure. Let us describe how we construct a Barabási-Albert network in this paper. We begin our network with three fully connected firms. The remaining N − 3 = 2497 firms are then added one after the other to the network. This is done as follows. Each new firm selects one of the already existing firms as a neighbor 15 . The probability that a new firm connects with one of the existing firms is simply proportional to the number of neighbors a given firm already has. The network is finished when all firms have been attached to the network. An example of such a network is displayed in figure 8. Note that some firms have only a few links while others are more heavily connected. Figure 9 shows the model dynamics based on the network displayed in figure 8. The simulation run is based on our leading parameter setting, introduced in section 3, except that we now assume α = 2 and β = 2. Note that there is a striking similarity between figures 1 and 9. Regardless of whether we use a square lattice network or a Barabási-Albert network, our approach is able to produce co-evolving swings between national income and the firms' average sentiment. Overall, this underlines the robustness of our finding that economies may display enduring business cycles simply because changes in firms' sentiment, cause changes in national income, which, in turn, feed back on firms' sentiments.

Conclusions
In this paper we propose a simple agent-based macroeconomic model in which the sales expectations of interacting boundedly rational firms are heterogeneous and sentiment-driven. Each firm has fixed social relations to other firms, and is either optimistic or pessimistic. If a firm is optimistic, it expects higher sales and consequently increases its production. A pessimistic firm, however, decreases its production since it fears a reduction in sales. A firm's opinion is influenced by two aspects. A firm tends to be optimistic (pessimistic) (i) if national income increases (decreases) and/or (ii) if more (fewer) firms it interacts with are optimistic. The mood of firms is dynamically updated. We incorporate this opinion formation model into a simple yet consistent macroeconomic framework, and establish a rather robust bi-directional feedback process between firms' sentiments and national income. Accordingly, changes in firms' sentiments cause changes in national income, which, in turn, feed back on firms' sentiments. We have observed this phenomenon both for a square lattice network and for a scale-free network. Despite being far from perfect, our simple model may help us improve our understanding of business cycle dynamics. One advantage of our approach is that we do not have to look inside a black box. On the contrary, it is quite easy to pinpoint the causalities acting inside our model. A more related hope is that models such as ours become useful for policy advice. For instance, these models may be used as computer platforms to evaluate macroeconomic policies. Policy makers can simulate agent-based macroeconomic models under different policy scenarios and compare their consequences. LeBaron and Tesfatsion (2008) argue that even fairly simple agentbased models can be used by policy makers for thought experiments to see whether there is something that has not yet been considered in the analysis. Similarly, a study of extreme events, such as the current worldwide economic crisis, may be injected into a simulation model to study possible reactions of the economy. Without question, more work is needed in this exciting field of research.