Measuring the Behavioral Component of Financial Fluctuations: An Analysis Based on the S&P 500

We study the evolution of the behavioral component of the financial market by estimating a Bayesian mixture model in which two types of investors coexist: one rational, with standard subjective expected utility theory (SEUT) preferences, and one behavioral, endowed with an S-shaped utility function. We perform our analysis by using monthly data on the constituents of the S&P 500 index from January 1962 to April 2012. We assume that agents take investment decisions by ranking the alternative assets according to their performance measures. A tuning parameter blending the rational and the behavioral choices can be estimated by using a criterion function. The estimated parameter can be interpreted as an endogenous market sentiment index. This is confirmed by a number of checks controlling for the correlation of our endogenous index with measures of (implied) financial volatility, market sentiments and financial stress. Our results confirm the existence of a significant behavioral component that reaches its peaks during periods of recession. Moreover, after controlling for a number of covariates, we observe a significant correlation between the estimated behavioral component and the S&P 500 return index.


Introduction
The main assumption of the traditional approach to finance (LeRoy and Werner, 2000) is that, in taking their investment decisions, agents maximize a well-conformed utility function that satisfies the requirements of the Subjective Expected Utility Theory (SEUT).
As is well known, the validity of this hypothesis has been strongly questioned for its inability to account for systematic empirical puzzles, such as the persistent mispricing of assets and the existence of arbitrage opportunities in the financial market (Hirshleifer, 2001; Barberis and Thaler, 2003;Lamont and Thaler, 2003). 1 Moreover, there is a huge amount of experimental evidence documenting systematic violations of the SEUT assumptions in risky gamble decisions; for an extensive and comprehensive survey, see Starmer (2000).
Once admitted that the requirements of the SEUT are rather innocuous for describing financial decisions, scholars have begun introducing novel behavioral assumptions on individual preferences in their models. An intriguing research question that remains open in the literature is concerned with how to isolate and empirically measure the behavioral component of the financial market.
The present paper is aimed at tackling this gap. In particular, by using monthly data on the 500 components of the S&P 500 index from January 1962 to April 2012, we propose a Bayesian mixture approach to estimate the relative impact of the behavioral component on financial market movements.
As in standard heterogeneous agent settings (Zeeman, 2007;Grossman and Stiglitz, 1980;De Long et al., 1990), the underlying model assumes that, in every period of time, the evolution of the asset prices reflects the interplay between the investment choices of two types of nonstrategic financial agents: one rational, endowed with a standard risk averse utility function that satisfies the SEUT requirements, and one characterized by behavioral preferences. Of all the new non-expected utility theories proposed as valid alternatives to the SEUT, the Prospect Theory (Kahneman and Tversky, 1979;Tversky and Kahneman, 1992) represents the most successful approach and serves as the natural benchmark for our methodology. According to the original formulation, behavioral agents' preferences are described by an S-shaped value function that presents three main attributes: (a) agents perceive a monetary outcome as a gain or a loss relative to a reference point; (b) agents' risk attitude changes over the monetary outcomes such 1 The equity premium puzzle surely represents the most intriguing empirical inconsistency studied by financial economists: although stocks on average exhibit attractive risk-return performances, investors appear to demand a substantial risk premium in order to prefer this asset to other riskless investment opportunities. that they exhibit risk averse preferences in the gain domain, while they are risk lovers in the loss domain; (c) agents are loss averse whereby, beginning from the reference point and for a given monetary change, their utility is more sensitive to negative monetary changes than to positive ones. As a first step, we set the Bayesian mixture by assuming that the behavioral agents are endowed with an S-shaped utility function. Given the specification of the two categories of agents, the mixture depends on a weighting factor that expresses the relative weight of the behavioral view over the rational ones: the higher the value of the weighting factor, the closer the asset evaluations of the financial market to those of the behavioral agents.
Although grounded in traditional agent's design, our methodology presents two main features that make it a powerful empirical instrument to analyze financial data. First, the relative importance of the behavioral component is estimated in every period by using an optimizing methodology that is based on performance measures. Performance measures have several advantages from an empirical viewpoint. They summarize into a single parameter the interplay between risk and return of the corresponding asset. Moreover, performance measures can be ordered in such a manner that assets with higher measures perform better. Finally, to define the performance measure of an asset, the financial agent chooses the partition of wealth between a riskless activity and the risky asset that maximizes her utility function (Pedersen and Satchell, 2002). In a capital allocation setting, both rational and behavioral agents make choices by maximizing a specific performance measure, which is related to the feature of their utility functions.
Risk-averse agents consider the Generalized Sharpe ratio (see Zakamouline and Koekebakker (2009a) and Zakamouline and Koekebakker (2009b)), while the Z-ratio is adopted by behavioral agents (Zakamouline, 2014). To make their investment decisions, in every period, each of the two categories of agents first determines the performance measure associated with each of the 500 constituents of the S&P 500, and then builds a ranking ordered from the best to the least performing asset. Given the evaluations of the two types of agents, the market acts as a sophisticated investor that builds a mixture ranking by conditioning, in a Bayesian setting, the prior ordering of the rational agents on that of the behavioral category. The mixture depends on a weighting factor that expresses the uncertainty on the rational prior, or, from an antithetic viewpoint, the relative weight of the behavioral evaluations over the rational one: the higher the value of the weighting factor, the more the mixture ordering approaches that of the behavioral agents. We compute the value of the weighting factor by maximizing the cumulated return of the first 100 most performing assets of the mixture ranking. Intuitively, the weighting factor captures the extent to which the financial market should have moved from the ordering of the rational category to the ranking of the behavioral agents to maximize the financial performances of her investments.
The second main feature of our methodology concerns its recursive nature. To build their rankings and make their investment decisions, financial agents use a substantial quantity of information on the past returns of assets. In particular, we assume that, to define the performance measure of an asset in a period, an agent considers the distribution of the asset's past returns in the previous 60 months. This is compatible with the idea that the performance measure defined by an agent in a period represents her best adaptive expectation of the future performance of the corresponding asset.
By virtue of the specific recursive structure, the methodology can be used to analyze the evolution of the behavioral component over time and its relationship with the economic cycle.
For example, the assumptions underlying the S-shaped value function imply that the risk attitude of behavioral agents changes along with the economic cycle. On the one hand, in periods of (financial and economic) recession, behavioral agents are risk seeking and, therefore, willing to invest in riskier assets that, with positive probabilities, might compensate past (observed) losses. On the other hand, in periods of expansion, agents are risk averse and prefer safer assets to capitalize past (observed) capital gains.
The novel framework as introduced here represents our first contribution to the literature.
Further insight comes from the empirical applications of our model. We confirm the existence of a substantial behavioral component which changes over time according to the fluctuations of the financial market. Under the specification based on the S-shaped utility functions, the weighting factor is significantly greater than zero and reaches its highest values when nearing periods of financial and economic crises. Consequently, the weighting factor might be given alternative financial explanations associated with market sentiment or market stress. To further validate this possible interpretation, we formally study the relation between the weighting factor and alternative measures of financial market stress (such as the Kansas City Financial Stress Index, Hakkio and Keeton (2009), or the St. Louis FED Financial Stress Index), market sentiment (Baker and Wurgler (2007)), as well as a number of further financial and macro-related controls (including time indicators for NBER-dated recessions, industrial production index, measures of market volatility and market liquidity). We find our behavioral indicator to be significantly associated with both financial market stress and sentiment measures, thereby reaffirming the validity of our interpretation. Building on these results, we interpret the indicator as an endogenous market sentiment index. More interestingly, when introduced as additional independent covariate in a multifactor model to explain the evolution of market returns, our behavioral indicator accounts for a substantial proportion of the unexplained time variability of the dependent variable. These findings are consistently observed under a number of alternative designs for the weighting factor estimation.
Our methodology does not impose any particular restriction on the function used to describe the preferences of the behavioral agent. In this respect, to check for robustness and in line with recent empirical findings (see Tibiletti and Farinelli (2003); Malmendier and Nagel (2011); Guiso et al. (2013); Cohn et al. (2013)), we also replicate our analysis by considering a reversed-S-shaped value function that is concave in the loss domain and convex in the gain domain.
Interestingly, compared to the S-shaped specification, the correlation between the S&P 500 return index and the estimated weighting factor series under this different specification reduces substantially, thereby providing evidence in favor of the existence of pro-cyclical risk aversion in the financial market.
The remainder of the paper proceeds in the following manner. Section 2 describes the agent types and how they determine investment choices, while Section 3 focuses on the market and on the blending of rational and behavioral choices. Section 4 presents the empirical analyses, where the data is described and weighting factors are estimated. Section 5 further analyses these factors and provides a financial interpretation. Section 6 contains the robustness checks, and Section 7 concludes. The paper also has an online web appendix with complimentary results.

