1 Introduction

Within the rational expectations and representative agent paradigm, the Sharpe–Lintner–Mossin (Sharpe 1964; Lintner 1965; Mossin 1966) Capital Asset Pricing Model (CAPM) is the most widely used tool to value returns on risky assets. However, there is considerable empirical evidence documenting cyclical behaviour of market characteristics, including risk premium, volatility, trading volume, price and dividend ratio, and in particular, market betas. The conditional CAPM has been developed to provide a convenient way to incorporate time-varying beta and it exhibits empirical superiority in explaining the cross-section of returns and anomalies.Footnote 1 There exists a large literature on time-varying beta models, but most of it is motivated by econometric estimation. It is often assumed that there are discrete changes in betas across subsamples but constant betas within subsamples.Footnote 2 It has been shown that when betas vary over time, the standard OLS inference is misspecified and cannot be used to assess the fit of a conditional CAPM. In addition, most of the econometric models of time-varying beta lack any economic explanation and intuition.

Most theoretical models on conditional CAPM are based on the representative agent economy by assuming perfect rationality and homogeneous beliefs. However, empirical evidence along with unconvincing justification of the assumption of unbounded rationality and investor psychology, have led to the incorporation of both heterogeneity in beliefs and bounded rationality into asset pricing and financial market modelling (see the survey papers in the edited handbook of Hens and Schenk-Hoppé (2009) for developments in this literature). Heterogeneous beliefs and bounded rationality have become important parts of the asset pricing literature in recent years. Over the last two decades, there has been a growing body of literature on heterogeneous agent models (HAMs) in economics and finance. HAMs consider financial markets as a nonlinear expectation-feedback system and reflect the interaction of heterogeneity, bounded rationality and adaptive behaviour of agents. Following the seminal work of Brock and Hommes (1997, 1998), various HAMs have been developed to show that, when agents increasingly switch to better performing strategies, this rational behaviour of agents can lead to instability of financial markets. This framework can also explain various types of market behaviour, such as the long-term swing of market prices from the fundamental prices, asset bubbles, market crashes, the stylized facts and various kinds of power law behaviour observed in financial markets.Footnote 3

However, most of the HAMs analysed in the literature involve a financial market with only one risky asset and are not in the context of the CAPM. Recently, some attempts have been made to develop HAMs with many assets.Footnote 4 Within a mean-variance framework, Chiarella et al. (2010, 2011) study a multi-asset CAPM through a consensus belief. In a dynamic setting, Chiarella et al. (2012) demonstrate the stochastic behavior of time-varying betas and show that there can be inconsistency between ex-ante and ex-post estimates of asset betas when agents are heterogeneous and boundedly rational.

The aim of this paper is to extend the HAMs with one risky asset to an evolutionary CAPM within the framework of HAMs to examine the impact of adaptive behaviour of heterogeneous agents in a market with many risky assets. This paper is closely related to Chiarella et al. (2012), but also differs from it in several respects. In Chiarella et al. (2012), the heterogeneous beliefs are modelled at the return level and agents do not change their strategies. A spill-over effect of market instability from one asset to others due to behavioural change of agents is demonstrated through numerical simulations. In this paper, the heterogeneous beliefs are modelled at the price level and agents are allowed to change their strategies based on a fitness function similar to that used by Brock and Hommes (1997, 1998). The advantage of this setting is that we are able to examine the stability and spill-over effects analytically. We extend the single-period static model in Chiarella et al. (2011) to a dynamic equilibrium asset pricing model. As in Chiarella et al. (2012), we incorporate two types of investors, fundamentalists and trend followers, into the model. It is found that the instability of one asset, characterized by large fluctuations of market prices from the fundamental prices, can spill over to other assets when agents increasingly switch to better performing strategies. The spill-over effect is also associated with high trading volumes and persistent volatility, characterized by significantly positive and geometrically decaying autocorrelations in volume and volatility over long time horizons. Also the correlations between trading volume and volatility of risky assets are positive when asset payoffs are less correlated. These implications show that the evolutionary CAPM developed in this paper can provide insights into market characteristics related to trading volume and volatility. Also consistent with Chiarella et al. (2012), we show that the commonly used rolling window estimates of time-varying betas may not be consistent with the ex-ante betas implied by the equilibrium model.

The paper is organized as follows. Section 2 sets up a dynamical equilibrium asset pricing model in the context of the CAPM to incorporate heterogeneous beliefs and adaptive behaviour of agents. Section 3 examines analytically the stability of the steady state equilibrium prices of the corresponding deterministic model. In Sect. 4, we conduct a numerical analysis of the stochastic model to explore the spill-over effects, together with the relation between trading volumes and volatility, and the consistency of time-varying betas between ex-ante and rolling window estimates. Section 5 concludes. All proofs are given in the Appendix.

2 The model

We consider an economy with \(I\) agents, indexed by \(i=1,\ldots ,I\), who invest in portfolios consisting of a riskless asset with risk free rate \(r_f\) and \(N\) risky assets, indexed by \(j=1,\ldots ,N\) (with \(N\ge 1\)). Let \(\mathbf p _t=(p_{1,t},\ldots ,p_{N,t})^\top \) be the prices, \(\mathbf d _t=(d_{1,t},\ldots ,d_{N,t})^\top \) be the dividends and \(\mathbf x _t:=\mathbf p _t+\mathbf d _t\) be the payoffs of the risky assets in period \(t\) (from \(t-1\) to \(t\)). Let \(\mathbf z _{i,t}\) be the risky portfolio of agent \(i\) (in terms of the number of shares of each risky asset), then the end-of-period portfolio wealth of agent \(i\) is given by \(W_{i,t+1}=\mathbf z ^\top _{i,t}(\mathbf x _{t+1}-R_f\mathbf p _t)+R_fW_{i,t}\), where \(R_f=1+r_f\).

2.1 Optimal portfolio

Assume that agent \(i\) has a constant absolute risk aversion (CARA) utility \(u_i(x)=-e^{-\theta _i x}\), where \(\theta _i\) is the CARA coefficient. Assuming that the wealth of agent \(i\) is conditionally normally distributed, agent \(i\)’s optimal investment portfolio is obtained by maximizing the certainty-equivalent utility of one-period-ahead wealthFootnote 5

$$\begin{aligned} U_{i,t}(W_{i,t+1})=E_{i,t}(W_{i,t+1})-\frac{\theta _i}{2} Var_{i,t}(W_{i,t+1}). \end{aligned}$$
(1)

Following Chiarella et al. (2011), the optimal portfolio of agent \(i\) at time \(t\) for time period \(t+1\) is then given by

$$\begin{aligned} \mathbf z _{i,t}=\theta _i^{-1}\varvec{\Omega }_{i,t}^{-1} [E_{i,t}(\mathbf x _{t+1})-R_f\mathbf p _{t}], \end{aligned}$$
(2)

where \(E_{i,t}(\mathbf x _{t+1})\) and \(\varvec{\Omega }_{i,t}=[Cov_{i,t}(x_{j,t+1},x_{k,t+1})]_{N\times N}\) are respectively the conditional expectation and variance-covariance matrix of agent \(i\) about the end-of-period payoffs of the risky assets, evaluated at time \(t\).

2.2 Market equilibrium

Assume that the \(I\) investors can be grouped into \(H\) agent-types, indexed by \(h=1,\ldots ,H\), where the agents within the same group are homogeneous in their beliefs as well as risk aversion. The risk aversion of agents of type \(h\) is denoted by \(\theta _h\). We also denote by \(I_{h,t}\) the number of investors in group \(h\) and by \(n_{h,t}:=I_{h,t}/I\) the market fraction of agents of type \(h\) in period \(t\). Let \(E_{h,t}(\mathbf x _{t+1})\) and \(\varvec{\Omega }_{h,t}=[Cov_{h,t}(x_{j,t+1},x_{k,t+1})]_{N\times N}\) be respectively the conditional expectation and variance-covariance matrix of type-\(h\) agents at time \(t\). Let \(\mathbf s =(s_{1},\ldots ,s_{N})^\top \) be the \(N\)-dimensional vector of average risky asset supply per agent. A supply shock to the market, denoted by a vector of random processes,Footnote 6 is assumed to follow \(\varvec{\xi }_{t+1}=\varvec{\xi }_{t}+\varvec{\sigma }_\kappa \varvec{\kappa }_{t+1}\), where \(\varvec{\kappa }_{t+1}\) is a standard normal i.i.d. random variable with \(E(\varvec{\kappa }_{t})=\mathbf 0 \) and \(Cov(\varvec{\kappa }_{t})=\mathbf I \). Then the market clearing condition becomes

$$\begin{aligned} \sum ^H_{h=1}n_{h,t}\theta ^{-1}_h\varvec{\Omega }^{-1}_{h,t} [E_{h,t}(\mathbf x _{t+1})-R_f\mathbf p _t] =\mathbf s +\varvec{\xi }_t. \end{aligned}$$
(3)

2.3 Consensus belief

We follow the construction in Chiarella et al (2011, 2012) to define an aggregate or consensus belief. Define the “average” risk aversion coefficient \(\theta _{a,t}:=(\sum ^H_{h=1}n_{h,t}\theta ^{-1}_h)^{-1}\), which is a market population fraction weighted harmonic mean of the risk aversions of different types of heterogeneous agents. Specifically, if all agents have the same risk aversion coefficient \(\theta _h=\theta \), then the “average” risk aversion coefficient \(\theta _{a,t}=\theta \).Footnote 7 Then the aggregate beliefs at time \(t\) about variances/covariances and expected payoffs over the time interval \((t, t+1)\) are specified, respectively, as

$$\begin{aligned} \varvec{\Omega }_{a,t}&= \theta _{a,t}^{-1} \left(\sum ^H_{h=1}n_{h,t}\theta ^{-1}_h \varvec{\Omega }_{h,t}^{-1}\right)^{-1},\nonumber \\ E_{a,t}(\mathbf x _{t+1})&= \theta _{a,t} \varvec{\Omega }_{a,t} \sum ^H_{h=1}n_{h,t}\theta ^{-1}_h \varvec{\Omega }_{h,t}^{-1} E_{h,t}(\mathbf x _{t+1}). \end{aligned}$$
(4)

The dividend process \(\mathbf d _t\) is assumed to follow a martingale process

$$\begin{aligned} \mathbf d _{t+1}=\mathbf d _{t}+\varvec{\sigma }_\zeta \varvec{\zeta }_{t+1}, \end{aligned}$$
(5)

where \(\varvec{\zeta }_{t+1}\) is a standard normal i.i.d. random variable with \(E(\varvec{\zeta }_{t})=\mathbf 0 \) and \(Cov(\varvec{\zeta }_{t})=\mathbf I \), independent of \(\varvec{\kappa }_{t+1}\). Moreover, agents are assumed to have homogeneous and correct conditional beliefs about the dividends (the unconditional expectation of which is assumed to be constant, \(E(\mathbf d _{t})=\overline{\mathbf{d }}\)). Following Chiarella et al (2011, 2012), the market equilibrium prices (3) can therefore be rewritten as if they were determined by a homogeneous agent endowed with average risk aversion \(\theta _{a,t}\) and the consensus beliefs \(\{E_{a,t}, \varvec{\Omega }_{a,t}\}\), namely

$$\begin{aligned} \mathbf p _{t}=\frac{1}{R_f}[E_{a,t}(\mathbf p _{t+1})+ \mathbf d _t-\theta _{a,t} \varvec{\Omega }_{a,t}(\mathbf s + \varvec{\xi }_t)]. \end{aligned}$$
(6)

Note that at time \(t\) the dividends \(\mathbf d _{t}\) are realized and agents formulate their beliefs about the next period payoff \(\mathbf x _{t+1}=\mathbf p _{t+1}+\mathbf d _{t+1}\), based on the realized prices up to time \(t-1\) and the dividends \(\mathbf d _{t}\).

2.4 Fitness

Following the discrete choice model (discussed for instance by Brock and Hommes 1997, 1998) the market fractions \(n_{h,t}\) of agents of type \(h\) are determined by their fitness \(v_{h,t-1}\), where the subscript \(t-1\) indicates that fitness depends only on past observed prices and dividends. The fraction of agents using a strategy of type \(h\) is thus driven by “experience” through reinforcement learning. That is, given the fitness \(v_{h,t-1}\), the fraction of agents using a strategy of type \(h\) is determined by the discrete choice model,

$$\begin{aligned} n_{h,t}=\frac{e^{\eta v_{h,t-1}}}{Z_t}, \qquad Z_t=\sum _h e^{\eta v_{h,t-1}}, \end{aligned}$$
(7)

where \(\eta >0\) is the switching intensity of choice parameter measuring how sensitive agents are to selecting a better performing strategy.Footnote 8 If \(\eta =0\), then agents are insensitive to past performance and pick a strategy at random with equal probability. In the other extreme case \(\eta \rightarrow \infty \), all agents choose the forecast that performed best in the last period. An increase in the intensity of choice \(\eta \) can therefore represent an increase in the degree of rationality with respect to the evolutionary selection of strategies.

Given the utility maximization problem (1) of agents, we use a fitness measure that generalizes the ‘risk-adjusted profit’ introduced in Hommes (2001) (see Hommes and Wagener 2009 for a discussion about different choice of fitness functions and the relation between them), namely we set

$$\begin{aligned} v_{h,t}=\pi _{h,t}-\pi _{h,t}^{B}-C_{h}, \end{aligned}$$
(8)

where \(C_h\ge 0\) measures the cost of the strategy,

$$\begin{aligned} \pi _{h,t}:=\mathbf z _{h,t-1}^{\top }(\mathbf p _{t}+\mathbf d _{t} -R_{f}\mathbf p _{t-1})-\frac{\theta _{h}}{2}\mathbf z _{h,t-1}^{\top }\mathbf \Omega _{h,t-1}\mathbf z _{h,t-1} \end{aligned}$$
(9)

and

$$\begin{aligned} \pi _{h,t}^{B}:=\left( \frac{\theta _{a,t-1}}{\theta _{h}}\mathbf s \right) ^{\top }(\mathbf p _{t}+\mathbf d _{t}-R_{f}\mathbf p _{t-1})-\frac{\theta _{h} }{2}\left( \frac{\theta _{a,t-1}}{\theta _{h}}\mathbf s \right) ^{\top }\mathbf \Omega _{h,t-1}\left( \frac{\theta _{a,t-1}}{\theta _{h}} \mathbf s \right). \nonumber \\ \end{aligned}$$
(10)