Rational and Behavioral Views
As anticipated in the introduction, we assume that there are two types of agents in the market that differ in terms of preferences. To optimally allocate financial wealth over assets, both types of agents build performance measures at the single asset level on the basis of their preferences.
Moreover, performance measures are related to the level of maximum expected utility provided by a given single asset, and, generally speaking, 2 are functions of the moments of the return distribution of the risky asset. The higher the performance measure of an asset, the higher the maximum expected utility it yields to the investor. Given the performance measures of the assets, both agents' categories invest their financial resources in the subset (a fraction of the investment universe) that contains the most performing assets. The purpose of the mixture model (synthesized in Figure 1) is to efficiently combine the two views, the rational and behavioral ones, in order to recover the composite investment perspective of a sophisticated investor, the market. In the following subsections, we briefly describe the utility functions characterizing the two types of agent and how they rank and select assets. We discuss the construction of the composite view in the next section.

The Choices of the Rational Agent
The first type of agent is equipped with a SEUT utility function satisfying the hypotheses of the expected utility theory. Thus, in this case, we refer to the optimal choices of a rational agent. For computational convenience, we use a Constant Absolute Risk Aversion (CARA) utility function. 3 Namely, preferences of the rational agents are described by the following negative exponential utility: where λ represents the coefficient of risk aversion. It is worth noticing that the concavity of the utility function depends on both λ and the wealth of the investor, W . In a simplified framework, the wealth of the agent is optimally allocated between a risky and a risk-free asset.
In the Markowitz model (Markowitz (1952)), under Gaussianity of the risky asset returns and negative exponential utility function specification, it is known that the optimal choice of the rational agents (i.e. that maximizes her expected utility) is obtained by maximizing the Sharpe ratio; see, among others, Zakamouline (2014). Moreover, a second well-known result is that the Sharpe ratio begins to be biased in the measurement of optimal allocations when there is a departure from the normal distribution assumption (for the risky asset returns). This has been empirically demonstrated in Gatfaoui (2009), among others. To overcome this issue and remain within the expected utility maximization framework, Zakamouline and Koekebakker (2009b) introduce a Generalized Sharpe Ratio (GSR), that is sensitive to higher order moments and can be evaluated with a parametric or non-parametric methodology. The GSR is obtained by the numerical optimization of the expected utility, see (Zakamouline and Koekebakker, 2009b), and is defined in the following manner: where the argument of the log in (2) is the expected wealth,W , that depends on the future returns of the risky asset. Note that, by resorting to the GSR, all moments of the risky asset returns have an impact on the performance measurement; thus, we do not constrain ourselves to the evaluation of the mean and variance. In addition, the GSR approaches the standard Sharpe ratio when the underlying distribution of the risky asset returns is close to the Gaussian. Given the well-known deviations from Gaussianity of asset returns, we consider GSR as the performance measure adopted by the rational investor to make investment decisions. The rational investor would prefer investment opportunities with higher GSR. 4