Note that (9) can be naturally interpreted as the risk-adjusted profit of type \(h\) agent. It represents the realized profit adjusted by the subjective risk undertaken by investor \(h\), which is consistent with investors’ utility-maximizing portfolio choices. Expression (10) can be interpreted as the (risk-adjusted) profit on portfolio \(\mathbf z _{h,t-1}^{B}:=\frac{\theta _{a,t-1}}{\theta _{h}}\mathbf s \), which represents a ‘benchmark’ portfolio for agents of type \(h\) at time \(t-1\). The portfolio \(\mathbf z _{h,t-1}^{B}\) is proportional to the market portfolio. The proportionality coefficient \(\frac{\theta _{a,t-1}}{\theta _{h}}\) takes into account the fact that the shares of the market portfolio of agents are positively correlated to their risk tolerance \((1/\theta _h)\). In the case that all agents have the same risk aversion (so that \(\theta _{a,t-1}=\theta _{h}\)), they all take the market portfolio. Put differently, the performance measure (8) views strategy \(h\) as a successful strategy only to the extent it outperforms its market benchmark in terms of risk-adjusted profitability. More precisely, portfolio \(z_{h,t}^{B}\) represents the portfolio that agents of type h would select at time \(t\) if all agents had identical beliefs (whichever they are) about the first and second moment of \(\mathbf x _{t+1}\). In this case agents would (possibly) differ only in terms of their risk aversion and they would hold \(z_{h,t}=z_{h,t}^{B}\) for all \(h\). According to the fitness measure \(v_{h,t}:=\pi _{h,t}-\pi _{h,t}^{B}-C_{h}\), their portfolios would thus have identical performance (apart from the costs). In other words, the selected fitness measure \(v_{h,t}\) is not affected by mere differences in risk aversion and accounts only of the profitability generated by the competing investment rules. Note that, in the case of zero supply of outside shares, the market clearing Eq. (3) leads to \( E_{a,t}(\mathbf x _{t+1})/R_{f}= \mathbf p _{t}\). This is the case considered in Hommes (2001) for a single-risky-asset model. The market thus behaves as if it were ‘risk-neutral’ at the aggregate levelFootnote 9 in this particular case and the performance measure reduces to the risk-adjusted profit considered in Hommes (2001).

2.5 Fundamentalists

Now we propose a model with classical heterogeneous agent-types and consider two types of agents, fundamentalists and trend followers, with \(h=f\) and \(h=c\), respectively. Following He and Li (2007), the fundamentalists realize the existence of non-fundamental traders, such as trend followers to be introduced in the following discussion. The fundamentalists believe that the stock price may be driven away from the fundamental value in the short-run, but it will eventually converge to the expected fundamental value in the long-run. Hence the conditional mean of the fundamental traders is assumed to follow

$$\begin{aligned} E_{f,t}(\mathbf p _{t+1})=\mathbf p _{t-1}+\varvec{\alpha } (E_{f,t}(\mathbf p ^*_{t+1})-\mathbf p _{t-1}), \end{aligned}$$
(11)

where \(\mathbf p ^*_{t}=(p^*_{1,t},\ldots ,p^*_{N,t})\) is the vector of fundamental prices and the parameter \(\varvec{\alpha }=diag[\alpha _1,\ldots ,\alpha _N]\) with \(\alpha _j\in [0,1]\) represents the speed of price adjustment of the fundamentalists toward their expected fundamental value or it reflects how confident they are in the fundamental value. The parameter \(\alpha _j\) can be different for different risky assets. In particular, for \(\alpha _j=1\), the fundamental traders are fully confident about the fundamental value of risky asset \(j\) and adjust their expected price in the next period instantaneously to the expected fundamental value. For \(\alpha _j=0\), the fundamentalists become naive traders of asset \(j\). We also assume that the fundamentalists have constant beliefs about the covariance matrix of the payoffs so that \(\varvec{\Omega }_{f,t}=\varvec{\Omega }_0:=(\sigma _{jk})_{N\times N}\).

2.6 Fundamental prices

To define the fundamental price \(\mathbf p _{t}^{*}\), we consider a ‘standard CAPM’ with homogeneous beliefs where all agents have correct beliefs about the fundamental prices and are fully confident about their expected fundamental values (that is \(\varvec{\alpha }=diag[1,\ldots ,1]\)). We also assume that their average risk aversion coefficient is constant over time, \(\theta _{a,t}=\overline{\theta }\), and so are their common second-moment beliefs, \(\mathbf \Omega _{0}\).Footnote 10 Correspondingly we define the fundamental price as

$$\begin{aligned} \mathbf p _{t}^*=\frac{1}{r_f}(\mathbf d _{t}-\overline{\theta } \varvec{\Omega }_{0} (\mathbf s + \varvec{\xi }_t)), \end{aligned}$$
(12)

which is a martingale process under the assumptions about the exogenous dividend and market noise processes, so that

$$\begin{aligned} \mathbf p ^*_{t+1}=\mathbf p ^*_t+\varvec{\epsilon }_{t+1},\qquad \varvec{\epsilon }_{t+1}= \frac{1}{r_f}(\varvec{\sigma }_\zeta \varvec{\zeta }_{t+1} -\overline{\theta } \varvec{\Omega }_{0} \varvec{\sigma }_\kappa \varvec{\kappa }_{t+1})\sim \text{ Normal}~ \text{ i.i.d.} \end{aligned}$$
(13)

In this case, it follows from Eq. (6) that the equilibrium price is given by \(\mathbf p _{t}=\mathbf p _{t}^{*}\). Thus we can treat the benchmark CAPM case as the ‘steady state’ of the dynamics of the heterogeneous beliefs model.

2.7 Trend followers

Unlike the fundamental traders, trend followers are technical traders who believe the future price change can be predicted from various patterns or trends generated from the historical prices. They are assumed to extrapolate the latest observed price change over a long-run sample mean price and to adjust their variance estimate accordingly. More precisely, their conditional mean and covariance matrices are assumed to satisfy

$$\begin{aligned} E_{c,t}(\mathbf p _{t+1})=\mathbf p _{t-1}+ \varvec{\gamma }(\mathbf p _{t-1}-\mathbf u _{t-1}),\qquad \varvec{\Omega }_{c,t}=\varvec{\Omega }_{0}+\lambda \mathbf V _{t-1}, \end{aligned}$$
(14)

where \(\mathbf u _{t-1}\) and \(\mathbf V _{t-1}\) are sample means and covariance matrices of past market prices \(\mathbf p _{t-1}, \mathbf p _{t-2},\ldots \), the constant vector \(\varvec{\gamma }=diag[\gamma _1,\ldots ,\gamma _N]>0\) reflects the trend following strategy, and \(\gamma _j\) measures the extrapolation rate and high (low) values of \(\gamma _j\) correspond to strong (weak) extrapolation by trend followers, and \(\lambda \) measures the sensitivity of the second-moment estimate to the sample variance. This specification of the trend followers captures the extrapolative behavior of the trend followers, who expect price changes to occur in the same direction as the price trend observed over a past time window. Assume that \(\mathbf u _{t-1}\) and \(\mathbf V _{t-1}\) are computed recursively as

$$\begin{aligned} \mathbf u _{t-1}&= \delta \mathbf u _{t-2}+(1-\delta )\mathbf p _{t-1}, \nonumber \\ \mathbf V _{t-1}&= \delta \mathbf V _{t-2}+\delta (1-\delta )(\mathbf p _{t-1}- \mathbf u _{t-2})(\mathbf p _{t-1}-\mathbf u _{t-2})^\top . \end{aligned}$$
(15)