The Choices of the Behavioral Agent
The second type of agent is characterized by a behavioral utility function that satisfies the following properties: (i) It contains a kink at the level of financial wealth that the investor considers as reference to discriminate between gains and losses; (ii) the concavity of the utility function (and, therefore, the risk attitude of the investor) changes passing from the loss domain to the gain domain.
Recently, Zakamouline (2014) proposed a generalized behavioral utility function characterized by a piecewise linear plus power utility function. Namely, where W 0 is the reference level of wealth, 1 + (·) and 1 − (·) are the indicator functions in {0, 1} which define the linear part of the utility and assume unit value for positive or negative arguments, respectively, and zero otherwise, γ + and γ − are real numbers that affect the shape of the utility and, finally, the additional parameters λ > 0, α > 0 and β > 0 are real numbers. The utility function is continuous and increasing in wealth, and with proved existence of the first and second derivatives with respect to the wealth of the investor, W . In this case, the expected generalized behavioral utility function can be approximated by a function of the mean and of the partial moments of the distribution. Similarly to what shown for the rational category, Zakamouline (2014) proves that the optimal allocation of a behavioral agent is obtained by maximizing the following Z-ratio: where x is the return of the risky asset; in addition, LP M and U P M are the lower and upper partial moments, respectively, as defined by Fishburn(1977): where n is the order of the partial moment of x at a threshold level r, usually set at the risk free return, and F x (·) is the cumulative distribution function of x. 5 Similar to the GSR, higher values of the Z-ratio are preferred to lower values.
There is one additional element to be consider when analyzing the choices of behavioral agents. The utility function proposed by Zakamouline (2014) allows for the construction of different preferences or beliefs of the agents through the calibration of the corresponding parameters. Therefore, the shape of the utility function in the domain of gains and losses depends on the specification choices of the researcher. In this respect, we set parameters to make our behavioral function as close as possible to the original formulation proposed by Kahneman and Tversky (1979). 6 In particular, we chose γ + = 0.1, γ − = −0.1, λ = 1.5, and β = α = 2. The main difference between our formulation and that proposed by Kahneman and Tversky (1979) lies in the definition of loss aversion. In our version, the agent exhibits loss aversion in the sense of Köbberling and Wakker (2005). More specifically, the loss aversion is locally defined around 5 See the Appendix for additional details on the derivation of the Z-ratio. 6 The best choice would be the classical utility function by (Kahneman and Tversky, 1979): Nonetheless, Zakamouline and Koekebakker (2009a) show that the existence of the solution and thus the Z-ratio requires β > α, which implies the absence of loss aversion in the utility.
the reference point 7 . Let us we define the ratio where the numerator and the denominator are the left and the right derivatives of the utility function, respectively. We say that the agent exhibits loss aversion if λ is greater than one.
This implies that the utility function is steeper in the domain of losses: losses loom larger than corresponding gains, (Kahneman and Tversky, 1979). Beside of this, our formulation is equivalent to the original specification as it assumes the utility function to be concave in the gain domain and convex in the loss domain.

Agent's Asset Ranks and Investment Choices
The two utility functions previously described are generally considered for the evaluation of optimal investment decisions, or for the construction of optimal allocations between a risky asset and risk-free investment (or within a set of risky assets). In our framework, both the rational and the behavioral agents have to optimally allocate their wealth across a set of risky assets. In particular, agents first rank assets according to their performance measures, 8 and then invest in the top performers. If the market includes K assets, we assume that the rational (behavioral) investor allocates his wealth across the M << K assets with highest value of the GSR (Zratio). The investment choices are thus myopic, as investors disregard the portfolio behavior and the correlation across assets. Consequently, we refer to a single risky asset choice instead of a portfolio decision/allocation where many different risky activities are jointly considered.
This allows us to compare different evaluations of the two types of investors across assets (the investment universe). We are interested in the rankings produced, on the basis of their utility function, by the rational and behavioral agents. Given the rankings, agents are able to identify the best performers, that will enter into their optimal portfolios. The last observation concerns the construction of allocations across the selected best assets M . In principle, agents could combine the M assets by maximizing a criterion function. However, we prefer focusing on a more naive criteria, and thus consider an equally weighted allocation scheme. This limits the impact of the portfolio weights estimation error and has been shown to be preferred over optimal weighting schemes by DeMiguel et al. (2009). Specifically, we assume that agents allocate their wealth using equal weights across a (relatively) small number of assets.