Effectively, the sample mean vector and variance-covariance matrix are calculated based on the all historical prices \(\mathbf p _{t-1}, \mathbf p _{t-2},\ldots \), spreading back to \(-\infty \) with geometric decaying probability weights \((1-\delta )\{1, \delta , \delta ^2,\ldots \}\). Therefore, as \(\delta \) decreases, the weights on the latest prices increase but decay geometrically at a common rate of \(\delta \). For \(\varvec{\gamma }>\mathbf 0 \) and large \(\delta \), momentum traders calculate the trend based on a long time horizon. In particular, when \(\delta =0, E_{c,t}(\mathbf p _{t+1})=\mathbf p _{t-1}\) and \(\mathbf V _{t-1}=\mathbf 0 \), implying naive behaviour by the trend followers. However, when \(\delta =1, \mathbf u _{t-1}=\mathbf u _0\) and \(\mathbf V _{t-1}=\mathbf V _0\), and therefore \(E_{c,t}(\mathbf p _{t+1})=\mathbf p _{t-1}\, +\, \varvec{\gamma }(\mathbf p _{t-1}-\, \mathbf u _0)\), so that trend followers are momentum traders.

2.8 The complete dynamic model

Based on the analysis above, the optimal demands of the fundamentalists and trend followers are given, respectively, by

$$\begin{aligned} \mathbf z _{f,t}=\theta _f^{-1}\varvec{\Omega }_o^{-1} [\mathbf p _{t-1}+\mathbf d _t+\varvec{\alpha } (\mathbf p _{t}^*-\mathbf p _{t-1})-R_f\mathbf p _{t}] \end{aligned}$$
(16)

and

$$\begin{aligned} \mathbf z _{c,t}=\theta _c^{-1}[\varvec{\Omega }_{0}+\lambda \mathbf V _{t-1}]^{-1}[\mathbf p _{t-1}+\mathbf d _t+\varvec{\gamma } (\mathbf p _{t-1}-\mathbf u _{t-1})-R_f\mathbf p _{t}]. \end{aligned}$$
(17)

Finally, the general dynamic model (6) reduces to the random nonlinear dynamical system