The Market Model
Given the mixture of the two types of agents, the main object of our methodology is to determine the relevance of the choices made by the behavioral category in explaining the fluctuations of the risky asset returns. An intuitive approach to recover this measure is to blend the rational and behavioral choices and estimate the blending parameter in such a way that the mixture choice approaches as close as possible the observed market fluctuations.
One way of blending the choices of the two agent types is to build on a Bayesian framework: the ranking of one category is taken as prior, while that of the other category keeps the role of additional conditioning information. As a result, the posterior will represent a composite of rational and behavioral elements.
From a Bayesian perspective, we define the prior as the decision of the rational investor.
Such a choice is purely subjective, but allows, in a limiting case, to have the rational choices as the market outcome. Thus, the conditioning component is represented by the behavioral ranking. As the choices of the two types of agents are driven by performance measures, GSR and Z-ratio, the mixture is produced at the performance measure level.
Thus, we begin by assuming that both performance measures are normally distributed, centered on their mean. For a generic performance measure, P M , we have where µ P M and σ 2 P M are the mean and dispersion of the performance measure. The distributional hypothesis in (4) takes into account the fact that agents aim at evaluating the expected value of a performance measure. This can be done in several ways and could permit the introduction of some uncertainty in performance evaluation. Here comes the prior, which is a density for the expected performance measure, centered on the estimates. Therefore, for the prior it holds that while for the conditional we have Note that both distributions have their means set to the optimal choice of the corresponding agent, that is, the GSR and the Z-ratio derived from market data. Moreover, the distributions refer to the performance measures of a single asset, that is, we have a collection of distributions, two for each risky asset in the market. Finally, to simplify the analysis, we also assume that innovations, ǫ and η, are independent. We emphasize that, by introducing innovations in (5) and (6), we are accounting for the presence of estimation errors in the two measures.
To determine the relevance of behavioral and rational choices, we modify the density in (5) by adding a multiplicative factor τ to the dispersion, thereby yielding The coefficient τ can be interpreted as the reliability or uncertainty of the rational (prior) expectations. The higher the τ , the less reliable (more uncertain) are the rational choices, and thus more weight can be attached to behavioral rankings once the two are blended. Conversely, the closer τ is to zero, the lower the level of uncertainty is. By construction, and given that τ affects the variance, this parameter can assume values in the domain [0, ∞].
The aggregation of the rational and behavioral performance measures in a Bayesian framework gives rise to a composite performance measure, consistent with (4), where mean and variance have the following expressions: and Now, the aggregate expected measure, namely µ p , might be considered as the quantity used to order or rank assets at the market level. Consequently, we can determine the role of behavioral choices through the composite measure, by examining the optimal allocation made by an agent who is deciding where to invest his wealth across a set of risky assets ordered according to (8).
In this case, the allocations can be evaluated in terms of past performances, while the impact of the behavioral rankings is determined by estimating the optimal τ level within a specified criterion function.
As already mentioned, we take a simplified allocation choice and consider an equally weighted investment strategy. Therefore, past performances can be evaluated as the cumulated returns of an equally weighted portfolio in a given time window.
where r p,l is the time l return of the equally weighted portfolio and m represents the time range for the portfolio evaluation (from time t − m + 1 to time t). The portfolio is composed by the best performing equities, according to (8). Let A t (τ ) be the set containing the M best assets selected across the K assets included in the market (with M << K) at time t. This set depends on the parameter τ , as a change in τ modifies the rankings produced by the agents.
Moreover, the set is also a function of time, given that the impact of the behavioral choices might change over time. Therefore, portfolio returns are represented as where r j,l is the return of asset j at time l; we emphasize that the index j vary from 1 to K although only M values are included in the set A t (τ ). Given the dependence on τ of the best performing asset set, the portfolio cumulated return in (10) is also a function of τ . The optimal choice of τ is determined by maximizing the portfolio returns, that is, The optimal value τ * provides the maximum cumulated return obtained by an agent investing on a subset of risky assets traded in the market, and taking decisions by blending the rational and behavioral rankings. Consequently, the estimated τ * represents the relevance of behavioral choices, or, conversely, the reliability of the rational rankings.
In fact, a high value of τ * implies that the rational investor should correct her investment evaluations towards a behavioral direction. On the contrary, a low value of τ * would imply that the investor should have continued according to her prior rational rankings. The criterion function enables us to ascertain which component, rational versus behavioral, had a larger influence on the market fluctuations. Moreover, by solving (12) over different samples, we obtain a sequence τ * t that gives further insight on the rational and behavioral rankings.
The proposed approach is linked to the investment decisions as modeled by Black and Litterman (1992). 9 In fact, our Bayesian combination is precisely equivalent to the Black and Litterman model where rational choices are prior expectations on asset returns (the equilibrium returns) and behavioral choices play the same role as that of the analysts' views. In our implementation, both the prior and the views are univariate. Moreover, the methodology for the evaluation of optimal choices when a subset of risky assets is selected from an investment universe, similar to the one adopted in Billio et al. (2012), in the framework of determining a composite performance measure by a convex linear combination of standard performance ratios.
4 Empirical Analysis

The S&P 500 in 1962-2012
Generally speaking, as indicated by Siegel (1991), the stock market evolution is one of the most sensitive indicators of the business cycle. Moreover, by using a bivariate model with two regimes, Hamilton and Lin (1998) found that economic recessions are the main determinant of the fluctuations in the volatility of stock returns. Therefore, a focus on equities might enable the derivation of relevant evidences on the relationship between economic and financial cycles, as well as on their association with agent's behavior.
Our reference market is composed by the equities included in the S&P 500 index from January   (1) and (2) report the timing of financial and economic crisis, respectively. It is evident from the plots that there is a match between the local minima in the log-index and the bands for the financial crisis. There is also a correspondence with the economic recessions.

Model Specification and Empirical Results
The model we introduced in Sections 2 and 3 has been applied on rolling windows of 60 monthly returns to take into account the time-varying structure of the returns series. Different periods can be clearly used, but those have an impact on the evaluation of performance measures: shorter periods increase the variability of performance measures and thus amplify the uncertainty of the rankings. In addition, the use of 60 months is consistent with the sample periods used to extract, for example, market factors, such as those based on long-term reversal; see Fama and French (1996). To implement our model and estimate the optimal value τ * t at a given time t, we select only those assets with at least 60 observations from the 500 stocks included in the index. Thus, we exclude those with a limited history where the evaluation of both the rational and behavioral performance measures, GSR and Z -ratio, might be characterized by an excessively large uncertainty. The variances of the performance measures are obtained using a block bootstrap procedure, setting the block size to a dimension of 4. Such a choice enables preserving any form of temporal dependence across the returns. 12 Such a procedure is repeated for each point in time, excluding the first five years, 1962-1969, which are needed to initialize 11 Note that our study does not focus on the real time detection of changes in economic and financial cycles but rather on the association between them and the impact of behavioral decisions in the financial market. 12 The bootstrap procedure has been applied to the returns. The measures have been computed in each iteration and then the variances have been obtained on the cross-section of simulated measures. the computation. Ultimately, we obtain a time series of optimal values τ * t . Note that for each utility function we recover a different sequence τ * t .
We filtered the optimized τ * t by using a local level model in a state space representation.
This enables extracting the level of the signal component while preserving its time variation. 13 The filtering model is given below: where µ t is the unobserved level, ǫ t is the observation disturbance and ξ i,t is the level disturbance at time t. We assume that both disturbances are identically and independently distributed according to a Gaussian density function. The estimated hyper-parameters of the model, using the filtered τ * t from the S-shaped utility function, areǫ 1,t ∼ N (0, .4547) andξ 1,t ∼ N (0, .001678).
Figure (4) illustrates µ t (henceforth, the filtered τ * t ) which includes the economic recession bands according NBER.
The first check we consider for the filtered τ * t refers to the evaluation of the significance of that quantity. For this purpose, we perform a TOBIT regression on the filtered τ * t , by specifying the censored dependent variable in the model. Thus, we set the lower bound equal to zero, as τ * t cannot be negative and will be zero when there is no uncertainty on the rational behavior.
Accordingly, we test whether the constant is significantly different from zero in the model Table (4) reports the results for the regressions in decades and for the full sample. The filtered τ * t is statistically different from zero in all the sub-samples and in the full sample.
Other descriptive statistics are also included in the table and show that the filtered τ * t series is concentrated around the mean, generally with positive asymmetry and larger range during the 70s and 80s.
Examining the dynamic of the filtered τ * t , see Figures (4) and (5), it clearly emerges the existence of three local maxima that coincide with the three longest economic recessions. The first is the oil crisis which corresponds to the highest value of the filtered τ * t . The second is the energy crisis which begun during the Iranian revolution. According to Labonte and Makinen (2002), one of the main reasons for this crisis was the FED's monetary policy for inflation control.
This energy crisis is often considered a 'Double Dip' recession (January 1980 -July 1980); we found an inflection point that is associated with this crisis in the series. In this regard, we found a similar result when considering the crisis from December 1969 to November 1970. The last two shortest recessions are very similar to each other: both occurred at the beginning of the decade (early 80s and 90s) and both lasted for a period of eight months. In these cases, our estimated behavioral factor does not provide any particular pattern. Finally, the third largest recession in the considered period is the sub-prime crisis (2007)(2008)(2009). It is worth noticing that the level of the filtered τ * t after the recession begins to decay very slowly. Then it remains substantially high at the beginning of the European sovereign debt crisis. We associate such a finding with the increased impact of behavioral rankings on market fluctuations during turmoils. As expected from the previous comments, we find the local minima in correspondence of booming periods of the equity market index. For example, the first minimum is located just before the early-80s crisis (in the 1978) and the other is located just before the subprime crisis. In the period 1991-2000, the economy had experienced a period of solid economic growth; we found a relative low dynamic of the filtered τ * t . Figure (2) depicts the estimated factor that includes the bands for the financial crisis in accordance with Kindleberger and Aliber (2011). Naturally, financial and economics crisis are highly interrelated and interdependent. Except for the 1987 stock market crash, they follow each other in most of the cases. An examination of the given crisis clearly reveals a local minimum in the estimated factor before the beginning of the crisis and then a local maxima during the crisis. As reported in Table (4), the periods 1971-1980 and 1981-1990 contain on average the highest value and the highest standard deviation for the filtered τ * t . This is probably due to the fact that there were two recessions in each decade. Now, we analyze the relation between the filtered τ * t and the systematic component of the financial market as proxied by the equity index. Each optimal value of τ * t is associated with a selection of equities -those included in the portfolio returns in (11) evaluated at the optimal value τ * t . If the mixed selection and the extrapolation of τ * t comes from two types of investors, it should reflect the real fluctuations in the financial market. Therefore, if this relation is present, it provides supporting evidence in favor of the existence of the two categories of agents in the market. Consequently, the market returns can be explained by the portfolio returns generated by the selection of the best performing assets used to estimate τ * t .
In order to verify the validity of the previous argument, we estimate the following model where r m is the S&P 500's return and r τ is the return of the aggregated selection according to the optimal τ * t . Contrary to the CAPM model, the market return represents the dependent variable in this model. Hence, according to our assumption, the model should return a high value for β and a constant close to zero. In the estimation, we use the equally-weighted returns for the S&P 500 (the dependent variable) since the returns from the selection are defined according to an equally-weighted allocation method. Table (5) reports the estimated coefficients. The constant captures the risk premium which is slightly positive but close to zero. Moreover, the positive sign of the constant term is consistent with the hypothesis of efficiency of the market portfolio; see Sharpe (1966) and Fama (1998). β is significant at the 1% confidence level and has a value close to 0.90.
We replicate the previous analysis by using the S&P 100 which includes the 100 most capitalized companies in the US market. In this case, we use the value-weighted return series for the S&P100 because of the short length of the equally-weighted series. The series for the index has been downloaded from Datastream and is available from January 1973; the results are reported in Table (5). β is still significant at the 1% confidence interval, but has a lower value of 0.78.
The constant is not statistically significant. A lower beta in this case is rather reasonable due to the different underlying market focus. In fact, it is possible that some of the selected assets are included in the S&P500 but not in the S&P100. However, the risk premium is not statistically different from zero and β captures a high level of systematic risk.
As a double check, the analysis is also conducted by considering the selection of the rational agent as implied by the GSR rankings. If we expect a co-existence between the two agents, the GSR-based rankings should capture a lower systematic component of the market -a lower β in the estimated model (15). Table (5) reports the results for the regression with the S&P 500 equally-weighted returns and the S&P100 value weighted returns. The β coefficients for both returns are 0.83 and 0.64 respectively. These results confirm that the rankings provided by the aggregated measure reflects a higher systematic part of the market movements with respect to the rankings resulting from rational agent's utility function. Given these results, it reasonable to assume the co-existence of the two types of agents in the market.