$$\begin{aligned} \left\{ \begin{array}{ll} \mathbf p _{t}&=\frac{\theta _{a,t}}{R_f}\varvec{\Omega }_{a,t} \Big [\frac{n_{f,t}}{\theta _f}\varvec{\Omega }_{0}^{-1}\big (\mathbf p _{t-1}+\varvec{\alpha } (\mathbf p ^*_{t}-\mathbf p _{t-1})\big )\\&\quad +\,\frac{n_{c,t}}{\theta _c}(\varvec{\Omega }_0+\lambda \mathbf V _{t-1})^{-1}\big (\mathbf p _{t-1}+\varvec{\gamma }(\mathbf p _{t-1}-\mathbf u _{t-1})\big )- \mathbf s -\varvec{\xi }_t\Big ]+\frac{1}{R_f}\mathbf d _t,\\ \mathbf p _{t}^*&=\frac{1}{r_f}(\mathbf d _{t}-\theta _{a}^* \varvec{\Omega }_{0} (\mathbf s + \varvec{\xi }_t)),\\ \mathbf u _{t}&=\delta \mathbf u _{t-1}+(1-\delta )\mathbf p _{t},\\ \mathbf V _{t}&=\delta \mathbf V _{t-1}+\delta (1-\delta )(\mathbf p _{t}- \mathbf u _{t-1})(\mathbf p _{t}-\mathbf u _{t-1})^\top ,\\ n_{f,t}&=\frac{1}{1\,+\,e^{-\eta v_{\Delta ,t-1}}},\\ \\ \varvec{\xi }_{t}&=\varvec{\xi }_{t-1}+\varvec{\sigma }_\kappa \varvec{\kappa }_{t},\\ \mathbf d _{t}&=\mathbf d _{t-1}+\varvec{\sigma }_\zeta \varvec{\zeta }_t, \end{array} \right. \end{aligned}$$
(18)

where

$$\begin{aligned} \theta _{a,t}&= \Big (\frac{n_{f,t}}{\theta _f}+ \frac{n_{c,t}}{\theta _c}\Big )^{-1}, \qquad \varvec{\Omega }_{a,t}=\frac{1}{\theta _{a,t}} \Big (\frac{n_{f,t}}{\theta _f}\varvec{\Omega }_{0}^{-1} +\frac{n_{c,t}}{\theta _c}(\varvec{\Omega }_0+\lambda \mathbf V _{t-1})^{-1}\Big )^{-1}, \\ v_{\Delta ,t}&:= v_{f,t}-v_{c,t}=\bigg (\mathbf z _{f,t-1}- \frac{\theta _{a,t-1}\mathbf s }{\theta _f}\bigg )^\top \\&\bigg (\mathbf p _{t}+\mathbf d _t-R_f \mathbf p _{t-1} -\frac{\theta _f}{2}\varvec{\Omega }_{0} ( \mathbf z _{f,t-1}+\frac{\theta _{a,t-1}\mathbf s }{\theta _f})\bigg ) -\bigg (\mathbf z _{c,t-1}-\frac{\theta _{a,t-1}\mathbf s }{\theta _c}\bigg )^\top \\&\bigg (\mathbf p _{t}+\mathbf d _t-R_f \mathbf p _{t-1} -\frac{\theta _c}{2}(\varvec{\Omega }_{0}+\lambda \mathbf V _{t-2})(\mathbf z _{c,t-1}+\frac{\theta _{a,t-1}\mathbf s }{\theta _c})\bigg )-C_\Delta ,\\ n_{c,t}&= 1-n_{f,t}, \qquad C_\Delta =C_f-C_c\ge 0. \end{aligned}$$

In summary, we have established an adaptively heterogeneous beliefs model of asset prices under the CAPM framework. The resulting model is characterized by a stochastic difference system with seven variables, which is difficult to analyze directly. To understand the interaction of the deterministic dynamics and noise processes, we first study the dynamics of the corresponding deterministic model in Sect. 3. The stochastic model (18) is then analyzed in Sect. 4.

3 Dynamics of the deterministic model

By assuming that the fundamental price and the dividend are constants \(\mathbf p ^*_{t}= \mathbf p ^*, \mathbf d _{t}=\bar{\mathbf{d }}\), and there is no supply shock \(\varvec{\xi }_t=0\), the system (18) becomes the deterministic dynamical systemFootnote 11

$$\begin{aligned} \left\{ \begin{array}{ll} \mathbf p _{t}&=\frac{\theta _{a,t}}{R_f}\varvec{\Omega }_{a,t} \Big [\frac{n_{f,t}}{\theta _f}\varvec{\Omega }_{0}^{-1}\big (\mathbf p _{t-1}+\varvec{\alpha } (\mathbf p ^*-\mathbf p _{t-1})\big )\\&\quad +\,\frac{n_{c,t}}{\theta _c}(\varvec{\Omega }_0+\lambda \mathbf V _{t-1})^{-1}\big (\mathbf p _{t-1}+\varvec{\gamma }(\mathbf p _{t-1}-\mathbf u _{t-1})\big )- \mathbf s \Big ]+\frac{1}{R_f}\bar{\mathbf{d }},\\ \mathbf u _{t}&=\delta \mathbf u _{t-1}+(1-\delta )\mathbf p _{t},\\ \mathbf V _{t}&=\delta \mathbf V _{t-1}+\delta (1-\delta )(\mathbf p _{t}- \mathbf u _{t-1})(\mathbf p _{t}-\mathbf u _{t-1})^\top ,\\ n_{f,t}&=\frac{1}{1\,+\,e^{-\eta v_{\Delta ,t-1}}}. \end{array} \right. \end{aligned}$$
(19)

The dynamical system (19) should not be interpreted as a deterministic approximation of stochastic system (18), based on some type of asymptotic convergence, but rather just as a system obtained by setting the dividend, the supply and the fundamental price at their unconditional mean levels. The analysis of this ‘deterministic skeleton’ is a common practice in the heterogeneous-agent literature, and it is aimed at gaining some initial insights into the impact of the parameters on the underlying dynamics. Although the properties of the deterministic skeleton do not carry over to the stochastic model in general, important connections between the dynamical structure of the stochastic model and that of the underlying deterministic model exist and have been highlighted in recent literature on stochastic heterogeneous-agent models (see, e.g. Chiarella et al. 2011; Zhu et al. 2011).

The system (19) has a unique steady state \((\mathbf p _{t}, \mathbf u _{t}, \mathbf V _{t}, n_{f,t})=(\mathbf p ^*, \mathbf p ^*, \mathbf 0 , n_f^*)\), where, following Eq. (12), the fundamental steady state price, \(\mathbf p ^*\), is given by

$$\begin{aligned} \mathbf p ^*=\frac{1}{r_f}(\bar{\mathbf{d }}- \theta _a^*\varvec{\Omega }_{0}\mathbf s ) \end{aligned}$$
(20)

and \(n^*_f=1/(1+e^{\eta C_\Delta })\). Hence, at the steady state, \(n^*_c=1-n^*_f\) and \(\theta _{a,t}=\theta _a^*=1/(n_{f}^*/\theta _f+n_{c}^*/\theta _c)\). Let \(\theta _0:=\theta _f/\theta _c\). Note that if \(\theta _f=\theta _c=\theta \), then \(\theta _{a,t}=\theta \) and \(\theta _0=1\).

For the \(N^2 + 5N + 2\) dimensional system (19), we are able to obtain the following proposition on the local stability of the steady state. The proof is given in the appendix.

Proposition 1

For the system (19),

  1. (i)

    if \(R_f \ge \delta (1+\gamma _j)\) for all \(j\in \{1,\ldots ,N\}\), then the steady state \((\mathbf p ^*, \mathbf p ^*, \mathbf 0 , n_f^*)\) is locally asymptotically stable;

  2. (ii)

    if \(R_f<\delta (1+\gamma _j)\) for all \(j\in \{1,\ldots ,N\}\), then the steady state is locally asymptotically stable when \(C_\Delta \ne 0\) and \(\eta < \widehat{\eta }_j:=\frac{1}{C_\Delta } \ln \frac{R_f\,-\,\delta (1-\alpha _j)}{\theta _0 [\delta (1\,+\,\gamma _j)\,-\,R_f]}\) for all \(j\in \{1,\ldots ,N\}\) and undergoes a Hopf bifurcation when \(\eta = \widehat{\eta }_j\) for some \(j\in \{1,\ldots ,N\}\). If \(C_\Delta =0\), then the steady state is locally asymptotically stable when \(\theta _0 \gamma _j<\alpha _j+(1+\theta _0)(\frac{R_f}{\delta }-1)\) for all \(j\);

  3. (iii)

    if \(R_f<\delta (1+\gamma _j)\) for some \(j\in J_o \subseteq \{1,\ldots ,N\}\), then the steady state is locally asymptotically stable when \(\eta < \widehat{\eta }_m:=\min _{j\in J_o} \widehat{\eta }_j\) and undergoes a Hopf bifurcation when \(\eta = \widehat{\eta }_m\).

The results in Proposition 1 are significant with respect to the intuitive and simple conditions on the stability of the steady state for such a high dimensional system. First, when the trend followers are not very active (so that \(\gamma _j\le R_f/\delta -1\)), the steady state of the system is stable. Second, the stability condition (ii) is equivalent to

$$\begin{aligned} \frac{R_f}{\delta }-1<\gamma _j<\frac{(\frac{R_f}{\delta }-1)(1+\theta _0 e^{\eta C_\Delta })+\alpha _j}{\theta _0 e^{\eta C_\Delta }}, \qquad j=1, \ldots , N. \end{aligned}$$

Hence, even when the trend followers are active (so that \(\gamma _j> R_f/\delta -1\)), the system can still be stable when the fundamentalists dominate the market at the steady state or, equivalently, the switching intensity is sufficiently small. In short, Proposition 1 shows clearly that increases in \(C_c, \alpha _j\) and \(\theta _c\) stabilize the system, while increases in \(C_f, \delta , \gamma \) and \(\theta _f\) destabilize the system. Intuitively, the fundamentalists play a stabilizing role in the market. The activity of fundamentalists is enhanced with an increase in \(\alpha _j\) or decreases in \(C_f\) (since a decrease in \(C_f\) increases the market fraction of fundamentalists) and \(\theta _f\) (since a decrease in \(\theta _f\) increases fundamentalists’ long/short position when the fundamental price moves away from the market price).

To understand how the impact of switching in a market with many risky assets is different from a market with a single risky asset, we consider a special case where agents invest in a market with one risk-free asset and one risky asset, say asset \(j\). In this case, system (19) reduces to

$$\begin{aligned} \left\{ \begin{array}{ll} p_{j,t}&=\frac{\bar{d}_j}{R_f}+ \frac{1}{R_f\Big (\frac{n_{f,t}}{\theta _f \sigma ^2_j}\,+\,\frac{n_{c,t}}{\theta _c(\sigma ^2_j\,+\,\lambda V_{j,t-1})}\Big )}\bigg [\frac{n_{f,t}\big (p_{j,t-1}\,+\,\alpha _j (p^*_j\,-\,p_{j,t-1})\big )}{\theta _f \sigma ^2_j}\\&\qquad \qquad +\,\frac{n_{c,t} \big (p_{j,t-1}\,+\,\gamma _j(p_{j,t-1}\,-\,u_{j,t-1})\big )}{\theta _c(\sigma ^2_j\,+\,\lambda V_{j,t-1})}-s_j\bigg ],\\ u_{j,t}&=\delta u_{j,t-1}+(1-\delta )p_{j,t},\\ \\ V_{j,t}&=\delta V_{j.t-1}+\delta (1-\delta )(p_{j,t}-u_{j,t-1})^2,\\ \\ n_{f,t}&=\frac{1}{1\,+\,e^{-\eta v_{\Delta ,t-1}}}. \end{array} \right. \end{aligned}$$
(21)

The dynamics of the system (21) can be characterized by the following proposition (the proof is given in the appendix).

Proposition 2

For the system (21),

  1. (i)

    if \(R_f \ge \delta (1+\gamma _j)\), then the steady state \((p^*_j, p^*_j, 0, n_f^*)\) of the system is always locally asymptotically stable;

  2. (ii)

    if \(R_f<\delta (1+\gamma _j)\), then the steady state is locally asymptotically stable when \(\eta < \widehat{\eta }_j\) and \(C_\Delta \ne 0\) and undergoes a Hopf bifurcation when \(\eta = \widehat{\eta }_j\). When \(C_\Delta =0\), the steady state is locally asymptotically stable if \(\theta _0 \gamma _j<\alpha _j+(1+\theta _0)(\frac{R_f}{\delta }-1)\).

By comparing the local stability conditions in Propositions 1 and 2, one can see that the stability conditions of each risky asset due to the increasing switching intensity are independent of the parameters specified to any other asset and, surprisingly, the correlations among risky assets have no impact on the local stability properties.Footnote 12 This result is due to the peculiar properties of the Jacobian matrix and the adaptive behaviour considered (this becomes clear from the proofs in the appendix). Hence the local stability properties of asset \(j\) in the multi-asset model are exactly the same as if asset \(j\) was considered in isolation (that is, in the model with only risky asset \(j\) and the risk-free asset).

Propositions 1 and 2 provide an initial insight into the mechanisms governing the joint price dynamics of multiple risky assets, showing that locally instability plays a very small role in the spill-over phenomena that we will discuss in what follows, but globally the instability of one asset can spill over to the other assets due to its correlations with other assets.

To better understand the implications of Propositions 1 and 2 and the price dynamics of the model, we consider an example of two risky assets and a riskless asset with

$$\begin{aligned} \varvec{\Omega }_0=\left(\begin{array}{cc} \sigma ^{2}_1&\quad \rho _{12}\sigma _1\sigma _2\\ \rho _{12}\sigma _1\sigma _2&\quad \sigma ^{2}_2 \end{array}\right) \end{aligned}$$

and setFootnote 13 \(\mathbf s =(0.1, 0.1)^\top , \theta _f=1, \theta _c=1, \lambda =1.5, C_f=4, C_c=1, \rho _{12}=0.5, \delta =0.98, \varvec{\gamma }=diag[0.3, 0.3]\) and \(\varvec{\alpha }=diag[0.4, 0.5]\). We choose the annual valuesFootnote 14 of the following parameters: \(r_f=0.025, \sigma _1=0.6, \sigma _2=0.4\) and \(\bar{\mathbf{d }}=(0.08, 0.05)^\top \). In this paper, we consider monthly time steps (i.e. \(K=12\)).

Based on this set of parameters, the model has the following implications. First, the equilibrium steady state fundamental price decreases when the correlation coefficient increases and, when the fundamental strategy costs more than the trend follower strategy, the steady state market fraction of the fundamentalists reduces as the switching intensity increases. These results are illustrated in Fig. 1a, b respectively for the two-asset system (19). In fact, Eq. (20) determines the dependence of the steady state fundamental price on the parameters. Figure 1a illustrates a negative linear relationship between the fundamental steady state price \(\mathbf p ^*=(p_1^*, p_2^*)\) and the correlation \(\rho _{12}\).

Fig. 1
figure 1

a The fundamental steady state price \(\mathbf p ^*=(p_1^*, p_2^*)\) as a function of the correlation \(\rho _{12}\) with \(\eta =1\); b The equilibrium market fractions of fundamentalists \(n_f^*\) as a function of the switching intensity \(\eta \)

Secondly, as implied by Propositions 1 and 2, asset prices become unstable as the switching intensity \(\eta \) increases. This is illustrated in Fig. 2. With the chosen parameters, one can verify that \(R_f<\delta (1+\gamma _j)\) for \(j=1,2\), and the bifurcation values for asset one and two are \(\widehat{\eta }_1\approx 2.2384\) and \(\widehat{\eta }_2\approx 3.0485\) respectively. According to Proposition 1, when \(\eta <\widehat{\eta }_1\) the two prices are stable; when \(\widehat{\eta }_1<\eta <\widehat{\eta }_2\), the price of asset two is still stable, however the price of asset one becomes unstable; when \(\eta >\widehat{\eta }_2\), the prices of both assets become unstable.Footnote 15 Figure 2 plots the price bifurcation diagrams with respect to the switching intensity parameter \(\eta \) for both system (19) with two risky assets and system (21) with one risky asset. For the single risky asset model, Fig. 2c, d show that an increase in the switching intensity \(\eta \) makes the steady state price unstable, leading to the complicated price dynamics documented in Brock and Hommes (1998). With two risky assets, Fig. 2a, b show that the steady state is stable when the switching intensity \(\eta \) is low, but becomes unstable as the switching intensity increases. The time series of prices and the market fraction of the fundamentalist in Fig. 3a–c provide further evidence on the analysis above. At first, both assets and the market fraction are stable and constant when \(\eta =1.5\) is small (Fig. 3a). As \(\eta \) increases to 2.5, asset one and then asset two become unstable as illustrated in Fig. 3b. As \(\eta \) increases to 3.5, both asset prices become unstable (see Fig. 3c). Also the price of risky asset one of the two-asset model is more irregular compared to the regular fluctuations in Fig. 3f of the one asset model. In addition, as the switching intensity \(\eta \) increases, even small fluctuations in the market fractions of agents can cause large fluctuations in asset prices.

Fig. 2
figure 2

The bifurcations of the two risky asset prices with respect to \(\eta \); (a, b), the two-asset model (19); and (c, d) the single risky asset model (21)

Fig. 3
figure 3

Time series plots of \(p_{1,t}, p_{2,t}\) and \(n_{f, t}\) in the two-asset model (a)–(c) and of \(p_{1,t}\) in the single-asset one model (d)–(f) with \(\eta =1.5\) in (a) and (d); \(\eta =2.5\) in (b) and (e); and \(\eta =3.5\) in (c) and (f)

Thirdly, the model displays a very interesting spill-over effect, which can be very different from portfolio effect. As we discussed earlier, the stability is a local result and the stability conditions of the risky assets are independent among the risky assets. When one asset becomes unstable, one would expect the spill-over of instability of the asset to spread to the other assets due to the portfolio effect. However, this may not always be the case, as demonstrated in Fig. 4. For \(\eta =2.5\), Fig. 4a shows that the price is unstable for asset one, but stable for asset two. Intuitively, the price fluctuations in asset one would be caused by changing portfolio positions taken by the two types of agents for asset one, which is confirmed by Fig. 4c. However, this intuition does not carry over to asset two for which the price is constant but the portfolio positions taken by agents for the asset are also varying, as illustrated in Fig. 4d. The portfolio variations due to the portfolio effect lead to the fluctuations of the portfolio values of the agents that are illustrated in Fig. 4b. How can this happen? As a matter of fact, there are two reasons behind this interesting phenomena. First, the variations of the risky assets in the portfolios are caused by the correlation between risky assets (reflected in both \(\varvec{\Omega }_0\) and \(\mathbf{V}_t\)) and the time-varying population fractions. Hence, even when the price of asset two is constant, the portfolio positions of agents in asset two may not be constant. Secondly, the spill-over effect is a nonlinear rather than a linear effect, meaning that the stability of asset two in the nonlinear system is observed when the initial values are near the steady state values; otherwise, stability may not be maintained. Figure 5 shows how the instability of asset one spill over to asset two for \(\eta \in (\hat{\eta }_1, \hat{\eta }_2)\) increases from 2.24 in (a) to 2.5 in (b) and then to 3.04 in (c) when the initial prices are far away from the steady state price levels. Note that asset two is locally stable for \(\eta \in (\hat{\eta }_1, \hat{\eta }_2)\). Hence the spill-over effect reflects the dynamics of the nonlinear system. In fact, we do observe such spill-over effects in the bifurcation plots in Fig. 2. Note that the first small price jump of asset one in Fig. 2a after the initial bifurcation (at \(\eta =\hat{\eta }_1\)) occurs at \(\eta =\hat{\eta }_2\), which is the bifurcation of the second asset in the single asset model (in Fig. 2d). This implies that, when asset two becomes unstable, there is a spill-over effect from asset two to asset one characterized by the price jump of asset one near \(\hat{\eta }_2\). Interestingly, as the intensity increases further, say \(\eta \approx 3.4\), the fluctuations of asset one increases significantly, which is demonstrated by the large price jump of asset one for \(\eta >3.4\).

Fig. 4
figure 4

The time series of a the prices and market fraction; b portfolio values of the fundamentalists and trend followers; and portfolio positions of two types of agents in asset one (c) and asset two (d). Here \(\eta =2.5\).

Fig. 5
figure 5

The market prices for \(\eta =2.24\) (a), 2.5 (b) and 3.04 (c) when initial values are far away from the steady state

In addition, numerical simulations (not reported here) show that an increase in \(\rho _{12}\) leads to increases in the fluctuations of the prices when the system (19) becomes unstable. Intuitively, as the correlation of the two risky assets increases, diversification becomes less effective, hence assets become more risky, and consequently the fundamental equilibrium prices decrease (in order to have a high expected return). Also, simulations show (not reported here) that market prices become more volatile when the trend followers are less concerned about the sample variance; that is when \(\lambda \) becomes small, even though \(\lambda \) does not affect the local stability of the system (19). In fact, when \(\lambda \) becomes small, the demand of the trend followers increases so that they become more active in the market, leading to a more volatile market.

In summary, we have shown that the rational behaviour of agents in switching to better performing strategies can lead to market instability and a non-linear spill-over of price fluctuations from one asset to other assets. The nonlinear dynamics due to the spill-over effect can lead to high trading volume and high volatility. This becomes clearer in the discussion of the stochastic model in the next section.

4 Price behaviour of the stochastic model

In this section, through numerical simulations, we first focus on the spill-over effect by examining the interaction between the dynamics of the deterministic model and the noise processes and explore the potential power of the model to explain price deviations from the fundamental prices and also high volatility. We then provide an evolutionary capital asset pricing model (ECAPM) and compare the ex-ante betas with the rolling window estimates of the betas used in the literature. Finally we study the relationship between the price volatility and trading volumes. We choose \(\varvec{\sigma }_\kappa =diag[0.001, 0.001]\) and \(\varvec{\sigma }_\zeta =diag[0.002, 0.002]\), representing \(0.1\) and \(0.2\;\%\) standard deviations of the noisy supply and dividend processes respectively in this section.

4.1 The spill-over effect

First, we examine the spill-over effect by exploring the joint impact of the switching intensity \(\eta \) and the two noise processes on the market price dynamics. To examine the impact of stability of the deterministic model on the price dynamics, in particular, the time-varying betas, for the stochastic model, with the same random draws of the dividend and supply noise processes, Fig. 6 plots the fundamental price (the dotted lines) and the market prices (the solid lines) in (a) and (b) and the corresponding market fractions of the fundamentalists of the two-asset model for two different switching intensities \(\eta \). For \(\eta =1.5\), Fig. 6a and c demonstrate that the market price follows the fundamental price closely with about 40 % of the fundamentalists. This is underlined by the stable fundamental steady state of the deterministic model (19) illustrated in Fig. 3a. For \(\eta =3.5\), Fig. 6b and d indicate that the market price fluctuates around the fundamental price in a cyclical fashion with about 29 % of the fundamentalists, which is underlined by the bifurcation of periodic oscillations of the corresponding deterministic model (see Fig. 3c). Corresponding to Fig. 4 for the deterministic model, Fig. 7 plots the time series of the prices in (a), the market fraction of the fundamentalists in (b), the portfolio values of the two agents in (c), the portfolio positions in asset one (d) and asset two (e) of the stochastic model. The large fluctuations of the stochastic model, in particular in the portfolio values and the portfolio positions, compared to the deterministic model reflect the impact of the nonlinear interaction of the spill-over effects and the noise processes.

Fig. 6
figure 6

The time series of the fundamental price (the dotted line) and the market prices (the solid line) of the two-asset model with a \(\eta =1.5\) and b \(\eta =3.5\), and the corresponding market fractions of the fundamentalists in (c) and (d).

Fig. 7
figure 7

The time series of prices (a), market fractions of the fundamentalists (b), the portfolio values of two types of agents (c), the portfolio positions in asset one (d) and asset two (e) of the stochastic model with \(\eta =2.5\)

4.2 Time-varying betas

Next, we examine the stochastic nature of the time-varying beta coefficients of the evolutionary CAPM. The value of the market portfolio \(\mathbf s \) at time \(t\) in the market equilibrium is given by \(W_{m,t}=\mathbf p _t^\top \mathbf s \) and the payoff is \( W_{m,t+1}=\mathbf x ^\top _{t+1} \mathbf s \). Hence, under the consensus belief there holds

$$\begin{aligned} E_{a,t}(W_{m,t+1})=E_{a,t}(\mathbf x _{t+1})^\top \mathbf s , \qquad Var_{a,t}(W_{m,t+1})=\mathbf s ^\top \varvec{\Omega }_{a,t} \mathbf s . \end{aligned}$$
(22)

Define the returns of risky asset \(j\) and the market portfolio \(m\), respectively, by

$$\begin{aligned} r_{j,t+1}=\frac{x_{j,t+1}}{p_{j,t}}-1, \qquad r_{m,t+1}=\frac{W_{m,t+1}}{W_{m,t}}-1, \end{aligned}$$
(23)

from which

$$\begin{aligned} E_{a,t}(r_{j,t+1})=\frac{E_{a,t}(x_{j,t+1})}{p_{j,t}}-1, \qquad E_{a,t}(r_{m,t+1})=\frac{E_{a,t}(W_{m,t+1})}{W_{m,t}}-1. \end{aligned}$$

Following Chiarella et al. (2011), we obtain the standard CAPM-like return relation

$$\begin{aligned} E_{a,t}(\mathbf r _{t+1})-r_f\mathbf 1 =\varvec{\beta }_{a,t} [E_{a,t}(r_{m,t+1})-r_f], \end{aligned}$$
(24)

where

$$\begin{aligned} \varvec{\beta }_{a,t}=(\beta _{1,t},\ldots ,\beta _{N,t})^\top , \qquad \beta _{j,t}=\frac{Cov_{a,t}(r_{m,t+1},r_{j,t+1})}{Var_{a,t}(r_{m,t+1})} \end{aligned}$$
(25)

are the beta coefficients in market equilibrium. Notice that the betas in Eq. (25) are ex-ante in the sense that they reflect the market equilibrium condition under the consensus belief \(E_{a,t}\) and \(\varvec{\Omega }_{a,t}\). In addition, Eq. (23) also implies \(r_{m,t+1}=\varvec{\omega }_{t}^\top \mathbf r _{t+1}\), leading to \(\varvec{\omega }_{t}^\top \varvec{\beta }_{a,t}=1\), where \(\varvec{\omega }_{t}=\mathbf P _t\mathbf s /(\mathbf p _t^\top \mathbf s )\) with \(\mathbf P _t=diag[p_{1,t},\ldots ,p_{N,t}]\) are the proportions of the total wealth (ex dividend) in the economy invested in the risky assets at time \(t\).

To examine the time-varying betas of the stochastic model, we choose two switching intensities \(\eta =1.5\) and 3.5 as before. The time series of the market prices, fractions of the fundamentalists, the proportions of the market portfolio invested in the two risky assets, the ex-ante betas of the risky assets, and the estimates of the betas using rolling windows of 100 and 300 are illustrated in Fig. 8 for \(\eta =1.5\) and in Fig. 9 for \(\eta =3.5\). For \(\eta =1.5\), the fundamental price of the deterministic model is stable, the variation of the beta coefficients in Fig. 8d is large but less significant compared to the beta coefficients in Fig. 9d for \(\eta =3.5\) (where the fundamental price of the deterministic model is unstable). Both the pattern and the level of the beta coefficients for \(\eta =1.5\) are very different from those for \(\eta =3.5\). More importantly, both Figs. 8 and 9 show that the rolling estimates of the betas do not necessarily reflect the nature of the ex-ante betas implied by the CAPM, which is consistent with the results in Chiarella et al. (2012). Interestingly, the estimated betas for window of 100 are more volatile compared to the ex-ante betas. However, an increase in the rolling window from 100 to 300 in (e) and (f) of Figs. 8 and 9 smooths the variations of the beta estimates significantly, leading to a similar patterns to the ex-ante betas.

Fig. 8
figure 8

Time series of a the market prices; b the returns; c the proportions of the total market wealth invested in risky assets; d the ex-ante betas of the risky assets; and the estimates of the betas using rolling windows of e 100 and f 300 with \(\eta =1.5\)

Fig. 9
figure 9

Time series of a the market prices; b the returns; c the proportions of the total market wealth invested in risky assets; d the ex-ante betas of the risky assets; and the estimates of the betas using rolling windows of e 100 and f 300 with \(\eta =3.5\)

4.3 Trading volume and volatility

Finally, we examine the dynamic relation between price volatility and trading volume. As in Banerjee and Kremer (2010), the price volatility is measured by the price difference \(|p_{j,t}-p_{j, t-1}|\) and the trading volume at time \(t\) is defined by

$$\begin{aligned}&\mathbf X _t=\min \{n_{f,t-1},n_{f,t}\}|\mathbf z _{f,t}- \mathbf z _{f,t-1}|+\min \{n_{c,t-1},n_{c,t}\}|\mathbf z _{c,t}- \mathbf z _{c,t-1}|\nonumber \\&\quad \qquad +\, |n_{f,t}-n_{f,t-1}|\hat{\mathbf{X }}_t, \end{aligned}$$
(26)

where

$$\begin{aligned} \hat{\mathbf{X }}_t=\left\{ \begin{array}{ll} |\mathbf z _{f,t}-\mathbf z _{c,t-1}|,&\quad n_{f,t}\ge n_{f,t-1},\\ \\ |\mathbf z _{c,t}-\mathbf z _{f,t-1}|,&\quad n_{f,t}<n_{f,t-1}.\\ \end{array}\right. \end{aligned}$$

Due to the switching mechanism, the total trading volume \(\mathbf X _t\) in (26) can be decomposed into three components. The first and second components correspond to the trading volume of the agents who use, respectively, the fundamental and trend following trading strategies at both time \(t-1\) and \(t\). The third component corresponds to the trading volume of those agents who change their strategies from \(t-1\) to \(t\). In particular, when \(n_{f, t}>n_{f, t-1}\), a fraction of \(n_{f, t}-n_{f, t-1}\) agents change their strategies from the trend following strategy at time \(t-1\) (with a demand of \(z_{c, t-1}\)) to the fundamental strategy at time \(t\) (with a demand of \(z_{f, t}\)).

To explore the dynamics of the volatility and trading volume, we set \(\eta =1.5\) and choose two values of \(\rho _{12}=0.5\) and \(-0.9\) to examine the impact of the correlation. The time series of prices, demands, price volatility and trading volumes are illustrated in Fig. 10 with \(\rho _{12}=0.5\) and Fig. 11 with \(\rho _{12}=-0.9\) for a typical simulation. With the same random seeds, Figs. 10 and 11 illustrate the significant impact of the portfolio effect due to the different choices of the correlation coefficient \(\rho _{12}=0.5\) and \(-0.9\). Figures 10 and 11a, b show that the market prices can deviate from the fundamental prices from time to time, though they follow each other in the long-run. Figures 10 and 11c, d show that the fundamentalists and trend followers take opposite positions in risky assets in general, as expected in market equilibrium with two types of agents trading against each other. Figures 10 and 11 e, f indicate that both volatility and trading volume are persistent, which is further verified by the autocorrelations (ACs) of the price volatility and trading volume of risky asset one in Fig. 12a, b respectively. The results are based on 100 numerical simulations with the same parameters but different random processes. They demonstrate that the ACs for both the volatility and trading volume are highly significant and decaying over long lags.

Fig. 10
figure 10

The time series of market prices and fundamental price of asset one (a) and asset two (b); the portfolio positions in asset one (c) and asset two (d); the price volatility and trading volume of asset one (e) and asset two (f). Here \(\rho _{12}=0.5\) and \(\eta =1.5\)

Fig. 11
figure 11

The time series of market prices and fundamental price of asset one (a) and asset two (b); the portfolio positions in asset one (c) and asset two (d); the price volatility and trading volume of asset one (e) and asset two (f). Here \(\rho _{12}=-0.9\) and \(\eta =1.5\)

Fig. 12
figure 12

The ACs of the price volatility and the trading volume of asset one with \(\eta =1.5\)

Intuitively, the correlation should play an important role in the relation between volatility and trading volume. With the two different values of \(\rho _{12}=0.5\) and -0.9, Figs. 10 and 11e, f depict the relationship between the price volatility and the trading volume of the two-asset model. The observation is summarized statistically by the plot in Fig. 13 of the relation between the correlation coefficient \(\rho _{12}\) and the average correlation between price volatility and trading volume of the two assets (asset one in (a) and asset two in (b)) and correlation in volatility (c) and trading volumes (d) among the two assets based on 100 simulations. We observe that the correlation between the volatility and trading volume is positive (negative) when assets are less (more) correlated, but the correlations in both volatilities and trading volumes of the two assets are high when both assets are highly correlated. The result is very intuitive; when the payoffs are less correlated in agents’ beliefs, both price volatility and trading volume of the two assets are also less correlated. In summary, the persistence in price volatility and trading volume and the autocorrelation patterns in volatility and trading volume illustrated by the model are closely related to the characteristics of financial markets.

Fig. 13
figure 13

The correlation between trading volumes and volatilities for asset one (a) and asset two (b) and the correlations of price volatilities (c) and trading volumes (d) of the two risky assets. The results are based on 100 simulations with \(\eta =1.5\)

5 Conclusion

This paper extends the single-period equilibrium CAPM of Chiarella et al. (2011) to a dynamic equilibrium evolutionary CAPM to incorporate the adaptively switching behaviour of heterogeneous agents. By analyzing the stability of the underlying deterministic model, we show that the evolutionary CAPM is capable of characterizing the spill-over effects, the persistence in price volatility and trading volume, and realistic correlations between price volatility and trading volume. Also, the stochastic nature of time-varying betas implied by the equilibrium model may not be consistent with the rolling window estimate of betas used in the empirical literature. The model provides further explanatory power of the recently developed HAMs.

In this paper, the numerical analysis is focused on the case of two risky assets, though the stability analysis is conducted for any number of risky assets. It would be interesting to see how an increase in the number of risky assets could have different effects. We expect the main results obtained in this paper to hold. The statistical analysis is mainly based on some Monte Carlo simulations and a systematical study of the empirical relevance using econometric methods would be interesting. We leave these issues to the future research.