A Financial Interpretation of the Filtered τ *
As we have observed in the previous section, the sequence of filtered τ * t might be associated with periods of financial stress. This is in line with the approach followed for the derivation of the indicator discussed above, and that intuitively leads to higher values during periods of market turbulence, when agents are more heterogeneous (and thus more irrational/behavioral).
Moreover, we could link these higher values of τ * t to a larger impact of the noise on agent's expectations. Since it is much more difficult to separate the true 'signal' from the market , there is a higher probability that agents make choices on the basis of a behavioral view. Thus, the τ * t could be interpreted as a quantity associated with an agent's overall behavior in periods of market stress. To support such a claim, we can relate the evolution of the τ * t to other indicators monitoring the level of financial stress. As reported in Hakkio and Keeton (2009)   An FSI is generally obtained through Principal Component Analysis (PCA) on a set of indicators associated with financial stress. We do not discuss the derivation of FSI in detail. We refer to the cited papers for such a discussion. 15 The sample size for the regressions reported in Table (6) is shorter than the sample size of the filtered τ * t . This is a consequence of the shorter times series, as compared to those of the filtered τ * t , available for the STLFSI. Thus, we adopted the STLFSI sample size in all regressions for reasons of comparability of results. Regressions for all the available data, with sample sizes differing across regressors, are reported in the web appendix.
with the R-squared, which is rather low for both FSIs. Nevertheless, this could be motivated by the different assets behind the FSIs and τ * t . In fact, the former depend on mostly on bonds, while the latter derives only from equity data.
The outcome of this first regression suggests a relation between the filtered τ * t and market stress. One might question whether what the τ * t is really capturing is nothing more than market volatility or the market expectation about volatility levels. As a check, we regress our endogenously determined index on the VIX index. show that the filtered τ * t is capturing a component unrelated to market volatility. In fact, the regression coefficient, despite being positive (in line with the expectation), is only marginally statistically significant and the regression provides a very low R-squared. Thus, this support our approach and shows that τ * t is not associated with the dispersion of market returns. 16 Despite these first intriguing results, we believe that the outcome is not very satisfactory, particularly with respect to the Financial Stress Index, as they are not purely equity-driven.
However, an equity-related FSI does not exist. Nevertheless, as the filtered τ * t captures the agent's behavior, it can be linked to market sentiment. In this case, we can refer to the indices provided by Baker and Wurgler (2007). In the paper, investor sentiment is defined as a belief about future asset cash flows and investment risks that is not justified in the current period.
Moreover, as indicated by Shleifer and Vishny (1997), betting against this sentiment is expensive and risky. Their sentiment index combines several proxies such as investor mood, retail investor trades, mutual fund flows, trading volume, dividend premium, closed-end fund discount, option implied volatility, IPO first-day return, IPO Volume, Equity Issues over total new issues and Insider trading. For the purpose of comparison, we consider the two versions of the index proposed by Baker and Wurgler (2007). The main version (equation 3 in the author's paper, denoted as BW ⊥ ) which eliminates business cycle variation (industrial production index, growth in consumer durable, non-durable, services and a dummy variable for NBER recessions) from each variable of the index. and the raw version (equation 2 in the author's paper, denoted as BW). 17 16 We conducted a similar analysis by using the monthly realized volatility of the S&P500 index, computed on the basis of daily data in the following manner: where ri is the daily market return and m is the number of trading days in each month. Replacing the VIX with the realized volatility does not affect the results: the filtered τ * t is not related to market volatility. 17 Since we are considering changes in variables, the changes in sentiment measures are based on first principal  Baker and Wurgler (2007). Notably, the regression coefficients are not statistically significant (on both sentiment indices) and suggest that the Baker and Wurgler (2007) indices capture different views on the market as compared to those from the τ . An element supporting this interpretation is the approach adopted for the construction of the two indices. While Baker and Wurgler (2007) combine different indicators that monitor the evolution of the market, our approach determines the τ * t in an endogenous manner. Thus, it is sensible that the views are extracted from the market data.
To further analyze the behavior of the filtered τ * t , we evaluate its association with other three variables, namely the industrial production index (INDPRO), 18 the liquidity of Pastor and Stambaugh (2001), 19 , and the dummy for NBER recessions. The results are reported in Table (6), where we observe the relevant significance of the three variables with coefficients in line with expectations: negative for liquidity and industrial production, as a decrease in those variables leads to an increase in the uncertainty (which we might associate with the filtered τ * t ); positive on the NBER recession dummy as uncertainty is expected to be higher during recessions. Thus, we provide further evidences on the relation of the τ * t with both market uncertainty or stress, as monitored by the FSI, as well as with macroeconomic (or business-cycle related) variables that potentially impact the equity market evolution. Further, it is also evident from these analyses that our index, the filtered τ sequence, τ * t , differs from previous FSI and market sentiment indices. Finally, as a last check, we regress the filtered τ * t on the entire set of indicators previously mentioned, thereby obtaining a high significance for the KSFSI, liquidity, industrial production and NBER recessions. The overall R-square is close to 28%, (see Table   (6)).
Given the previous comments and evidences, we believe that the filtered τ * t captures an endogenous market sentiment that differs from those proposed by Baker and Wurgler, also differs from the FSI.
As a final check for this last claim, we mimic the approach of Baker and Wurgler (2007).
It corresponds to a regression of market returns on the sequence of filtered τ * t . However, to further verify the relevance of our index, robustify the outcome of the analyses, and given the components of the changes in the underlying series. 18 The Industrial Production Index (INDPRO) measures real output for manufacturing such as mining, electric, gas utilities (excluding those in US territories) located in the US. Data have been downloaded from  This liquidity measure is obtained as an average at stock-level measures, estimated with daily data. The principle behind is that order flow causes greater return reversals when liquidity is lower in the market. fact that τ * t provides additional information opposed to the sentiment indices, the FSI, the VIX and other macro-related quantities, we also added those quantities in the regressions. Selected results are reported in Table (7); regressions are always run considering first differences of all variables. We observe that the filtered τ * t is statistically significant and has a negative impact. This is expected as the increase in the τ * t leads to a decrease in market returns. More relevantly, such a result is confirmed in all regressions reported, which consider several combinations for the contemporaneous presence of FSI, sentiment indices, and other variables. Thus, we interpret these further evidences as a confirmation for the endogenous market sentiment interpretation of τ * t .

Robustness Checks
We perform two main checks to ensure the stability of our empirical analysis. There is a vivid empirical literature that studies how investors' risk attitude is mediated by behavioral artifacts and changes over time along with the economic cycle. Guiso et al. (2013) elicit risk preferences using hypothetical lotteries in a repeated survey of Italian bank's clients and find that risk aversion increases substantially after the 2008 financial crises. Similarly, in a controlled experiment involving professionals, Cohn et al. (2013) found that, compared to expansion phases, financial crises trigger negative emotions and diminish risk-taking choices in incentivized lotteries. Together, these findings are difficult to reconcile with the predictions provided by the Prospect Theory, as they suggest that risk aversion is countercyclical.
By following this literature, as a second robustness check, we replicate our analysis by mod-20 In addition to the elements described here, we also test the consistency of the assets ranking with the S-shaped utility function by varying the magnitude of the parameters from γ+ = 0.1, γ− = −0.1, λ = 1.5, and β = α = 2. The order of ranks are invariant. Results are available upon request. 21 We also test for k = 50, but given the higher turnover in the selected assets we obtain a noise signal that is totally uninformative when we apply the local level model. ifying the specification of the behavioral utility function. In particular, we assume that preferences of the behavioral agents are now described by an inverse-S-shaped utility function with no loss-aversion that is concave in the loss domain and convex in the gain domain. The performance measures implied by the new behavioral utility function are based on the ratio proposed by Tibiletti and Farinelli (2003). In the model, we use the utility function proposed by Zakamouline and Koekebakker (2009b). 22 The estimations for the local level model in equation (13) for the filtered τ * t areǫ 2,t ∼ N ID(0, .1080) andξ 2,t ∼ N ID(0, .04454).
We replicate the analyses over decades and for the entire sample, as we have done in Section 4. Even in this case, the filtered τ * t for this utility function is statistically different from zero in all the sub-samples and in the entire sample. Thereafter, we repeat the analysis for this 'alternative' specification in terms of its association with both market stress and sentiment indices and macro-finance related variables. The results show evidence of a limited relation, particularly with market stress and sentiment indices, and with economic recession. These results corroborate our finding and the choice of the behavioral utility function made in Section 4. Finally, we consider the regressions between the market index and the alternative filtered τ * t , that is, those associated with 200 assets and with the inverse-S-shaped utility. The results are coherent with the previous ones, with a limited relevance of the inverse-S-shaped utility filtered τ * t .

Conclusion
Identifying and measuring the behavioral component of financial investments is an open question for economists. We contribute to this flourishing literature by proposing a Bayesian mixture model to estimate the behavioral component of the financial market. Our methodology is based on two main assumptions. First, agents take investment decisions by ranking the alternative assets according to their performance measures. Second, the financial market is populated by two types of agents, one with standard SEUT preferences and one endowed with an S-shaped utility function that is compatible with the Prospect Theory.
Rather than using experimental and survey data and with the intent of reducing the impact of sampling and measurement errors, we conducted the analysis on real financial data. In particular, we used monthly data on the 500 components of the S&P 500 index from January the behavioral component over the various of boom and bust phases of the financial market.
We detected a significant and time-varying behavioral component that reaches its peaks during economic and financial crises, such as the oil crisis in the 70s and the recent 2010 financial burst.
Further, we interpreted the behavioral component obtained through the Bayesian mixture model as an endogenous sentiment measure. In fact, it differs from the market sentiment indices introduced by Baker and Wurgler (2007) and provides additional information with respect to market stress indices. Our claim is supported by a number of regressions considering, apart from sentiment indices, financial stress indices, and several macrofinance related control variables.
Moreover, our explanation is not influenced by risk considerations, as we also show that our endogenous sentiment measure is uncorrelated with market volatility and thus does not capture the dispersion of financial fluctuations. Finally, we also demonstrate that the introduction of the endogenous sentiment in a linear factor model for the market returns yields statistically significant and negative (as expected) coefficient, thereby providing some insight for future extensions of the present work.
By virtue of the flexibility of our methodology, we assess how results change when the underlying behavioral utility function is replaced by an inverse-S-shaped that assumes agents to be risk averse in the loss domain and risk seeker in the gain domain. In this case, the filtered τ * t has a limited impact, thus supporting our choices for the behavioral agent's utility. We note that, partially in contrast with the above-mentioned references, estimates from the specification based on an S-shaped value function with pro-cyclical risk aversion better account for the evolution of the S&P 500 than estimates from a reverse-S-shaped specification with countercyclical risk aversion. Such a preliminary finding will be further analyzed in future researches.
The analysis presented here can be extended at least in two directions. The first is focusing on the comparison of endogenous market sentiment indices across financial markets (Europe and Asia compared to North America), or within a given market by considering different market segments (large versus small, or other partitions of a given market). A second research direction is analyzing the potential implications of τ * t for asset pricing, beginning from the preliminary insight we provided at the market index level. The Subprime Crisis 03-Dec-07 09-Mar-09 Table 1: The table provides the crisis list for the U.S. market according Kindleberger and Aliber (2011).   Period 1962Period -1970Period 1971Period -1980Period 1981Period -1990Period 1991Period -2000Period 2001Period -2012   year 1962-1970 1971-1980 1981-1990 1991-2000 2001-2012 Table 5: Regressions between one equity market index returns, either S&P500 equally weighted or the S&100 value weighted, and the returns from the selection of assets associated with the optimal τ * or with the highest levels of GSR (note the selected assets change in each period  Table 7: Results from regressing the S&P500 market returns (r mkt ) on ∆τ 100 and other economic, financial and sentiment indicators. The considered common sample is from February 1994 to December 2010 (203 obs).

Rational investor GSR ratio
Behavioral investor Z-ratio Figure 1: The model framework: blending the rational and behavioral rankings to explain the market evolution.

Web Appendix Appendix A: Derivation and Estimation of the Generalized Sharpe Ratio
In this section, we review the derivation of the Sharpe Ratio and the non-parametric estimation of the Generalized Sharpe Ratio (GSR) following Zakamouline (2014).
The expected utility associated with an investment in asset X is given as the convex combination of the utilities associated with a collection of different and alternative outcomes x i , each corresponding to the realization of a given state of the world (state i). Each realization is weighted by its respective probability, thereby leading to following characterization of expected utility.
where f (x) is the probability density function associating a given probability with each state of the world. In this case, the utility is expressed as a function of the risky asset X to highlight their relations. However, the wealth of the investor, not explicitly appearing, also plays a role.
In fact, the wealth W is always allocated between a risky and a risk-free asset.
According to the maximum principle, the performance measure is strictly related to the level of maximum expected utility originated from a given financial activity. 23 In fact, the higher the value of the performance measure, the higher is the maximum expected utility provided to the investor.
A first possible utility function is the power utility. The latter belongs to the class of Constant Relative Risk Aversion (CRRA) utility functions and, notably, as proved by Zakamouline and Koekebakker (2009b), the CRRA utility functions lead to the identification of a performance measure which is coherent with market equilibrium. Thus, the utility function of the rational agent can be defined in the following manner: where W is the agent's wealth and ρ measures the degree of relative risk aversion. The power utility function has been extensively used in empirical studies, some of those aiming at identifying the value of ρ. The results of Mehra and Prescott (1985) indicate a value of around 30 to ensure consistency with the observed market equity premium. As reported in Zakamouline and Koekebakker (2009b), for high values of ρ, the relative preferences across the moments of the distributions are similar to those of a second possible choice for the utility function, the Constant Absolute Risk Aversion (CARA) utility functions.
For computational convenience, we use the CARA function. 24 Namely, preferences of the rational agents are described by the following negative exponential utility. The utility of the decision-maker is defined over his/her total wealth, while the performance measure is defined over return. Therefore, to be consistent with the expected utility theory, the utility function that threat returns identically must be independent from wealth. This is a well-known result in the mean-variance approach by Markowitz (1952), a particular case of the expected utility theory when the returns are normally distributed. In the Markowitz 23 The axiomatization approach is an alternative method for defining the performance measure. See De Giorgi (2005) and Cherny and Madan (2009). 24 The choice is merely computational but, as reported in Zakamouline and Koekebakker (2009b), for high values of the relative risk aversion coefficient, a power utility function (a Constant Relative Risk Aversion -CRRA utility function), provides relative preferences across the moments of the risky returns distributions, which is similar to those of CARA utility functions. model, the Sharpe Ratio is the optimal solution for the maximization of the expected utility (the latter being the CARA negative exponential utility function).
Let us consider a decision-maker with wealth W at the begin of a period t 0 . Moreover, a denotes the amount of wealth allocated in a risky asset, while W − a is the wealth allocated in the riskfree asset r f . At the end of period, t 1 the wealth of the investor will be, where x is the return provided by the risky asset. In this framework, the aim of the investor is to maximize the expected utility with respect to the amount invested in the risky asset, a. Hence, the optimal problem corresponds to a utility maximization with respect to a, Given the CARA function and the Gaussianity assumption, the maximized expected utility will be where the last term within parentheses is a deterministic quantity.
By setting x 0 = W (1 + r f ) as in Zakamouline (2014), we can approximate the expected utility using Taylor's expansion, From the first-order condition (FOC), we obtain the Sharpe Ratio as the quantity that maximizes the expected utility function, However, a second well-known result, is that the Sharpe ratio begins to be biased both in the measurement of optimal allocations and in the ranking across a collection of assets when there is a departure from the normal distribution assumption (for the risky asset returns). This has been empirically demonstrated in Gatfaoui (2009), among others. To overcome this issue and still remaining within the expected utility maximization framework, Zakamouline and Koekebakker (2009b), among others, suggested the introduction of the Generalized Sharpe Ratio (GSR). Such a quantity would be sensitive to higher order moments, and can be evaluated with a parametric or non-parametric methodology. In the non-parametric estimation, by following the Hodges (1998) conjecture, Zakamouline andKoekebakker (2009b) derived what they called GSR.
The problem is solved through a numerical optimization by computing the maximum expected utility E[U * (w)], wheref h (x) is the estimated kernel density function.
The numerical optimization of the expected utility considers all the empirical moments of the probability distributions, Note that, by resorting to the GSR, all moments of the risky asset returns play a role; thus, we are not constraining ourselves to the evaluation of the mean and variance. Notably, the GSR approaches to standard Sharpe ratio when the underlying distribution of the risky asset returns is close to the Gaussian. Given the well-known deviations from Gaussianity of asset returns, we consider GSR as the performance measure adopted by the rational investor to rank risky assets. The rational investor would prefer assets with higher GSR to assets with lower values of the performance measure.
Therefore, the capital allocation to solve is, subject to a ≥ 0. The FOC for the optimal a, As observed in Zakamouline and Koekebakker (2009a) there is no closed-form solution for a, given all the possible values of α and β however, under some additional assumptions, 1 + = 1 (linearity) and α = β > 1, there exists a closed form solution.
In this case, the FOC for the optimal a becomes The existence of the local maximum with an interior solution holds when β > 1. Therefore, the solution for the optimal a, and by inserting it in the investor's expected utility, we obtain We can write, where f (z) = [(β − 1)/β]z β/(β−1) is a strictly increasing function in z. Consequently, the performance measure, the Z-ratio, can be expressed as where   Table 9: Results from regressing ∆τ 100 with k = 100 obtained from the inverse-S-shaped utility function on different economic, financial and sentiment indicators. The considered common sample is from February 1994 to December 2010 (203 obs).   Table 10: Results from regressing the S&P500 market returns (r mkt ) on ∆τ 200 , ∆τ inv 100 and other economic, financial and sentiment indicators. The considered common sample is from February 1994 to December 2010 (203 obs).