A Practical Guide To Quantitative Portfolio Trading
User Manual: Pdf
Open the PDF directly: View PDF .
Page Count: 743
Download | |
Open PDF In Browser | View PDF |
Quantitative Analytics A Practical Guide To Quantitative Portfolio Trading Daniel Bloch 30th of December 2014 The copyright to this computer software and documentation is the property of Quant Finance Ltd. It may be used and/or copied only with the written consent of the company or in accordance with the terms and conditions stipulated in the agreement/contract under which the material has been supplied. Copyright © 2015 Quant Finance Ltd Quantitative Analytics, London Created: 14 January 2015 A Practical Guide To Quantitative Portfolio Trading Daniel B LOCH 1 Q UANT F INANCE LTD eBook 30th of December 2014 Version 1.01 1 db@quantfin.eu Abstract We discuss risk, preference and valuation in classical economics, which led academics to develop a theory of market prices, resulting in the general equilibrium theories. However, in practice, the decision process does not follow that theory since the qualitative aspect coming from human decision making process is missing. Further, a large number of studies in empirical finance showed that financial assets exhibit trends or cycles, resulting in persistent inefficiencies in the market, that can be exploited. The uneven assimilation of information emphasised the multifractal nature of the capital markets, recognising complexity. New theories to explain financial markets developed, among which is a multitude of interacting agents forming a complex system characterised by a high level of uncertainty. Recently, with the increased availability of data, econophysics emerged as a mix of physical sciences and economics to get the best of both world, in view of analysing more deeply assets’ predictability. For instance, data mining and machine learning methodologies provide a range of general techniques for classification, prediction, and optimisation of structured and unstructured data. Using these techniques, one can describe financial markets through degrees of freedom which may be both qualitative and quantitative in nature. In this book we detail how the growing use of quantitative methods changed finance and investment theory. The most significant benefit being the power of automation, enforcing a systematic investment approach and a structured and unified framework. We present in a chronological order the necessary steps to identify trading signals, build quantitative strategies, assess expected returns, measure and score strategies, and allocate portfolios. Quantitative Analytics I would like to thank my wife and children for their patience and support during this adventure. 1 Quantitative Analytics I would like to thank Antoine Haddad and Philippe Ankaoua for giving me the opportunity, and the means, of completing this book. I would also like to thank Sebastien Gurrieri for writing a section on CUDA programming in finance. 2 Contents 0.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0.1.1 Preamble . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 0.1.2 An overview of quantitative trading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I Quantitative trading in classical economics 1 Risk, preference, and valuation 1.1 A brief history of ideas . . . . . . . . . . . . . . . 1.2 Solving the St. Petersburg paradox . . . . . . . . . 1.2.1 The simple St. Petersburg game . . . . . . 1.2.2 The sequential St. Petersburg game . . . . 1.2.3 Using time averages . . . . . . . . . . . . 1.2.4 Using option pricing theory . . . . . . . . 1.3 Modelling future cashflows in presence of risk . . . 1.3.1 Introducing the discount rate . . . . . . . . 1.3.2 Valuing payoffs in continuous time . . . . 1.3.3 Modelling the discount factor . . . . . . . 1.4 The pricing kernel . . . . . . . . . . . . . . . . . . 1.4.1 Defining the pricing kernel . . . . . . . . . 1.4.2 The empirical pricing kernel . . . . . . . . 1.4.3 Analysing the expected risk premium . . . 1.4.4 Infering risk premium from option prices . 1.5 Modelling asset returns . . . . . . . . . . . . . . . 1.5.1 Defining the return process . . . . . . . . . 1.5.2 Valuing potfolios . . . . . . . . . . . . . . 1.5.3 Presenting the factor models . . . . . . . . 1.5.3.1 The presence of common factors 1.5.3.2 Defining factor models . . . . . 1.5.3.3 CAPM: a one factor model . . . 1.5.3.4 APT: a multi-factor model . . . . 1.6 Introducing behavioural finance . . . . . . . . . . 1.6.1 The Von Neumann and Morgenstern model 1.6.2 Preferences . . . . . . . . . . . . . . . . . 1.6.3 Discussion . . . . . . . . . . . . . . . . . 1.6.4 Some critics . . . . . . . . . . . . . . . . . 1.7 Predictability of financial markets . . . . . . . . . 1.7.1 The martingale theory of asset prices . . . 1.7.2 The efficient market hypothesis . . . . . . 3 21 21 21 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 26 28 28 29 30 32 33 33 34 36 38 39 40 41 42 43 43 44 46 46 46 47 48 48 49 50 52 53 54 54 55 Quantitative Analytics 1.7.3 1.7.4 1.7.5 1.7.6 2 Some major critics . . . . . . . . . . . . Contrarian and momentum strategies . . Beyond the EMH . . . . . . . . . . . . . Risk premia and excess returns . . . . . . 1.7.6.1 Risk premia in option prices . . 1.7.6.2 The existence of excess returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56 57 59 62 62 63 Introduction to asset management 2.1 Portfolio management . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.1 Defining portfolio management . . . . . . . . . . . . . . . . . . 2.1.2 Asset allocation . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1.2.1 Objectives and methods . . . . . . . . . . . . . . . . . 2.1.2.2 Active portfolio strategies . . . . . . . . . . . . . . . . 2.1.2.3 A review of asset allocation techniques . . . . . . . . . 2.1.3 Presenting some trading strategies . . . . . . . . . . . . . . . . . 2.1.3.1 Some examples of behavioural strategies . . . . . . . . 2.1.3.2 Some examples of market neutral strategies . . . . . . 2.1.3.3 Predicting changes in business cycles . . . . . . . . . . 2.1.4 Risk premia investing . . . . . . . . . . . . . . . . . . . . . . . . 2.1.5 Introducing technical analysis . . . . . . . . . . . . . . . . . . . 2.1.5.1 Defining technical analysis . . . . . . . . . . . . . . . 2.1.5.2 Presenting a few trading indicators . . . . . . . . . . . 2.1.5.3 The limitation of indicators . . . . . . . . . . . . . . . 2.1.5.4 The risk of overfitting . . . . . . . . . . . . . . . . . . 2.1.5.5 Evaluating trading system performance . . . . . . . . . 2.2 Portfolio construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.2.1 The problem of portfolio selection . . . . . . . . . . . . . . . . . 2.2.1.1 Minimising portfolio variance . . . . . . . . . . . . . . 2.2.1.2 Maximising portfolio return . . . . . . . . . . . . . . . 2.2.1.3 Accounting for portfolio risk . . . . . . . . . . . . . . 2.3 A market equilibrium theory of asset prices . . . . . . . . . . . . . . . . 2.3.1 The capital asset pricing model . . . . . . . . . . . . . . . . . . . 2.3.1.1 Markowitz solution to the portfolio allocation problem . 2.3.1.2 The Sharp-Lintner CAPM . . . . . . . . . . . . . . . . 2.3.1.3 Some critics and improvements of the CAPM . . . . . 2.3.2 The growth optimal portfolio . . . . . . . . . . . . . . . . . . . . 2.3.2.1 Discrete time . . . . . . . . . . . . . . . . . . . . . . . 2.3.2.2 Continuous time . . . . . . . . . . . . . . . . . . . . . 2.3.2.3 Discussion . . . . . . . . . . . . . . . . . . . . . . . . 2.3.2.4 Comparing the GOP with the MV approach . . . . . . 2.3.2.5 Time taken by the GOP to outperfom other portfolios . 2.3.3 Measuring and predicting performances . . . . . . . . . . . . . . 2.3.4 Predictable variation in the Sharpe ratio . . . . . . . . . . . . . . 2.4 Risk and return analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.4.1 Some financial meaning to alpha and beta . . . . . . . . . . . . . 2.4.1.1 The financial beta . . . . . . . . . . . . . . . . . . . . 2.4.1.2 The financial alpha . . . . . . . . . . . . . . . . . . . 2.4.2 Performance measures . . . . . . . . . . . . . . . . . . . . . . . 2.4.2.1 The Sharpe ratio . . . . . . . . . . . . . . . . . . . . . 2.4.2.2 More measures of risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64 64 64 66 66 68 69 70 70 71 73 74 75 75 77 79 79 80 80 81 81 83 84 85 85 85 87 89 91 91 95 99 99 102 102 104 105 105 105 107 107 108 109 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quantitative Analytics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109 110 111 111 113 113 114 114 114 115 115 117 117 117 118 Introduction to financial time series analysis 3.1 Prologue . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2 An overview of data analysis . . . . . . . . . . . . . . . . . . . . 3.2.1 Presenting the data . . . . . . . . . . . . . . . . . . . . . 3.2.1.1 Data description . . . . . . . . . . . . . . . . . 3.2.1.2 Analysing the data . . . . . . . . . . . . . . . . 3.2.1.3 Removing outliers . . . . . . . . . . . . . . . . 3.2.2 Basic tools for summarising and forecasting data . . . . . 3.2.2.1 Presenting forecasting methods . . . . . . . . . 3.2.2.2 Summarising the data . . . . . . . . . . . . . . 3.2.2.3 Measuring the forecasting accuracy . . . . . . . 3.2.2.4 Prediction intervals . . . . . . . . . . . . . . . 3.2.2.5 Estimating model parameters . . . . . . . . . . 3.2.3 Modelling time series . . . . . . . . . . . . . . . . . . . . 3.2.3.1 The structural time series . . . . . . . . . . . . 3.2.3.2 Some simple statistical models . . . . . . . . . 3.2.4 Introducing parametric regression . . . . . . . . . . . . . 3.2.4.1 Some rules for conducting inference . . . . . . 3.2.4.2 The least squares estimator . . . . . . . . . . . 3.2.5 Introducing state-space models . . . . . . . . . . . . . . . 3.2.5.1 The state-space form . . . . . . . . . . . . . . . 3.2.5.2 The Kalman filter . . . . . . . . . . . . . . . . 3.2.5.3 Model specification . . . . . . . . . . . . . . . 3.3 Asset returns and their characteristics . . . . . . . . . . . . . . . 3.3.1 Defining financial returns . . . . . . . . . . . . . . . . . . 3.3.1.1 Asset returns . . . . . . . . . . . . . . . . . . . 3.3.1.2 The percent returns versus the logarithm returns 3.3.1.3 Portfolio returns . . . . . . . . . . . . . . . . . 3.3.1.4 Modelling returns: The random walk . . . . . . 3.3.2 The properties of returns . . . . . . . . . . . . . . . . . . 3.3.2.1 The distribution of returns . . . . . . . . . . . . 3.3.2.2 The likelihood function . . . . . . . . . . . . . 3.3.3 Testing the series against trend . . . . . . . . . . . . . . . 3.3.4 Testing the assumption of normally distributed returns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119 119 120 120 120 120 120 121 121 122 125 127 128 128 128 129 131 132 132 135 135 136 138 138 138 139 141 141 142 143 143 144 144 146 2.4.3 2.4.4 2.4.5 2.4.6 3 2.4.2.3 Alpha as a measure of risk . . . . . 2.4.2.4 Empirical measures of risk . . . . 2.4.2.5 Incorporating tail risk . . . . . . . Some downside risk measures . . . . . . . . Considering the value at risk . . . . . . . . . 2.4.4.1 Introducing the value at risk . . . . 2.4.4.2 The reward to VaR . . . . . . . . . 2.4.4.3 The conditional Sharpe ratio . . . 2.4.4.4 The modified Sharpe ratio . . . . . 2.4.4.5 The constant adjusted Sharpe ratio Considering drawdown measures . . . . . . Some limitation . . . . . . . . . . . . . . . . 2.4.6.1 Dividing by zero . . . . . . . . . . 2.4.6.2 Anomaly in the Sharpe ratio . . . . 2.4.6.3 The weak stochastic dominance . . 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quantitative Analytics 3.4 II 4 3.3.4.1 Testing for the fitness of the Normal distribution . 3.3.4.2 Quantifying deviations from a Normal distribution 3.3.5 The sample moments . . . . . . . . . . . . . . . . . . . . . 3.3.5.1 The population mean and volatility . . . . . . . . 3.3.5.2 The population skewness and kurtosis . . . . . . 3.3.5.3 Annualisation of the first two moments . . . . . . Introducing the volatility process . . . . . . . . . . . . . . . . . . . 3.4.1 An overview of risk and volatility . . . . . . . . . . . . . . 3.4.1.1 The need to forecast volatility . . . . . . . . . . . 3.4.1.2 A first decomposition . . . . . . . . . . . . . . . 3.4.2 The structure of volatility models . . . . . . . . . . . . . . 3.4.2.1 Benchmark volatility models . . . . . . . . . . . 3.4.2.2 Some practical considerations . . . . . . . . . . . 3.4.3 Forecasting volatility with RiskMetrics methodology . . . . 3.4.3.1 The exponential weighted moving average . . . . 3.4.3.2 Forecasting volatility . . . . . . . . . . . . . . . 3.4.3.3 Assuming zero-drift in volatility calculation . . . 3.4.3.4 Estimating the decay factor . . . . . . . . . . . . 3.4.4 Computing historical volatility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Statistical tools applied to finance 146 147 149 149 150 151 152 152 152 153 153 155 156 157 157 158 159 160 161 164 Filtering and smoothing techniques 4.1 Presenting the challenge . . . . . . . . . . . . . . . . . . . . . 4.1.1 Describing the problem . . . . . . . . . . . . . . . . . . 4.1.2 Regression smoothing . . . . . . . . . . . . . . . . . . 4.1.3 Introducing trend filtering . . . . . . . . . . . . . . . . 4.1.3.1 Filtering in frequency . . . . . . . . . . . . . 4.1.3.2 Filtering in the time domain . . . . . . . . . . 4.2 Smooting techniques and nonparametric regression . . . . . . . 4.2.1 Histogram . . . . . . . . . . . . . . . . . . . . . . . . . 4.2.1.1 Definition of the Histogram . . . . . . . . . . 4.2.1.2 Smoothing the histogram by WARPing . . . . 4.2.2 Kernel density estimation . . . . . . . . . . . . . . . . 4.2.2.1 Definition of the Kernel estimate . . . . . . . 4.2.2.2 Statistics of the Kernel density . . . . . . . . 4.2.2.3 Confidence intervals and confidence bands . . 4.2.3 Bandwidth selection in practice . . . . . . . . . . . . . 4.2.3.1 Kernel estimation using reference distribution 4.2.3.2 Plug-in methods . . . . . . . . . . . . . . . . 4.2.3.3 Cross-validation . . . . . . . . . . . . . . . . 4.2.4 Nonparametric regression . . . . . . . . . . . . . . . . 4.2.4.1 The Nadaraya-Watson estimator . . . . . . . 4.2.4.2 Kernel smoothing algorithm . . . . . . . . . . 4.2.4.3 The K-nearest neighbour . . . . . . . . . . . 4.2.5 Bandwidth selection . . . . . . . . . . . . . . . . . . . 4.2.5.1 Estimation of the average squared error . . . . 4.2.5.2 Penalising functions . . . . . . . . . . . . . . 4.2.5.3 Cross-validation . . . . . . . . . . . . . . . . 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165 165 165 166 167 167 168 169 169 169 172 173 173 174 176 177 177 177 178 180 181 186 186 187 187 189 190 Quantitative Analytics 4.3 5 Trend filtering in the time domain . 4.3.1 Some basic principles . . . 4.3.2 The local averages . . . . . 4.3.3 The Savitzky-Golay filter . . 4.3.4 The least squares filters . . . 4.3.4.1 The L2 filtering . 4.3.4.2 The L1 filtering . 4.3.4.3 The Kalman filters 4.3.5 Calibration . . . . . . . . . 4.3.6 Introducing linear prediction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190 190 192 194 195 195 196 197 198 199 Presenting time series analysis 5.1 Basic principles of linear time series . . . . . . . . . . . 5.1.1 Stationarity . . . . . . . . . . . . . . . . . . . . 5.1.2 The autocorrelation function . . . . . . . . . . . 5.1.3 The portmanteau test . . . . . . . . . . . . . . . 5.2 Linear time series . . . . . . . . . . . . . . . . . . . . . 5.2.1 Defining time series . . . . . . . . . . . . . . . 5.2.2 The autoregressive models . . . . . . . . . . . . 5.2.2.1 Definition . . . . . . . . . . . . . . . 5.2.2.2 Some properties . . . . . . . . . . . . 5.2.2.3 Identifying and estimating AR models 5.2.2.4 Parameter estimation . . . . . . . . . 5.2.3 The moving-average models . . . . . . . . . . . 5.2.4 The simple ARMA model . . . . . . . . . . . . 5.3 Forecasting . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1 Forecasting with the AR models . . . . . . . . . 5.3.2 Forecasting with the MA models . . . . . . . . . 5.3.3 Forecasting with the ARMA models . . . . . . . 5.4 Nonstationarity and serial correlation . . . . . . . . . . . 5.4.1 Unit-root nonstationarity . . . . . . . . . . . . . 5.4.1.1 The random walk . . . . . . . . . . . 5.4.1.2 The random walk with drift . . . . . . 5.4.1.3 The unit-root test . . . . . . . . . . . 5.4.2 Regression models with time series . . . . . . . 5.4.3 Long-memory models . . . . . . . . . . . . . . 5.5 Multivariate time series . . . . . . . . . . . . . . . . . . 5.5.1 Characteristics . . . . . . . . . . . . . . . . . . 5.5.2 Introduction to a few models . . . . . . . . . . . 5.5.3 Principal component analysis . . . . . . . . . . 5.6 Some conditional heteroscedastic models . . . . . . . . 5.6.1 The ARCH model . . . . . . . . . . . . . . . . 5.6.2 The GARCH model . . . . . . . . . . . . . . . 5.6.3 The integrated GARCH model . . . . . . . . . . 5.6.4 The GARCH-M model . . . . . . . . . . . . . . 5.6.5 The exponential GARCH model . . . . . . . . . 5.6.6 The stochastic volatility model . . . . . . . . . . 5.6.7 Another approach: high-frequency data . . . . . 5.6.8 Forecasting evaluation . . . . . . . . . . . . . . 5.7 Exponential smoothing and forecasting data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202 202 202 203 204 205 205 206 206 206 208 209 209 210 211 212 212 213 213 213 214 215 215 216 217 218 218 219 220 221 221 224 225 225 226 227 228 229 229 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quantitative Analytics 5.7.1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230 230 231 231 233 234 235 236 237 242 245 246 Filtering and forecasting with wavelet analysis 6.1 Introducing wavelet analysis . . . . . . . . . . . . . . . . . . . . . 6.1.1 From spectral analysis to wavelet analysis . . . . . . . . . . 6.1.1.1 Spectral analysis . . . . . . . . . . . . . . . . . . 6.1.1.2 Wavelet analysis . . . . . . . . . . . . . . . . . . 6.1.2 The a trous wavelet decomposition . . . . . . . . . . . . . . 6.2 Some applications . . . . . . . . . . . . . . . . . . . . . . . . . . . 6.2.1 A brief review . . . . . . . . . . . . . . . . . . . . . . . . 6.2.2 Filtering with wavelets . . . . . . . . . . . . . . . . . . . . 6.2.3 Non-stationarity . . . . . . . . . . . . . . . . . . . . . . . 6.2.4 Decomposition tool for seasonality extraction . . . . . . . . 6.2.5 Interdependence between variables . . . . . . . . . . . . . 6.2.6 Introducing long memory processes . . . . . . . . . . . . . 6.3 Presenting wavelet-based forecasting methods . . . . . . . . . . . . 6.3.1 Forecasting with the a trous wavelet transform . . . . . . . 6.3.2 The redundant Haar wavelet transform for time-varying data 6.3.3 The multiresolution autoregressive model . . . . . . . . . . 6.3.3.1 Linear model . . . . . . . . . . . . . . . . . . . . 6.3.3.2 Non-linear model . . . . . . . . . . . . . . . . . 6.3.4 The neuro-wavelet hybrid model . . . . . . . . . . . . . . . 6.4 Some wavelets applications to finance . . . . . . . . . . . . . . . . 6.4.1 Deriving strategies from wavelet analysis . . . . . . . . . . 6.4.2 Literature review . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248 248 248 248 249 249 251 251 252 253 253 254 254 255 255 256 257 257 258 258 259 259 259 5.7.2 5.7.3 5.7.4 5.7.5 5.7.6 6 III 7 The moving average . . . . . . . . . . . . . . . 5.7.1.1 Simple moving average . . . . . . . . 5.7.1.2 Weighted moving average . . . . . . . 5.7.1.3 Exponential smoothing . . . . . . . . 5.7.1.4 Exponential moving average revisited . Introducing exponential smoothing models . . . 5.7.2.1 Linear exponential smoothing . . . . . 5.7.2.2 The damped trend model . . . . . . . A summary . . . . . . . . . . . . . . . . . . . . Model fitting . . . . . . . . . . . . . . . . . . . Prediction intervals and random simulation . . . Random coefficient state space model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quantitative trading in inefficient markets Introduction to quantitative strategies 7.1 Presenting hedge funds . . . . . . . . . . . . . . . . . 7.1.1 Classifying hedge funds . . . . . . . . . . . . 7.1.2 Some facts about leverage . . . . . . . . . . . 7.1.2.1 Defining leverage . . . . . . . . . . 7.1.2.2 Different measures of leverage . . . 7.1.2.3 Leverage and risk . . . . . . . . . . 7.2 Different types of strategies . . . . . . . . . . . . . . . 7.2.1 Long-short portfolio . . . . . . . . . . . . . . 7.2.1.1 The problem with long-only portfolio 8 261 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 262 262 262 263 263 263 264 264 264 264 Quantitative Analytics 7.2.1.2 The benefits of long-short portfolio 7.2.2 Equity market neutral . . . . . . . . . . . . . 7.2.3 Pairs trading . . . . . . . . . . . . . . . . . 7.2.4 Statistical arbitrage . . . . . . . . . . . . . . 7.2.5 Mean-reversion strategies . . . . . . . . . . 7.2.6 Adaptive strategies . . . . . . . . . . . . . . 7.2.7 Constraints and fees on short-selling . . . . . Enhanced active strategies . . . . . . . . . . . . . . 7.3.1 Definition . . . . . . . . . . . . . . . . . . . 7.3.2 Some misconceptions . . . . . . . . . . . . 7.3.3 Some benefits . . . . . . . . . . . . . . . . . 7.3.4 The enhanced prime brokerage structures . . Measuring the efficiency of portfolio implementation 7.4.1 Measures of efficiency . . . . . . . . . . . . 7.4.2 Factors affecting performances . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 265 266 267 269 270 270 271 271 271 272 273 274 275 275 276 Describing quantitative strategies 8.1 Time series momentum strategies . . . . . . . . . . . 8.1.1 The univariate time-series strategy . . . . . . 8.1.2 The momentum signals . . . . . . . . . . . . 8.1.2.1 Return sign . . . . . . . . . . . . . 8.1.2.2 Moving Average . . . . . . . . . . 8.1.2.3 EEMD Trend Extraction . . . . . . 8.1.2.4 Time-Trend t-statistic . . . . . . . 8.1.2.5 Statistically Meaningful Trend . . 8.1.3 The signal speed . . . . . . . . . . . . . . . 8.1.4 The relative strength index . . . . . . . . . . 8.1.5 Regression analysis . . . . . . . . . . . . . . 8.1.6 The momentum profitability . . . . . . . . . 8.2 Factors analysis . . . . . . . . . . . . . . . . . . . . 8.2.1 Presenting the factor model . . . . . . . . . 8.2.2 Some trading applications . . . . . . . . . . 8.2.2.1 Pairs-trading . . . . . . . . . . . . 8.2.2.2 Decomposing stock returns . . . . 8.2.3 A systematic approach . . . . . . . . . . . . 8.2.3.1 Modelling returns . . . . . . . . . 8.2.3.2 The market neutral portfolio . . . . 8.2.4 Estimating the factor model . . . . . . . . . 8.2.4.1 The PCA approach . . . . . . . . 8.2.4.2 The selection of the eigenportfolios 8.2.5 Strategies based on mean-reversion . . . . . 8.2.5.1 The mean-reverting model . . . . . 8.2.5.2 Pure mean-reversion . . . . . . . . 8.2.5.3 Mean-reversion with drift . . . . . 8.2.6 Portfolio optimisation . . . . . . . . . . . . 8.2.7 Back-testing . . . . . . . . . . . . . . . . . 8.3 The meta strategies . . . . . . . . . . . . . . . . . . 8.3.1 Presentation . . . . . . . . . . . . . . . . . . 8.3.1.1 The trading signal . . . . . . . . . 8.3.1.2 The strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278 278 278 279 279 279 280 280 280 281 281 282 283 284 284 287 287 287 288 288 289 290 290 291 292 292 294 294 295 297 297 297 297 298 7.3 7.4 8 9 Quantitative Analytics 8.3.2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298 298 299 300 301 301 301 Portfolio management under constraints 9.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.2 Robust portfolio allocation . . . . . . . . . . . . . . . . . . . . . . . . 9.2.1 Long-short mean-variance approach under constraints . . . . . 9.2.2 Portfolio selection . . . . . . . . . . . . . . . . . . . . . . . . 9.2.2.1 Long only investment: non-leveraged . . . . . . . . . 9.2.2.2 Short selling: No ruin constraints . . . . . . . . . . . 9.2.2.3 Long only investment: leveraged . . . . . . . . . . . 9.2.2.4 Short selling and leverage . . . . . . . . . . . . . . . 9.3 Empirical log-optimal portfolio selections . . . . . . . . . . . . . . . . 9.3.1 Static portfolio selection . . . . . . . . . . . . . . . . . . . . . 9.3.2 Constantly rebalanced portfolio selection . . . . . . . . . . . . 9.3.2.1 Log-optimal portfolio for memoryless market process 9.3.2.2 Semi-log-optimal portfolio . . . . . . . . . . . . . . 9.3.3 Time varying portfolio selection . . . . . . . . . . . . . . . . . 9.3.3.1 Log-optimal portfolio for stationary market process . 9.3.3.2 Empirical portfolio selection . . . . . . . . . . . . . 9.3.4 Regression function estimation: The local averaging estimates . 9.3.4.1 The partitioning estimate . . . . . . . . . . . . . . . 9.3.4.2 The Nadaraya-Watson kernel estimate . . . . . . . . 9.3.4.3 The k-nearest neighbour estimate . . . . . . . . . . . 9.3.4.4 The correspondence . . . . . . . . . . . . . . . . . . 9.4 A simple example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.4.1 A self-financed long-short portfolio . . . . . . . . . . . . . . . 9.4.2 Allowing for capital inflows and outflows . . . . . . . . . . . . 9.4.3 Allocating the weights . . . . . . . . . . . . . . . . . . . . . . 9.4.3.1 Choosing uniform weights . . . . . . . . . . . . . . 9.4.3.2 Choosing Beta for the weight . . . . . . . . . . . . . 9.4.3.3 Choosing Alpha for the weight . . . . . . . . . . . . 9.4.3.4 Combining Alpha and Beta for the weight . . . . . . 9.4.4 Building a beta neutral portfolio . . . . . . . . . . . . . . . . . 9.4.4.1 A quasi-beta neutral portfolio . . . . . . . . . . . . . 9.4.4.2 An exact beta-neutral portfolio . . . . . . . . . . . . 9.5 Value at Risk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9.5.1 Defining value at risk . . . . . . . . . . . . . . . . . . . . . . . 9.5.2 Computing value at risk . . . . . . . . . . . . . . . . . . . . . 9.5.2.1 RiskMetrics . . . . . . . . . . . . . . . . . . . . . . 9.5.2.2 Econometric models to VaR calculation . . . . . . . . 9.5.2.3 Quantile estimation to VaR calculation . . . . . . . . 9.5.2.4 Extreme value theory to VaR calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303 303 304 304 307 308 310 312 313 314 314 315 316 318 318 318 319 320 320 321 322 322 322 322 325 326 326 326 327 327 327 327 328 328 328 329 329 330 332 334 8.4 9 The risk measures . . . . . . . . . . . . . 8.3.2.1 Conditional expectations . . . . 8.3.2.2 Some examples . . . . . . . . . 8.3.3 Computing the Sharpe ratio of the strategies Random sampling measures of risk . . . . . . . . . 8.4.1 The sample Sharpe ratio . . . . . . . . . . 8.4.2 The sample conditional Sharpe ratio . . . . 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quantitative Analytics IV Quantitative trading in multifractal markets 10 The fractal market hypothesis 10.1 Fractal structure in the markets . . . . . . . . . . . . . . . . . . 10.1.1 Introducing fractal analysis . . . . . . . . . . . . . . . . 10.1.1.1 A brief history . . . . . . . . . . . . . . . . . 10.1.1.2 Presenting the results . . . . . . . . . . . . . 10.1.2 Defining random fractals . . . . . . . . . . . . . . . . . 10.1.2.1 The fractional Brownian motion . . . . . . . . 10.1.2.2 The multidimensional fBm . . . . . . . . . . 10.1.2.3 The fractional Gaussian noise . . . . . . . . . 10.1.2.4 The fractal process and its distribution . . . . 10.1.2.5 An application to finance . . . . . . . . . . . 10.1.3 A first approach to generating random fractals . . . . . . 10.1.3.1 Approximating fBm by spectral synthesis . . 10.1.3.2 The ARFIMA models . . . . . . . . . . . . . 10.1.4 From efficient to fractal market hypothesis . . . . . . . 10.1.4.1 Some limits of the efficient market hypothesis 10.1.4.2 The Larrain KZ model . . . . . . . . . . . . . 10.1.4.3 The coherent market hypothesis . . . . . . . . 10.1.4.4 Defining the fractal market hypothesis . . . . 10.2 The R/S analysis . . . . . . . . . . . . . . . . . . . . . . . . . 10.2.1 Defining R/S analysis for financial series . . . . . . . . 10.2.2 A step-by-step guide to R/S analysis . . . . . . . . . . . 10.2.2.1 A first approach . . . . . . . . . . . . . . . . 10.2.2.2 A better step-by-step method . . . . . . . . . 10.2.3 Testing the limits of R/S analysis . . . . . . . . . . . . . 10.2.4 Improving the R/S analysis . . . . . . . . . . . . . . . . 10.2.4.1 Reducing bias . . . . . . . . . . . . . . . . . 10.2.4.2 Lo’s modified R/S statistic . . . . . . . . . . 10.2.4.3 Removing short-term memory . . . . . . . . 10.2.5 Detecting periodic and nonperiodic cycles . . . . . . . . 10.2.5.1 The natural period of a system . . . . . . . . 10.2.5.2 The V statistic . . . . . . . . . . . . . . . . . 10.2.5.3 The Hurst exponent and chaos theory . . . . . 10.2.6 Possible models for FMH . . . . . . . . . . . . . . . . 10.2.6.1 A few points about chaos theory . . . . . . . 10.2.6.2 Using R/S analysis to detect noisy chaos . . 10.2.6.3 A unified theory . . . . . . . . . . . . . . . . 10.2.7 Revisiting the measures of volatility risk . . . . . . . . . 10.2.7.1 The standard deviation . . . . . . . . . . . . . 10.2.7.2 The fractal dimension as a measure of risk . . 10.3 Hurst exponent estimation methods . . . . . . . . . . . . . . . . 10.3.1 Estimating the Hurst exponent with wavelet analysis . . 10.3.2 Detrending methods . . . . . . . . . . . . . . . . . . . 10.3.2.1 Detrended fluctuation analysis . . . . . . . . 10.3.2.2 A modified DFA . . . . . . . . . . . . . . . . 10.3.2.3 Detrending moving average . . . . . . . . . . 10.3.2.4 DMA in high dimensions . . . . . . . . . . . 10.3.2.5 The periodogram and the Whittle estimator . . 11 337 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338 338 338 338 339 342 342 344 344 345 346 347 347 348 350 350 351 352 353 353 353 355 355 356 357 358 358 359 360 360 360 361 361 362 362 363 364 365 365 366 367 367 369 370 372 372 373 374 Quantitative Analytics 10.4 Testing for market efficiency . . . . . . . . . . . . . . . . . . . . . . . . 10.4.1 Presenting the main controversy . . . . . . . . . . . . . . . . . . 10.4.2 Using the Hurst exponent to define the null hypothesis . . . . . . 10.4.2.1 Defining long-range dependence . . . . . . . . . . . . 10.4.2.2 Defining the null hypothesis . . . . . . . . . . . . . . . 10.4.3 Measuring temporal correlation in financial data . . . . . . . . . 10.4.3.1 Statistical studies . . . . . . . . . . . . . . . . . . . . 10.4.3.2 An example on foreign exchange rates . . . . . . . . . 10.4.4 Applying R/S analysis to financial data . . . . . . . . . . . . . . 10.4.4.1 A first analysis on the capital markets . . . . . . . . . . 10.4.4.2 A deeper analysis on the capital markets . . . . . . . . 10.4.4.3 Defining confidence intervals for long-memory analysis 10.4.5 Some critics at Lo’s modified R/S statistic . . . . . . . . . . . . 10.4.6 The problem of non-stationary and dependent increments . . . . . 10.4.6.1 Non-stationary increments . . . . . . . . . . . . . . . . 10.4.6.2 Finite sample . . . . . . . . . . . . . . . . . . . . . . 10.4.6.3 Dependent increments . . . . . . . . . . . . . . . . . . 10.4.6.4 Applying stress testing . . . . . . . . . . . . . . . . . 10.4.7 Some results on measuring the Hurst exponent . . . . . . . . . . 10.4.7.1 Accuracy of the Hurst estimation . . . . . . . . . . . . 10.4.7.2 Robustness for various sample size . . . . . . . . . . . 10.4.7.3 Computation time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374 374 375 375 376 376 376 377 378 378 378 379 380 381 381 381 382 382 383 383 385 387 11 The multifractal markets 11.1 Multifractality as a new stylised fact . . . . . . . . . . . . . . . . . . . . . . 11.1.1 The multifractal scaling behaviour of time series . . . . . . . . . . . 11.1.1.1 Analysing complex signals . . . . . . . . . . . . . . . . . 11.1.1.2 A direct application to financial time series . . . . . . . . . 11.1.2 Defining multifractality . . . . . . . . . . . . . . . . . . . . . . . . . 11.1.2.1 Fractal measures and their singularities . . . . . . . . . . . 11.1.2.2 Scaling analysis . . . . . . . . . . . . . . . . . . . . . . . 11.1.2.3 Multifractal analysis . . . . . . . . . . . . . . . . . . . . . 11.1.2.4 The wavelet transform and the thermodynamical formalism 11.1.3 Observing multifractality in financial data . . . . . . . . . . . . . . . 11.1.3.1 Applying multiscaling analysis . . . . . . . . . . . . . . . 11.1.3.2 Applying multifractal fluctuation analysis . . . . . . . . . 11.2 Holder exponent estimation methods . . . . . . . . . . . . . . . . . . . . . . 11.2.1 Applying the multifractal formalism . . . . . . . . . . . . . . . . . . 11.2.2 The multifractal wavelet analysis . . . . . . . . . . . . . . . . . . . 11.2.2.1 The wavelet transform modulus maxima . . . . . . . . . . 11.2.2.2 Wavelet multifractal DFA . . . . . . . . . . . . . . . . . . 11.2.3 The multifractal fluctuation analysis . . . . . . . . . . . . . . . . . . 11.2.3.1 Direct and indirect procedure . . . . . . . . . . . . . . . . 11.2.3.2 Multifractal detrended fluctuation . . . . . . . . . . . . . . 11.2.3.3 Multifractal empirical mode decomposition . . . . . . . . 11.2.3.4 The R/S ananysis extented . . . . . . . . . . . . . . . . . 11.2.3.5 Multifractal detrending moving average . . . . . . . . . . 11.2.3.6 Some comments about using MFDFA . . . . . . . . . . . . 11.2.4 General comments on multifractal analysis . . . . . . . . . . . . . . 11.2.4.1 Characteristics of the generalised Hurst exponent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390 390 390 390 391 391 391 394 396 399 400 400 401 402 402 403 404 405 406 406 407 408 408 409 409 411 411 12 . . . . . . . . . . . . . . . . . . . . . . Quantitative Analytics 11.3 11.4 11.5 11.6 11.2.4.2 Characteristics of the multifractal spectrum . . . . . . . . 11.2.4.3 Some issues regarding terminology and definition . . . . The need for time and scale dependent Hurst exponent . . . . . . . . . . . 11.3.1 Computing the Hurst exponent on a sliding window . . . . . . . . . 11.3.1.1 Introducing time-dependent Hurst exponent . . . . . . . 11.3.1.2 Describing the sliding window . . . . . . . . . . . . . . 11.3.1.3 Understanding the time-dependent Hurst exponent . . . . 11.3.1.4 Time and scale Hurst exponent . . . . . . . . . . . . . . 11.3.2 Testing the markets for multifractality . . . . . . . . . . . . . . . . 11.3.2.1 A summary on temporal correlation in financial data . . . 11.3.2.2 Applying sliding windows . . . . . . . . . . . . . . . . . Local Holder exponent estimation methods . . . . . . . . . . . . . . . . . 11.4.1 The wavelet analysis . . . . . . . . . . . . . . . . . . . . . . . . . 11.4.1.1 The effective Holder exponent . . . . . . . . . . . . . . 11.4.1.2 Gradient modulus wavelet projection . . . . . . . . . . . 11.4.1.3 Testing the performances of wavelet multifractal methods 11.4.2 The fluctuation analysis . . . . . . . . . . . . . . . . . . . . . . . 11.4.2.1 Local detrended fluctuation analysis . . . . . . . . . . . 11.4.2.2 The multifractal spectrum and the local Hurst exponent . 11.4.3 Detection and localisation of outliers . . . . . . . . . . . . . . . . 11.4.4 Testing for the validity of the local Hurst exponent . . . . . . . . . 11.4.4.1 Local change of fractal structure . . . . . . . . . . . . . 11.4.4.2 Abrupt change of fractal structure . . . . . . . . . . . . . 11.4.4.3 A simple explanation . . . . . . . . . . . . . . . . . . . Analysing the multifractal markets . . . . . . . . . . . . . . . . . . . . . . 11.5.1 Describing the method . . . . . . . . . . . . . . . . . . . . . . . . 11.5.2 Testing for trend and mean-reversion . . . . . . . . . . . . . . . . 11.5.2.1 The equity market . . . . . . . . . . . . . . . . . . . . . 11.5.2.2 The FX market . . . . . . . . . . . . . . . . . . . . . . . 11.5.3 Testing for crash prediction . . . . . . . . . . . . . . . . . . . . . 11.5.3.1 The Asian crisis in 1997 . . . . . . . . . . . . . . . . . . 11.5.3.2 The dot-com bubble in 2000 . . . . . . . . . . . . . . . . 11.5.3.3 The financial crisis of 2007 . . . . . . . . . . . . . . . . 11.5.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Some multifractal models for asset pricing . . . . . . . . . . . . . . . . . . 12 Systematic trading 12.1 Introduction . . . . . . . . . . . . . . . . . . 12.2 Technical analysis . . . . . . . . . . . . . . . 12.2.1 Definition . . . . . . . . . . . . . . . 12.2.2 Technical indicator . . . . . . . . . . 12.2.3 Optimising portfolio selection . . . . 12.2.3.1 Classifying strategies . . . 12.2.3.2 Examples of multiple rules V . . . . . . . . . . . . . . Numerical Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 412 415 415 415 415 416 417 417 417 418 421 421 421 422 423 423 423 425 425 426 426 427 427 428 428 430 430 431 432 432 433 434 435 436 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441 441 442 442 443 443 444 445 446 13 Presenting some machine-learning methods 448 13.1 Some facts on machine-learning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 13 Quantitative Analytics 13.2 13.3 13.4 13.5 13.6 13.1.1 Introduction to data mining . . . . . . . . . . . . . . . . . 13.1.2 The challenges of computational learning . . . . . . . . . Introduction to information theory . . . . . . . . . . . . . . . . . 13.2.1 Presenting a few concepts . . . . . . . . . . . . . . . . . 13.2.2 Some facts on entropy in information theory . . . . . . . 13.2.3 Relative entropy and mutual information . . . . . . . . . 13.2.4 Bounding performance measures . . . . . . . . . . . . . . 13.2.5 Feature selection . . . . . . . . . . . . . . . . . . . . . . Introduction to artificial neural networks . . . . . . . . . . . . . . 13.3.1 Presentation . . . . . . . . . . . . . . . . . . . . . . . . . 13.3.2 Gradient descent and the delta rule . . . . . . . . . . . . . 13.3.3 Introducing multilayer networks . . . . . . . . . . . . . . 13.3.3.1 Describing the problem . . . . . . . . . . . . . 13.3.3.2 Describing the algorithm . . . . . . . . . . . . 13.3.3.3 A simple example . . . . . . . . . . . . . . . . 13.3.4 Multi-layer back propagation . . . . . . . . . . . . . . . . 13.3.4.1 The output layer . . . . . . . . . . . . . . . . . 13.3.4.2 The first hidden layer . . . . . . . . . . . . . . 13.3.4.3 The next hidden layer . . . . . . . . . . . . . . 13.3.4.4 Some remarks . . . . . . . . . . . . . . . . . . Online learning and regret-minimising algorithms . . . . . . . . . 13.4.1 Simple online algorithms . . . . . . . . . . . . . . . . . . 13.4.1.1 The Halving algorithm . . . . . . . . . . . . . 13.4.1.2 The weighted majority algorithm . . . . . . . . 13.4.2 The online convex optimisation . . . . . . . . . . . . . . 13.4.2.1 The online linear optimisation problem . . . . . 13.4.2.2 Considering Bergmen divergence . . . . . . . . 13.4.2.3 More on the online convex optimisation problem Presenting the problem of automated market making . . . . . . . 13.5.1 The market neutral case . . . . . . . . . . . . . . . . . . 13.5.2 The case of infinite outcome space . . . . . . . . . . . . . 13.5.3 Relating market design to machine learning . . . . . . . . 13.5.4 The assumptions of market completeness . . . . . . . . . Presenting scoring rules . . . . . . . . . . . . . . . . . . . . . . . 13.6.1 Describing a few scoring rules . . . . . . . . . . . . . . . 13.6.1.1 The proper scoring rules . . . . . . . . . . . . . 13.6.1.2 The market scoring rules . . . . . . . . . . . . 13.6.2 Relating MSR to cost function based market makers . . . 14 Introducing Differential Evolution 14.1 Introduction . . . . . . . . . . . . . . . . . . . . . 14.2 Calibration to implied volatility . . . . . . . . . . . 14.2.1 Introducing calibration . . . . . . . . . . . 14.2.1.1 The general idea . . . . . . . . . 14.2.1.2 Measures of pricing errors . . . . 14.2.2 The calibration problem . . . . . . . . . . 14.2.3 The regularisation function . . . . . . . . . 14.2.4 Beyond deterministic optimisation method 14.3 Nonlinear programming problems with constraints 14.3.1 Describing the problem . . . . . . . . . . . 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448 449 451 451 452 453 455 457 460 460 461 462 463 463 465 465 466 466 468 470 471 471 471 471 473 473 473 474 475 475 476 479 480 480 480 480 481 482 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483 483 483 483 483 484 485 486 487 487 487 Quantitative Analytics 14.3.1.1 A brief history . . . . . . . . . . . . . . . . . . . 14.3.1.2 Defining the problems . . . . . . . . . . . . . . . 14.3.2 Some optimisation methods . . . . . . . . . . . . . . . . . 14.3.2.1 Random optimisation . . . . . . . . . . . . . . . 14.3.2.2 Harmony search . . . . . . . . . . . . . . . . . . 14.3.2.3 Particle swarm optimisation . . . . . . . . . . . . 14.3.2.4 Cross entropy optimisation . . . . . . . . . . . . 14.3.2.5 Simulated annealing . . . . . . . . . . . . . . . . 14.3.3 The DE algorithm . . . . . . . . . . . . . . . . . . . . . . 14.3.3.1 The mutation . . . . . . . . . . . . . . . . . . . . 14.3.3.2 The recombination . . . . . . . . . . . . . . . . . 14.3.3.3 The selection . . . . . . . . . . . . . . . . . . . . 14.3.3.4 Convergence criterions . . . . . . . . . . . . . . 14.3.4 Pseudocode . . . . . . . . . . . . . . . . . . . . . . . . . . 14.3.5 The strategies . . . . . . . . . . . . . . . . . . . . . . . . . 14.3.5.1 Scheme DE1 . . . . . . . . . . . . . . . . . . . . 14.3.5.2 Scheme DE2 . . . . . . . . . . . . . . . . . . . . 14.3.5.3 Scheme DE3 . . . . . . . . . . . . . . . . . . . . 14.3.5.4 Scheme DE4 . . . . . . . . . . . . . . . . . . . . 14.3.5.5 Scheme DE5 . . . . . . . . . . . . . . . . . . . . 14.3.5.6 Scheme DE6 . . . . . . . . . . . . . . . . . . . . 14.3.5.7 Scheme DE7 . . . . . . . . . . . . . . . . . . . . 14.3.5.8 Scheme DE8 . . . . . . . . . . . . . . . . . . . . 14.3.6 Improvements . . . . . . . . . . . . . . . . . . . . . . . . . 14.3.6.1 Ageing . . . . . . . . . . . . . . . . . . . . . . . 14.3.6.2 Constraints on parameters . . . . . . . . . . . . . 14.3.6.3 Convergence . . . . . . . . . . . . . . . . . . . . 14.3.6.4 Self-adaptive parameters . . . . . . . . . . . . . 14.3.6.5 Selection . . . . . . . . . . . . . . . . . . . . . . 14.4 Handling the constraints . . . . . . . . . . . . . . . . . . . . . . . 14.4.1 Describing the problem . . . . . . . . . . . . . . . . . . . . 14.4.2 Defining the feasibility rules . . . . . . . . . . . . . . . . . 14.4.3 Improving the feasibility rules . . . . . . . . . . . . . . . . 14.4.4 Handling diversity . . . . . . . . . . . . . . . . . . . . . . 14.5 The proposed algorithm . . . . . . . . . . . . . . . . . . . . . . . . 14.6 Describing some benchmarks . . . . . . . . . . . . . . . . . . . . . 14.6.1 Minimisation of the sphere function . . . . . . . . . . . . . 14.6.2 Minimisation of the Rosenbrock function . . . . . . . . . . 14.6.3 Minimisation of the step function . . . . . . . . . . . . . . 14.6.4 Minimisation of the Rastrigin function . . . . . . . . . . . . 14.6.5 Minimisation of the Griewank function . . . . . . . . . . . 14.6.6 Minimisation of the Easom function . . . . . . . . . . . . . 14.6.7 Image from polygons . . . . . . . . . . . . . . . . . . . . . 14.6.8 Minimisation problem g01 . . . . . . . . . . . . . . . . . . 14.6.9 Maximisation problem g03 . . . . . . . . . . . . . . . . . . 14.6.10 Maximisation problem g08 . . . . . . . . . . . . . . . . . . 14.6.11 Minimisation problem g11 . . . . . . . . . . . . . . . . . . 14.6.12 Minimisation of the weight of a tension/compression spring 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487 487 489 489 490 491 492 493 494 494 494 495 495 495 496 496 496 496 496 497 497 497 498 498 498 499 499 499 499 500 500 500 501 502 503 504 505 505 505 506 506 506 507 507 508 508 508 508 Quantitative Analytics 15 Introduction to CUDA Programming in Finance 15.1 Introduction . . . . . . . . . . . . . . . . . . . . . . 15.1.1 A birief overview . . . . . . . . . . . . . . . 15.1.2 Preliminary words on parallel programming . 15.1.3 Why GPUs? . . . . . . . . . . . . . . . . . 15.1.4 Why CUDA? . . . . . . . . . . . . . . . . . 15.1.5 Applications in financial computing . . . . . 15.2 Programming with CUDA . . . . . . . . . . . . . . 15.2.1 Hardware . . . . . . . . . . . . . . . . . . . 15.2.2 Thread hierarchy . . . . . . . . . . . . . . . 15.2.3 Memory management . . . . . . . . . . . . 15.2.4 Syntax and connetion to C/C++ . . . . . . . 15.2.5 Random number generation . . . . . . . . . 15.2.5.1 Memory storage . . . . . . . . . . 15.2.5.2 Inline . . . . . . . . . . . . . . . . 15.3 Case studies . . . . . . . . . . . . . . . . . . . . . . 15.3.1 Exotic swaps in Monte-Carlo . . . . . . . . . 15.3.1.1 Product and model . . . . . . . . . 15.3.1.2 Single-thread algorithm . . . . . . 15.3.1.3 Multi-thread algorithm . . . . . . 15.3.1.4 Using the texture memory . . . . . 15.3.2 Volatility calibration by differential evolution 15.3.2.1 Model and difficulties . . . . . . . 15.3.2.2 Single-thread algorithm . . . . . . 15.3.2.3 Multi-thread algorithm . . . . . . 15.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Appendices A Review of some mathematical facts A.1 Some facts on convex and concave analysis A.1.1 Convex functions . . . . . . . . . . A.1.2 Concave functions . . . . . . . . . A.1.3 Some approximations . . . . . . . A.1.4 Conjugate duality . . . . . . . . . . A.1.5 A note on Legendre transformation A.1.6 A note on the Bregman divergence . A.2 The logistic function . . . . . . . . . . . . A.3 The convergence of series . . . . . . . . . . A.4 The Dirac function . . . . . . . . . . . . . A.5 Some linear algebra . . . . . . . . . . . . . A.6 Some facts on matrices . . . . . . . . . . . A.7 Utility function . . . . . . . . . . . . . . . A.7.1 Definition . . . . . . . . . . . . . . A.7.2 Some properties . . . . . . . . . . A.7.3 Some specific utility functions . . . A.7.4 Mean-variance criterion . . . . . . A.7.4.1 Normal returns . . . . . . A.7.4.2 Non-normal returns . . . A.8 Optimisation . . . . . . . . . . . . . . . . 510 510 510 511 512 513 513 514 514 514 515 516 520 521 521 522 522 522 522 523 524 525 525 526 526 527 528 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 529 529 530 530 532 532 533 533 534 536 538 538 542 544 544 545 547 548 548 549 549 Quantitative Analytics A.9 Conjugate gradient method . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551 B Some probabilities B.1 Some definitions . . . . . . . . . . . . . . . . . . . . . . B.2 Random variables . . . . . . . . . . . . . . . . . . . . . . B.2.1 Discrete random variables . . . . . . . . . . . . . B.2.2 Continuous random variables . . . . . . . . . . . B.3 Introducing stochastic processes . . . . . . . . . . . . . . B.4 The characteristic function and moments . . . . . . . . . . B.4.1 Definitions . . . . . . . . . . . . . . . . . . . . . B.4.2 The first two moments . . . . . . . . . . . . . . . B.4.3 Trading correlation . . . . . . . . . . . . . . . . . B.5 Conditional moments . . . . . . . . . . . . . . . . . . . . B.5.1 Conditional expectation . . . . . . . . . . . . . . B.5.2 Conditional variance . . . . . . . . . . . . . . . . B.5.3 More details on conditional expectation . . . . . . B.5.3.1 Some discrete results . . . . . . . . . . B.5.3.2 Some continuous results . . . . . . . . . B.6 About fractal analysis . . . . . . . . . . . . . . . . . . . . B.6.1 The fractional Brownian motion . . . . . . . . . . B.6.2 The R/S analysis . . . . . . . . . . . . . . . . . . B.7 Some continuous variables and their distributions . . . . . B.7.1 Some popular distributions . . . . . . . . . . . . . B.7.1.1 Uniform distribution . . . . . . . . . . . B.7.1.2 Exponential distribution . . . . . . . . . B.7.1.3 Normal distribution . . . . . . . . . . . B.7.1.4 Gamma distribution . . . . . . . . . . . B.7.1.5 Chi-square distribution . . . . . . . . . B.7.1.6 Weibull distribution . . . . . . . . . . . B.7.2 Normal and Lognormal distributions . . . . . . . . B.7.3 Multivariate Normal distributions . . . . . . . . . B.7.4 Distributions arising from the Normal distribution . B.7.4.1 Presenting the problem . . . . . . . . . B.7.4.2 The t-distribution . . . . . . . . . . . . B.7.4.3 The F -distribution . . . . . . . . . . . . B.8 Some results on Normal sampling . . . . . . . . . . . . . B.8.1 Estimating the mean and variance . . . . . . . . . B.8.2 Estimating the mean with known variance . . . . . B.8.3 Estimating the mean with unknown variance . . . B.8.4 Estimating the parameters of a linear model . . . . B.8.5 Asymptotic confidence interval . . . . . . . . . . B.8.6 The setup of the Monte Carlo engine . . . . . . . . B.9 Some random sampling . . . . . . . . . . . . . . . . . . . B.9.1 The sample moments . . . . . . . . . . . . . . . . B.9.2 Estimation of a ratio . . . . . . . . . . . . . . . . B.9.3 Stratified random sampling . . . . . . . . . . . . . B.9.4 Geometric mean . . . . . . . . . . . . . . . . . . 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 554 554 556 556 557 557 558 558 559 560 560 560 563 564 564 565 566 566 567 568 568 568 568 568 569 569 569 570 570 571 571 572 573 574 574 574 575 575 575 576 577 577 579 580 584 Quantitative Analytics C Stochastic processes and Time Series C.1 Introducing time series . . . . . . . . . . . . . . . C.1.1 Definitions . . . . . . . . . . . . . . . . . C.1.2 Estimation of trend and seasonality . . . . C.1.3 Some sample statistics . . . . . . . . . . . C.2 The ARMA model . . . . . . . . . . . . . . . . . C.3 Fitting ARIMA models . . . . . . . . . . . . . . . C.4 State space models . . . . . . . . . . . . . . . . . C.5 ARCH and GARCH models . . . . . . . . . . . . C.5.1 The ARCH process . . . . . . . . . . . . . C.5.2 The GARCH process . . . . . . . . . . . . C.5.3 Estimating model parameters . . . . . . . . C.6 The linear equation . . . . . . . . . . . . . . . . . C.6.1 Solving linear equation . . . . . . . . . . . C.6.2 A simple example . . . . . . . . . . . . . C.6.2.1 Covariance matrix . . . . . . . . C.6.2.2 Expectation . . . . . . . . . . . C.6.2.3 Distribution and probability . . . C.6.3 From OU to AR(1) process . . . . . . . . . C.6.3.1 The Ornstein-Uhlenbeck process C.6.3.2 Deriving the discrete model . . . C.6.4 Some facts about AR series . . . . . . . . C.6.4.1 Persistence . . . . . . . . . . . . C.6.4.2 Prewhitening and detrending . . C.6.4.3 Simulation and prediction . . . . C.6.5 Estimating the model parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 585 585 585 586 587 588 599 606 608 608 609 610 610 610 611 611 612 612 613 613 614 615 615 615 616 616 D Defining market equilibrirum and asset prices D.1 Introducing the theory of general equilibrium . . . . . . . . D.1.1 1 period, (d + 1) assets, k states of the world . . . . D.1.2 Complete market . . . . . . . . . . . . . . . . . . . D.1.3 Optimisation with consumption . . . . . . . . . . . D.2 An introduction to the model of Von Neumann Morgenstern D.2.1 Part I . . . . . . . . . . . . . . . . . . . . . . . . . D.2.2 Part II . . . . . . . . . . . . . . . . . . . . . . . . . D.3 Simple equilibrium model . . . . . . . . . . . . . . . . . . D.3.1 m agents, (d + 1) assets . . . . . . . . . . . . . . . D.3.2 The consumption based asset pricing model . . . . . D.4 The n-dates model . . . . . . . . . . . . . . . . . . . . . . . D.5 Discrete option valuation . . . . . . . . . . . . . . . . . . . D.6 Valuation in financial markets . . . . . . . . . . . . . . . . D.6.1 Pricing securities . . . . . . . . . . . . . . . . . . . D.6.2 Introducing the recovery theorem . . . . . . . . . . D.6.3 Using implied volatilities . . . . . . . . . . . . . . . D.6.4 Bounding the pricing kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 618 618 618 620 620 622 622 623 624 624 625 627 628 629 629 631 632 633 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quantitative Analytics E Pricing and hedging options E.1 Valuing options on multi-underlyings . . . . . . . . . . . . E.1.1 Self-financing portfolios . . . . . . . . . . . . . . . E.1.2 Absence of arbitrage opportunity and rate of returns E.1.3 Numeraire . . . . . . . . . . . . . . . . . . . . . . E.1.4 Evaluation and hedging . . . . . . . . . . . . . . . . E.2 The dynamics of financial assets . . . . . . . . . . . . . . . E.2.1 The Black-Scholes world . . . . . . . . . . . . . . . E.2.2 The dynamics of the bond price . . . . . . . . . . . E.3 From market prices to implied volatility . . . . . . . . . . . E.3.1 The Black-Scholes formula . . . . . . . . . . . . . . E.3.2 The implied volatility in the Black-Scholes formula . E.3.3 The robustness of the Black-Scholes formula . . . . E.4 Some properties satisfied by market prices . . . . . . . . . . E.4.1 The no-arbitrage conditions . . . . . . . . . . . . . E.4.2 Pricing two special market products . . . . . . . . . E.4.2.1 The digital option . . . . . . . . . . . . . E.4.2.2 The butterfly option . . . . . . . . . . . . E.5 Introduction to indifference pricing theory . . . . . . . . . . E.5.1 Martingale measures and state-price densities . . . . E.5.2 An overview . . . . . . . . . . . . . . . . . . . . . E.5.2.1 Describing the optimisation problem . . . E.5.2.2 The dual problem . . . . . . . . . . . . . E.5.3 The non-traded assets model . . . . . . . . . . . . . E.5.3.1 Discrete time . . . . . . . . . . . . . . . . E.5.3.2 Continuous time . . . . . . . . . . . . . . E.5.4 The pricing method . . . . . . . . . . . . . . . . . . E.5.4.1 Computing indifference prices . . . . . . E.5.4.2 Computing option prices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 634 634 634 637 638 639 642 642 643 645 645 645 646 647 647 647 647 648 648 648 649 649 650 651 651 651 652 653 654 F Some results on signal processing F.1 A short introduction to Fourier transform methods . . . . . . . . . . . . . F.1.1 Some analytical formalism . . . . . . . . . . . . . . . . . . . . . F.1.2 The Fourier integral . . . . . . . . . . . . . . . . . . . . . . . . F.1.3 The Fourier transformation . . . . . . . . . . . . . . . . . . . . . F.1.4 The discrete Fourier transform . . . . . . . . . . . . . . . . . . . F.1.5 The Fast Fourier Transform algorithm . . . . . . . . . . . . . . . F.2 From spline analysis to wavelet analysis . . . . . . . . . . . . . . . . . . F.2.1 An introduction to splines . . . . . . . . . . . . . . . . . . . . . F.2.2 Multiresolution spline processing . . . . . . . . . . . . . . . . . F.3 A short introduction to wavelet transform methods . . . . . . . . . . . . F.3.1 The continuous wavelet transform . . . . . . . . . . . . . . . . . F.3.2 The discrete wavelet transform . . . . . . . . . . . . . . . . . . . F.3.2.1 An infinite summations of discrete wavelet coefficients F.3.2.2 The scaling function . . . . . . . . . . . . . . . . . . . F.3.2.3 The FWT algorithm . . . . . . . . . . . . . . . . . . . F.3.3 Discrete input signals of finite length . . . . . . . . . . . . . . . F.3.3.1 Discribing the algorithm . . . . . . . . . . . . . . . . . F.3.3.2 Presenting thresholding . . . . . . . . . . . . . . . . . F.3.4 Wavelet-based statistical measures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 657 657 657 659 661 662 663 665 665 667 669 669 675 675 676 678 679 679 681 682 19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Quantitative Analytics F.4 The problem of shift-invariance . . . . . . . . . . . . . . . . . . . . . . F.4.1 A brief overview . . . . . . . . . . . . . . . . . . . . . . . . . F.4.1.1 Describing the problem . . . . . . . . . . . . . . . . F.4.1.2 The a trous algorithm . . . . . . . . . . . . . . . . . F.4.1.3 Relating the a trous and Mallat algorithms . . . . . . F.4.2 Describing some redundant transforms . . . . . . . . . . . . . F.4.2.1 The multiresolution analysis . . . . . . . . . . . . . . F.4.2.2 The standard DWT . . . . . . . . . . . . . . . . . . F.4.2.3 The -decimated DWT . . . . . . . . . . . . . . . . F.4.2.4 The stationary wavelet transform . . . . . . . . . . . F.4.3 The autocorrelation functions of compactly supported wavelets . 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 684 684 684 685 685 687 687 690 691 692 693 Quantitative Analytics 0.1 0.1.1 Introduction Preamble There is a vast literature on the investment decision making process and associated assessment of expected returns on investments. Traditionally, historical performances, economic theories, and forward looking indicators were usually put forward for investors to judge expected returns. However, modern finance theory, including quantitative models and econometric techniques, provided the foundation that has revolutionised the investment management industry over the last 20 years. Technical analysis have initiated a broad current of literature in economics and statistical physics refining and expanding the underlying concepts and models. It is remarkable to note that some of the features of financial data were general enough to have spawned the interest of several fields in sciences, from economics and econometrics, to mathematics and physics, to further explore the behaviour of this data and develop models explaining these characteristics. As a result, some theories found by a group of scientists were rediscovered at a later stage by another group, or simply observed and mentioned in studies but not formalised. Financial text books presenting academic and practitioners findings tend to be too vague and too restrictive, while published articles tend to be too technical and too specialised. This guide tries to bridge the gap by presenting the necessary tools for performing quantitative portfolio selection and allocation in a simple, yet robust way. We present in a chronological order the necessary steps to identify trading signals, build quantitative strategies, assess expected returns, measure and score strategies, and allocate portfolios. This is done with the help of various published articles referenced along this guide, as well as financial and economical text books. In the spirit of Alfred North Whitehead, we aim to seek the simplest explanations of complex facts, which is achieved by structuring this book from the simple to the complex. This pedagogic approach, inevitably, leads to some necessary repetitions of materials. We first introduce some simple ideas and concepts used to describe financial data, and then show how empirical evidences led to the introduction of complexity which modified the existing market consensus. This book is divided into in five parts. We first present and describe quantitative trading in classical economics, and provide the paramount statistical tools. We then discuss quantitative trading in inefficient markets before detailing quantitative trading in multifractal markets. At last, we we present a few numerical tools to perform the necessary computation when performing quantitative trading strategies. The decision making process and portfolio allocation being a vast subject, this is not an exhaustive guide, and some fields and techniques have not been covered. However, we intend to fill the gap over time by reviewing and updating this book. 0.1.2 An overview of quantitative trading Following the spirit of Focardi et al. [2004], who detailed how the growing use of quantitative methods changed finance and investment theory, we are going to present an overview of quantitative portfolio trading. Just as automation and mechanisation were the cornerstones of the Industrial Revolution at the turn of the 19th century, modern finance theory, quantitative models, and econometric techniques provide the foundation that has revolutionised the investment management industry over the last 20 years. Quantitative models and scientific techniques are playing an increasingly important role in the financial industry affecting all steps in the investment management process, such as • defining the policy statement • setting the investment objectives • selecting investment strategies • implementing the investment plan • constructing the portfolio • monitoring, measuring, and evaluating investment performance 21 Quantitative Analytics The most significant benefit being the power of automation, enforcing a systematic investment approach and a structured and unified framework. Not only completely automated risk models and marking-to-market processes provide a powerful tool for analysing and tracking portfolio performance in real time, but it also provides the foundation for complete process and system backtests. Quantifying the chain of decision allows a portfolio manager to more fully understand, compare, and calibrate investment strategies, underlying investment objectives and policies. Since the pioneering work of Pareto [1896] at the end of the 19th century and the work of Von Neumann et al. [1944], decision making has been modelled using both 1. utility function to order choices, and, 2. some probabilities to identify choices. As a result, in order to complete the investment management process, market participants, or agents, can rely either on subjective information, in a forecasting model, or a combination of both. This heavy dependence of financial asset management on the ability to forecast risk and returns led academics to develop a theory of market prices, resulting in the general equilibrium theories (GET). In the classical approach, the Efficient Market Hypothesis (EMH) states that current prices reflect all available or public information, so that future price changes can be determined only by new information. That is, the markets follow a random walk (see Bachelier [1900] and Fama [1970]). Hence, agents are coordinated by a central price signal, and as such, do not interact so that they can be aggregated to form a representative agent whose optimising behaviour sets the optimal price process. Classical economics is based on the principles that 1. the agent decision making process can be represented as the maximisation of expected utility, and, 2. that agents have a perfect knowledge of the future (the stochastic processes on which they optimise are exactly the true stochastic processes). The essence of general equilibrium theories (GET) states that the instantaneous and continuous interaction among agents, taking advantage of arbitrage opportunities (AO) in the market is the process that will force asset prices toward equilibrium. Markowitz [1952] first introduced portfolio selection using a quantitative optimisation technique that balances the trade-off between risk and return. His work laid the ground for the capital asset pricing model (CAPM), the most fundamental general equilibrium theory in modern finance. The CAPM states that the expected value of the excess return of any asset is proportional to the excess return of the total investible market, where the constant of proportionality is the covariance between the asset return and the market return. Many critics of the mean-variance optimisation framework were formulated, such as, oversimplification and unrealistic assumption of the distribution of asset returns, high sensitivity of the optimisation to inputs (the expected returns of each asset and their covariance matrix). Extensions to classical mean-variance optimisation were proposed to make the portfolio allocation process more robust to different source of risk, such as, Bayesian approaches, and Robust Portfolio Allocation. In addition, higher moments were introduced in the optimisation process. Nonetheless, the question of whether general equilibrium theories are appropriate representations of economic systems can not be answered empirically. Classical economics is founded on the concept of equilibrium. On one hand, econometric analysis assumes that, if there are no outside, or exogenous, influences, then a system is at rest. The system reacts to external perturbation by reverting to equilibrium in a linear fashion. On the other hand, it ignores time, or treats time as a simple variable by assuming the market has no memory, or only limited memory of the past. These two points might explain why classical economists had trouble forecasting our economic future. Clearly, the qualitative aspect coming from human decision making process is missing. Over the last 30 years, econometric analysis has shown that asset prices present some level of predictability contradicting models such as the CAPM or the APT, which are based on constant trends. As a result, a different view on financial markets emerged postulating that markets are populated by interacting agent, that is, agents making only imperfect forecasts and directly influencing each other, leading to feedback in financial markets and potential asset prices predictability. In consequence, factor models and other econometric techniques developed 22 Quantitative Analytics to forecast price processes in view of capturing these financial paterns at some level. However, until recently, asset price predictability seemed to be greater at the portfolio level than at the individual asset level. Since in most cases it is not possible to measure the agent’s utility function and its ability to forecast returns, GET are considered as abstract mathematical constructs which are either not easy or impossible to validate empirically. On the other hand, econometrics has a strong data-mining component since it attempts at fitting generalised models to the market with free parameters. As such, it has a strong empirical basis but a relatively simple theoretical foundation. Recently, with the increased availability of data, econophysics emerged as a mix of physical sciences and economics to get the best of both world in view of analysing more deeply asset predictability. Since the EMH implicitly assumes that all investors immediately react to new information, so that the future is unrelated to the past or the present, the Central Limit Theorem (CLT) could therefore be applied to capital market analysis. The CLT was necessary to justify the use of probability calculus and linear models. However, in practice, the decision process do not follow the general equilibrium theories (GET), as some agents may react to information as it is received, while most agents wait for confirming information and do not react until a trend is established. The uneven assimilation of information may cause a biased random walk (called fractional Brownian motion) which were extensively studied by Hurst in the 1940s, and by Mandelbrot in the 1960s and 1970s. A large number of studies showed that market returns were persistent time series with an underlying fractal probability distribution, following a biased random walk. Stocks having Hurst exponents, H, greater than 12 are fractal, and application of standard statistical analysis becomes of questionable value. In that case, variances are undefined, or infinite, making volatility a useless and misleading estimate of risk. High H values, meaning less noise, more persistence, and clearer trends than lower values of H, we can assume that higher values of H mean less risk. However, stocks with high H values do have a higher risk of abrupt changes. The fractal nature of the capital markets contradicts the EMH and all the quantitative models derived from it, such as the Capital Asset Pricing Model (CAPM), the Arbitrage Pricing Theory (APT), and the Black-Scholes option pricing model, and other models depending on the normal distribution and/or finite variance. This is because they simplify reality by assuming random behaviour, and they ignore the influence of time on decision making. By assuming randomness, the models can be optimised for a single optimal solution. That is, we can find optimal portfolios, intrinsic value, and fair price. On the other hand, fractal structure recognises complexity and provides cycles, trends, and a range of fair values. New theories to explain financial markets are gaining ground, among which is a multitude of interacting agents forming a complex system characterised by a high level of uncertainty. Complexity theory deals with processes where a large number of seemingly independent agents act coherently. Multiple interacting agent systems are subject to contagion and propagation phenomena generating feedbacks and producing fat tails. Real feedback systems involve long-term correlations and trends since memories of long-past events can still affect the decisions made in the present. Most complex, natural systems, can be modelled by nonlinear differential, or difference, equations. These systems are characterised by a high level of uncertainty which is embedded in the probabilistic structure of models. As a result, econometrics can now supply the empirical foundation of economics. For instance, science being highly stratified, one can build complex theories on the foundation of simpler theories. That is, starting with a collection of econometric data, we model it and analyse it, obtaining statistical facts of an empirical nature that provide us with the building blocks of future theoretical development. For instance, assuming that economic agents are heterogeneous, make mistakes, and mutually interact leads to more freedom to devise economic theory (see Aoki [2004]). With the growing quantity of data available, machine-learning methods that have been successfully applied in science are now applied to mining the markets. Data mining and more recent machine-learning methodologies provide a range of general techniques for the classification, prediction, and optimisation of structured and unstructured data. Neural networks, classification and decision trees, k-nearest neighbour methods, and support vector machines (SVM) are some of the more common classification and prediction techniques used in machine learning. Further, combinatorial optimisation, genetic algorithms and reinforced learning are now widespread. Using these techniques, one can describe financial markets through degrees of freedom which may be both qualitative and quantitative in nature, each node being the siege of complicated mathematical entity. One could use a matrix form to represent interactions 23 Quantitative Analytics between the various degrees of freedom of the different nodes, each link having a weight and a direction. Further, time delays should be taken into account, leading to non-symmetric matrix (see Ausloos [2010]). Future success for portfolio managers will not only depend on their ability to provide excess returns in a riskcontrolled fashion to investors, but also on their ability to incorporate financial innovation and process automation into their frameworks. However, the quantitative approach is not without risk, introducing new sources of risk such as model risk, operational risk, and an inescapable dependence on historical data as its raw material. One must therefore be cautious on how the models are used, understand their weaknesses and limitations, and prevent applications beyond what they were originally designed for. With more model parameters and more sophisticated econometric techniques, we run the risk of over-fitting models, and distinguishing spurious phenomena as a result of data mining becomes a difficult task. In the rest of this guide we will present an overview of asset valuation in presence of risk and we will review the evolution of quantitative methods. We will then present the necessary tools and techniques to design the main steps of an automated investment management system, and we will address some of the challenges that need to be met. 24 Part I Quantitative trading in classical economics 25 Chapter 1 Risk, preference, and valuation 1.1 A brief history of ideas Pacioli [1494] as well as Pascal and Fermat (1654) considered the problem of the points, where a game of dice has to be abandoned before it can be concluded, and how is the pot (the total wager) distributed among the players in a fair manner, introducing the concept of fairness (see Devlin [2008] for historical details). Pascal and Fermat agreed that the fair solution is to give to each player the expectation value of his winnings. The expectation value they computed is an ensemble average, where all possible outcomes of the game are enumerated, and the products of winnings and probabilities associated with each outcome for each player are added up. Instead of considering only the state of the universe as it is, or will be, an infinity of additional equally probable universes is imagined. The proportion of those universes where some event occurs is the probability of that event. Following Pascal’s and Fermat’s work, others recognised the potential of their investigation for making predictions. For instance, Halley [1693] devised a method for pricing life annuities. Huygens [1657] is credited with making the concept of expectation values explicit and with first proposing an axiomatic form of probability theory. A proven result in probability theory follows from the axioms of probability theory, now usually those of Kolmogorov [1933]. Once the concept of probability and expectation values was introduced by Pascal and Fermat, the St Petersburg paradox was the first well-documented example of a situation where the use of ensembles leads to absurd conclusions. The St Petersburg paradox rests on the apparent contradiction between a positively infinite expectation value of winnings in a game and real people’s unwillingness to pay much to be allowed to participate in the game. Bernoulli [1738-1954] (G. Cramer 1728, personal communication with N. Bernoulli) pointed out that because of this incongruence, the expectation value of net winnings has to be discarded as a descriptive or prescriptive behavioural rule. As pointed out by Peters [2011a], one can decide what to change about the expectation value of net winnings, either the expectation value or the net winnings. Bernoulli (and Cramer) chose to replace the net winnings by introducing utility, and computing the expectation value of the gain in utility. They argued that the desirability or utility associated with a financial gain depends not only on the gain itself but also on the wealth of the person who is making this gain. The expected utility theory (EUT) deals with the analysis of choices among risky projects with multidimensional outcomes. The classical resolution is to apply a utility function to the wealth, which reflects the notion that the usefulness of an amount of money depends on how much of it one already has, and then to maximise the expectation of this. The choice of utility function is often framed in terms of the individual’s risk preferences and may vary between individuals. The first important use of the EUT was that of Von Neumann and Morgenstern (VNM) [1944] who used the assumption of expected utility maximisation in their formulation of game theory. When comparing objects one needs to rank utilities but also compare the sizes of utilities. VNM method of comparison involves considering probabilities. If a person can choose between various randomised events (lotteries), then it is possible to additively compare for example a shirt and a sandwich. Later, Kelly [1956], who contributed to the debate on time averages, computed time-average exponential growth rates in games of chance (optimise wager sizes in a hypothetical horse race using private information) and 26 Quantitative Analytics argued that utility was not necessary and too general to shed any light on the specific problems he considered. In the same spirit, Peters [2011a] considered an alternative to Bernoulli’s approach by replacing the expectation value (or ensemble average) with a time average, without introducing utility. It is argued that Kelly [1956] is at the origin of the growth optimal portfolio (GOP), when he studied gambling and information theory and stated that there is an optimal gambling strategy that will accumulate more wealth than any other different strategy. This strategy is the growth optimal strategy. We refer the reader to Mosegaard Christensen [2011] who presented a comprehensive review of the different connections in which the GOP has been applied. Since one aspect of the GOP is the maximisation of the geometric mean, one can go back to Williams [1936] who considered speculators in a multi-period setting and reached the conclusion that due to compounding, speculators should worry about the geometric mean and not the arithmetic one. One can further go back in time by recognising that the GOP is the choice of a log-utility investor, which was first discussed by Bernoulli and Cramer in the St. Petersurg paradox. However, it was argued (leading to debate among economists) that the choice of the logarithm appears to have nothing to do with the growth properties of the strategy (Cramer solved the paradox with a square-root function). Nonetheless, the St. Petersurg paradox inspired Latane [1959], who independently from Kelly, suggested that investors should maximise the geometric mean of their portfolios, as this would maximise the probability that the portfolio would be more valuable than any other portfolio. It was recently proved that when denominated in terms of the GOP, asset prices become supermartingales, leading Long [1990] to consider change of numeraire and suggest a method for measuring abnormal returns. The change of numeraire technique was then used for derivative pricing. No matter the approach chosen, the perspective described by Bernoulli and Cramer has consequences far beyond the St Petersburg paradox, including predictions and investment decisions, as in this case, the conceptual context change from moral to predictive. In the latter, one can assume that the expected gain (or growth factor or exponential growth rate) is the relevant quantity for an individual deciding whether to take part in the lottery. However, considering the growth of an investment over time can make this assumption somersault into being trivially false. In order to explain the prices of economical goods, Walras [1874-7] started the theory of general equilibrium by considering demand and supply and equating them, which was formalised later by Arrow-Debreu [1954] and McKenzie [1959]. In parallel Arrow [1953] and then Debreu [1953] generalised the theory, which was static and determinist, to the case of uncertain future by introducing contingent prices (Arrow-Debreu state-prices). Arrow [1953] proposed to create financial markets, and was at the origin of the modern theory of financial markets equilibrium. This theory was developed to value asset prices and define market equilibium. Radner [1976] improved Arrow’s model by considering more general assets and introducing the concept of rational anticipation. Radner is also at the origin of the incomplete market theory. Defining an arbitrage as a transaction involving no negative cash flow at any probabilistic or temporal state, and a positive cash flow in at least one state (that is, the possibility of a risk-free profit after transaction costs), the prices are said to constitute an arbitrage equilibrium if they do not allow for profitable arbitrage (see Ross [1976]). An arbitrage equilibrium is a precondition for a general economic equilibrium (see Harrison et al. [1979]). In complete markets, no arbitrage implies the existence of positive Arrow-Debreu state-prices, a risk-neutral measure under which the expected return on any asset is the risk-free rate, and equivalently, the existence of a strictly positive pricing kernel that can be used to price all assets by taking the expectation of their payoffs weighted by the kernel (see Ross [2005]). More recently, the concepts of EUT have been adapted for derivative security (contingent claim) pricing (see Hodges et al. [1989]). In a financial market, given an investor receiving a particular contingent claim offering payoff CT at future time T > 0 and assuming market completeness, then the price the investor would pay can be found uniquely. Option pricing in complete markets uses the idea of replication whereby a portfolio in stocks and bonds recreates the terminal payoff of the option, thus removing all risk and uncertainty. However, in reality, most situations are incomplete as market frictions, transactions costs, non-traded assets and portfolio constraints make perfect replication impossible. The price is no-longer unique and several potential approaches exist, including utility indifference pricing (UIP), superreplication, the selection of one particular measure according to a minimal distance criteria (for example the minimal martingale measure or the minimal entropy measure) and convex risk measures. The UIP will be of 27 Quantitative Analytics particular interest to us in the rest of this book (see Henderson et al. [2004] for an overview). In that setting, the investor can maximise expected utility of wealth and may be able to reduce the risk due to the uncertain payoff through dynamic trading. As explained by Hodges et al. [1989], the investor is willing to pay a certain amount today for the right to receive the claim such that he is no worse off in expected utility terms than he would have been without the claim. Some of the advantages of UIP include its economic justification, incorporation of wealth dependence, and incorporation of risk aversion, leading to a non-linear price in the number of units of claim, which is in contrast to prices in complete markets. 1.2 1.2.1 Solving the St. Petersburg paradox The simple St. Petersburg game The expected utility theory (EUT) deals with the analysis of choices among risky projects with (possibly multidimensional) outcomes. The expected utility model was first proposed by Nicholas Bernoulli in 1713 and solved by Daniel Bernoulli [1738-1954] in 1738 as the St. Petersburg paradox. A casino offers a game of chance for a single player in which a fair coin is tossed at each stage. The pot starts at $1 and is doubled every time a head appears. The first time a tail appears, the game ends and the player wins whatever is in the pot. The player wins the payout Dk = $2k−1 where k heads are tossed before the first tail appears. That is, the random number of coin tosses, k, follows a geometric distribution with parameter 12 , and the payouts increase exponentially with k. The question being on the fair price to pay the casino for entering the game. Following Pascal and Fermat, one answer is to consider the average payout (expected value) E[Dk ] =< Dk >= ∞ ∞ X X 1 1 1 1 ( )k 2k−1 = 1 + 2 + ... = =∞ 2 2 4 2 k=1 k=1 A gamble is worth taking if the expectation value of the net change of wealth, < Dk > −c where c is the cost charged to enter the game, is positive. Assuming infinite time and unlimited resources, this sum grows without bound and so the expected win for repeated play is an infinite amount of money. Hence, considering nothing but the expectation value of the net change in one’s monetary wealth, one should therefore play the game at any price if offered the opportunity, but people are ready to pay only a few dollars. The paradox is the discrepancy between what people seem willing to pay to enter the game and the infinite expected value. Instead of computing the expectation value of the monetary winnings, Bernoulli [1738-1954] proposed to compute the expectation value of the gain in utility. He argued that the paradox could be resolved if decision-makers displayed risk aversion and argued for a logarithmic cardinal utility function u(w) = ln w where w is the gambler’s total initial wealth. It was based on the intuition that the increase in wealth should correspond to an increase in utility which is inversely proportional to the wealth a person 1 already has, that is, du dx = x , whose solution is the logarithm. The expected utility hypothesis posits that a utility function exists whose expected net change is a good criterion for real people’s behaviour. For each possible event, the change in utility will be weighted by the probability of that event occurring. Letting c be the cost charged to enter the game, the expected net change in logarithmic utility is ∞ X 1 E[∆u] =< ∆u >= ln (w + 2k−1 − c) − ln w < ∞ 2k (1.2.1) k=1 where w +2k−1 −c is the wealth after the event, converges to a finite value. This formula gives an implicit relationship between the gambler’s wealth and how much he should be willing to pay to play (specifically, any c that gives a positive expected utility). However, this solution by Cramer and Bernoulli is not completely satisfying, since the lottery can easily be changed in a way such that the paradox reappears. For instance, we just need to change the game so that k it gives the (even larger) payoff e2 . More generally, it is argued that one can find a lottery that allows for a variant 28 Quantitative Analytics of the St. Petersburg paradox for every unbounded utility function (see Menger [1934]). But, this conclusion was shown by Peters [2011b] to be incorrect. Nicolas Bernoulli himself proposed an alternative idea for solving the paradox, conjecturing that people will neglect unlikely events, since only unlikely events yield the high prizes leading to an infinite expected value. The idea of probability weighting resurfaced much later in the work of Kahneman et al. [1979], but their experiments indicated that, very much to the contrary, people tend to overweight small probability events. Alternatively, relaxing the unrealistic assumption of infinite resources for the casino, and assuming that the expected value of the lottery only grows logarithmically with the resources of the casino, one can show that the expected value of the lottery is quite modest. 1.2.2 The sequential St. Petersburg game As a way of illustrating the GOP (presented in Section (2.3.2)) for constantly rebalanced portfolio, Gyorfi et al. [2009] [2011] introduced the sequential St. Petersburg game which is a multi-period game having exponential growth. Before presenting that game we first discuss an alternative version (called iterated St. Petersburg game) where in each round the player invest CA = $1, and let Xn denotes the payoff for the n-th simple game. Assuming the sequence {Xn }∞ n=1 to be independent and identically distributed, after n rounds the player’s wealth in the repeated game becomes CA (n) = n X Xi i=1 so that in the limit we get lim n→∞ CA (n) =1 n log2 n in probability, where log2 denotes the logarithm with base 2. We can now introduce the sequential St. Petersburg game. Starting with initial capital CA (0) = $1 and assuming an independent sequence of simple St. Petersburg c (n − 1) is the capital after the (n − 1)-th simple games, for each simple game the player reinvest his capital. If CA c c game, then the invested capital is CA (n − 1)(1 − fc ), while CA (n − 1)fc is the proportional cost of the simple game with commission factor 0 < fc < 1. Hence, after the n-th round the capital is c CA (n) = CA (n − 1)f c (1 − fc )Xn = CA (0)(1 − fc )n n Y Xi = (1 − fc )n i=1 n Y Xi i=1 c Given its multiplicative definition, CA (n) has exponential trend c c CA (n) = enWn ≈ enW c with average growth rate Wnc = 1 c ln CA (n) n and with asymptotic average growth rate W c = lim n→∞ 1 c ln CA (n) n From the definition of the average growth rate, we get Wnc = n X 1 n ln (1 − fc ) + ln Xi n i=1 and applying the strong law of large numbers, we obtain the asymptotic average growth rate 29 (1.2.2) Quantitative Analytics n 1X ln Xi = ln (1 − fc ) + E[ln X1 ] a.s. n→∞ n i=1 W c = ln (1 − fc ) + lim so that W c can be calculated via expected log-utility. The commission factor fc is called fair if Wc = 0 so that the growth rate of the sequential game is 0. We can calculate the fair factor fc as ln (1 − fc ) = −E[ln X1 ] = − ∞ X k ln 2 k=1 1 = −2 ln 2 2k and we get 3 4 Note, Gyorfi et al. [2009] studied the portfolio game, where a fraction of the capital is invested in the simple fair St. Petersburg game and the rest is kept in cash. fc = 1.2.3 Using time averages Peters [2011a] used the notion of ergodicity in stochastic systems, where it is meaningless to assign a probability to a single event, as the event has to be embedded within other similar events. While Fermat and Pascal chose to embed events within parallel universes, alternatively we can embed them within time, as the consequences of the decision will unfold over time (the dynamics of a single system are averaged along a time trajectory). However, the system under investigation, a mathematical representation of the dynamics of wealth of an individual, is not ergodic, and that this manifests itself as a difference between the ensemble average and the time average of the growth rate of wealth. The origins of ergodic theory lie in the mechanics of gases (large-scale effects of the molecular dynamics) where the key rationale is that the systems considered are in equilibrium. It is permissible under strict conditions of stationarity (see Grimmet et al. [1992]). While the literature on ergodic systems is concerned with deterministic dynamics, the basic question whether time averages may be replaced by ensemble averages is equally applicable to stochastic systems, such as Langevin equations or lotteries. The essence of ergodicity is the question whether the system when observed for a sufficiently long time t samples all states in its sample space in such a way that the relative frequencies f (x, t)dx with which they are observed approach a unique (independent of initial conditions) probability P (x)dx lim f (x, t) = P (x) t→∞ R 1 T If this distribution does not exist or is not unique, then the time average A = limT →∞ R T 0 A(x(t))dt of an observable A can not be computed as an ensemble average in Huygens’ sense, < A >= x A(x)P (x)dx. Peters [2011a] pointed out that computing the naive expected payout is mathematically equivalent to considering multiple outcomes of the same lottery in parallel universes. It is therefore unclear why expected wealth should be a quantity whose maximization should lead to a sound decision theory. Indeed, the St. Petersburg paradox is only a paradox if one accepts the premise that rational actors seek to maximize their expected wealth. The choice of utility function is often framed in terms of the individual’s risk preferences and may vary between individuals. An alternative premise, which is less arbitrary and makes fewer assumptions, is that the performance over time of an investment better characterises an investor’s prospects and, therefore, better informs his investment decision. To compute ensemble averages, only a probability distribution is required, whereas time averages require a dynamic, implying an additional assumption. This assumption corresponds to the multiplicative nature of wealth accumulation. That is, any wealth gained can itself be employed to generate further wealth, which leads to exponential growth (banks and governments offer exponentially growing interest payments on savings). The accumulation of wealth over time is well characterized by an exponential 30 Quantitative Analytics growth rate, see Equation (1.2.2). To compute this, we consider the factor rk by which a player’s wealth changes in one round of the lottery (one sequence of coin tosses until a tails-event occurs) w − c + Dk w where Dk is the kth (positive finite) payout. Note, this factor corresponds to the payoff Xk for the k-th simple game described in Section (1.2.2). To convert this factor into an exponential growth rate g (so that egt is the factor by which wealth changes in t rounds of the lottery), we take the logarithm gk = ln rk . The ensemble-average growth factor is rk = < r >= ∞ X pk rk k=1 where pk is the (non-zero) probability. The logarithm of < r > expresses this as the ensemble-average exponential growth rate, that is < g >= ln < r >, and we get < g >= ln ∞ X pk rk k=1 by 1t to be consistent with the factor egt . Further, this rate Note, the exponential growth rate < g > should be rescaled corresponds to the rate of an M-market. The main idea in the time averages is to consider the rate of an ergotic process and to average over time. In this case, the passage of time is incorporated by identifying as the quantity of interest the Average Rate of Exponential Growth of the player’s wealth in a single round of the lottery. Repeating the simple game in sequences, the time-average growth factor r is r= ∞ Y rkpk k=1 c corresponding to the player’s wealth CA (∞). The logarithm of r expresses this as the time-average exponential growth rate, that is, g = ln r. Hence, the time-average exponential growth rate is g(w, c) = ∞ X pk ln ( k=1 w − c + Dk ) w where pk is the (non-zero) probability of receiving it. In the standard St. Petersburg lottery, Dk = 2k−1 and pk = Note, given Jensen’s inequality (see Appendix (A.1.1)), when f is concave (here, the logarithm function), we get 1 . 2k < g >≥ g(w, c) Although the rate g(w, c) is an expectation value of a Growth Rate rk (the time unit being one lottery game), and may therefore be thought of in one sense as an average over parallel universes, it is in fact equivalent to the time average Growth Rate that would be obtained if repeated lotteries were played over time. This is because the logarithm function, taken as a utility function, has the special property of encoding the multiplicative nature common to gambling and investing in a linear additive object. The expectation value is ∞ X pk ln rk = ln k=1 lim ( T →∞ T Y 1 ri ) T i=1 which is the geometric average return (for details see Section (2.3.2)). It is reasonable to assume that the intuition behind the human behaviour is a result of making repeated decisions and considering repeated games. While g(., .) is identical to the rate of change of the expected logarithmic utility in Equation (1.2.1), it has been obtained without making any assumptions about the player’s risk preferences or behaviour, other than that he is interested in the Rate of Growth of his wealth. Under this paradigm, an individual with wealth w should buy a ticket at a price c provided g(w, c) > 0. Note, this equation can also be considered a criterion for how much risk a person should take. 31 Quantitative Analytics 1.2.4 Using option pricing theory Bachelier [1900] asserted that every price follows a martingale stochastic process, leading to the notion of perfect market. One of the fundamental concept in the mathematical theory of financial markets is the no-arbitrage condition. The fundamental theorem of asset pricing states that in an arbitrage free market model there exists a probability measure Q on (Ω, F) such that every discounted price process X is a martingale under Q, and Q is equivalent to P. Using the notion of Arrow-Debreu state-price density from economics, Harrison et al. [1979] showed that the absence of arbitrage implies the existence of a density or pricing kernel, also called stochastic discount factor, that prices all asset. We consider the probability space (Ω, F, P) where Ft is a right continuous filtration including all P negligible sets in F. Given the payoff CT at maturity T , the prices πt seen at time t can be calculated as the expectation under the physical measure πt = E[ξT CT |Ft ] (1.2.3) where ξT is the state-price density at time T which depend on the market price of risk λ. The pricing kernel measures the degree of risk aversion in the market, and serves as a benchmark for preferences. In the special case where the interest rates and the market price of risk are null, one can easily compute the price of a contingent claim as the expected value of the terminal flux. These conditions are satisfied in the M-market (see Remark (E.1.2) in Appendix (E.1)) also called the market numeraire and introduced by Long [1990]. A common approach to option pricing in complete markets, in the mathematical financial literature, is to fix a measure Q under which the discounted traded assets are martingales and to calculate option prices via expectation under this measure (see Harrison et al. [1981]). The option pricing theory (OPT) states that when the market is complete, and market price of risk and rates are bounded, then there exists a unique risk-neutral probability Q, and the risk-neutral rule of valuation can be applied to all contingent claims which are square integrable (see Theorem (E.1.5)). Risk-neutral probabilities are the product of an unknown kernel (risk aversion) and natural probabilities. While in a complete market there is just one martingale measure or state-price density, there are an infinity of state-price densities in an incomplete market (see Cont et al. [2003] for a description of incomplete market theory). In the utility indifference pricing (UIP) theory (see an introduction to IUP in Appendix (E.5)), assuming the investor initially has wealth w, the value function (see Equation (E.5.16)) is given by V (w, k) = sup E[u(WT + kCT )] WT ∈A(w) with k > 0 units of the claim, and where the supremum is taken over all wealth WT which can be generated from initial fortune w. The utility indifference buy price πb (k) (see Equation (E.5.18)) is the solution to V (w − πb (k), k) = V (w, 0) which involve solving two stochastic control problems (see Merton [1969] [1971]). An alternative solution is to convert this primal problem into the dual problem which involves minimising over state-price densities or martingale measures (see Equation (E.5.19)) (a simple example is given in Appendix (D.5)). A consequence of the dual problem is that the market price of risk plays a fundamental role in the characterisation of the solution to the utility indifference pricing problem (see Remark (E.5.1)). Clearly the St Petersburg paradox is neither an example of a complete market situation nor one of an incomplete market situation, since the payout grows without bound, making the payoff not square integrable. Further, the expectation value of net winnings proposed by Pascal and Fermat implicitly assume the situation of an M-market, corresponding to a market with null rates and null market price of risk. As pointed out by Huygens [1657], this concept of expectation is agnostic regarding fluctuations, which is harmless only if the consequences of the fluctuations, such as associated risks, are negligible. The ability to bear risk depends not only on the risk but also on the risk-bearer’s resources. Similarly, Bernoulli [1738-1954] noted ”if I am not wrong then it seems clear that all men can not use the 32 Quantitative Analytics same rule to evaluate the gamble". That is, in the M-market investors are risk-neutral which does not correspond to a real market situation, and one must incorporate rates and market price of risk in the pricing of a claim. Rather than explicitly introducing the market price of risk, Bernoulli and Cramer proposed to compute the expectation value of the gain in some function of wealth (utility). It leads to solving Equation (1.2.1) which is to be compared with Equation (E.5.16) in the IUP discussed above. If the utility function is properly defined, it has the advantage of bounding the claim so that a solution can be found. Clearly, the notion of time is ignored, and there is no supremum taken over all wealth generated from initial fortune w. Note, the lottery is played only once with wealth w and one round of the game is assumed to be very fast (instantaneous). Further, there is no mention of repetitions of the game in N. Bernoulli’s letter, only human behaviour. It is assumed that the gambler’s wealth is only modified by the outcome of the game, so that his wealth after the event becomes w + 2k−1 − c where c is the ticket price. Hence, the absence of supremum in the ensemble average. As a result, the ensemble average on gain by Pascal and Fermat has been replaced by an ensemble average on a function of wealth (bounding the claim), but no notion of time and market price of risk has been considered. As discussed by Peters [2011a], utility functions (in Bernoulli’s framework) are externally provided to represent risk preferences, but are unable by construction to recommend appropriate levels of risk. A quantity that is more directly relevant to the financial well-being of an individual is the growth of an investment over time. In UIP and time averages, any wealth gained can itself be employed to generate further wealth, leading to exponential growth. By proposing a time average, Peters introduced wealth optimisation over time, but he had to assume something about wealth W in the future. In the present situation, similarly to the sequential St. Petersburg game discussed in Section (1.2.2), he based his results on the assumption that equivalent lotteries can be played in sequence as often as desired, implying that irrespective of how close a player gets to bankruptcy, losses will be recovered over time. To summarise, UIP and time averages are meaningless in the absence of time (here sequences of equivalent rounds). 1.3 Modelling future cashflows in presence of risk The rationally oriented academic literature still considered the pricing equation (1.3.4), but in a world of uncertainty and time-varying expected returns (see Arrow [1953] and Debreu [1953]). That is, the discount rate (µt )t≥0 is now a stochastic process, leading to the notion of stochastic discount factor (SDF). As examined in Section (1.1), a vast literature discussed the various ways of valuing asset prices and defining market equilibrium. In view of introducing the main ideas and concepts, we present in Appendix (D) some simple models in discrete time with one or two time periods and with a finite number of states of the world. We then consider in Appendix (E) more complex models in continuous time and discuss the valuation of portfolios on multi-underlyings where we express the dynamics of a self-financing portfolio in terms of the rate of return and volatility of each asset. As a consequence of the concept of absence of arbitrage opportunity (AAO) (see Ross [1976]), the idea that there exists a constraint on the rate of return of financial assets developed, leading to the presence of a market price of risk λt which is characterised in Equation (E.1.2). Further, in a complete market with no-arbitrage opportunity, the price of a contingent claim is equal to the expected value of the terminal flux expressed in the cash numeraire, under the risk-neutral probability Q (see details in Appendix (D) and Appendix (E) and especially Theorem (E.1.5)). 1.3.1 Introducing the discount rate We saw in Section (1.2.4) that at the core of finance is the present value relation stating that the market price of an asset should equal its expected discounted cash flows under the right probability measure (see Harrison et al. [1979], Dana et al. [1994]). The question being: How to define the pricing Kernel? or equivalently, how to define the martingale measures? We let πt be the price at time t of an asset with random cash flows Fk = F (Tk ) at the time Tk for k = 1, .., N such that 0 < T1 < T2 < ... < TN . Note, N can possibly go to infinity. Given the price of an asset in Equation (1.2.3) and assuming ξTk = e−µ(Tk −t) , the present value of the asset at time t is given by 33 Quantitative Analytics πt = E[ N X e−µ(Tk −t) Fk |Ft ] (1.3.4) k=1 where µ is the discount rate, and such that the most common cash flows Fk can be coupons and principal payments of bonds, or dividends of equities. The main question becomes: What discount rate to use? As started by Walras [1874-7], equilibrium market prices are set by supply and demand among investors applying the pricing Equation (1.3.4), so that the discount rates they require for holding assets are the expected returns they can rationally anticipate. Hence, the discount rate or the expected return contains both compensation for time and compensation for risk bearing. Williams [1936] discussed the effects of risk on valuation and argued that ”the customary way to find the value of a risky security has been to add a premium for risk to the pure rate of interest, and then use the sum as the interest rate for discounting future receipts”. The expected excess return of a given asset over the risk-free rate is called the expected risk premium of that asset. In equity, the risk premium is the growth rate of earnings, plus the dividend yield, minus the riskless rate. Since all these variables are dynamic, so must be the risk premium. Further, the introduction of stock and bond option markets confirmed that implied volatilities vary over time, reinforcing the view that expected returns vary over time. Fama et al. [1989] documented counter-cyclical patterns in expected returns for both stocks and bonds, in line with required risk premia being high in bad times, such as cyclical troughs or financial crises. Understanding the various risk premia is at the heart of finance, and the capital asset pricing model (CAPM) as well as the option pricing theory (OPT) are two possible answers among others. To proceed, one must find a way to observe risk premia in view of analyising them and possibly forecasting them. Through out this guide we are going to describe the tools and techniques used by institutional asset holders to estimate the risk premia via historical data as well as the approach used by option’s traders to implicitly infer the risk premia from option prices. 1.3.2 Valuing payoffs in continuous time A consequence of the fundamental theorem of asset pricing introduced in Section (1.2.4) is that the price process S need to be a semimartingale under the original measure P. In this section we give a bief introduction to some fundamental finance concepts. While some more general models might include discontinuous semimartingales and even stochastic processes which are not semimartingales (for example fractional Brownian motion), we consider the continuous decomposable semimartingales models for equity securities S(t) = A(t) + M (t) where the drift A is a finite variation process and the volatility M is a local martingale. For simplicity of exposition we focus on an Ft -adapted market consisting of the (N + 1) multi-underlying diffusion model described in Appendix (E.1) with 0 ≤ t ≤ T and dynamics given by dSt = bt dt+ < σt , Ŵt > St (1.3.5) where the instantaneous rate of return bt is an adapted vector in RN , Ŵt is a k-dimensional Brownian motion with components Ŵtj , and σt is a N × k adapted volatility matrix with elements σji (t). The market {St }t∈[0,T ] is called normalised if St0 = 1. We can always normalise the market by defining i St = Sti ,1≤i≤N St0 so that 1 N St = 1, S t , ..., S t is the normalisation of St . Hence, it corresponds to regarding the price Stt of the safe investment as the unit of price (the numeraire) and computing the other prices in terms of this unit. We define the riskless asset or accumulation 34 Quantitative Analytics factor B(t) as the value at time t of a fund created by investing $1 at time 0 on the money market and continuously reinvested at the instantaneous interest rate r(t). Assuming that for almost all ω, t → rt (ω) is strictly positive and continuous, and rt is an Ft measurable process, then the riskless asset is given by B(t) = St0 = e Rt 0 r(s)ds (1.3.6) We can now introduce the notion of arbitrage in the market. Lemma 1.3.1 Suppose there exists a measure Q on FT such that Q ∼ P and such that the normalised price process {S t }t∈[0,T ] is a martingale with respect to Q. Then the market {St }t∈[0,T ] has no arbitrage. Definition 1.3.1 A measure Q ∼ P such that the normalised process {S t }t∈[0,T ] is a martingale with respect to Q is called an equivalent martingale measure. That is, if there exists an equivalent martingale measure then the market has no arbitrage. In that setting the market also satisfies the stronger condition called no free lunch with vanishing risk (NFLVR) (see Delbaen et al. [1994]). We can consider a weaker result. We let Q be an equivalent martingale measure with dQ = ξdP , such that ξ is strictly positive and square integrable. Further, the process {ξt }0≤t≤T defined by ξt = E[ξ|Ft ] is a strictly positive martingale over the Brownian fields {Ft } with ξT = ξ and E[ξt ] = E[ξ] = 1 for all t. Given φ an arbitrary bounded, real-valued function on the real line, Harrison et al. [1979] showed that the Radon-Nikodym derivative is given by ξt = dQ dP 1 Ft = e− 2 Rt 0 R φ2 (Ws )ds+ 0t φ(Ws )dW̃ (s) ,0≤t≤T where W̃ is a Brownian motion on the probability space (Ω, F, P). Note, λt = φ(W̃t ) is the market price of risk such that (λt )0≤t≤T is a bounded adapted process. Then, ξ is a positive martingale under P and one can define the new probability measure Q for arbitrary t > 0 by Q(A) = E[ξt IA ] where IA is the indicator function for the event A ∈ Ft . Moreover, using the theorem of Girsanov [1960], the Brownian motion Z t W (t) = W̃ (t) + λs ds 0 is a Brownian motion on the probability space (Ω, F, Q) (see Appendix (E.2)). Using the Girsanov transformation (see Girsanov [1960]), we choose λt in a clever way, and verify that each discounted price process is a martingale under the probability measure Q. For instance, in the special case where we assume that the stock prices are lognormally distributed with drift µ and volatility σ, the market price of risk is given by Equation ((E.2.4)) (see details in Appendix (E.2.1)). Hence, we see that modelling the rate of return of risky asset is about modelling the market price of risk λt . Assuming a viable Ito market, Theorem (E.1.1) applies, that is, there exists an adapted random vector λt and an equivalent martingale measure Q such that the instantaneous rate of returns bt of the risky assets satisfies Equation (E.1.2), that is bt = rt I + σt λt , dP × dt a.s. Remark 1.3.1 As a result of the absence of arbitrage opportunity, there is a constraint on the rate of return of financial assets. The riskier the asset, the higher the return, to justify its presence in the portfolio. 35 Quantitative Analytics Hence, in absence of arbitrage opportunity, the multi-underlyings model has dynamics k k X X dSti i i = r dt + σ (t)λ dt + σji (t)Ŵtj t j t Sti j=1 j=1 and we see that the normalised market S t is a Q-martingale, and the conclusion of no-arbitrage follows from Lemma (1.3.1). Geman et al. [1995] proved that many other probability measures can be defined in a similar way, which reveal themselves to be very useful in complex option pricing. We can now price claims with future cash flows. Given XT an FT -measurable random variable, and assuming πT (H) = X for some self-financing H, then by the Law of One Price, πt (H) is the price at time t of X defined as πt (H) = Bt E Q [ πT X |Ft ] = Bt E Q [ |Ft ] BT BT is a martingale under Q (see Harrison et al. [1981] [1983]). As a where Bt = ert is the riskless asset, and π(H) B result, the market price πt in Equation (1.3.4) becomes πt = E Q [ N X e− R Tk t rs ds Fk ] = k=1 N X F̂k P (t, Tk ) k=1 where (rt )0≤t≤T is the risk-free rate (possibly stochastic), P (t, Tk ) is the discount factor, and R Tk E Q [e− t rs ds Fk ] F̂k (t) = t P (t, Tk ) is the expected cash flows at time t for the maturities Tk for k = 1, .., N . 1.3.3 Modelling the discount factor We let the zero-coupon bond price P (t, T ) be the price at time t of $1 paid at maturity. Given the pair (rt , λt )t≥0 of bounded adapted stochastic processes, the price of a zero-coupon bond in the period [t, T ] and under the risk-neutral probability measure Q is given by P (t, T ) = E Q [e− RT t rs ds |Ft ] reflecting the uncertainty in time-varying discount rates. As a result, to model the bond price we can characterise a dynamic of the short rate rt . Alternatively, the AAO allows us to describe the dynamic of the bond price from its initial value and the knowledge of its volatility function. Therefore, assuming further hypothesis, the shape taken by the volatility function fully characterise the dynamic of the bond price and some specific functions gave their names to popular models commonly used in practice. Hence, the dynamics of the zero-coupon bond price are dP (t, T ) = rt dt ± ΓP (t, T )dWP (t) with P (T, T ) = 1 P (t, T ) (1.3.7) where (WP (t))t≥0 is valued in Rn and ΓP (t, T ) 1 is a family of local volatilities parameterised by their maturities T . However, practitioners would rather work with the forward instantaneous rate which is related to the bond price by fP (t, T ) = −∂T ln P (t, T ) 1 ΓP (t, T )dW (t) = Pn j=1 ΓP,j (t, T )dWj (t) 36 Quantitative Analytics The relationship between the bond price and the rates in general was found by Heath et al. [1992] and following their approach the forward instantaneous rate is Z t Z t γP (s, T )ΓP (s, T )T ds γP (s, T )dWP (s) + fP (t, T ) = fP (0, T ) ∓ 0 0 where γP (s, T ) = ∂T ΓP (t, T ). The spot rate rt = fP (t, t) is therefore Z t Z t rt = fP (0, t) ∓ γP (s, t)dWP (s) + γP (s, t)ΓP (s, t)T ds 0 0 Similarly to the bond price, the short rate is characterised by the initial yield curve and a family of bond price volatility functions. However, either the bond price or the short rate above are too general and additional constraints must be made on the volatility function. A large literature flourished to model the discount-rate process and risk premia in continuous time with stochastic processes. The literature on term structure of interest rates is currently dominated by two different frameworks. The first one is originated by Vasicek [1977] and extended among others by Cox, Ingersoll, and Ross [1985]. It assumes that a finite number of latent factors drive the whole dynamics of term structure, among which are the Affine models. The other framework comprises curve models which are calibrated to the relevant forward curve. Among them are forward rate models generalised by Heath, Jarrow and Morton (HJM) [1992], the libor market models (LMM) initiated by Brace, Gatarek and Musiela (BGM) [1997] and the random field models introduced by Kennedy [1994]. As an example of the HJM models, Frachot [1995] and Duffie et al. [1993] considered respectively the special case of the quadratic and linear factor model for the yield price. In that setting, we assume that at a given time t all the zero-coupon bond prices are function of some state variables. We can further restrain the model by assuming that market price of claims is a function of some Markov process. Assumption 1 We assume there exists a Markov process Xt valued in some open subset D ⊂ Rn × [0, ∞) such that the market value at time t of an asset maturing at t + τ is of the form f (τ, Xt ) where f ∈ C 1,2 (D × [0, ∞[) and τ ∈ [0, T ] with some fixed and finite T . For tractability, we assume that the drift term and the market price of risk of the Markov process X are nontrivially affine under the historical probability measure P. Only technical regularity is required for equivalence between absence of arbitrage and the existence of an equivalent martingale measure. That is, the price process of any security is a Q Rt martingale after normalisation at each time t by the riskless asset e 0 R(Xs )ds (see Lemma (1.3.1)). Therefore, there is a standard Brownian motion W in Rn under the probability measure Q such that dXt = µ(Xt )dt + σ(Xt )dWt (1.3.8) where the drift µ : D → Rn and the diffusion σ : D → Rn×n are regular enough to have a unique strong solution valued in D. To be more precise, the domain D is a subset of Rn × [0, ∞) and we treat the state process X defined so that (Xt , t) is in D for all t. We assume that for each t, {x : (t, x) ∈ D} contains an open subset of Rn . We are now going to be interested in the choice for (f, µ, σ) that are compatible in the sense that f characterises a price process. El Karoui et al. [1992] explained interest rates as regular functions of an n-dimensional state variable process X fP (t, T ) = F (t, T, Xt ) , t ≤ T where F is at most quadratic in X. By constraining X to be linear, it became the Quadratic Gaussian model (QG). Similarly, introducing n state variables Frachot in [1995] described the linear factor model 37 Quantitative Analytics fP (t, T ) = b(t, T ) + a(t, T ).Xt , ∀t ≤ T (1.3.9) where fP (t, T ) is the instantaneous forward rate and the functions b(t, T ) and a(t, T ) = [a1 (t, T ), ..., an (t, T )]> are deterministic. He showed that by discarding the variables Xi (t) one can identify the state variables to some particular rates such that fP (t, T ) = b(t, T ) + a1 (t, T )fP (t, t + θ1 ) + ... + an (t, T )fP (t, t + θn ) , ∀t ≤ T where θi for i = 1, .., n are distinct maturities and the functions a(., .) and b(., .) must satisfy extra compatibility conditions b(t, t + θi ) = 0 , ai (t, t + θi ) = 1 , aj (t, t + θi ) = 0(j 6= i) that is, the rate with maturity (t + θi ) can only be identified with a single state variable. Frachot also showed that the QG model could be seen as a linear factor model with constraints, that is by considering a model linear in X and XX > . In that case, the entire model can not be identified in term of some particular rates but only XX > as in the case of X it would leads to ai (t, T ) = 0 for all i belonging to X. Frachot [1995] and Filipovic [2001] proved that the quadratic class represents the highest order of polynomial functions that one can apply to consistent time-separable term structure models. Another example is the Yield factor model defined by Duffie et al. [1993] which is a special case of the linear factor model where the asset f (τ, Xt ) in assumption (1) is the price of a zero-coupon bond of maturity t + τ f (T − t, Xt ) = E Q [e− RT t R(Xs )ds |Ft ] (1.3.10) so that given the definition of the risk-free zero coupon bond, P (t, T ) is its price at time t. The short rate is assumed to be such that there is a measurable function R : D → R defined as the limit of yields as the maturity goes to zero, that is 1 R(x) = lim − log f (τ, x) for x ∈ D τ →0 τ Depending on the asset prices and the markets under consideration, many different authors have constructed such compatible set (f, ν, σ). For instance, the Factors models were extended by Duffie, Pan and Singleton [2000] in the case of jump-diffusion models, and a unified presentation was developed by Duffie, Filipovic and Schachermayer [2003]. Affine models is a class of time-homogeneous Markov processes that has arisen from a large and growing range of useful applications in finance. They imply risk premium on untraded risks which are linear functions of the underlying state variables, creating a method for going between the objective and risk-neutral probability measures while retaining convenient affine properties for both measures. Duffie et al. [2003] provided a definition and complete n characterization of regular affine processes. Given a state space of the form D = Rm + × R for integers m ≥ 0 and n ≥ 0 the key affine property, is roughly that the logarithm of the characteristic function of the transition distribution pt (x, .) of such a process is affine with respect to the initial state x ∈ D. Given a regular affine process X, and a discount-rate process {R(Xt ) : t ≥ 0} defined by an affine map x → R(x) on D into R, the discount factor P (t, T ) = E[e− RT t R(Xu )du |Xt ] is well defined under certain conditions, and is of the anticipated exponential-affine form in Xt . 1.4 The pricing kernel We saw in Section (1.3.2) that risk neutral returns are risk-adjusted natural returns. That is, the return under the risk neutral measure is the return under the natural measure with the risk premium subtracted out. Hence, to use risk neutral prices to estimate natural probabilities, we must know the risk adjustment to add it back in. This is equivalent 38 Quantitative Analytics to knowing both the agent’s risk aversion and his subjective probability which are non-observable. Various authors tried to infer these risks from the market with the help a model, but with more or less success. Further, the natural expected return of a strategy depends on the risk premium for that strategy, so that knowledge on the kernel can help in estimating the variability of the risk premium. At last, we are unable to obtain the current market forecast of the expected returns on equities directly from their prices, and we are left to using historical returns. Even though the risk premium is not directly observable from option prices various authors tried to infer it. This is because there is a rich market in equity option prices and a well developed theory to extract the martingale or risk neutral probabilities from these prices. As a result, one can use these probabilities to forecast the probability distribution of future returns. 1.4.1 Defining the pricing kernel The asset pricing kernel summarises investor preferences for payoffs over different states of the world. In absence of arbitrage, all asset prices can be expressed as the expected value of the product of the pricing kernel and the asset payoff (see Equation (1.2.3)). Discounting payoffs using time and risk preferences, it is also called the stochastic discount factor. Hence, combined with a probability model for the states, the pricing kernel gives a complete description of asset prices, expected returns, and risk premia. In a discrete time world with asset payoffs h(X) at time T , contingent on the realisation of a state of nature X ∈ Ω, absence of arbitrage opportunity (AAO) (see Dybvig et al. [2003]) implies the existence of positive state space prices, that is, the Arrow-Debreu contingent claims prices p(X) paying $1 in state X and nothing in any other states (see Theorem (D.1.1)). If the market is complete, then these state prices are unique. The current value πh of an asset paying h(X) in one period is given by Z πh = h(X)dP (X) where P (X) is a price distribution function. Letting r(X 0 ) be the riskless rate as a function of the current state X 0 , R 0 such that p(X)dX = e−r(X )T , we can rewrite the price as Z πh = Z h(X)dP (X) = ( = e−r(X 0 )T Z dP (X)) 0 dP (X) = e−r(X )T h(X) R dP (X) Z E ∗ [h(x)] = E[h(X)ξ(X)] h(X)dq ∗ (X) (1.4.11) where the asterisk denotes the expectation in the martingale measure and where the pricing kernel, that is, the stateprice density ξ(X) is the Radon-Nikodym derivative of P (X) with respect to the natural measure denoted F (X). With continuous distribution, we get ξ(X) = fp(X) (X) where f (X) is the natural probability, that is, the actual or relevant objective probability distribution, and the risk-neutral probabilities are given by q ∗ (X) = R 0 p(X) = er(X )T p(X) p(X)dX so that ξ(X) = e−r(X 0 )T q ∗ (X) f (X) (1.4.12) We let Xt denote the current state and Xt+1 be a state after one period and assume that it fully describe the state of nature. Then, ξt,t+1 is the empirical pricing kernel associated with returns between date t and t + 1, conditional on the information available at date t ≤ t + 1. It is estimated as ξt,t+1 = ξ(Xt , Xt+1 ) = p(Xt+1 |Xt ) q(Xt+1 |Xt ) = e−r∆t f (Xt+1 |Xt ) f (Xt+1 |Xt ) 39 Quantitative Analytics where q is the risk-neutral density, and f is the objective (historical) density. Hence, the kernel is defined as the price per unit of probability in continuous state spaces (see Equation (D.6.13)). Note, we can always rewrite the risk-neutral probability as q(Xt+1 |Xt ) = er∆t ξt,t+1 f (Xt+1 |Xt ) where the natural probability transition function f (Xt+1 |xt ), the kernel ξt,t+1 , and the discount factor e−r∆t are unknowns. One can therefore spend his time either modelling each separate element and try to recombine them or directly infer them from the risk-neutral probability. However, one can not disentangle them, and restrictions on the kernel, or the natural distribution must be imposed to identify them separately from the knowledge of the risk-neutral probability. One approach is to use the historical distribution of returns to estimate the unknown kernel and then link the historical estimate of the natural distribution to the risk neutral distribution. For instance, Jackwerth et al. [1996] used implied binomial trees to represent the stochastic process, Ait Sahalia et al. [1998] [2000] combined state prices derived from option prices with estimates of the natural distribution to determine the kernel, Bollerslev et al. [2011] used high frequency data to estimate the premium for jump risk in a jump diffusion model. Assuming a transition independent kernel, Ross [2013] showed that the equilibrium system above could be solved without the need of historical data. 1.4.2 The empirical pricing kernel The discount factor can be seen as an index of bad times such that the required risk premium for any asset reflects its covariation with bad times. Investors require higher risk premia for assets suffering more in bad times, where bad times are periods when the marginal utility (MU) of investors is high. Lucas [1978] expressed the pricing kernel as the intertemporal marginal rate of substitution 0 ξt,t+1 u (ct+1 ) = 0 u (ct ) where u(•) is a utility function and ct is the consumption at time t. Under the assumption of power utility, the pricing kernel becomes ξt,t+1 = e−ρ ( ct+1 −γ ) ct where ρ is the rate of time preference and γ is a level of relative risk aversion. The standard risk-aversion measures are usually functions of the pricing kernel slope, and Pratt showed that it is the negative of the ratio of the derivative of the pricing kernel to the pricing kernel, that is 0 ct+1 ξt,t+1 (ct+1 ) γt = − ξt,t+1 (ct+1 ) Generally, the pricing kernel depends not just on current and future consumption, but also on all variables affecting the marginal utility. When the pricing kernel is a function of multiple state variables, the level of risk aversion can also fluctuate as these variables change. Several authors used Equation (Equation (1.2.3)) to investigate the characteristics of investor preferences in relation to equity securities, that is St = E[ξt,t+1 Xt+1 |Ft ] where St is the current stock price and Xt+1 is the asset payoff in one period. Hansen et al. [1982] identified the pricing kernel equation above with the unconditional version 40 Quantitative Analytics E[ St+1 ξt,t+1 ] = 1 St (1.4.13) They specified the aggregate consumption growth rate as a pricing kernel state variable, and measured consumption using data from the National Income and Products Accounts. Campbell et al. [1997] and Cochrane [2001] provided comprehensive treatments of the role of the pricing kernel in asset pricing. As it is not clear among researchers about what state variables should enter the pricing kernel, Rosenberg et al. [2001] [2002] considered a pricing kernel projection estimated without specifying the state variables. Writing the original pricing kernel as ξt,t+1 = ξt,t+1 (Zt , Zt+1 ) where Zt is a vector of pricing kernel state variables they re-wrote the pricing equation by factoring the joint density ft (Xt+1 , Zt+1 ) into the product of the conditional density ft (Zt+1 |Xt+1 ) and the marginal density ft (Xt+1 ). The expectation is then evaluated in two step, first the pricing kernel is integrated using the conditional ∗ density, giving the projected pricing kernel ξt,t+1 (Xt+1 ). second, the product of the projected pricing kernel and the payoff variable is integrated using the marginal density, giving the asset price ∗ ∗ St = Et [ξt,t+1 (Xt+1 )Xt+1 ] , ξt,t+1 (Xt+1 ) = Et [ξt,t+1 (Zt , Zt+1 )|Xt+1 ] Thus, for the valuation of an asset with payoffs depending only on Xt+1 , the pricing kernel is summarised as a function of the asset payoff which can vary over time, reflecting time-variation in the state variables. It is called the empirical pricing kernel (EPK) and was estimated on monthly basis from 1991 to 1995 on the S&P 500 index option data. Barone-Adesi et al. [2008] relaxed the restriction that the variances of the objective return distribution and risk neutral distribution are equal, along with higher moments such as skewness and kurtosis. Further, Barone-Adesi et al. combined an empirical and a theoretical approach relaxing the restriction that the objective return distribution and risk neutral distribution share the same volatility and higher order moments. 1.4.3 Analysing the expected risk premium One of the consequence of the absence of arbitrage opportunities (AAO) is that the expected value of the product of the pricing kernel and the gross asset return Rtg defined in Equation (3.3.4) must equal unity (see Equation (1.4.13)). g , we That is, assuming dividend adjusted prices and setting the one period gross return as Rt+1 = 1 + Rt,t+1 = SSt+1 t get g πt = E[ξt+1 Rt+1 |Ft ] = 1 Hence, the one-period risk-free rate rf t can be written as the inverse of the expectation of the pricing kernel rf t = E[ξt+1 |Ft ]−1 Further, Equation (1.4.13) implies that the expected risk premium is proportional to the conditional covariance of its return with the pricing kernel g g ) Et [Rt+1 − rf t ] = −rf t Covt (ξt+1 , Rt+1 where Covt (•, •) is the covariance conditional on information available at time t (see Whitelaw [1997]). As a result, the conditional Sharpe ratio of any asset, defined as the ratio of the conditional mean excess return to the conditional standard deviation of this return, can be written in terms of the volatility of the pricing kernel and the correlation between the kernel and the return g Et [Rt+1 − rf t ] g σt (Rt+1 − rf t ) g ) Covt (ξt+1 , Rt+1 g σt (Rt+1 ) = −rf t = g −rf t σt (ξt+1 )Corrt (ξt+1 , Rt+1 ) 41 Quantitative Analytics where σt (•) and Corrt (•, •) are respectively the standard deviation and correlation, conditional on information at time t. Hence, this equation shows that the conditional Sharpe ratio MSR,t is proportional to the correlation between the pricing kernel and the return on the market Rm,t g MSR,t = −rf t σt (ξt+1 )Corrt (ξt+1 , Rm,t+1 ) Hence, if the Sharpe ratio varies substantially over time, then the variation is mostly attributable to the variation in the conditional correlation and depend critically on the modelling of the pricing kernel. One approach is to specify the kernel ξt as a function of asset returns. For instance, modelling the pricing kernel as a linear function of the market return produces the conditional CAPM. Since risk aversion implies a negative coefficient on the market return, modelling the pricing kernel as a linear function of the market return leads the correlation to be around −1 so that the market Sharpe ratio is approximately constant over time. Alternatively, modelling the discount factor as a quadratic function of the market return gives the conditional three moment CAPM proposed by Kraus et al. [1976] allowing for some time variation in the market SRs due to to the pricing of skewness risk, but the correlation is still pushed towards −1. Other modelling of the pricing kernel exists, such as nonlinear function of the market return or a linear function of multiple asset returns, but with limited time variation in the correlation (see Bansal et al. [1993]). Based on explanatory and predictive power, a number of additional factors, including small firm returns and return spreads between long-term and short-term bonds, have been proposed and tested but the correlations between the discount factor and the market return tend to be relatively stable. Another approach uses results from a representative agent and exchange economy, and models the pricing kernel as the marginal rate of substitution (MRS) over consumption leading to the consumption CAPM (see Breeden et al. [1989]). When the MRS depends on consumption growth and the stock market is modelled as a claim on aggregate consumption, one might expect the correlation and the Sharpe ratio to be relatively stable. Assuming consumption growth follows a two-regime autoregressive process, Whitelaw [1997a] obtained regime shifts (phases of business cycle) with mean and volatility being negatively correlated, implying significant time variation in the Sharpe ratio. 1.4.4 Infering risk premium from option prices In a recent article, assuming that the state-price transition function p(Xi , Xj ) is observable, Ross [2013] used the recovery theorem to uniquely determine the kernel, the discount rate, future values of the kernel, and the underlying natural probability distribution of return from the transition state prices alone. Note, the notion of transition independence was necessary to separately determine the kernel and the natural probability distribution. Other approaches used the historical distribution of returns to estimate the unknown kernel and thereby link the historical estimate of the natural distribution to the risk-neutral distribution. Alternatively, one could assume a functional form for the kernel. Ross [2013] showed that the equilibrium system in Equation (D.6.15) could be solved without the need to use either the historical distribution of returns or independent parametric assumptions on preferences to find the market’s subjective distribution of future returns. The approach relies on the knowledge of the state transition matrix whose elements give the price of one dollar in a future state, conditional on any other state. One way forward is to find these transaction prices from the state-prices for different maturities derived from the market prices of simple options by using a version of the forward equation for Markov processes. As pointed out by Ross, there are a lot of possible applications if we know the kernel (market’s risk aversion) and the market’s subjective assessment of the distribution of returns. We can use the market’s future distribution of returns much as we use forward rates as forecasts of future spot rates. Rather than using historical estimates of the risk premium on the market as an input into asset allocation models (see Section (1.4.3)), we should use the market’s current subjective forecast. The idea can extend to all project valuation using historical estimates of the risk premium. 42 Quantitative Analytics 1.5 Modelling asset returns 1.5.1 Defining the return process Setting αt = log (Bt ) for 0 ≤ t ≤ T where B(t) is the riskless asset defined in Equation (1.3.6), we call α the return process for B, such that dB = Bdα with α0 = 0. Since the riskless asset, B, is absolutely continuous, then Z t αt = rs ds 0 and, rs , is the time-s interest rate with continuous compounding. Similarly to the riskless asset, assuming any semimartingale price process, S, possibly with jumps, we want to consider its return process for a stock to satisfy the equation dS = S− dR which is equivalent to t Z St = S0 + Su dRu (1.5.14) dSu (1.5.15) 0 as well as t Z Rt = 0 1 Su− t where the return, Rt , is defined over the range [0, t]. Note, SdS , is the infinitesimal rate of return of the price process, S, t− while, Rt , is its integrated version. Given a (reasonable) price process, S, the above equation defines the corresponding return process R. Similarly, given, S0 , and a semimartingale, R, Equation (1.5.14) always has a semimartingale solution S. It is unique and given by St = S0 ψt (R) , 0 ≤ t ≤ t where 1 ψt (R) = eRt −R0 − 2 [R,R]t Y 1 2 (1 + ∆Rs )e−∆Rs + 2 (∆Rs ) s≤t with ∆Rs = Rs − Rs− and quadratic variation Z [R, R]t = Rt Rt − 2 t Rs− dRs 0 Note, R, is such that 1 + ∆R > 0 for any and all jumps if and only if ψt (R) > 0 for all t. Similarly with weak inequalities. Further, we have ψ0 (R) = 1. In that setting, the discounted price process is given by S = S0 ψ(R)e−α B Since −α is continuous, α0 = 0, and [−α, −α] = 0 we get the semimartingale exponential expression S= S = S0 ψ(R)ψ(−α) Further, since [R, −α] = 0, using a probability property, we get S = S0 ψ(R − α) = S 0 ψ(R − α) 43 Quantitative Analytics so that Y = R − α can be interpreted as the return process for the discounted price process S. For example, in the Black-Scholes [1973] model the return process is given by Z t 1 Rt = dSu = µt + σ Ŵt S u 0 where Ŵt is a standard Brownian motion in the historical probability measure P. With a constant interest rate, r, we get αt = rt, and the return process for the discounted price process becomes Yt = (µ − r)t + σ Ŵt 1.5.2 Valuing potfolios In order to describe general portfolio valuation and its optimisation, we consider a general continuous time framework where the stock price, S, is the decomposable semimartingale. The example of a multi-underlying diffusion model is detailed in Appendix (E.1). We let the world be defined as in Assumption (E.1.1), and we assume (N + 1) assets S = (S 0 , S 1 , .., S N ) traded between 0 and TH where the risky-assets S i ; 1 ≤ i ≤ N are Ito’s random functions given in Equation (1.3.5). The risk-free asset S 0 satisfies the dynamics dSt0 = rt St0 dt The data format of interest is returns, that is, relative price change. From the definition of the percent return given in i Equation (3.3.4), we consider the one period net returns Rt,t+1 = i rL (t, t i ln St+1 ln Sti i St+1 Sti − 1, which for high-frequency data are almost identical to log-price changes + 1) = − (at daily or higher frequency). The portfolio strategy is given by the process (δi (t))0≤i≤N corresponding to the quantity invested in each asset. The financial value of the portfolio δ is given by V (δ), and its value at time t satisfies Vt (δ) =< δ(t), St >= N X δ i (t)Sti (1.5.16) i=0 Assuming a self-financing portfolio (see Definition (E.1.2)), its dynamics satisfy dVt (δ) = N X δ i (t)dSti = δ 0 (t)dSt0 + i=0 N X δ i (t)dSti i=1 0 Assuming a simple strategy, for any dates t < t , the self-financing condition can be written as 0 t Z Vt0 − Vt = t 0 (t)St0 From the definition of the portfolio we get δ factorising, the dynamics of the portfolio become N X i=0 = Vt (δ) − dVt (δ) = Vt (δ)rt dt + N X i=1 i δ i (u)dSui PN i=1 δ i (t)Sti δ i (t)Sti , so that, plugging back in the SDE and dSti − rt dt i St (t)Sti )1≤i≤N Further, we let (hi (t))1≤i≤N = (δ be the fraction of wealth invested in the ith risky security, or the dollars invested in the ith stock, so that the dynamics of the portfolio rewrite dVt (h) = Vt (h) − N X N X i hi (t) rt dt + hi (t)Rt,t+1 i=1 i=1 44 (1.5.17) Quantitative Analytics which can be rewritten as dVt (h) = Vt (h)rt dt + N X i hi (t)(Rt,t+1 − rt dt) i=1 corresponding to Equation (E.1.1), that is dVt (h) = rt Vt (h)dt+ < ht , Rt − rt Idt > where ht = (δS)t corresponds to the vector with component (δ i (t)Sti )1≤i≤N describing the amount to be invested in i each stock, and where Rt is a vector with component (Rt,t+1 )1≤i≤N describing the return of each risky security. It is often convenient to consider the portfolio fractions πv = πv (t) = (πv0 (t), .., πvN (t))> , t ∈ [0, ∞) with coordinates defined by πvi (t) = hi (t) δ i (t)Sti = Vt (h) Vt (h) (1.5.18) denoting the proportion of the investor’s capital invested in the ith asset at time t. It leads to the dynamics of the portfolio defined as dVt (h) = rt dt+ < πv (t), Rt − rt Idt > Vt (h) The linear Equation having a unique solution, knowing the initial investment and the weights of the portfolio is enough to characterise the value of the portfolio. In a viable market, one of the consequences of the absence of arbitrage opportunity is that the instantaneous rate of returns of the risky assets satisfies Equation (E.1.2). Hence, in that setting, the dynamics of the portfolio become dVt (h) = rt dt+ < πv (t), σt λt dt > + < πv (t), σt dW̃t > Vt (h) where < πv (t), σt λt dt > represents the systematic component of returns of the portfolio, and < πv (t), σt dW̃t > represents the idiosyncratic component of the portfolio. i Remark 1.5.1 To value the portfolio, one must therefore assume a model for the process Rt,t+1 . One way forward is to consider Equation (1.5.15) and follow the interest rate modelling described in Section (1.3.3) by assuming that the equity return is a function of some latent factors or state variables. 45 Quantitative Analytics 1.5.3 Presenting the factor models 1.5.3.1 The presence of common factors Following Ilmanen [2011], we state that the expected returns on a zero-coupon government bond are known, but for all other assets the expected returns are uncertain ex-ante and unknowable ex-post, while the realised returns are knowable ex-post but do not reveal what investors expected. As a result, apart from ZC-bond, institutional asset holders, such as pension funds, must infer expected returns from empirical data, past returns, and investor surveys, and from statistical models. The aim being to forecast expected future returns in time and across assets in view of valuing portfolios (see Section (1.5.2)) and performing the asset allocation process described in Section (2.1.2). Given constant expected returns, the best way for estimating expected future return is to calculate the sample average realised return over a long sample period. However, when the risk premia λt is time-varying or stochastic, this average becomes biased. It is understood that time-varying expected returns (risk-premia) can make historical average returns highly misleading since it can reflect historical average unexpected returns. As a result, practitioners became interested in ex-ante return measures such as valuation ratios or dividend discount models. Even though market’s expected returns are unobservable, both academics and practitioners focused on forward-looking indicators such as simple value and carry measures as proxies of long-run expected returns. The carry measures include any income return and other returns that are earned when capital market conditions are unchanged. Among these measures, dividend yield was the early leader, but broader payout yields including share buybacks have replaced it as the preferred carry measure, while earnings yield and the Gordon model (DDM) equity premium became the preferred valuation measures (see Campbell et al. [1988]). This is because they give better signals than extrapolation of past decade realised returns. For instance, in order to estimate prospective returns, one can relate current market prices to some sort of value anchor (historical average price, yield, spread etc.) assuming that prices will revert to fair values which are proxied by the anchors. Note, value or carry indicators are inherently narrow and one should consider broader statistical forecasting models such as momentum, volatility, macroeconomic environment etc. The presence of portfolio forecastability, even if single assets are sometime unforecastable, is one of the key features of cointegration. Two or more processes are said to be cointegrated if there are long-term stable regression relationships between them, even if the processes themselves are individually integrated. This means that there are linear combinations of the processes that are autocorrelated and thus forecastable. Hence, the presence of cointegrating relationships is associated with common trends, or common factors, so that cointegration and the presence of common factors are equivalent concepts. This equivalence can be expressed more formally in terms of state-space models which are dynamic models representing a set of processes as regressions over a set of possibly hidden factors or state variables. One approach is to express asset returns in terms of factor models. 1.5.3.2 Defining factor models The economical literature considered Factors models of the risk premia in discrete time, and concentrated on the special case of Affine models. In the equity setting, given the one period percentage return Rt = Rt−1,t , the econometric linear factor model in Equation (1.3.9) can be expressed as Rt = αt + m X βk Fkt + t (1.5.19) k=1 where the terms Fkt for k = 1, .., m represent returns of the risk factors associated with the market under condition, m is the number of factors explaining the stock returns, and αt is the drift of the idiosyncratic component. We can then view the residuals as increments of a process that will be estimated Xt = X0 + t X i,s s=1 As a result, using continuous-time notation, the continuous-time model for the evolution of stock prices becomes 46 Quantitative Analytics m X dS(t) = αt dt + βk Fk (t) + dX(t) S(t) (1.5.20) k=1 Pm where the term k=1 βk Fk (t) represents the systematic component of returns. The coefficients βk are the corresponding loadings. The idiosyncratic component of the stock returns is given by dX̃(t) = αt dt + dX(t) where αt represents the drift of the idiosyncratic component, which implies that αt dt represents the excess rate of return of the stock with respect to the stock market, or some industry sector, over a particular period of time. The term dX(t) is assumed to be the increment of a stationary stochastic process which models price fluctuations corresponding to over-reactions or other idiosyncratic fluctuations in the stock price which are not reflected the industry sector. 1.5.3.3 CAPM: a one factor model The capital asset pricing model (CAPM) introduced by Sharpe [1964], which is an approach to understanding expected asset returns or discount rates beyond the riskless rate, is a simplification of Factors models defined above, based on some restrictive assumptions • one-period world (constant investment opportunity set and constant risk premia over time) • access to unlimited riskless borrowing and lending as well as tradable risky assets • no taxes or transaction costs • investors are rational mean variance optimisers (normally distributed asset returns, or quadratic utility function) • investors have homogeneous expectations (all agree about asset means and covariances) These assumptions ensure that every investor holds the same portfolio of risky assets, combining it with some amount of the riskless asset (based on the investor’s risk aversion) in an optimal way. Even though these assumptions are too restrictive, the main insight is that only systematic risk is priced in the sense that it influences expected asset returns. In the CAPM, the ith asset’s return is given by Rit = αi (t) + βiM (t)RM t + it where RM t is the market return, and the residual it is normally distributed with zero mean and variance σi2 (t). It i ,RM ) is the slope called the represent a straight line in the (Ri , RM ) plane where αi is the intercept and βiM = Cov(R 2 σM beta value. According to the CAPM, in equilibrium, the ith asset’s expected excess return Et [Ri,(t+1) ] is a product of its market beta βiM (t) and the market risk premium λM (t), given by Et [Ri,(t+1) ] = βiM (t)λM (t) Note, λM is the market risk premium PN common to all assets, but it also reflects the price of risk (investor risk aversion). Defining the portfolio as P (t) = i=1 wi Rit where wi is the ith weight of the portfolio, the portfolio beta is βP (t) = PN i=1 wi βiM (t), and the variance of the portfolio is given by V ar(P (t)) = 2 βP2 (t)σM + N X wi2 V ar(it ) i=1 Note, in the case where the weights are uniform w1 = w2 = .. = wN = 47 1 N, we get the limit Quantitative Analytics N X 1 ( )2 V ar(it ) → 0 , N → ∞ N i=1 and the idiosyncratic risk vanishes. Realised returns reflect both common (systematic) risk factors and asset specific (idiosyncratic) risk. While idiosyncratic risk can be diversified away as N increases, risk premia compensate investors for systematic risk that can not be diversified away. However, the CAPM does not specify how large the market risk premium should be. While the CAPM is a static model, a more realistic approach should reflect the view that market risk aversion varies with recent market moves and economic conditions, and that the amount of risk in the market varies with stock market volatility and asset correlations. 1.5.3.4 APT: a multi-factor model Relaxing some of the simplifying assumptions of the CAPM, new approaches flourished to explain expected returns such as multiple systematic factors, time-varying risk premia, skewness and liquidity preferences, market frictions, investor irrationalities etc. The Arbitrage Pricing Theory (APT) developed by Ross [1976] is one of the theories that relate stock returns to macroeconomic state variables. However, identifying risk factors in the multi-factor models in Equation (1.5.20) that are effective at explaining realised return variations over time is an open problem, since theory gives limited guidance. One can either consider theoretical factor models or empirical factor models where factors are chosen to fit empirical asset return behaviour (see Ilmanen [2011]). Factors with a strong theoretical basis include aggregate consumption growth, investment growth, as well as overall labour income growth and idiosyncratic job risk. Equity factors that are primarily empirical include value, size, and often momentum. The list can be extended to indicators like return reversals, volatility, liquidity, distress, earnings momentum, quality factors such as accruals, and corporate actions such as asset growth and net issuance. Beyond equities, sensitivities to major asset classes are the most obvious factors to consider. For instance, the inflation factor is especially important for bonds, and liquidities for other assets. In the case where several common factors generate undiversifiable risk, then a multi-factor relation holds. For instance, with K sistematic factors, the ith asset’s expected excess return reflects its factor sensitivities (βi1 , .., βiK ) and the factor risk premia (λ1 , .., λk ) Et [Ri,(t+1) ] = βi1 (t)λ1 (t) + ... + βiK (t)λk (t) More generally, if we assume that the stochastic discount factor (SDF) is linearly related to a set of common risk factors, then asset returns can be described by a linear factor model. Moreover, the idea that the risk premium depends on covariation with the SDF (bad times, high MU periods) also applies to the risk factors, not just to individual assets. 1.6 Introducing behavioural finance We saw in Section (1.3) that understanding the risk premia in view of predicting asset returns was at the heart of finance, and that several answers existed. One of them, called behavioural finance, implies that market prices do not only reflect the rationally expected discounted cash flows from an asset (see Section (1.4.12)), but also incorporate noise from irrational investors. In complete markets, rational investors make forecast that correctly incorporate all available information, leaving no room for systematic forecasting errors. Behavioural economics and behavioural finance have challenged this paradigm (see Barberis et al. [2002]). As fully rational behaviour requires quite complex calculations, an alternative idea developed suggesting that investors exhibit bounded rationality, rationality that is limited by their cognitive resources and observational powers. Psychological biases predict specific systematic deviations from rationality causing mispricings. The main biases are heuristic simplifications such as rules of thumb, mental shortcuts, attention and memory biases, representativeness, conservatism, and/or self-deception such as overconfidence, overoptimism, biased self-attribution, confirmation bias, hindsight bias. The best known market-level mispricings are speculative bubbles, and the best known relative mispricings are value and momentum effects. Even though it is argued that rational traders will view any such mispricings as trading opportunities, which when realised, 48 Quantitative Analytics will undo any price impact irrational traders might have, it did not happen in practice since these strategies are risky and costly (see Shleifer et al. [1997]). In fact, any observed predictability pattern can be interpreted to reflect either irrational mispricings or rational time-varying risk premia (rational learning about structural changes). It is likely that both irrational and rational forces drive asset prices and expected returns. That is, available information is not fully reflected in current market prices, leading to incomplete market situations. Hence, by challenging the complete market paradigm, behavioural finance attempted to propose an alternative theory, which is to be compared with the incomplete market theory (IMT). 1.6.1 The Von Neumann and Morgenstern model The first important use of the EUT was that of Von Neumann and Morgenstern (VNM) [1944] who used the assumption of expected utility maximisation in their formulation of game theory. When comparing objects one needs to rank utilities but also compare the sizes of utilities. VNM method of comparison involves considering probabilities. If a person can choose between various randomised events (lotteries), then it is possible to additively compare for example a shirt and a sandwich. It is possible to compare a sandwich with probability 1, to a shirt with probability p or nothing with probability 1 − p. By adjusting p, the point at which the sandwich becomes preferable defines the ratio of the utilities of the two options. If options A and B have probability p and 1 − p in the lottery, we can write the lottery L as a linear combination L = pA + (1 − p)B and for a lottery with n possible options, we get L= n X p i Ai i=1 Pn with i=1 pi = 1. VNM showed that, under some assumptions, if an agent can choose between the lotteries, then this agent has a utility function which can be added and multiplied by real numbers, which means the utility of an arbitrary lottery can be calculated as a linear combination of the utility of its parts. This is called the expected utility theorem. The required assumptions are made of four axioms about the properties of the agent’s preference relation over simple lotteries, which are lotteries with just two options. Writing B A for A is weakly preferred to B, the axioms are 1. Completeness: for any two simple lotteries L and M, either L M or M L (or both). 2. Transitivity: for any three lotteries L, M, N, if L M and M N , then L N . 3. Convexity: if L M N , then there is p ∈ [0, 1] such that the lottery pL + (1 − p)N is equally preferable to M. 4. Independence: for any three lotteries L, M, N, L M if and only if pL + (1 − p)N pM + (1 − p)N . A VNM utility function is a function from choices to the real numbers u : X → R which assigns a real number to every outcome in a way that captures the agent’s preferences over simple lotteries. Under the four assumptions mentioned above, the agent will prefer a lottery L2 to a lottery L1 , if and only if the expected utility of L2 is greater than the expected utility of L1 L1 L2 if and only if u(L1 ) ≤ u(L2 ) More formally, we assume a finite number of states of the world such that the jth state happens with the probability pj , and we let the consumption C be a random variable taking the values cj for j = 1, .., k (see Appendix (D.2) for details). To get a Von-Neumann Morgenstern (VNM) utility there must exist v : R+ → R such that 49 Quantitative Analytics ∞ Z u(P ) = v(x)dP (x) 0 In the special case where PC is a discrete sum, the VNM utility simplifies to u(P ) = k X pj v(cj ) j=1 Hence, the criterion becomes that of maximising the expected value of the utility of consumption where u(P ) = E[v(C)], with E[v(C)] =< v(C) >= k X pj v(cj ) j=1 A variety of generalized expected utility theories have arisen, most of which drop or relax the independence axiom. One of the most common uses of a utility function, especially in economics, is the utility of money. The utility function for money is a nonlinear function that is bounded and asymmetric about the origin. The utility function is concave in the positive region, reflecting the phenomenon of diminishing marginal utility. The boundedness reflects the fact that beyond a certain point money ceases being useful at all, as the size of any economy at any point in time is itself bounded. The asymmetry about the origin reflects the fact that gaining and losing money can have radically different implications both for individuals and businesses. The nonlinearity of the utility function for money has profound implications in decision making processes: in situations where outcomes of choices influence utility through gains or losses of money, which are the norm in most business settings, the optimal choice for a given decision depends on the possible outcomes of all other decisions in the same time-period. 1.6.2 Preferences In traditional decision theory, people form beliefs, or make judgments about some probabilities by assigning values, or utilities, to outcomes (see Arrow [1953] [1971]). Attitudes toward risk (risk aversion) determine what choices people make among the various opportunities that exist, given their beliefs. We saw in Section (1.6.1) that people calculate the expected utility of each gamble or lottery as the probability weighted sum of utility outcomes, then choose the gamble with the highest expected utility (see Von Neumann et al. [1944] and Friedman et al. [1948]). More formaly, one can view decision making under risk as a choice between prospects Pn or gambles (lotteries). A prospect (x1 , p1 ; ...; xn , pn ) is a contract yielding outcome xi with probability pi where i=1 pi = 1. To simplify notation, omitting null outcomes, we use (x, p) to denote the prospect (x, p; 0, (1 − p)) that yields x with probability p and 0 with probability (1 − p). It is equivalent to a simple lottery. The riskless prospect that yields x with certainty is denoted (x). The application of expected utility theory is based on 1. Expectation: u(x1 , p1 ; ...; xn , pn ) =< u(X) >= p1 u(x1 ) + ... + pn u(xn ) where u(.) is the utility function of a prospect. The utilities of outcomes are weighted by their probabilities. 2. Asset integration: (x1 , p1 ; ...; xn , pn ) is acceptable at asset position w if and only if u(w + x1 , p1 ; ...; w + xn , pn ) ≥ u(w). A prospect is acceptable if the utility resulting from integrating the prospect with one’s assets exceeds the utility of those assets alone. The domain of the utility function is final states rather than gains or losses. 00 3. Risk aversion: u is concave, that is, u < 0. However, experimental work found substantial violations of this rational model (see Allais [1953]), leading to the development of various alternative theories, such as the prospect theory (PT). Kahneman et al. [1979] described several classes of choice problems in which preferences systematically violate the axioms of expected utility theory, 50 Quantitative Analytics and developed an intentionally positive, or descriptive, model of preferences that would best characterise the deviations of actual choices from the normative expected utility model. Their experimental studies revealed that people • overweight outcomes that are considered certain, relative to outcomes which are merely probable (certainty effect). • care more about gains and losses (changes in wealth) than about overall wealth • exhibit loss aversion and can be risk seeking when facing the possibility of loss (reflection effect). • overweight low probability events. The reflection effect implies that risk aversion in the positive domain is accompanied by risk seeking in the negative domain. Further, outcomes which are obtained with certainty are overweighted relative to uncertain outcomes. In the positive domain, the certainty effect contributes to a risk averse preference for a sure gain over a larger gain that is merely probable. In the negative domain, the same effect leads to a risk seeking preference for a loss that is merely probable over a smaller loss that is certain. The following example (Problem 11, 12) illustrates these findings. 1. suppose that you are paid $1000 to participate in a gamble that presents you with the following further choices (a) a sure $500 gain (b) a 50% chance of winning $1000, a 50% chance of $0 2. suppose that you are paid $2000 to participate in a gamble that presents you with the following further choices (a) a sure $500 loss (b) a 50% chance of winning $1000, a 50% chance of $0 The typical strategies chosen are (1a) (certainty) and (2b) (risk seeking), even though the total wealth outcomes in (1a) and (2a) are identical, and that in (1b) and (2b) are likewise identical. People act as if they are risk averse when only gains are involved but become risk seeking when facing the possibility of loss and they view the initial bonus and the gamble separately (isolation effect). The experimental studies showed that the intuitive notion of risk is not adequately captured by the assumed concavity of the utility function for wealth. Prospect theory (PT) distinguishes two phases in the choice process, an early phase of editing and a subsequent phase of evaluation. The major operations of the editing phase are coding, combination, segregation, and cancellation. The edited prospects are then evaluated and the prospect of highest value is chosen. As the editing operations facilitate the task of decision, it can explain many anomalies of preference. For example, the inconsistencies associated with the isolation effect result from the cancellation of common components. In PT, people maximise the weighted sum of values (utilities) where weights are not probability themselves (probabilities are rational) but their nonlinear transformation. • whether an outcome is seen as a gain or a loss (relative to some neutral reference point) determines the value (utility) of a dollar. Its value depends on the context (coding). The reference point can be affected by the formulation of the offered prospects, and by the expectations of the decision maker. • the value function is kinked at the origin (reference point) where the steeper slope below zero implies loss aversion. Many studies show that losses hurt twice to two and a half times as much as same-sized gains satisfy. In general, the value function has concave (convex) shape to the right (left) of the reference point, implying risk aversion among gambles involving only gains but risk seeking among gambles involving only losses. • overweighting low-probability events is the main feature of the probability weighting function, explaining the simultaneous demand for both lotteries and insurance. Such overweighting of small probabilities can be strong enough to reverse the sign of risk appetite in the value function. Lotteries offering a small chance of very large gains can induce risk seeking, despite a general tendency to risk aversion when gambles only involve gains. 51 Quantitative Analytics To summarise, the main idea was to assume that values are attached to changes rather than to final states, and that decision weights do not coincide with stated probabilities, leading to inconsistencies, intransitivities, and violations of dominance. More formally, the overall value of an edited prospect, denoted V, is expressed in terms of two scales π and v, where the former associates with each probability p a decision weight π(p) reflecting the impact of p on the over-all value of the prospect, and the latter assigns to each outcome x a number v(x) reflecting the subjective value of that outcome. Note, v measures the value of deviations from that reference point (gains and losses). Kahneman et al. [1979] considered simple prospects (x, p; y, q) with at most two non-zero outcomes, where one receives x with probability p, y with probability q, and nothing with probability 1 − p − q, with p + q ≤ 1. An offered prospect is strictly positive if its outcomes are all positive, if x, y > 0 and p + q = 1, and it is strictly negative if its outcomes are all negative. A prospect is regular if it is neither strictly positive nor strictly negative (either p + q < 0, or x ≥ 0 ≥ y, or x ≤ 0 ≤ y). If (x, p; y, q) is a regular prospect, then the value is given by V (x, p; y, q) = π(p)v(x) + π(q)v(y) where v(0) = 0, π(0) = 0, and π(1) = 1. The two scales coincide for sure prospects, where V (x, 1) = V (x) = v(x). In that setting, the expectation principle (1) of the expected utility theory is relaxed since π is not a probability measure. The evaluation of strictly positive and strictly negative prospects is slightly modified. If p + q = 1, and either x > y > 0, or x < y < 0, then V (x, p; y, q) = v(y) + π(p)(v(x) − v(y)) since π(p) + π(1 − p) = 1. Markowitz [1952b] is at the origin of the idea that utility be defined on gains and losses rather than on final asset positions. He proposed a utility function which has convex and concave regions in both the positive and the negative domains. However, in PT, the carriers of value are changes in wealth or welfare, rather than final states, which is consistent with basic principles of perception and judgment. Value should be treated as a function in two arguments, the asset position that serves as reference point, and the magnitude of the change (positive or negative) from that reference point. Kahneman et al. [1979] assumed that the value function for changes of wealth 00 00 is normally concave above the reference point (v (x) < 0, for x > 0) and often convex below it (v (x) > 0, for x < 0). Put another way, PT postulates the leaning S-shape of the value function. However, the actual scaling is considerably more complicated than in utility theory, because of the introduction of decision weights. They measure the impact of events on the desirability of prospects, and should not be interpreted as measures of degree or belief. Note, π(p) = p only if the expectation principle holds, but not otherwise. In general, π is an increasing function of p, with π(0) = 0 and π(1) = 1. In the case of small values of p, π is a subadditive function of p, that is, π(rp) > rπ(p) for 0 < r < 1, and that very low probabilities are generally overweighted, that is, π(p) > p for small p. In general, for 0 < p < 1 we get π(p) + π(1 − p) < 1 called subcertainty. Thus, for a fixed ratio of probabilities, the ratio of the corresponding decision weights is closer to unity when the probabilities are low than when they are high. This holds if and only if log π is a convex function of log p. The slope of π in the interval (0, 1) can be viewed as a measure of the sensitivity of preferences to changes in probability. These properties entail that π is relatively shallow in the open interval and changes abruptly near the end-points where π(0) = 0 and π(1) = 1. Because people are limited in their ability to comprehend and evaluate extreme probabilities, highly unlikely events are either ignored or overweighted, and the difference between high probability and certainty is either neglected or exaggerated. Consequently, π is not well-behaved near the end-points (sharp drops, discontinuities). 1.6.3 Discussion Note, most applications of the PT theory have been concerned with monetary outcomes. We saw that one consequence of the reflection effect is that risk aversion in the positive domain is accompanied by risk seeking in the negative domain. That is, the preference between negative prospects is the mirror image of the preference between positive prospects. Denoting > the prevalent preference, in Problem 3 we get (3000) > (4000, 0.8) with 80% against 20%, 0 and in Problem 3 we get (−4000, 0.8) > (−3000) with 92% against 8%. The majority of subjects were willing to accept a risk of 0.8 to lose 4000, in preference to a sure loss of 3000, although the gamble has a lower expected value. 52 Quantitative Analytics These Problems demonstrate that outcomes which are obtained with certainty are overweighted relative to uncertain outcomes. The same psychological principle, the overweighting of certainty, favours risk aversion in the domain of gains and risk seeking in the domain of losses. Referencing Markowitz [1959] and Tobin [1958], the authors postulate that the aversion for uncertainty or variability is the explanation of the certainty effect in the rational theory. That is, people prefer prospects with high expected value and small variance (high Sharpe ratio). For instance, (3000) is chosen over (4000, 0.8) despite its lower expected value because it has no variance. They argued that the difference in variance between (3000, 0.25) and (4000, 0.20) may be insufficient to overcome the difference in expected value. They further postulate that since (−3000) has both higher expected value and lower variance than (−4000, .80), the sure loss should be preferred, contrary to the data. They concluded that their data was incompatible with the notion that certainty is generally desirable and that certainty increases the aversiveness of losses as well as the desirability of gains. In all these Problems, there is no notion of volatility so that one can not define preferences in terms of measures such as the Sharpe ratio, except in the case of certainty events. In problem 3, the prospect (3000) has an 0 infinite Sharpe ratio (MSR = ∞), while in Problem 3 the prospect (−3000) has a negative infinite Sharpe ratio (MSR = −∞) contradicting the founding that (−3000) should be preferred over (−4000, .80). Other research proposed an alternative foundation based on salience while using standard risk preferences (see Bordalo et al. [2010]). Decision makers overweight the likelihood of salient states (where lotteries have extreme, contrasting payoffs), explaining both the reflecting shape of the value function and the overweighting of low probability events. Note, one feature of PT preferences is that people derive decision utility from the gains and losses of a single trade. To obtain testable predictions, PT must be combined with other assumptions such as narrow framing or the house money effect. The former stipulates that ignoring the rest of wealth implies narrow framing (analysing problems in a too isolated framework). For instance, focusing too much on asset specific risks (volatility, default) and ignoring correlation effects. One important aspect of framing is the selection of a reference point as the benchmark for comparisons (doing nothing, one’s current asset position). The latter stipulates that gamblers tend to become less loss averse and more willing to take risks when they are ahead (playing with house money). Risk preferences in a sequence of gambles depend on how prior gains and losses influence loss aversion over time (more aggressive risk taking following successful trading, and cautiousness following losses). Further, people dislike vague uncertainty (ambiguity) more than objective uncertainty. While risky choices always involve the possibility of adverse outcomes, some outcomes are more likely to trigger regret than others. Hence, we might want to minimise regret (when hanging on to losers) which is also a motivation for diversification. At last, moods and feelings may be the most plausible explanations for empirical observations that average stock returns tend to be higher or lower near major events (holidays, weather, lunar cycles). 1.6.4 Some critics Kahneman et al. [1979] considered a very simplistic approach that can be interpreted (in the positive domain) as a special case of the model of Von Neumann Morgenstern with a single agent, one period of time, a single good of consumption and a finite number of states of the world, described in Appendix (D.2). However, in their settings, there is no notion of good of consumption, and as a result, no objective of maximising wealth over time via optimal consumption. The idea being to compute the expected value of the utility function rather than to maximise that expected value over consumption. Consequently, their class of choice problems is to be related to the St Petersburg paradox described in Section (1.2.1). Hence, all the critics addressed in Section (1.2.3) to Bernoulli’s expected utility theory apply. That is, it is meaningless to assign a probability to a single event, as the event has to be embedded within other similar events. The main difference with the EUT being that the decision weights π(p) do not coincide with stated probabilities, relaxing the expectation principle of the EUT, since π is no-longer a probability measure. Recognising that EUT can represent risk preferences, but is unable to recommend appropriate levels of risk (see Section (1.2.4)), PT, via the modification of the historical probability, is an artifact to include the missing notion of risk premia in the EUT. It is a non-mathematical approach where the choices of the decision weights have to be related to the minimisation over martingale measures introduced in the utility indifference pricing theory discussed in Section (1.2.4). Obviously the previous example (Problem 11, 12) is a free lunch and one can not use the results from 53 Quantitative Analytics this experimental work to elaborate a pricing theory. However, the main idea of behavioural finance is to recognise that rationality requires complex calculations, and that when facing a situation where the decision process must be instantaneous investors exhibit bounded rationality. Put another way, investors can not by themselves value the fair price of uncertain future outcomes, and requires shortcuts and heuristic simplifications with an early phase of editing and a subsequent phase of evaluation. 1.7 1.7.1 Predictability of financial markets The martingale theory of asset prices As told by Mandelbrot [1982], the question of the predictability of financial markets is an old one, as financial newspapers have always presented analysis of charts claiming that they could predict the future from the geometry of those charts. However, as early as 1900, Bachelier [1900] asserted that successive price changes were statistically independent, implying that charting was useless. Weakening that statement, he stated that every price follows a martingale stochastic process, leading to the concept of perfect market (for the definition of independent processes and martingales see Appendix (B.3)). That is, everything in its past has been discounted fully for the definition of independent processes and martingales. Bachelier introduced an even weaker statement, the notion of efficient market where imperfections remain only as long as they are smaller than transaction costs. A more specific assertion by Bachelier is that any competitive price follows, in the first approximation, a one-dimensional Brownian motion. Since the thesis of Bachelier, the option pricing theory (see Sections (1.2.4) and (1.3.2)) developed around the martingale theory of dynamic price processes, stating that discounted traded assets are martingales under the appropriate probability measure. In a martingale, the expected value of a process at future dates is its current value. If after the appropriate discounting (by taking into account the time value of money and risk), all price processes behave as martingales, the best forecast of future prices is present prices. That is, prices might have different distributions, but the conditional mean, after appropriate discounting, is the present price. Hence, under the appropriate probability measure, discounted prices are not exponentially diverging. In principle, it is satisfied by any price process that precludes arbitrage opportunities. Delbaen et al. [1994] proved that an arbitrage opportunity exists if a price process, P , is not a semimartingale. Hence, an important question in the quantitative analysis of financial data is therefore to check whether an observed process is a semimartingale. However, the discount factors taking risk into account, also called kernels, are in general stochastic making the theory difficult to validate. Estimating the Hurst exponent (see Hurst [1951]) for a data set provides a measure of whether the data is a pure white noise random process or has underlying trends (see details in Section (10.1)). For instance, processes that we might assume are purely white noise sometimes turn out to exhibit Hurst exponent statistics for long memory processes. In practice, asset prices have dependence (autocorrelation) where the change at time t has some dependence on the change at time t−1, so that the Brownian motion is a poor representation of financial data. Actual stock returns, especially daily returns, do not have a normal distribution as the curve of the distribution exhibits fatter tails (called the stylised facts of asset distribution). One approach to validate the theory is to introduce a test about the Hurst coefficient H of a fractional Brownian motion (fBm). A fBm is an example for a stochastic process that is not a semimartingale except in the case of a Hurst coefficient H equal to 12 . Hence, a financial market model with a price process, P , that is assumed to be a fBm with H 6= 12 implies an arbitrage opportunity. Rogers [1997] provided a direct construction of a trading strategy producing arbitrage in this situation. Many applied areas of financial economics such as option pricing theory (see Black et al. [1973]) and portfolio theory (see Markowitz [1952] and [1959]) followed Bachelier’s assumption of normally distributed returns. The justification for this assumption is provided by the law of large numbers stating that if price changes at the smallest unit of time are independently and identically distributed (i.i.d.) random numbers, returns over longer intervals can be seen as the sum of a large number of such i.i.d. observations, and, irrespective of the distribution of their summands, should under some weak additional assumptions converge to the normal distribution. While this seemed plausible 54 Quantitative Analytics and the resulting Gaussian distribution would also come very handy for many applied purposes, Mandelbrot [1963] was the first to demonstrate that empirical data are distinctly non-Gaussian, exhibiting excess kurtosis and higher probability mass in the center and in their tails than the normal distribution. Given sufficiently long record of stock market, foreign exchange or other financial data, the Gaussian distribution can always be rejected with statistical significance beyond all usual boundaries, and the observed largest historical price changes would be so unlikely under the normal law that one would have to wait for horizons beyond at least the history of stock markets to observe them occur with non-negligible probability. 1.7.2 The efficient market hypothesis From a macroeconomic perspective, it is often assumed that the economy is the superposition of different economic cycles ranging from short to long periods. They have first been studied by Clément Juglar in the 19th-Century to prevent France from being hit by repetitive crises. Then, many economists have been interested in these phenomena such as Mitchell [1927], Kondratiev [1925] or Schumpeter [1927], to name but a few. Nowadays, many new classical economists such as Kydland (Nobel Prize in 1995), Prescott (Nobel Prize in 2004), Sargent (Nobel Prize in 2011) are still working on this area. As a consequence, it is widely believed that equity prices react sensitively to the developments of these macroeconomic fundamentals. That is, the changes in the current fundamental value of the firm will depend upon the present value of the future earnings, explaining the behaviour of stock markets in the long-run. However, some economists such as Fama [1965a] [1970] demonstrated that stock prices were extremely difficult to predict in the short run, with new information quickly incorporated into prices. Even though Bachelier is at the origin of using statistical methods to analyse returns, his work was largely ignored and forgotten until the late 1940s where the basis of the efficient market hypothesis (EMH) was collected in a book by Cootner [1964]. The book presents the rationale for what was to be formalised as the EMH by Fama in the 1960s. Originally, during the 1920s through the 1940s, on one hand the Fundamentalists assumed investors to be rational, in order for value to reassert itself, and on the other hand the Technicians assumed markets were driven by emotions. In the 1950s the Quants made an appeal for widespread use of statistical analysis (see Roberts [1964]). At the same time, Osborn [1964] formalised the claim that stock prices follow a random walk. Similarly, Samuelson [1965] postulated that properly anticipated prices fluctuate randomly. Later, Malkiel [1973] stated that the past movement or direction of the price of a stock or overall market could not be used to predict its future movements, leading to the Random Walk Theory (RWT). Note, in his conclusion (Assumption 7), Osborn states that since price changes are independent (random walk), we expect the distribution of changes to be normal, with a stable mean and finite variance. This is a result of the Central Limit Theorem stating that a sample of i.i.d. random variables will be normally distributed as the sample gets larger. This postulate relies on the fact that capital markets are large systems with a large number of degrees of freedom (investors or agents), so that current prices must reflect the information everyone already has. Hence, investors value stocks based on their expected value (expected return), which is the probability weighted average of possible returns. It is assumed that investors set their subjective probabilities in a rational and unbiased manner. Consequently, if we can not beat the market, the best investment strategy we can apply is buy-and-hold where an investor buys stocks and hold them for a long period of time, regardless of market fluctuations. Fama [1970] formalised the concept of EMH by presenting three basic models which states that the market is a martingale model and a random walk model, or a fair game model. The main implications of the EMH are • Homogeneity of investors based on their rationality: if all investors are rational and have the access to the same information, they necessarily arrive at the same expectations and are therefore homogeneous. • Normal distribution of returns: random walk can be represented by AR(1) process in the form of Pt = Pt−1 +t implying that rt = Pt − Pt−1 = t where t ∼ N (0, σ) is independent normally distributed variable. • Standard deviation as a measure of volatility and thus risk : since returns are normally distributed, it implies that standard deviation is stable and finite and thus is a good measure of volatility. 55 Quantitative Analytics • Tradeoff between risk and return: since standard deviation is stable and finite, there is a relationship between risk and return based on non-satiation and risk-aversion of the investors. • Unpredictability of future returns: since returns follow random walk, the known information is already incorporated in the prices and thus their prediction is not possible. While the EMH does not require independence through time or accept only i.i.d. observations, the random walk does. That is, if returns are random, the markets are efficient, but the converse may not be true. Over time, a semistrong version of the EMH was accepted by the investment community which states that markets are efficient because prices reflect all public information. In a weak form efficient market, the price changes are independent and may be a random walk. It can be restated in terms of information sets such that, in the weak form, only historical prices of stocks are available for current price formation, while the semi-strong form broadens the information set by all publicly available information, and the strong form includes insider information into the information set. Market is then said to be weakly efficient when investors can not reach above-average risk-adjusted returns based on historical prices and similarly for the other forms. While the efficient market hypothesis (EMH) implies that all available information is reflected in current market prices, leading to future returns to be unpredictable, this assumption has been rejected both by practitioners and academics. To test the EMH requires understanding the restrictions it imposes on probabilistic models of returns. In theory, the EMH is embodied in the martingale theory of dynamic price process (see Section 1.7.1) which can be hardly, if at all, tested in practice since the full reflection of information in prices is hard to define 2 . LeRoy [1976] criticised all presented definitions of EMH and argued that they were tautologies and therefore impossible to test. Further, some authors raised the problem of joint-hypothesis which state that even when the potential inefficiency of the market is uncovered, it can be due to wrongly chosen asset-pricing model. It is therefore impossible to reject EMH in general, and one must state under which conditions to test EMH (see Lo [2008]). For instance, we can either follow Fama [1965a] (Fa65) and assume that the market is weakly efficient if it follows a random walk, or we can follow Samuelson [1965] (Sa65) and assume that the market is efficient if it follows a martingale process. Note, the assumption of martingale process is more general than the random walk one and allows for dependence in the process. 1.7.3 Some major critics For the technical community, this idea of purely random movements of prices was totally rejected. A large number of studies showed that stock prices are too volatile to be explained entirely by fundamentals (see Shiller [1981] and LeRoy et al. [1981]). Even Fama [1965] found that returns were negatively skewed, the tails were fatter, and the peak around the mean was higher than predicted by the normal distribution (leptokurtosis). This was also noted by Sharpe [1970] on annual returns. Similarly, using daily S&P returns from 1928 till 1990, Turner et al. [1990] found the distributions to be negatively skewed and having leptokurtosis. While any frequency distribution including October 1987 will be negatively skewed with a fat negative tail, earlier studies showed the same phenomenon. Considering quaterly S&P 500 returns from 1946 till 1999, Friedman et al. [1989] noted that in addition to being leptokurtotic, large movements have more often been crashes than rallies, and significant leptokurtosis appears regardless of the period chosen. Analysing financial futures prices of Treasury Bond, Treasury Note, and Eurodollar contracts, Sterge [1989] found that very large (three or more standard deviations from the norm) price changes could be expected to occur two or three times as often as predicted by normality. Evidence suggests that in the short-run equity prices deviate from their fundamental values, and are also driven by non-fundamental forces (see Chung et al. [1998] and Lee [1998]). This is due to noise and can be driven by irrational expectations such as irrational waves of optimism or pessimism, feedback trading, or other inefficiencies. The facts that stock market returns are not normally distributed weaken statistical analysis such as correlation coefficients and t-statistics as well as the concept of random walk. Nonetheless, over a longer period of time, the deviations from the fundamentals diminish, and stock prices can be compatible with economic theories such as the Present Value Model. 2 The problem was mentioned by Fama in Fama [1970]. 56 Quantitative Analytics Mandelbrot [1964] postulated that capital market returns follow the family of Stable Paretian distribution with high peaks at the mean, and fat tails. These distributions are characterised by a tendency to have trends and cycles as well as abrupt and discontinuous changes, and can be adjusted for skewness. However, since variance can be infinite (or undefined), if financial returns fall into the Stable Paretian family of distributions, then variance is only stable and finite for the normal distribution. Hence, given that market returns are not normally distributed, volatility was found to be disturbingly unstable. For instance, Turner et al. [1990] found that monthly and quarterly volatility were higher than they should be compared to annual volatility, but daily volatility was lower. Engle [1982] proposed to model volatility as conditional upon its previous level, that is, high volatility levels are followed by more high volatility, while low volatility is followed by more low volatility. This is consistent with the observation by Mandelbrot [1964] that the size of price changes (ignoring the sign) seems to be correlated. Engle [1982] and LeBaron [1990], among others, found supportive evidence of the autoregressive conditional heteroskedastic (ARCH) model family, such that standard deviation is not a standard measure (at least over the short term). Defining rationality as the ability to value securities on the basis of all available information, and to price them accordingly, we see that the EMH is heavily dependent on rational investors. Even though investors are risk-averse, Kahneman et al. [1979] and Tversky [1990] suggested that when losses are involved, people tend to be risk-seeking. That is, they are more likely to gamble if gambling can minimise their loss (see Section (1.6)). In addition, in practice, markets are not complete, and investors are not always logical. Shiller [1981] showed that investors could be irrational and that assets from stocks to housing could develop into bubbles. He concluded that rational models of the stock market, in which stock prices reflect rational expectations of future payouts, were in error. He argued that a clever combination of logic, statistics, and data implied that stock markets were, instead, prone to irrational exuberance. Following from these studies and from the paper by DeBondt et al. [1985], behavioural finance developed where people do not recognise, or react to, trends until they are well established. This behaviour is quite different from that of the rational investor, who would immediately adjust to new information, leading to market inefficiencies as all information has not yet been reflected in prices. As explained by Peters [1991-96], if the reaction to information occurs in clumps, and investors ignore information until trends are well in place, and then react in a cumulative fashion to all the information previously ignored, then people react to information in a nonlinear way. This sequence implies that the present is influenced by the past, which is a clear violation of the EMH. This old debate was partly put to an end by The Royal Swedish Academy of Sciences which attributed the Nobel prize 2013 for economics to both Fama and Shiller. Nonetheless, there is a consensus in empirical finance around the idea that financial assets may exhibit trends or cycles, resulting in persistent inefficiencies in the market that can be exploited (see Keim et al. [1986], Fama et al. [1989]). For instance, Kandel et al. [1996] showed that even a low level of statistical predictability can generate economic significance with abnormal returns attained even if the market is successfully timed only one out of hundred times. One argument put forward is that risk premiums are time varying and depend on business cycle so that returns are related to some slow moving economic variables exhibiting cyclical patterns in accordance with business cycles (see Cochrane [2001]). Another argument states that some agents are not fully rational (for theory of behavioural finance see Barberis et al. [1998], Barberis et al. [2002]), leading prices to underreact in the short run and to overreact at longer horizons. 1.7.4 Contrarian and momentum strategies Since the seminal article of Fama [1970], a large number of articles have provided substantial evidence that the stock returns and portfolio returns can be predicted from historical data. For instance, Campbell et al. [1997] showed that while the returns of individual stocks do not seem to be autocorrelated, portfolio returns are significantly autocorrelated. The presence of significant cross-autocorrelations lead to more evident predictability at the portfolio level than at the level of individual stocks. The profit generated by trading strategies based on momentum and reversal effect are further evidence of cross-autocorrelations. Lo et al. [1990b] and Lewellen [2002] showed that momentum and reversal effects are not due to significant positive or negative auto-correlation of individual stocks but to crossautocorrelation effects and other cross-sectional phenomena. The empirical evidences challenged the paradigm of the 57 Quantitative Analytics weak form efficient market hypothesis (EMH) putting into questions the well accepted capital asset pricing model (CAPM). The two most popular strategies that emerged from the literature are the contrarian and the momentum strategies. A contrarian strategy takes advantage of the negative autocorrelation of asset returns and is constructed by taking a long position in stocks performing badly in the past and shorting stocks performing well in the past. In contrast, a momentum strategy is based on short selling past losers and buying past winners. Empirical evidence suggested that these two strategies mutually co-exist and that their profitability are international (see Griffin et al. [2003], Chui et al. [2005]). However, although there are sufficient supportive evidence for both strategies, the source and interpretations of the profits is a subject of much debate. Three alternative explanations for such an outcome were proposed: 1. the size effect: with the losers tending to be those stocks with small market value and overreaction being most significant for small firms. 2. time-varying risk: the coefficients of the risk premia of the losers are larger than those of the winners in the period after the formation of the portfolios. 3. market microstructure related effect: part of the return reversal is due to bid-ask biases, illiquidity, etc. Although contrarian strategies (buying past losers and selling past winners) have received a lot of attention in the early literature on market efficiency, recent literature focused on relative strength strategies that buy past winners and sell past losers. It seems that the authors favoring contrarian strategies focuses on trading strategies based on either very short-term return reversals (1 week or 1 month) or very long-term return reversals (3 to 5 years), while evidence suggests that practitioners using relative strength rules base their selections on price movements over the past 3 to 12 months. As individual tend to overreact to information, De Bondt et al. [1985] [1987] assumed that stock prices also overreact to information, and showed that over 3 to 5-year holding periods stocks performing poorly over the previous 3 to 5 years achieved higher returns than stocks performing well over the same period. When ranked by the previous cumulated returns in the past 3 to 5 years, the losers outperformed the previous winners by nearly 25% in the subsequent 3 to 5 years. Jegadeesh [1990] and Lehmann [1990] provided evidence of shorter-term return reversal. That is, contrarian strategies selecting stocks based on their returns in the previous week or month generated significant abnormal returns. In the case of momentum strategies, Levy [1967] claimed that a trading rule that buys stocks with current prices being substantially higher than their average prices over the past 27 weeks realised significant abnormal returns. Jegadeesh et al. [1993] provided analysis of relative strength trading strategies over 3 to 12-month horizon on the NYSE and AMEX stock, and showed significant profits in the 1965 to 1989 sample period for each of the relative strength strategies examined. For example, a strategy selecting stocks based on their past 6-month returns and holds them for 6 months realised a compounded excess return of 12.01% per year on average. Additional evidence indicates that the profitability of the relative strength strategies are not due to their systematic risk. These results also indicated that the relative strength profits can not be attributed to lead-lag effects resulting from delayed stock price reactions to common factors. However, the evidence is consistent with delayed price reactions to firm specific information. That is, part of the abnormal returns generated in the first year after portfolio formation dissipates in the following two years. Using out-of-sample tests, Jegadeesh et al. [2001] found that momentum profits continued after 1990, indicating that their original findings were not due to a data snooping bias. They suggested that the robustness of momentum returns could be driven by investors’ cognitive biases or under reaction to information, such as earning announcements. Time series momentum or trend is an asset pricing anomaly with effect persisting for about a year and then partially reversing over longer horizons. Hurst et al. [2010] noted that the main driver of many managed futures strategies pursued by CTAs is trend-following or momentum investing. That is, buying assets whose price is rising and selling assets whose price is falling. Rather than focus on the relative returns of securities in the cross-section, time series momentum focuses purely on a security’s own past return. These findings are robust across a number of subsamples, look-back periods, and holding periods (see Moskowitz et al [2012]). They argued that time series momentum 58 Quantitative Analytics directly matches the predictions of many prominent behavioral and rational asset pricing theories. They found that the correlations of time series momentum strategies across asset classes are larger than the correlations of the asset classes themselves, suggesting a stronger common component to time series momentum across different assets than is present among the assets themselves. They decomposed the returns to a time series and cross-sectional momentum strategy to identify the properties of returns that contribute to these patterns and found that positive auto-covariance in futures contracts’ returns drives most of the time series and cross-sectional momentum effects. One explanation is that speculators trade in the same direction as a return shock and reduce their positions as the shock dissipates, whereas hedgers take the opposite side of these trades. In general, spot price changes are mostly driven by information shocks, and they are associated with long-term reversals, consistent with the idea that investors may be over-reacting to information in the spot market. This finding of time series momentum in virtually every instrument challenges the random walk hypothesis on the stock prices. Further, they showed that a diversified portfolio of time series momentum across all assets is remarkably stable and robust, yielding a Sharpe ratio greater than one on an annual basis, or roughly 2.5 times the Sharpe ratio for the equity market portfolio, with little correlation to passive benchmarks in each asset class or a host of standard asset pricing factors. At last, the abnormal returns to time series momentum also do not appear to be compensation for crash risk or tail events. Rather, the return to time series momentum tends to be largest when the stock market’s returns are most extreme, performing best when the market experiences large up and down moves. Note, the studies of autocorrelation examine, by definition, return predictability where the length of the look-back period is the same as the holding period over which returns are predicted. This restriction masks significant predictability that is uncovered once look-back periods are allowed to differ from predicted or holding periods. Note, return continuation can be detected implicitly from variance ratios. Also, a significant component of the higher frequency findings in equities is contaminated by market microstructure effects such as stale prices. Focusing on liquid futures instead of individual stocks and looking at lower frequency data mitigates many of these issues (see Ahn et al. [2003]). Recently, Baltas et al. [2012a] extended existing studies of futures time-series momentum strategies in three dimensions (time-series, cross-section and trading frequency) and documented strong return continuation patterns across different portfolio rebalancing frequencies with the Sharpe ratio of the momentum portfolios exceeding 1.20. These strategies are typically applied to exchange traded futures contracts which are considered relatively liquid compared to cash equity or bond markets. However, capacity constraints have limited these funds in the past. The larger they get, the more difficult it is to maintain the diversity of their trading books. Baltas et al. rigorously establish a link between CTAs and momentum strategies by showing that time-series momentum strategies have high explanatory power in the time series of CTA returns. They do not find evidence of capacity constraints when looking at momentum strategies in commodities markets only, suggesting that the futures markets are relatively deep and liquid enough to accommodate the trading activity of the CTA industry. 1.7.5 Beyond the EMH In financial markets, volatility is a measure of price fluctuations of risky assets over time which can not be directly observed and must be estimated via appropriate measures. These measures of volatility show volatility clustering, asymmetry and mean reversion, comovements of volatilities across assets and financial markets, stronger correlation of volatility compared to that of raw returns, (semi-) heavy-tails of the distribution of returns, anomalous scaling behaviour, changes in shape of the return distribution over time horizons, leverage effects, asymmetric lead-lag correlation of volatilities, strong seasonality, and some dependence of scaling exponents on market structure. Mandelbrot [1963] showed that the standard Geometric Brownian motion (gBm) proposed by Bachelier was unable to reproduce these stylised facts. In particular, the fat tails and the strong correlation observed in volatility are in sharp contrast to the mild, uncorrelated fluctuations implied by models with Brownian random terms. He presented an alternative description of asset prices constructed on the basis of a scaling assumption. From simple observation, a continuous process can not account for a phenomenon characterised by very sharp discontinuities such as asset prices. When P (t) is a price at time t, then log (P (t)) has the property that its increment over an arbitrary time lag d, that is 59 Quantitative Analytics ∆(d) = log (P (t + d)) − log (P (t)), has a distribution independent of d, except for a scale factor. Hence, in a competitive market no time lag is more special than any other. Under this assumption, typical statistics to summarise data such as sample average to measure location and sample root mean square to measure dispersion have poor descriptive properties. This lead Mandelbrot to assume that the increment ∆(d) has infinite variance and to conclude that price change is ruled by Levy stable distribution. It was motivated by the fact that in a generalised version of the central limit law dispensing with the assumption of a finite second moment, sums of i.i.d. random variables converge to these more general distributions (where the normal law is a special case of the Levy stable law obtained in the borderline case of a finite second moment). Therefore, the desirable stability property indicates the choice of the Levy stable law which has a shape that, in the standard case of infinite variance, is characterised by fat tails. It is interesting to note that Fama [1963] discussed the Levy stable law applied to market returns and Fama et al. [1971] proposed statistical techniques for estimating the parameters of the Levy distributions. While the investment community accepted variance and standard deviation as the measures of risk, the early founders of the capital market theory (Samuelson, Sharpe, Fama, and others) were well aware of these assumptions and their limitations as they all published work modifying the MPT for non-normal distributions. Through the 1960s and 1970s, empirical evidence continued to accumulate proving the non-normallity of market returns (see Section (1.7.3)). Sharpe [1970] and Fama et al. [1972] published books including sections on needed modifications to standard portfolio theory accounting for the Stable Paretian Hypothesis of Mandelbrot [1964]. As the weak-form EMH became widely accepted more complex applications developed such as the option pricing of Black et al. [1973] and the Arbitrage Pricing Theory (APT) of Ross [1976]. The APT postulates that price changes come from unexpected changes in factors, allowing the structure to handle nonlinear relationships. In the statistical extreme value theory the extremes and the tail regions of a sample of i.i.d. random variables converge in distribution to one of only three types of limiting laws (see Reiss et al. [1997]) 1. exponential decay 2. power-law decay 3. the behaviour of distributions with finite endpoint of their support Fat tails are often used as a synonym for power-law tails, so that the highest realisations of returns would obey a law like P (xt < x) ∼ 1 − x−α after appropriate normalisation with transformation xt = art + b. Hence, the universe of fat-tailed distributions can be indexed by their tail index α with α ∈ (0, ∞). Levy stable distributions are characterised by tail indices α < 2 (2 characterising the case of the normal distribution). All other distributions with a tail index smaller than 2 converge under summation to the Levy stable law with the same index, while all distributions with an asymptotic tail behaviour with α > 2 converge under aggregation to the Gaussian law. Various authors such as Jansen et al. [1991] and Lux [1996] used semi-parametric methods of inference to estimate the tail index without assuming a particular shape of the entire distribution. The outcome of these studies on daily records is a tail index α in the range of 3 to 4 counting as a stylised fact. Using intra-daily data records Dacorogna et al. [2001] confirmed the previous results on daily data giving more weight to the stability of the tail behaviour under time aggregation as predicted by extreme-value theory. As a result, it was then assumed that the unconditional distribution of returns converged toward the Gaussian distribution, but was distinctly different from it at the daily (and higher) frequencies. Hence, the nonnormal shape of the distribution motivated the quest for the best non-stable characterisation at intermediate levels of aggregation. A large literature developed on mixtures of normal distributions (see Kon [1984]) as well as on a broad range of generalised distributions (see Fergussen et al. [2006]) leading to the distribution of daily returns close to a Student-t distribution with three degrees of freedom. Note, even though a tail index between 3 and 4 was typically found for stock and foreign exchange markets, some other markets were found to have fatter tails (see Koedijk et al. [1992]). Even though the limiting laws of extreme value theory apply to samples of i.i.d. random variables it may still be valid for certain deviations from i.i.d. behaviour, but dependency in the time series of return will dramatically slow down convergence leading to a long regime of pre-asymptotic behaviour. While this dependency of long lasting 60 Quantitative Analytics autocorrelation is subject to debate for raw (signed) returns, it is plainly visible in absolute returns, squared returns, or any other measure of the extent of fluctuations (volatility). For instance, Ausloos et al. [1999] identified such effects on raw returns. With sufficiently long time series, significant autocorrelation can be found for time lags (of daily data) up to a few years. This positive feedback effect, called volatility clustering or turbulent (tranquil) periods, are more likely followed by still turbulent (tranquil) periods than vice versa. Lo [1991] proposed rigorous statistical test for long term dependence with more or less success on finding deviations from the null hypothesis of short memory for raw asset returns, but strongly significant evidence of long memory in squared or absolute returns. In general, short memory comes along with exponential decay of the autocorrelation, while one speaks of long memory if the decay follows a power-law. Evidence of the latter type of behaviour both on rate of returns and volatility accumulated over time. Lobato et al. [1998] claimed that such long-range memory in volatility measures was a universal stylised fact of financial markets. Note, this long-range memory effect applies differently on the foreign exchange markets and the stock markets (see Genacy et al. [2001a]). Further, LeBaron [1992] showed that, due to the leverage effect, stock markets exhibited correlation between volatility and raw returns. The hyperbolic decay of the unconditional pdf together with the hyperbolic decay of the autocorrelations of many measures of volatility (squared, absolute returns) fall into the category of scaling laws in the natural sciences. The identification of such universal scaling laws in financial markets spawned the interest of natural scientists to further explore the behaviour of financial data and to develop models explaining these characteristics. From this line of research, multifractality, multi-scaling or anomalous scaling emerged gradually over the 90s as a more subtle characteristic of financial data, motivating the adaptation of known generating mechanisms for multifractal processes from the natural sciences in empirical finance. The background of these models is the theory of multifractal measures originally developed by Mandelbrot [1974] in order to model turbulent flows. The formal analysis of such measures and processes, called multifractal formalism, was developed by Frisch et al. [1985], Mandelbrot [1989], and Evertz et al. [1992], among others. Mandelbrot et al. [1997] introduced the concept of multifractality in finance by adapting an earlier asset pricing framework of Mandelbrot [1974]. Subsequent literature moved from the more combinatorial style of the multifractal model of asset returns (MMAR) to iterative, causal models of similar design principles such as the Markov-switching multifractal (MSM) model proposed by Calvet et al. [2004] and the multifractal random walk (MRW) by Bacry et al. [2001] constituting the second generation of multifractal models. Mantegna et al. [2000] and Bouchaud et al. [2000] considered econophysics to study the herd behaviour of financial markets via return fluctuations, leading to a better understanding of the scaling properties based on methods and approaches in scientific fields. To measure the multifractals of dynamical dissipative systems, the generalised dimension and the spectrum have effectively been used to calculate the trajectory of chaotic attractors that may be classified by the type and number of the unstable periodic orbits. Even though a time series can be tested for correlation in many different ways (see Taqqu et al. [1995]), some attempts at computing these statistical quantities emerged from the box-counting method, while others extended the R/S analysis. Using detrended fluctuation analysis (DFA) or detrended moving average (DMA) to analyse asset returns on different markets, various authors observed that the Hurst exponent would change over time indicating multifractal process (see Costa et al. [2003], Kim et al. [2004]). Then methods for the multifractal characterisation of nonstationary time series were developed based on the generalisation of DFA, such as the MFDFA by Kantelhardt et al. [2002]. Consequently, the multifractal properties as a measure of efficiency (or inefficiency) of financial markets were extensively studied in stock market indices, foreign exchange, commodities, traded volume and interest rates (see Matia et al. [2003], Ho et al. [2004], Moyano et al. [2006], Zunino et al. [2008], Stosic et al. [2014]). It was also shown that observable in the dynamics of financial markets have a richer multifractality for emerging markets than mature one. As a rule, the presence of multifractality signalises time series exhibiting a complex behaviour with long-range time correlations manifested on different intrinsic time scales. Considering an artificial multifractal process and daily records of the S&P 500 index gathered over a period of 50 years, and using multifractal detrended fluctuation analysis (MFDFA) and multifractal diffusion entropy analysis (MFDEA), Jizba et al. [2012] showed that the latter posses highly nonlinear, and longranged, interactions which is the manifestation of a number of interlocked driving dynamics operating at different time scales each with its own scaling function. Such a behaviour typically points to the presence of recurrent economic 61 Quantitative Analytics cycles, crises, large fluctuations (spikes or sudden jumps), and other non-linear phenomena that are out of reach of more conventional multivariate methods (see Mantegna et al. [2000]). 1.7.6 Risk premia and excess returns 1.7.6.1 Risk premia in option prices The Black-Scholes model [1973] for pricing European options assumes a continuous-time economy where trading can take place continuously with no differences between lending and borrowing rates, no taxes and short-sale constraints. Investors require no compensation for taking risk, and can construct a self-financing riskless hedge which must be continuously adjusted as the asset price changes over time. In that model, the volatility is a parameter quantifying the risk associated to the returns of the underlying asset, and it is the only unknown variable. However, since the market crash of October 1987, options with different strikes and expirations exhibit different Black-Scholes implied volatilities (IV). The out-of-the-money (OTM) put prices have been viewed as an insurance product against substantial downward movements of the stock price and have been overpriced relative to OTM calls that will pay off only if the market rises substantially. As a result, the implicit distribution inferred from option prices is substantially negatively skewed compared to the lognormal distribution inferred from the Black-Scholes model. That is, given the BlackScholes assumptions of lognormally distributed returns, the market assumes a higher return than the risk-free rate in the tails of the distributions. Market efficiency states that in a free market all available information about an asset is already included in its price so that there is no good buy. However, in financial markets, perfect hedges do not exist and option prices induce market risks called gamma risk and vega risk whose order of magnitude is much larger than market corrections such as transaction costs and other imperfections. In general, these risks can not be hedged away even in continuous time trading, and hedging becomes approximating a target payoff with a trading strategy. The value of the option price is thus the cost of the hedging strategy plus a risk premium required by the seller to cover his residual risk which is unhedgeable. The no-arbitrage pricing theory tells us about the first component of the option value while the second component depends on the preferences of investors. Thus, the unhedgeable portion is a risky asset and one must decide how much he is willing to pay for taking the risk. The no-arbitrage argument implies a unique price for that extra risk called the market price of risk. Hence, when pricing in incomplete market, the market price of risk enter explicitly the pricing equation leading to a distribution of prices rather than a single price such that one consider bounds. Therefore, one can either simply ignore the risk premium associated to a discontinuity in the underlying, or one can choose any equivalent martingale measure as a self-consistent pricing rule but in that case the option price does not correspond to the cost of a specific hedging strategy. Hence, one should first discuss a hedging strategy and then derive a valuation for the options in terms of the cost of hedging plus a risk premium. Incorporating market incompleteness, alternative explanations for the divergence between the risk-neutral distributions and observed returns include peso problems, risk premia and option mispricing but no consensus has yet been reached. For instance, in the analysis performed by Britten-Jones et al. [2000] the bias may not be due to model misspecification or measurement errors, but to the way the market prices volatility risk. Similarly Duarte et al. [2007] documented strong evidence of conditional risk premium that varies positively with the overall level of market volatility. Their results indicate that the bias induced by censoring options that do not satisfy arbitrage bounds can be large, possibly resulting in biases in expected returns as large as several percentage points per day. Option investors are willing to pay more to purchase options as hedges under adverse market conditions, which is indicative of a negative volatility risk premium. These results are consistent with the existence of time-varying risk premiums and volatility feedback, but there may be other factors driving the results. Nonetheless, negative market price of volatility risk is the key premium in explaining the noticeable differences between implied volatility and realised volatility in the equity market. Thus, research now proposes the volatility risk premium as a possible explanation (Lin et al. [2009] , Bakshi et al. [2003] found supportive evidence of a negative market volatility risk premium). 62 Quantitative Analytics 1.7.6.2 The existence of excess returns To capture the extra returns embedded in the tails of the market distributions, the literature focused on adding stochastic processes to the diffusion coefficient of the asset prices or even jumps to the asset prices as the drift was forced to match the risk-free rate. The notion that equity returns exhibit stochastic volatility is well documented in the literature, and evidence indicates the existence of a negative volatility risk premium in the options market (see Bakshi et al. [2003]). CAPM suggests that the only common risk factor relevant to the pricing of any asset is its covariance with the market portfolio, making beta the right measure of risk. However, excess returns on the traded index options and on the market portfolio explain this variation, implying that options are non-redundant securities. As a result, Detemple et al. [1991] argued that there is a general interaction between the returns of risky assets and the returns of options, implying that option returns should help explain stock returns. That is, option returns should appear as factors in explaining the cross section of asset returns. For example, Bekaert et al. [2000] investigated the leverage effect and the time-varying risk premium explanations of the asymmetric volatility phenomenon at both the market and firm level. They found covariance asymmetry to be the main mechanism behind the asymmetry for the high and medium leverage portfolios. Negative shocks increase conditional covariances substantially, whereas positive shocks have a mixed impact on conditional covariances. While the above evidence indicates that volatility risk is priced in options market, Arisoy et al. [2006] used straddle returns (volatility trade) on the S&P 500 index and showed that it is also priced in securities markets. 63 Chapter 2 Introduction to asset management 2.1 2.1.1 Portfolio management Defining portfolio management A financial portfolio consists in a group of financial assets, also called securities or investments, such as stocks, bonds, futures, or groups of these investment vehicles referred as exchange-traded-funds (ETFs). The building of financial portfolio constitutes a well known problem in financial markets requiring a rigorous analysis in order to select the most profitable assets. Portfolio construction consists of two interrelated tasks 1. an asset allocation task for choosing how to allocate the investor’s wealth between a risk-free security and a set of N risky securities, and 2. a risky portfolio construction task for choosing how to distribute wealth among the N risky securities. Therefore, in order to construct a portfolio, we must define investments objectives by focusing on accepted degree of risk for a given return. Portfolio management is the act of deciding which assets need to be included in the portfolio, how much capital should be allocated to each kind of security, and when to remove a specific investment from the holding portfolio while taking the investor’s preferences into account. We can apply two forms of management (see Maginn et al. [2007]) 1. Passive management in which the investor concentrates his objective on tracking a market index. This is related to the idea that it is not possible to beat the market index, as stated by the Random Walk Theory (see Section (1.7.2)). A passive strategy aims only at establishing a well diversified portfolio without trying to find under or overvalued stocks. 2. Active management where the main goal of the investor consists in outperforming an investment benchmark index, buying undervalued stocks and selling overvalued ones. As explained by Jacobs et al. [2006], a typical equity portfolio is constructed and managed relative to an underlying benchmark. Designed to track a benchmark, an indexed equity portfolio is a passive management style with no active returns and residual risk constrained to be close to zero (see Equation (8.2.1)). While the indexed equity portfolio may underperform the benchmark after costs are considered, enhanced indexed portfolios are designed to provide an index-like performance plus some excess return after costs. The latter are allowed to relax the constraint on residual risk by slightly overweighting securities expected to perform well and slightly underweighting securities expected to perform poorly. This active portfolio incurs controlled anticipated residual risk at a level generally not exceeding 2%. Rather than placing hard constraint on the portfolio’s residual risk, active equity management seek portfolios 64 Quantitative Analytics with a natural level of residual risk based on the return opportunities available and consistent with the investor’s level of risk tolerance. The aim of most active equity portfolios is to generate attractive risk-adjusted returns (or alpha). While both the portfolio and the benchmark are defined in terms of constituent securities and their percentage weights, active equity portfolios have active weights (differ from their weights in the benchmark) giving rise to active returns measured as the difference between the returns of the actively managed equity portfolio and the returns of its benchmark. In general, an actively managed portfolio overweights the securities expected to perform the benchmark and underweights the securities expected to perform below the benchmark. In a long-only portfolio, while any security can be overweighted to achieve a significant positive active weight, the maximum attainable underweight is equal to the security’s weight in the underlying benchmark index which is achieved by not holding any of the security in the portfolio. As the weights of most securities in most benchmarks are very small, there is extremely limited opportunity to profit from underweighting unattractive securities in long-only portfolios. Allowing short-selling by relaxing the long-only constraint gives the investor more flexibility to underweight overvalued stocks and enhance the actively managed portfolio’s ability to produce attractive active equity returns. It also reduces the portfolio’s market exposure. Greater diversification across underweighted and overweighted opportunities should result in greater consistency of performance relative to the benchmark (see details in Section (7.2)). An active portfolio management tries to find under or overvalued stocks in order to achieve a significant profit when prices are rising or falling. Both trend measurement and portfolio allocation are part of momentum trading strategies. The former requires the selection of trend filtering techniques which can involve a pool of methods and the need for an aggregation procedure. This can be done through averaging or dynamic model selection. The resulting trend indicator can be used to analyse past data or to forecast future asset returns for a given horizon. The latter requires quantifying the size of each long or short position given a clear investment process. This process should account for the risk entailed by each position given the expected return. In general, individual risks are calculated in relation to asset volatility, while a correlation matrix aggregate those individual risks into a global portfolio risk. Note, rather than considering the correlation of assets one can also consider the correlation of each individual strategy. In any case, the distribution of these risks between assets or strategies remains an open problem. One would like the distribution to account for the individual risks, their correlations, and the expected return of each asset. Wagman [1999] provided a simple framework based on Genetic Programming (GP), which tries to find an optimal portfolio with recurrence to a simple technical analysis indicator, the moving average (MA). The approach starts by generating a set of random portfolios and the GP algorithm tries to converge in an optimal portfolio by using an evaluation function which considers the weight of each asset within the portfolio and the respective degree of satisfaction against the MA indicator, using different period parameters. Similarly, Yan [2003] and Yan et al. [2005] used a GP approach to find an optimal model to classify the stocks within the market. The top stocks adopt long positions while the bottom ones follows short positions. Their model is based on the employment of Fundamental Analysis which consists on studying the underlying forces of the economy to forecast the market development. In order to outperform a benchmark index by buying and selling properly selected assets, a portfolio manager must detect profitable opportunities. For instance, in the capital asset pricing model (CAPM), or extension to a multi-factor model (APT), the skill of a fund manager relies on accurate forecasts of the expected returns and systematic risk on all risky assets, and on the market portfolio. That is, conditional on the returns on the market portfolio and the risk free asset, and given forecasts of the systematic risks of risky assets, the fund manager must identify those assets presenting promising investment opportunities. As a result, markets need to be predictable in some way in order to apply successfully active management. Fortunately, we saw in Section (1.7.4) that there was substantial evidence showing that market returns and portfolio returns could be predicted from historical data. We also saw that the two most popular strategies in financial markets are the contrarian and the momentum strategies. The literature, which tries to explain the reasons behind why momentum exists, seems to be split into two categories: 1. behavioural explanations (irrational), 2. and market-based explanations (rational). 65 Quantitative Analytics The literature on behavioural explanations usually focuses around investors under-reacting to information such as news. This under-reaction can be manifested by either not reacting early enough or the actions that they take are insufficiently drastic in order to protect themselves from the volatility of the market. As a result, prices rise or fall for longer than would normally be expected by the market players. Market-based explanations regarding momentum are based around the fact that poor market performance can establish diminishing illiquidity, putting downward pressure on performance (see Smith [2012]). Another market-based explanation for momentum is that an investor’s appetite for risk changes over time. When the values of an investor’s assets are forced towards their base level of wealth, the investor begins to worry about further losses. This leads the investor to sell, putting downward pressures on prices, further lowering risk appetites and prices. Markets can therefore generate their own momentum when risk appetites fall or liquidity is low. In a study on the inequality of capital returns, Piketty [2013] stressed the importance of active portfolio management by showing that skilled portfolio managers could generate substantial additional profits. Analysing capital returns from the world’s richest persons ranked in Forbes magazine as well as the returns generated from donations to the US universities, he showed that the rate of return was proportional to the size of the initial capital invested. The net annualised rate of return of the wealthiest persons and universities is around 6 − 7% against 3 − 4% for the rest. The main reason being that a larger fraction of the capital could be invested in riskier assets, necessitating the services of skilled portfolio managers to identify and select in an optimum way the best portfolio. For instance, with about 30 billion dollars of donations invested in 2010, Harvard university obtained a rate of return of about 10.2% from 1980-2010. On the other hand, for roughly 500 universities out of 850 having a capital smaller or equal to 100 million dollars invested, they obtained a rate of return of about 6.2% from 1980-2010 (5.1% from 1990-2010). Universities investing over 1 billion dollars have 60% or more of their capital invested in risky assets, while for universities investing between 50 and 100 million dollars 25% of the capital is invested in risky assets, and for universities investing less that 50 million dollars only 10% is invested in risky assets. While Harvard university spent about 100 million dollars of management fees, which is 0.3% of 30 billion of dollars, it represents 10% for a university investing 1 billion dollars. Considering that a university pays between 0.5% and 1% of management fees, it would spend 5 million dollars to manage 1 billion dollars. A university such as North Iowa Community College which investing 11.5 million dollars, would spend 150, 000 dollars in management fees. 2.1.2 Asset allocation 2.1.2.1 Objectives and methods While the objective of investing is to increase the purchasing power of capital, the main goal of asset allocation is to improve the risk-reward trade-off in an investment portfolio. As explained by Darst [2003], investors pursue this objective by selecting an appropriate mix of asset classes and underlying investments based on • the investor’s needs and temperament • the characteristics of risk, return, and correlation coefficients of the assets under consideration in the portfolio • the financial market outlook The objective being 1. to increase the overall return from a portfolio for a given degree of risk, or, 2. to reduce the overall risk from the portfolio for a targeted level of return. For most investors asset allocation often means 1. calculating the rates of return from, standard deviations on, and correlations between, various asset classes 66 Quantitative Analytics 2. running these variables through a mean-variance optimisation program to select asset mixes with different riskreward profiles 3. analysing and implementing some version of the desired asset allocation in light of the institution’s goals, history, preferences, constraints, and other factors A disciplined asset allocation process tends to proceed in a series of sequential steps 1. investor examines and proposes some assumptions on future expected returns, risk, and the correlation of future returns between asset classes 2. investor selects asset classes that best match his profile and objectives with the maximum expected return for a given level of risk 3. investor establishes a long-term asset allocation policy (Strategic Asset Allocation (SAA)) reflecting the optimal long-term standard around which future asset mixes might be expected to vary 4. investor may decide to implement Tactical Asset Allocation (TAA) decisions against the broad guidelines of the Strategic Asset Allocation 5. investor will periodically rebalance the portfolio of assets, with sensitivity to the tax and transaction cost consequences of such rebalancing, taking account of the SAA framework 6. from time to time, the investor may carefully review the SAA itself to ensure overall appropriateness given current circumstances, frame of mind, the outlook for each of the respective asset classes, and overall expectations for the financial markets Asset allocation seeks, through diversification, to provide higher returns with lower risk over a sufficiently long time frame and to appropriately compensate the investor for bearing non-diversifiable volatility. Some of the foundations of asset allocation are related to • the asset - such as the selection of asset classes, the assessment of asset characteristics, the evaluation of the outlook for each asset class • the market - such as gauging divergence, scenario analysis, risk estimation • the investor - such as investor circumstances review, models efficacy analysis, application of judgment While the scope of asset allocation for any investor defines his universe of investment activity, the types of asset allocation are classified according their style, orientation, and inputs and can be combined accordingly • The style of an asset allocation can be described as conservative, moderate, or aggressive (cash, bonds, equities, derivatives). A conservative style should exhibit lower price volatility (measured by the standard deviation of returns from the portfolio), and generate a greater proportion of its returns in the form of dividend and interest income. An aggressive style may exhibit higher price volatility and generate a greater proportion of its returns in the form of capital gains. • The orientation type can be described as strategic, tactical, or a blend of the two. A strategic asset allocation (SAA) attempts to establish the best long-term mix of assets for the investor, with relatively less focus on short-term market fluctuations. It helps determine which asset classes to include in the long-term asset mix. Some investors may adopt a primarily tactical approach to asset allocation by viewing the long term as an ongoing series of short term time frames. Others can use TAA to either reinforce or counteract the portfolio’s strategic allocation policies. Owing to the price-aware, opportunistic nature of TAA, special forms of tactical risk management can include price alerts, limit and stop-loss orders, simultaneous transaction techniques, and value-at-risk (VaR) models. While SAA allows investors to map out a long-term plan, TAA helps investors to anticipate and respond to significant shifts in asset prices. 67 Quantitative Analytics • Investors can use different inputs to formulate the percentages of the overall portfolio that they will invest in each asset class. These percentages can be determined with the help of quantitative models, qualitative judgements, or a combination of both. The quantitative approach consists in selecting the asset classes and subclasses for the portfolio, propose assumptions on future expected returns, risk of the asset classes, correlations of future expected returns between each pair of asset classes. Then, portfolio optimisation program can generate a set of possible asset allocations, each with its own level of expected risk and return. As a result, investors can select a series of Efficient Frontier asset allocation showing portfolios with the minimum risk for a given level of expected return. Investors may then decide to set upper and lower percentage limits on the maximum and minimum amounts allowed in the portfolio by imposing constraints on the optimisation. Qualitative asset allocation assesses fundamental measures, valuation measures, psychology and liquidity measures. These assessments, carried out on an absolute basis and relative to long-term historical averages, are often expressed in terms of the number of standard deviations above or below their long-term mean. 2.1.2.2 Active portfolio strategies The use of predetermined variables to predict asset returns in view of constructing optimum portfolios, has produced new insights into asset pricing models which have been applied on improving existing policies based upon unconditional estimates. Several strategies exist in taking advantage of market predictability in view of generating excess return. Extending Sharpe’s CAPM [1964] to account for the presence of pervasive risk, Fama et al. [1992] decomposed portfolio returns into: • systematic market risk, • systematic style risk, and, • specific risk. As a result, a new classification of active portfolio strategies appears where • Market Timing or Tactical Asset Allocation (TAA) strategies aim at exploiting evidence of predictability in market factors, while, • Style Timing or Tactical Style Allocation (TSA) strategies aim at exploiting evidence of predictability in style factors, and, • Stock Picking (SP) strategies are based on stock specific risk. As early as the 1970s, Tactical Asset Allocation (TAA) was considered as a way of allocating wealth between two asset classes, typically shifting between stocks and bonds. It is a style timing strategy, that is, a dynamic investment strategy actively adjusting a portfolio’s asset allocation in view of improving the risk-adjusted returns of passive management investing. The objectives being to maximise total return on investment, limit risk, and maintain an appropriate degree of portfolio diversification. Systematic TAA use quantitative investment models such as trend following or relative strength techniques, capitalising on momentum, to exploit inefficiencies and produce excess returns. Market timing is another form of asset allocation where investors attempt to time the market by adding funds to or withdrawing funds from the asset class in question according to a periodic schedule, seeking to take advantage of downward or upward price fluctuations. Momentum strategies are examples of market timing. For instance, momentum strategies try to benefit from either market trends or market cycles. Being an investment style based only on the history of past prices, one can identify two types of momentum strategies: 1. On one hand the trend following strategy consisting in buying (or selling) an asset when the estimated price trend is positive (or negative). 68 Quantitative Analytics 2. On the other hand the contrarian (or mean-reverting) strategy consisting in selling (or buying) an asset when the estimated price trend is positive (or negative). For example, earning momentum strategies involve buying the shares of companies exhibiting strong growth in reported earnings, and selling shares experiencing a slowdown in the rate of growth in earnings. Similarly, price momentum strategies are based on buying shares with increasing prices, and selling shares with declining prices. Note, such momentum based methods involves high rate of portfolio turnover and trading activity, and can be quite risky. Stock Selection criteria or Stock Picking strategies aim at exploiting evidence of predictability in individual stock specific risk. Perhaps one of the most popular stock picking strategies is that of the long/short with the majority of equity managers still favouring this strategy to generate returns. The stock investment or position can be long to benefit from a stock price increase or short to benefit from a stock price decrease, depending on the investor’s expectation of how the stock price is going to move. The stock selection criteria may include systematic stock picking methods utilising computer software and/or data. Note, most mutual fund managers actually make discretionary, and sometimes unintended, bets on styles as much as they make bets on stocks. In other words, they perform tactical asset allocation (TAA), tactical style allocation (TSA) and stock picking (SP) at the same time. 2.1.2.3 A review of asset allocation techniques We present a few allocation techniques among the numerous methodologies developed in the financial literature. For more details see text book by Meucci [2005]. • Equally-weighted is the simplest allocation algorithm, where the same weight is attributed to each strategy. It is used as a benchmark for other allocation methods. • Inverse volatility consists of weighting the strategies in proportion to the inverse of their volatility, that is, it takes a large exposure to assets with low volatility. • Minimum variance seeks at building a portfolio such that the overall variance is minimal. If the correlation between all assets in the basket is null, the minimum variance will allocate everything to the lowest volatility asset, resulting in poor diversification. • Improved minimum variance improves the portfolio’s covariance by using a correlation matrix based on the Speaman correlation which is calculated on the ranks of the variables and tends to be a more reliable estimate of correlation. • Minimum value-at-risk (VaR) seeks to build a portfolio such that the overall VaR is minimal. The marginal distribution of each strategy is measured empirically and the relationship between the strategies is modelled by the Gaussian copula which consider a single correlation coefficient. • Minimum expected shortfall seeks to build a portfolio such that the overall expected shortfall (average risk above the VaR) is minimal. • Equity-weighted risk contribution (ERC) seeks to equalise the risk contribution of each strategy. The risk contribution of a strategy is the share of the total portfolio risk due to the strategy represented by the product of the standard deviation and correlation with the portfolio. • Factor based minimum variance applies the minimum variance method on a covariance matrix reduced to the first three factors of a rolling principal component analysis (PCA). • Factor based ERC applies the ERC method on a covariance matrix reduced to the first three factors of a rolling PCA. 69 Quantitative Analytics Optimal portfolios are designed to offer best risk metrics by computing estimates of future covariances and risk metrics measured by looking at past data over a certain rolling window. However, future returns may vary widely from the past and strategies may subsequently fail. Investors have preferences in terms of risk, return, and diversification. One can classify the allocation strategies into two groups: 1. the low volatility allocation techniques (inverse volatility, minimum variance), 2. and the strong performance allocation techniques (equally-weighted allocation, minimum VaR, minimum expected shortfall). While low volatility techniques deliver the best risk metrics once adjusted for volatility, strong performance techniques, such as minimum VaR and shortfall, lead to higher extreme risks. Techniques such as inverse volatility and minimum variance reduce risk and improve Sharpe ratios, mostly by steering away from the most volatile strategies at the right time. But in some circumstances this is done at the cost of lower diversification. Note, getting away from too volatile strategies by reducing the scope of the portfolio may be preferable. While the equally weighted allocation is the most diversified allocation strategy, equal risk contribution offers an attractive combination of low risk and high returns. 2.1.3 Presenting some trading strategies 2.1.3.1 Some examples of behavioural strategies For applications of behavioural finance such as bubbles and other anomalies see Shiller [2000]. To summarise, the bubble story states that shifting investor sentiment over time creates periods of overvaluation and undervaluation in the aggregate equity market level that a contrarian market timer can exploit. In addition, varying investor sentiment across individual stocks creates cross-sectional opportunities that a contrarian stock-picker can exploit. However, short-term market timers may also join the bandwagon while the bubble keeps growing (there is a cross-sectional counterpart for this behaviour). Specifically, momentum-based stock selection strategies involving buying recent winners appear profitable. Cross-sectional trading strategies may be relatively value oriented (buy low, sell high) or momentum oriented (buy rising stocks, sell falling ones), and they may be applied within one market or across many asset markets. Micro-inefficiency refers to either the rare extreme case of riskless arbitrage opportunities or the more plausible case of risky trades and strategies with attractive reward-to-risk ratios. Note, cross-sectional opportunities are safer to exploit than market directional opportunities since one can hedge away directional risk and diversify specific risk much more effectively. Also, the value effect refers to the pattern that value stocks. For instance, those with low valuation ratios (low price/earnings, price/cash flow, price/sales, price/dividend, price/book value ratios) tend to offer higher long-run average return than growth stocks or glamour stocks with high valuation ratios. Some of the most important biases of behavioural finance are 1. momentum, 2. and reversal effects. DeBondt et al. [1985] found stocks that had underperformed in the previous 12 to 36 months tended to subsequently outperform the market. Jegadeesh et al. [1993] found a short to medium term momentum effect where stocks that had outperformed in recent months tended to keep outperforming up to 12 months ahead. In addition, time series evidence suggests that many financial time series exhibit positive autocorrelation over short horizons and negative autocorrelation over multi-year horizons. As a result, trend following strategies are profitable for many risky assets in the short run, while value strategies, which may in part rely on long-term (relative) mean reversion, are profitable in the long run. Momentum and value strategies also appear to be profitable when applied across countries, within other asset classes, and across asset classes (global tactical asset allocation) but with different time horizons. It seems that behavioural finance was better equipped than rational finance to explain the combination of momentum patterns up to 12 months followed by reversal patterns beyond 12 months. Other models relying on different behavioural errors were developed to explain observed momentum and reversal patterns. Assuming that noise traders follow positive 70 Quantitative Analytics feedback strategies (buying recent winners and selling recent losers) which could reflect extrapolative expectations, stop-loss orders, margin calls, portfolio insurance, wealth dependent risk aversion or sentiment, De Long et al. [1990] developed a formal model to predict both short-term momentum and long-term reversal. Positive feedback trading creates short-term momentum and price over-reaction with eventual return toward fundamental values creating longterm price reversal. Hong et al. [1999] developed a model relying on the interaction between two not-fully rational investor groups, news-watchers and momentum traders, under condition of heterogeneous information. Slow diffusion of private information across news-watchers creates underreaction and momentum effects. That is, momentum traders jumping on the bandwagon when observing trends in the hope to profit from the continued diffusion of information, generating further momentum and causing prices to over-react beyond fundamental values. All these models use behavioural finance to explain long-term reversal as a return toward fundamental values as a correction to over-reation. 2.1.3.2 Some examples of market neutral strategies As described by Guthrie [2006], equity market neutral hedge funds buy and sell stocks with the goal of neutralising exposure to the market, while capturing a positive return, regardless of the market’s direction. It includes different equity strategies with varying degrees of volatility seeking to exploit the market inefficiencies. This is in direct contradiction with the efficient market hypothesis (EMH) (see Section (1.7.2)). The main strategy involves simultaneously holding matched long and short stock positions, taking advantage of relatively under-priced and over-priced stocks. The spread between the performance of the longs and the shorts, and the interest earned from the short rebate, provides the primary return for this strategy. An equity market neutral strategy can be established in terms of dollar amount, beta, country, currency, industry or sector, market capitalisation, style, and other factors or a combination thereof. The three basic steps to build a market neutral strategy are 1. Select the universe: The universe consists of all equity securities that are candidates for the portfolio in one or more industry sectors, spanning one or more stock exchanges. The stock in the universe should have sufficient liquidity so that entering and exiting positions can be done quickly, and it should be feasible to sell stocks short. with reasonable borrowing cost. 2. Generate a forecast: Fund managers use proprietary trading models to generate potential trades. The algorithms should indicate each trade’s expected return and risk, and implementation costs should be included when determining the net risk-return profile. 3. Construct the portfolio: In the portfolio construction process, the manager assigns weights (both positive and negative) to each security in the universe. There are different portfolio construction techniques, but in any case risk management issues must be considered. For instance, the maximum exposure to any single security or sector, and the appropriate amount of leverage to be employed. One can distinguish two main approaches to equity market neutral: 1. the statistical arbitrage, 2. and the fundamental arbitrage which can be combined. Statistical arbitrage involves model-based, short-term trading using quantitative and technical analysis to detect profit opportunities. A particular type of arbitrage opportunity is hypothesised, formalised into a set of trading rules and back-tested with historical data. This way, the manager hopes to discover a persistent and statistically significant method to detect profit opportunities. Three typical statistical arbitrage techniques are 1. Pairs or peer group involves simultaneously buying and selling short stocks of companies in the same economic sector or peer group. Typical correlations are measured and positions are established when current prices fall outside of a normal band. Position sizes can be weighted to achieve dollar, beta, or volatility neutrality. Positions are closed when prices revert to the normal range or when stop losses are breached. Portfolios of multiple pair trades are blended to reduce stock specific risk. 71 Quantitative Analytics 2. Stub trading involves simultaneously buying and selling short stocks of a parent company and its subsidiaries, depending on short-term discrepancies in market valuation versus actual stock ownership. Position sizes are typically weighted by percentage ownership. 3. Multi-class trading involves simultaneously buying and selling short different classes of stocks of the same company, typically voting and non-voting or multi-volting and single-volting share classes. Much like pairs trading, typical correlations are measured and positions are established when current prices fall outside of a normal band. Fundamental arbitrage consists mainly of building portfolios in certain industries by buying the strongest companies and selling short companies showing signs of weakness. Even though the analysis is mainly fundamental and less quantitative than statistical arbitrage, some managers use technical and price momentum indicators (moving averages, relative strength and trading volume) to help them in their decision making. Fundamental factors used in the analysis include valuation ratios (price/earnings, price/cash flow, price/earnings before interest and tax, price/book), discounted cash flows, return on equity, operating margins and other indicators. Portfolio turnover is generally lower than in statistical arbitrage as the signals are stronger but change less frequently. Among the factors contributing to the different sources of return are • No index constraint: Equity market neutral removes the index constraints limiting the buy-and-hold market participants. Selling a stock short is different from not owning a stock in the index, since the weight of the short position is limited only by the manager’s forecast accuracy, confidence and ability to offset market risk with long positions. • Inefficiencies in short selling: Significant inefficiencies are available in selling stocks short. • Time arbitrage: Equity market neutral involves a time arbitrage for short-term traders at the expense of longterm investors. With higher turnover and more frequent signals, the equity market neutral manager can often profit at the expense of the long-term equity investor. • Additional active return potential: Equity market neutral involves double the market exposure by being both long and short stocks. At a minimum, two dollars are at work for every one dollar of invested capital. Hence, a market neutral manager has the potential to generate more returns than the active return of a long-only equity manager. • Managing volatility: Through an integrated optimisation, the co-relationship between all stocks in an index can be exploited. Depending on the dispersion of stock returns, risk can be significantly reduced by systematically reweighting positions to profit from offsetting volatility. Reducing volatility allows for leverage to be used, which is an additional source of return. • Profit potential in all market conditions: By managing a relatively fixed volatility portfolio, an equity market neutral manager may have an advantage over a long-only equity manager allowing him to remain fully invested in all market conditions. The key risk factors of an equity market neutral strategy are • Unintended beta mismatch: Long and short equity portfolios can easily be dollar neutral, but not beta neutral. Reaction to large market movements is therefore unpredictable, as one side of the portfolio will behave differently than the other. • Unintended factor mismatch: Long and Short equity portfolios can be both dollar neutral and beta neutral, but severely mismatched on other important factors (liquidity, turnover, value/growth, market capitalisation). Again, large market moves will affect one side of the portfolio differently from the other. 72 Quantitative Analytics • Model risk: All risk exposures of the model should be assessed to prevent bad forecast generation, and practical implementation issues should be considered. For instance, even if the model indicates that a certain stock should be shorted at a particular instant in time, this may not be feasible due to the uptick rule. Finally, the effectiveness of the model may diminish as the market environment changes. • Changes in volatility: The total volatility of a market neutral position depends on the volatility of each position, so that the manager must carefully assess the volatility of each long and short position as well as the relationship between them. • Low interest rates: As part of the return from an equity market neutral strategy is due to the interest earned on the proceeds from a short sale (rebate), a lower interest rate environment places more pressure on the other return sources of this strategy. • Higher borrowing costs for stock lending: Higher borrowing costs cause friction on the short stock side, and decreases the number of market neutral opportunities available. • Short squeeze: A sudden increase in the price of a stock that is heavily shorted will cause short sellers to scramble to cover their positions, resulting in a further increase in price. • Currency risk: Buying and selling stocks in multiple countries may create currency risk for an equity market neutral fund. The cost of hedging, or not hedging, can significantly affect the fund’s return. • Lack of rebalancing risk: The success of a market neutral fund is contingent on constantly rebalancing the portfolio to reflect current market conditions. Failure to rebalance the portfolio is a primary risk of the strategy. 2.1.3.3 Predicting changes in business cycles We saw in Section (2.1.3) that there are evidence in the market for different equity styles to perform better at different points in time. For instance, the stock market can be divided into two types of stocks, value and growth where value stocks are bargain or out-of-favour stocks that are inexpensive relative to company earnings or assets, and growth stocks represent companies with rapidly expanding earnings growth. Hence, an investment style which is based around growth searches for investments whose returns are expected to grow at a faster pace than the rest of the market, while the value style of investment seeks to find investments that are thought to be under-priced. Investors have an intuitive understanding that equity indexes have contrasted performance at different points of the business cycle. Historically, value investing tends to be more prominent in periods when the economy is experiencing a recession, while growth investing is performing better during times of economic booms (BlackRock, 2013). As a result, excess returns are produced by value and growth styles at different points within the business cycle since growth assets and sectors are affected in a different way than their value equivalents. Therefore, predicting the changes in the business cycle is very important as it has a direct impact on the tactical style allocation decisions. There are actually two approaches which can be considered when predicting these changes: • One approach consists in forecasting returns by first forecasting the values of various economic variables (scenarios on the contemporaneous variables). • The other approach to forecasting returns is based on anticipating market reactions to known economic variables (econometric model with lagged variables). A number of academic studies (see Bernard et al. [1989]) suggested that the reaction of market participants to known variables was easier to predict than financial and economic factors. The performance of timing decisions based on an econometric model with lagged variables results from a better ability to process available information, as opposed to privileged access to private information. This makes a strong case towards using time series modelling in order to gain insights into the momentum that a market exhibits. Therefore, the objective of a Systematic Tactical Allocator is to set up an econometric model capable of predicting the time when a given Style is going to outperform other Styles. 73 Quantitative Analytics For instance, using a robust multi-factor recursive modelling approach, Amenc et al. [2003] found strong evidence of predictability in value and size style differentials. Since forecasting returns based on anticipating market reactions to known economic variables is more favourable than trying to forecast financial or economic factors, econometric models which include lagged variables are usually used. This type of modelling is usually associated with univariate time series models but can be extended to account for cross-sections. These types of models attempt at predicting variables using only the information contained in their own past values. The class of time series models one should first consider is the ARMA/ARIMA family of univariate time series models. These types of models are usually atheoretical therefore their construction is not based on any underlying theoretical model describing the behaviour of a particular variable. ARMA/ARIMA models try to capture any empirically relevant features of the data, and can be used to forecast past stock returns as well as to improve the signals associated with time series momentum strategies. More sophisticated models, such as Exponential Smoothing models and more generally State-Space models models can also be used. 2.1.4 Risk premia investing As discussed in Section (1.5.3), a large range of effective multi-factor models exist to explain realised return variation over time. A different approach is to use multi-factor models directly on strategies. Risk premia investing is a way of improving asset allocation decisions with the goal of delivering a more dependable and less volatile investment return. This new approach is about allocating investment to strategies rather than to assets (see Ilmanen [2011]). Traditional portfolio allocation such as a 60/40 allocation between equities and bonds remain volatile and dominated by equity risk. Risk premia investing introduce a different approach to portfolio diversification by constructing portfolios using available risk premia within the traditional asset classes or risk premia from systematic trading strategies rather than focusing on classic risk premia, such as equities and bonds. Correlations between many risk premia have historically been low, offering significant diversification potential, particularly during periods of distress (see Bender et al [2010]). There is a large selection of risk premia strategies across assets covering equities, bonds, credit, currency and derivative markets, and using risk-return characteristics, most of them can be classified as either income, momentum, or relative value. 1. Income strategies aim at receiving a certain steady flow of money, typically in the form of interest rates or dividend payments. These strategies are often exposed to large losses during confidence crises, when the expected income no longer offsets the risk of holding the instruments. Credit carry, VIX contango, variance swap strategies, and volatility premium strategy, equity value, dividend and size, FX carry, the rates roll-down strategy, and volatility tail-event strategies belongs to that grouping. 2. Momentum strategies are designed to bring significant gains in market downturns, whilst maintaining a decent performance in other circumstances. For example, CTA-type momentum strategies perform well when markets rise or fall significantly. An equity overwriting strategy performs best when stock prices fall, and still benefits from the option premia in other circumstances. Equity/rates/FX momentum, quality equity, overwriting, and interest rates carry belongs to that grouping. Further, a momentum system has a lot in common with a strategy that buys options and can be used as a hedge during crisis (see Ungari [2013]). 3. Relative value outright systematic alpha strategies based on market anomalies and inefficiencies, for example convertible arbitrage and dividend swaps. Such discrepancies are expected to correct over a time frame varying from a few days for technical strategies to a few months or even years for more fundamental strategies. These categories represent distinct investment styles which is a key component in understanding risk premia payoffs and can be compared to risk factors in traditional asset classes. Portfolio managers have always tried to reap a reward for bearing extra risk, and risk premia investing is one way forward since risk premium has • demonstrated an attractive positive historical return profile • fundamental value allowing for a judgement on future expected returns 74 Quantitative Analytics • some diversification benefits when combined with multi-asset portfolio The basic concept recognises that assets are driven by a set of common risk factors for which the investor typically gets paid and, by controlling and timing exposures to these risk factors the investor can deliver a superior and more robust outcome than through more traditional forms of asset allocation (see Clarke et al. [2005]). Principal Components Analysis (PCA), which is an efficient way of summing up the information conveyed by a correlation matrix, is generally used to determine the main drivers of the strategy. For instance, in order to assess the performances of risk premia investing, Turc et al. [2013] compiled two equity portfolios based on the same five factors (value, momentum, size, quality and yield). The former is an equal-weighted combination of the five factors in the form of risk premia indices, and the latter is a quant specific model with a quantitative stock selection process scoring each stock on a combination of the five factors and creating a long-short portfolio. Using PCA, they identified three risk factors to which each strategy is exposed, market crisis, equity direction, and volatility premium. In their study, the traditional equity quant portfolio outperformed by far the combined risk premia approach. Nonetheless, when comparing the two approaches, most risk premia are transparent, easy of access, and obtained through taking a longer term view exploiting the short term consideration of other active market participants. An important issue with risk premia strategies is the way in which they are combined, as their performance and behaviour are linked to the common factors, making them difficult to implement. In the equity market, returns are expressed on a long-short basis, adding a significant amount of cost and complexity, as portfolios are often rebalanced to such a degree that annual turnover rates not only eat into returns, but also involve a considerable amount of portfolio management. Capacity constraints are another concern faced by many portfolio managers. In order to compare risk premia strategies across different asset classes, one need to use a variety of risk metrics based on past returns such as volatility, skew and kurtosis. The skewness is a measure of the symmetry of a distribution, such that a negative skew means that the most extreme movements are on the downside. On the other hand, a strategy with a positive skew is more likely to make large gains than suffer large loss. Kurtosis is a measure of extreme risk, and a high kurtosis indicates potential fat-tails, that is, a tendency to post unusually large returns, whether either on the upside or the downside. Practitioners compares some standard performance ratios and statistics commonly used in asset management including the Sharpe ratio (returns divided by volatility), the Sortino ratio (returns divided by downside volatility), maximum drawdown and time to recovery, or measures designed to evaluate extreme risks such as value-at-risk and expected shortfall. 2.1.5 Introducing technical analysis 2.1.5.1 Defining technical analysis We saw in Section (1.7.2) that the accumulating evidence against the efficiency of the market has caused a resurgence of interest in the claims of technical analysis as the belief that the distribution of price dynamics is totally random is now being questioned. There exists a large body of work on the mathematical analysis of the behaviour of stock prices, stock markets and successful strategies for trading in these environments. While investing involves the study of the basic market fundamentals which may take several years to be reflected in the market, trading involves the study of technical factors governing short-term market movements together with the behaviour of the market. As a result, trading is riskier than long-term investing, but it offers opportunities for greater profits (see Hill et al. [2000]). Technical analysis is about market traders studying market price history with the view of predicting future price changes in order to enhance trading profitability. Technical trading rules involve the use of technical analysis to design indicators that help a trader determine whether current behaviour is indicative of a particular trend, together with the timing of a potential future trade. As a result, in order to apply Technical Analysis, which tries to analyse the securities past performance in view of evaluating possible future investments, we must assume that the historical data in the markets forms appropriate indications about the market future performance. Technical Analysis relies on three principles (see Murphy [1999]) 75 Quantitative Analytics 1. market action discounts everything 2. prices move in trends or are contrarian 3. history tends to repeat itself Hence, by analysing financial data and studying charts, we can anticipate which way the market is most likely to go. That is, even though we do not know when we pick a specific stock if its price is going to rise or fall, we can use technical indicators to give us a future perspective on its behaviour in order to determine the best choice when building a portfolio. Technical indicators try to capture the behaviour and investment psychology in order to determine if a stock is under or overvalued. For instance, in order to classify each stock within the market, we can employ a set of rules based on technical indicators applied to the asset’s prices, their volumes, and/or other financial factors. Based on entry/exit signals and other plot characteristics, we can define different rules allowing us to score the distinct stocks within the market and subsequently pick the best securities according to the indicator employed. However, there are several problems occurring when using technical indicators. There is no better indicator, so that the indicators should be combined in order to provide different perspectives. Further, a technical indicator always need to be applied to a time window, and determining the best time window is a complex task. For instance, the problem of determining the best time window can be the solution to an optimisation problem (see Fernandez-Blanco et al. [2008]). New techniques combining elements of learning, evolution and adaptation from the field of Computational Intelligence developed, aiming at generating profitable portfolios by using technical analysis indicators in an automated way. In particular, subjects such as Neural Networks (28), Swarm Intelligence, Fuzzy Systems and Evolutionary Computation can be applied to financial markets in a variety of ways such as predicting the future movement of stock’s price or optimising a collection of investment assets (funds and portfolios). These techniques assume that there exist patterns in stock returns and that they can be exploited by analysis of the history of stock prices, returns, and other key indicators (see Schwager [1996]). With the fast increase of technology in computer science, new techniques can be applied to financial markets in view of developing applications capable of automatically manage a portfolio. Consequently, there is substantial interest and possible incentive in developing automated programs that would trade in the market much like a technical trader would, and have it relatively autonomous. A mechanical trading systems (MTS), founded on technical analysis, is a mathematically defined algorithm designed to help the user make objective trading decisions based on historically reoccurring events. Some of the reasons why a trader should use a trading systems are • continuous and simultaneous multimarket analysis • elimination of human emotions • back test and verification capabilities Mechanical system traders assume that the trending nature of the markets can be understood through the use of mathematical formulas. For instance, properly filtering time series by removing the noise (congestion), they recover the trend which is analysed in view of inferring trading signals. Assuming that assets are in a continuous state of flux, a single system can profitably trade many markets allowing a trader to be exposed to different markets without fully understanding the nuances of all the individual markets. Since MTS can be verified and analysed with accuracy through back testing, they are very popular. Commodity Trading Advisors (CTA) use systems due to their ease of use, non-emotional factor, and their ability to be used as a foundation for an entire trading platform. Everything being mathematically defined, a CTA can demonstrate a hypothetical track record based on the different needs of his client and customise a specific trading plan. However, one has to make sure the the system is not over-fitting the data in the back test. A system must have robust parameters, that is, parameters not curve fitted to historical data. Hence, one must understand the logic and mathematics behind a system. Unlike actual performance records, simulated results do not represent actual trading. As a rule of thumb, one should expect only one half of the total profit and twice the maximum draw down of a hypothetical track record. 76 Quantitative Analytics 2.1.5.2 Presenting a few trading indicators Any mechanical trading system (MTS) must have some consistent method or trigger for entering and exiting the market based on some type of indicator or mathematical statistics with price forecasting capability. Anything that indicates what the future may hold is an indicator. Most system traders and developers spend 90% of their time developing entry and exit technique, and the rest of their time is dedicated to the decision process determining profitability. Some of the most popular indicators include moving average, rate of change, momentum, stochastic (Lane 1950), Relative Strength Iindex (RSI) (see Wilder [1978]), moving average convergence divergence (MACD) (see Appel [1999]), Donchian breakout, Bollinger bands, Keltner bands (see Keltner [1960]). However, indicators can not stand alone, and should be used in concert with other ideas and logic. There is a large list of indicators with price forecasting capability and we will describe a few of them. For more details we refer the reader to Hill et al. [2000]. • In the 50s Lane introduced an oscillatoring type of indicator called Stochastics that compares the current market close to the range of prices over a specific time period, indicating when a market is overbought or oversold (see Lane [1984]). This indicator is based on the assumption that when an uptrend/downtrend approaches a turning point, the closing prices start moving away from the high/low price of a specific range. The number generated by this indicator is a percentage in the range [0, 100] such that for a reading of 70 or more it indicates that the close is near the high of the range. A reading of 30 or below indicates the close is near the low of the range. Note, in general the values of the indicator are smoothed with a moving average (MA). • The Donchian breakout is an envelope indicator involving two lines that are plotted above and below the market. The top line represents the highest high of n days back (or weeks) and conversely the bottom line represents the lowest low of n days back. The idea being buying when the day’s high penetrates the highest high of four weeks back and selling when the day’s low penetrates the lowest low of four weeks back. • The Moving Average Crossover involves two or more moving averages usually consisting of a longer-term and shorter-term average. When the short-term MA crosses from below the long-term MA, it usually indicates a buying opportunity, and selling opportunities occur when the shorter-term MA crosses from above the longerterm MA. Moving averages can be calculated as simple, exponential, and weighted average. Exponential and weighted MAs tend to skew the moving averages toward the most recent prices, increasing volatility. • In the 70s Appel developed another price oscillator called the moving average convergence divergence (MACD) which is derived from three different exponentially smoothed moving averages (see Appel et al. [2008]). It is plotted as two different lines, the first line (MACD line) being the difference between the two MAs (long-term and short-term MAs), and the second line (signal or trigger line) being an exponentially smoothed MA of the MACD line. Note, the difference (or divergence) between the MACD line and the signal line is shown as a bar graph. The purpose being to try to eliminate the lag associated with MA type systems. This is done by anticipating the MA crossover and taking action before the actual crossover. The system buys when the MACD line crosses the signal line from below and sells when the MACD line crosses the signal line from above. • As an example of channel trading, Keltner [1960] proposed a system called the 10-day moving average rule using a constant width channel to time buy-sell signals with the following rules 1. compute the daily average price high+low+close . 3 2. compute a 10-day average of the daily average price. 3. compute a 10-day average of the daily range. 4. add and subtract the daily average range from the 10-day moving average to form a band or channel. 5. buy when the market penetrates the upper band and sell when it breaks the lower band. While this system is buying on the strength and selling on weakness, some practitioners have modified the rules as follow 77 Quantitative Analytics 1. instead of buying at the upper band, you sell and vice versa. 2. the number of days are changed to a three-day average with bands around that average. • The Donchian channel is an indicator formed by taking the highest high and the lowest low of the last n periods. The area between the high and the low is the channel for the period chosen. While it is an indicator of volatility of a market price, it is used for providing signals for long and short positions. If a security trades above its highest n periods high, then a long is established, otherwise if it trades below the lowest n periods, a short is established. • The Bollinger bands, also called alpha-beta bands, usually uses 20 or more days in its calculations and does not oscillate around a fixed point. It consist of three lines, where the middle line is a simple moving average and the outside lines are plus or minus two (that number can vary) standard deviations above and below the MA. A typical BB type system buys when price reaches the bottom and liquidates as the price moves up past the MA. The sell side is simply the opposite. It is assumed that when a price goes beyond two standard deviations it should revert to the MA. Note, some practitioners revert the logic and sell rather than buy when prices reach the lower band, and vice versa with the upper band. Alternatively, one can use a 20-day MA with one and two standard deviations above and below the MA. Looking at the chart we can deduce trend, volatility, and overbought/oversold conditions. A market above one standard deviation is overbought, and it becomes extremely overbought above two standard deviation. That is, most underlyings will pullback to the average even in strongly trending markets. Further, with narrow bands we should buy volatility (calls and puts) and when the bands are widening we should sell volatility. Considering projected charts to map future market activity, Drummond et al. [1999] introduced the Drummond Geometry (DG) which is both a trend-following and a congestion-action methodology, leading rather than lagging the market. It tries to foretell the most likely scenario that shows the highest probability of occurring in the immediate future and can be custom fitted to one’s personality and trading style. The key elements of DG include a combination of the following three basic categories of trading tools and techniques 1. a series of short-term moving averages 2. short-term trend lines 3. multiple time-period overlays The concept of Point and Line (PL) reflecting how all of life moves from one extreme to another, flowing back and forth in a cyclical or wave-like manner, is applied to the market. The PLdot (average of the high, low, and close of the last three bars) is a short-term MA based on three bars (or time periods) of data capturing the trend/nontrend activity of the time frame that is being charted. It represent the center of all market activity. The PLdot is very sensitive to trending markets, it is also very quick at registering the change of a market out of congestion (noise) into trend, and it is sensitive to ending trend. Since pattern is defined as a predictable route or movement, all trading systems are pattern recognition systems. For instance, a long-term moving average cross over system uses pattern recognition, the crossover, in its decision to buy or sell. Similarly, an open range breakout is pattern recognition given by the movement from the open to the breakout point. All systems look for some type of reoccurring event and try to capitalise on it. Hill demonstrated the success of pattern recognition when used as a filter. The system was developed around the idea of a pattern consisting of the last four days’ closing prices. A buy or sell signal is not generated unless the range of the past four days’ closes is less than the 30-day average true range, indicating that the market has reached a state of rest and any movement, up or down, from this state will most likely result in a significant move. 78 Quantitative Analytics Eventually, we want to develop an approach into a comprehensive, effective, trading methodology that combines analytical sophistication with tradable rules and principles. One way forward is to consider a multiple time frame approach. A time frame is any regular sampling of prices in a time series, from the smallest such as one minute up to the longest capped out at ten year. The multiple time frame approach has proven to be a fundamental advance in the field of TA allowing for significant improvement in trading results. For instance, if market analysis is coordinated to show the interaction of these time frames, then the trader can monitor what happens when the support and resistance lines of the different time frames coincide. Assuming we are interested in analysing the potential of the integration of time frames, then we need to look at both a higher time frame and a lower time frame. 2.1.5.3 The limitation of indicators Since each indicator has a significant failure rate, the random nature of price change being one reason why indicators fail, Chande et al. [1994] explained how most traders developed several indicators to analyse prices. Traders use multiple indicators to confirm the signal of one indicator with respect to another one, believing that the consensus is more likely to be correct. However, this is not a viable approach due to the strong similarities existing between price based momentum indicators. In general, momentum based indicators fail most of the time because • none of them is a pure momentum oscillator that measures momentum directly. • the time period of the calculations is fixed, giving a different picture of market action for different time periods. • they all mirror the price pattern, so that it may be better trading prices themselves. • they do not consistently show extremes in prices because they use a constant time period. • the smoothing mechanism introduces lags and obscures short-term price extremes that are valuable for trading. 2.1.5.4 The risk of overfitting While a simplified representation of reality can either be descriptive or predictive in nature, or both, financial models are predictive to forecast unknown or future values based on current or known values using mathematical equations or set of rules. However, the forecasting power of a model is limited by the appropriateness of the inputs and assumptions so that one must identify the sources of model risk to understand these limitations. Model risk generally occurs as a result of incorrect assumptions, model identification or specification errors, inappropriate estimation procedures, or in models used without satisfactory out-of-sample testing. For instance, some models can be very sensitive to small changes in inputs, resulting in big changes in outputs. Further, a model may be overfitted, meaning that it captures the underlying structure or the dynamics in the data as well as random noise. This generally occurs when too many model parameters are used, restricting the degrees of freedom relative to the size of the sample data. It often results in good in-sample fit but poor out-of-sample behaviour. Hence, while an incorrect or misspecified model can be made to fit the available data by systematically searching the parameter space, it does not have a descriptive or predictive power. Familiar examples of such problems include the spurious correlations popularised in the media, where over the past 30 years when the winner of the Super Bowl championship in American football is from a particular league, a leading stock market index historically goes up in the following months. Similar examples are plentiful in economics and the social sciences, where data are often relatively sparse but models and theories to fit the data are relatively prolific. In economic time series prediction, there may be a relatively short time-span of historical data available in conjunction with a large number of economic indicators. One particularly humorous example of this type of prediction was provided by Leinweber who achieved almost perfect prediction of annual values of the S&P 500 financial index as a function of annual values from previous years for butter production, cheese production, and sheep populations in Bangladesh and the United States. There are no easy technical solutions to this problem, even though various strategies have been developed. In order to avoid model overfitting and data snooping, one should decide upon the 79 Quantitative Analytics framework by defining how the model should be specified before beginning to analyse the actual data. First, by properly formulating model hypothesis making financial or economic sense, and then carefully determining the number of dependent variables in a regression model, or the number of factors and components in a stochastic model one can expect avoiding or reducing storytelling and data mining. To increase confidence in a model, true out-of-sample studies of model performance should be conducted after the model has been fully developed. We should also be more comfortable with a model working cross-sectionally and producing similar results in different countries. Note, in a general setting, sampling bootstraping, and randomisation techniques can be used to evaluate whether a given model has predictive power over a benchmark model (see White [2000]). All forecasting models should be monitored and compared on a regular basis, and deteriorating results from a model or variable should be investigated and understood. 2.1.5.5 Evaluating trading system performance We define a successful strategy to be one that maximise the number of profitable days, as well as positive average profits over a substantial period of time, coupled with reasonably consistent behaviour. As a result, while we must look at profit when evaluating trading system performance, we must also look at other statistics such as • maximum drawdown: the highest point in equity to the subsequent lowest point in equity. It is the largest amount of money the system lost before it recovered. • longest flat time: the amount of time the system went without making money. • average drawdown: maximum drawdown is one time occurrence, but the average drawdown takes all of the yearly drawdowns into consideration. • profit to loss ratio: it represents the magnitude of winning trade dollars to the magnitude of losing trade dollars. As it tells us the ratio of wins to losses, the higher the ratio the better. • average trade: the amount of profit or loss we can expect on any given trade. • profit to drawdown ratio: risk in this statistic comes in the form of drawdown, whereas reward is in the form of profit. • outlier adjusted profit: the probability of monstrous wins and/or losses reoccurring being extremely slim, it should not be included in an overall track record. • most consecutive losses: it is the total number of losses that occurred consecutively. It gives the user an idea of how many losing trades one may have to go through before a winner occurs. • Sharpe ratio: it indicates the smoothness of the equity curve. The ratio is calculated by dividing the average monthly or yearly return by the standard deviation of those returns. • long and short net profit: as a robust system would split the profits between the long trades and the short trades, we need to make sure that the money made is well balanced between both sides. • percent winning months: it checks the number of winning month out of one year. 2.2 Portfolio construction We assume that the assets have already been selected, but we do not know the allocations, and we try to make the best choice for the portfolio weights. In his article about the St. Petersburg paradox, Bernoulli [1738-1954] argued that risk-averse investors will want to diversify: ” ... it is advisable to divide goods which are exposed to some small danger into several portions rather than to risk them all together ”. Later, Fisher [1906] suggested variance as a measure of economic risk, which lead investors to allocate their portfolio weights by minimising the variance 80 Quantitative Analytics of the portfolio subject to several constraints. For instance, the theory of mean-variance based portfolio selection, proposed by Markowitz [1952], assumes that rational investors choose among risky assets purely on the basis of expected return and risk, where risk is measured as variance. Markowwitz concluded that rational investors should diversify their investments in order to reduce the respective risk and increase the expected returns. The author’s assumption focus on the basis that for a well diversified portfolio, the risk which is assumed as the average deviation from the mean, has a minor contribution to the overall portfolio risk. Instead, it is the difference (covariance) between individual investment’s levels of risk that determines the global risk. Based on this assumption, Markowitz provided a mathematical model which can easily be solved by meta-heuristics such as Simulated Annealing (SA) or Genetic Algorithm (GA). Solutions based on this model focus their goals on optimising either a single objective, the risk inherent to the portfolio, or two conflicting objectives, the global risk and the expected returns of the securities within the portfolio. That is, a portfolio is considered mean-variance efficient • if it minimises the variance for a given expected mean return, or, • if it maximise the expected mean return for a given variance. On a theoretical ground, mean-variance efficiency assumes that • investors exhibit quadratic utility, ignoring non-normality in the data, or • returns are multivariate normal, such that all higher moments are irrelevant for utility function. 2.2.1 The problem of portfolio selection The expected return on a linear portfolio being a weighted sum of the returns on its constituents, we denote the expected return by µp = w> E[r], where E[r] = (E[r1 ], .., E[rN ])> and w = (w1 , ..., wN )> are the vectors of expected returns on N risky assets and portfolio weights. The variance of a linear portfolio has the quadratic form σ 2 = w> Qw where Q is the covariance matrix of the asset returns. In practice, we can either • minimise portfolio variance for all portfolios ranging from minimum return to maximum return to trace out an efficient frontier, or • construct optimal potfolios for different risk-tolerance parameters, and by varying the parameters, find the efficient frontier. 2.2.1.1 Minimising portfolio variance We assume that the elements of the N × 1 vector w are all non-negative and sum to 1. We can write the N × N covariance matrix Q as Q = DCD where D is the N × N diagonal matrix of standard deviations and C is the correlation matrix of the asset returns (see details in Appendix (A.6)). One can show that whenever asset returns are less than perfectly correlated, the risk from holding a long-only portfolio will be less than the weighted sum of the component risks. We can write the variance of the portfolio return R as Q(R) = w> Qw = w> DCDw = x> Cx where x = Dw = (w1 σ1 , .., wN σN )> is a vector where each portfolio weight is multiplied by the standard deviation of the corresponding asset return. If all asset returns are perfectly correlated, then C = IN , and the volatility of the portfolio becomes 81 Quantitative Analytics 1 (w> Qw) 2 = w1 σ1 + ... + wN σN where the standard deviation of the portfolio return is the weighted sum of the asset return standard deviation. However, when some asset returns have less than perfect correlation, then C has elements less than 1. As the portfolio is long-only, the vector x has non-negative elements, and we get Q(R) = w> Qw = x> Cx ≤ I > CI which is an upper bound for the portfolio variance. It correspond to the Principle of Portfolio Diversification (PPD). Maximum risk reduction for a long-only portfolio occurs when correlations are highly negative. However, if the portfolio contains short positions, we want the short positions to have a high positive correlation with the long positions for the maximum diversification benefit. The PPD implies that investors can make their net specific risk very small by holding a large portfolio with many assets. However, they are still exposed to irreducible risk since the exposure to a general market risk factor is common to all assets. We obtain the minimum variance portfolio (MVP) when the portfolio weights are chosen so that the portfolio variance is as small as possible. That is min w> Qw w (2.2.1) with the constraint N X wi = 1 i=1 in the case of a long-only portfolio. Any constraint on the portfolio weights restricts the feasible set of solutions to the minimum variance problem. In the case of the single constraint above, the solution to the MVP is given by w̃i = ψi N X ψi −1 i=1 where ψi is the sum of all the elements in the ith column of Q−1 . The portfolio with these weights is called the global minimum variance portfolio with variance V∗ = N X ψi −1 i=1 In general, there is no analytic solution to the MVP when more constraints are added. While the MVP ignores the return characteristics of portfolio, more risk may be perfectly acceptable for higher returns. As a result, Markowitz [1952] [1959] considered adding another constraint to the MVP by allowing the portfolio to meet or exceed a target level of return R leading to the optimisation problem of solving Equation (2.2.1) subject to the constraints N X wi = 1 and w> E[r] = R i=1 where E[r] = R is a target level for the portfolio return. Using the Lagrange multipliers we can obtain the solution analytically. 82 Quantitative Analytics 2.2.1.2 Maximising portfolio return An alternative approach is to maximise portfolio return by defining the utility function 1 2 1 > σ = w> µ − w Qw 2λ 2λ where µ = E[r]. We let λ be a risk-tolerance parameter, and compute the optimal solution by taking the first derivative with respect to portfolio weights, setting the term to zero U = µp − dU 1 1 =µ− 2Qw = µ − CQ = 0 dw 2λ λ and solving for the optimal vector w∗ , getting w∗ = λQ−1 µ To be more realistic, we introduce general linear constraints of the form Aw = b, where A is a N × M matrix where N is the number of assets and M is the number of equality constraints and b is a N × 1 vector of limits. We now maximise U = w> µ − 1 > w Qw subject to Aw = b 2λ We can write the Lagrangian 1 > w Qw − δ > (Aw − b) 2λ where δ is the M × 1 vector of Lagrangian multipliers (one for each constraint). Taking the first derivatives with respect to the optimal weight vector and the vector of multipliers yields L = w> µ − dL dw dL dδ = µ− 1 Qw − δ > A = 0 , w∗ = λQ−1 (µ − δ > A) λ = Aw − b , Aw = b From the above equations, we obtain λAQ−1 µ − b = δ = λAQ−1 A> δ 1 AC −1 µ − bAC −1 A> AC −1 A> λ Replacing in the derivative of the Lagrangian, we get the optimal solution under linear equality constraints w∗ = Q−1 A> (AQ−1 A> )b + λQ−1 µ − A> (AQ−1 A> )−1 AQ−1 µ The optimal solution is split into a (constrained) minimum variance portfolio and a speculative portfolio. It is called a two-fund separation because the first term does not depend on expected returns or on risk tolerance, and the second term is sensitive to both inputs. To test for the significance between the constrained and unconstrained optimisation we 0 can use the Shape ratio RS . Assuming an unconstrained optimisation with N assets and a constrained optimisation 0 with only N assets (N > N ) we an use the measure 0 0 0 (T − N )(N − N )(RS2 (N ) − RS2 (N )) ∼ FN 0 ,T −(N 0 +N +1) (1 + RS2 (N )) where T is the number of observations. This statistic is F-distributed. 83 Quantitative Analytics 2.2.1.3 Accounting for portfolio risk While there are many competing allocation procedures such as Markowwitz portfolio theory (PT), or risk budgeting methods to name a few, in all cases risk must be decided. Scherer [2007] argued that portfolio construction, using various portfolio optimisation tools to assess expected return versus expected risk, is equivalent to risk budgeting. In both cases, investors have to trade off risk and return in an optimal way. Even though the former is an allocation either in nominal dollar terms or in percentage weights, and the latter arrives at risk exposures expressed in terms of value at risk (VaR) or percentage contributions to risk, this is juste a presentational difference. While the average target volatility of the portfolio is closely related to the risk aversion of the investors, this amount is not constant over time. In general, any consistent investment process should measure and control the global risk of a portfolio. Nonetheless, it seems that full risk-return optimisation at the portfolio level is only done in the most quantitative firms, and that portfolio management remains a pure judgemental process based on qualitative, not quantitative, assessments. Portfolio managers developed risk measures to represent the level of risk in a particular portfolio, where risk is defined as underperformance relative to a mandate. In the financial industry, there is a large variety of risk indicators, and portfolio managers must decide which ones to consider. For instance, one may consider the maximum drawdown of the cumulative profit or total open equity of a financial trading strategy. One can also consider performance measures such as the Sharpe ratio, the Burke ratio, the Calmar ratio and many more at their disposal. In practice, portfolio managers must consider other issues such as execution policies and transaction cost management on a regular basis. The main reason for using qualitative measures being the difficulty to apply practically optimisation technology. For instance, the classical mean-variance optimisation is very sensitive to inputs such as expected returns of each asset and their covariance matrix. Chopra et al. [1993] have done elementary research to the sensitivity of the classic Mean-Variance to errors in the input parameters. According to their research, errors in expected returns have a much bigger influence on the performance than errors in variances or covariances. This lead to optimal portfolios having extreme or non-intuitive weights for some of the individual assets. Consequently, practitioners added constraints to the original problem to limit or reduce these drawbacks, resulting in an optimum portfolio dominated by the constraints. Additional problems to portfolio optimisation exist, such as • poor model ex-post performance, coupled with the risk of maximising error rather than minimising it. • difficulty in estimating a stable covariance matrix for a large number of assets. • sensitivity of portfolio weights to small changes in forecasts. Different methods exist to make the portfolio allocation process more robust to different sources of risk (estimation risk, model risk etc.) among which are • Bayesian approches • Robust Portfolio Allocation In the classical approach future expected returns are estimated by assuming that the true expected returns and covariances of returns are unknown and fixed. Hence, a point estimate of expected returns and (co)variances is obtained using forecasting models of observed market data, influencing the mean-variance portfolio allocation decision by the estimation error of the forecasts. Once the expected returns and the covariance matrix of returns have been estimated, the portfolio optimisation problem is typically treated and solved as a deterministic problem with no uncertainty. A more realistic model would consider the uncertainty of expected returns and risk into the optimisation problem. One way forward is to choose an optimum portfolio under different scenarios that is robust in some worst case model misspecification. The goal of the Robust Portfolio Allocation (RPA) framework is to get a portfolio, which will perform well under a number of different scenarios instead of one scenario. However, to obtain such a portfolio the investor has to give up some performance under the most likely scenarios to have some insurance for the less 84 Quantitative Analytics likely scenarios. In order to construct such portfolios an expected returns distribution is necessary instead of a pointestimate. One method to obtain such distributions is the Bayesian method which assumes that the true expected returns are unknown and random. A prior distribution is used, reflecting the investor’s knowledge about the probability before any data are observed. The posterior distribution, computed with Bayes’ formula, is based on the knowledge of the prior probability distribution plus the new data. For instance, Black et al. [1990] estimated future expected returns by combining market equilibrium (CAPM equilibrium) with an investor’s views. The Bayesian framework allows forecasting systems to use external information sources and subjective interventions in addition to traditional information sources. The only restriction being that additional information is combined with the model following the law of probability (see Carter et al. [1994]). One alternative approach, discussed by Focardi et al. [2004], is to use Monte Carlo technique by sampling from the return distribution and averaging the resulting portfolios. In this method a set of returns is drawn iteratively from the expected return distribution. In each iteration, a mean-variance optimisation is run on the set of expected returns. The robust portfolio is then the average of all the portfolios created in the different iterations. Although this method will create portfolios that are more or less robust, it is computationally very expensive because an optimisation must be run for each iteration step. Furthermore there is no guarantee that the resulting average portfolio will satisfy the constraints on which the original portfolios are created. Note, in the Robust Portfolio Allocation approach, the portfolio is not created with an iterative process but the distribution of the expected returns is directly taken into account, resulting in a single optimisation process. Therefore this approach is computationally more effective than the Monte Carlo process. 2.3 A market equilibrium theory of asset prices In the problem of portfolio selection, the mean-variance approach introduced by Markowitz [1952] is a simple tradeoff between return and uncertainty, where one is left with the choice of one free parameter, the amount of variance acceptable to the individual investor. For proofs and rigorous introduction to the mean-variance portfolio technique see Huang et al. [1988]. For a retrospective on Markowitz’s portfolio selection see Rubinstein [2002]. Investment theory based on growth is an alternative to utility theory with simple goal. Following this approach, Kelly [1956] used the role of time in multiplicative processes to solve the problem of portfolio selection. 2.3.1 The capital asset pricing model 2.3.1.1 Markowitz solution to the portfolio allocation problem We showed in Section (2.2.1) how a rational investor should allocate his funds between the different risky assets in his universe, leading to the portfolio allocation problem. To solve this problem Markowitz [1952] introduced the concept of utility functions (see Section (1.6.1) and Appendix (A.7)) to express investor’s risk preferences. Markowitz first considered the rule that the investor should maximise discounted expected, or anticipated returns (which is linked to the St. Petersurg paradox). However, he showed that the law of large numbers (see Bernoulli [1713]) can not apply to a portfolio of securities since the returns from securities are too intercorrelated. That is, diversification can not eliminate all variance. Hence, rejecting the first hypothesis, he then considered the rule that the investor should consider expected return a desirable thing and variance of return an undesirable thing. Note, Marschak [1938] suggested using the means and covariance matrix of consumption of commodities as a first order approximation to utility. We saw in Section (2.2.1) that the mean-variance efficient portfolios are obtained as the solution to a quadratic optimisation program. Its theoretical justification requires either a quadratic utility function or some fairly restrictive assumptions on the class of return distribution, such as the assumption of normally distributed returns. For instance, we assume zero transaction costs and portfolios with prices Vt taking values in R and following the geometric Brownian motion with dynamics under the historical probability measure P given by 85 Quantitative Analytics dVt = µdt + σV dWt Vt (2.3.2) where µ is the drift, σV is the volatility and Wt is a standard Brownian motion. Markowitz first considered the problem of maximising the expected rate of return g= 1 dVt < >= µ dt Vt (also called ensemble average growth rate) and rejected such strategy because the portfolio with maximum expected rate of return is likely to be under-diversified, and as a result, to have an unacceptable high volatility. As a result, he postulated that while diversification would reduce risk, it would not eliminate it, so that an investor should maximise the expected portfolio return µ while minimising portfolio variance of return σV2 . It follows from the relation between the variance of the return of the portfolio σV2 and the variance of return of its constituent securities σj2 for j = 1, 2, ..., N given by X XX σV2 = wj2 σj2 + wj wk ρjk σj σk j j k6=j P where the wj are the portfolio weights such that j wj = 1, and ρjk is the correlation of the returns of securities j and k. Therefore, ρjk σj σk is the covariance of their returns. So, the decision to hold any security would depend on what other securities the investor wants to hold. That is, securities can not be properly evaluated in isolation, but only as a group. Consequently, Markowitz suggested calling portfolio i efficient if 1. there exists no other portfolio j in the market with equal or smaller volatility, σj ≤ σi , whose drift term µj exceeds that of portfolio i. That is, for all j such that σj ≤ σi , we have µj ≤ µi . 2. there exists no other portfolio j in the market with equal or greater drift term, µj ≥ µi , whose volatility σj is smaller than that of portfolio i. That is, for all j such that µj ≥ µi , we have σj ≥ σi . In the presence of a riskless asset (with σi = 0), all efficient portfolios lie along a straight line, the efficient frontier, intersecting in the space of volatility and drift terms, the riskless asset rf and the so-called market portfolio M . Since any point along the efficient frontier represents an efficient portfolio, additional information is needed in order to select the optimal portfolio. For instance, one can specify the usefulness or desirability of a particular investment outcome to a particular investor, namely his risk preference, and represent it with a utility function u = u(Vt ). Following the work of von Neumann et al. [1944] and Savage [1954], Markowitz [1959] found a way to reconcile his mean-variance criterion with the maximisation of the expected utility of wealth after many reinvestment periods. He advised using the strategy of maximising the expected logarithmic utility of return each period for investors with a long-term horizon, and developed a quadratic approximation to this strategy allowing the investor to choose portfolios based on mean and variance. As an alternative to the problem of portfolio selection, Kelly [1956] proposed to maximise the expected growth rate 1 1 < d ln Vt >= µ − σ 2 dt 2 obtained by using Ito’s formula (see Peters [2011c]). This rate is called the expected growth rate, or the logarithmic geometric mean rate of return (also called the time average growth rate). In that setting, we observe that large returns and small volatilities are desirable. Note, Ito’s formula changes the behaviour in time without changing the noise term. That is, Ito’s formula encode the multiplicative effect of time (for noise terms) in the ensemble average (see Oksendal [1998]). Hence, it can be seen as a mean of accounting for the effects of time. For self-financing portfolios, where eventual outcomes are the product over intermediate returns, maximising g b yields meaningful results. This gb = 86 Quantitative Analytics is because it is equivalent to using logarithmic utility function u(Vt ) = ln Vt . In that setting, the rate of change of the ensemble average utility happens to be the time average of the growth rate in a multiplicative process. Note, the problem that additional information is needed to select the right portfolio disappears when using the expected growth rate g b . That is, there is no need to use utility function to express risk preferences as one can use solely the role of time in multiplicative processes. 2.3.1.2 The Sharp-Lintner CAPM As discusses in Section (2.2.1), in equilibrium and under proper diversification, market prices are made of the risk-free rate and the price of risk in such a way that an investor can attain any desired point along a capital market line (CML). Higher expected rate of return can be obtained only by incurring additional risk. In view of properly describing the price of risk, Sharpe [1964] extended the model of investor behaviour (see Arrow [1952] and Markowitz [1952]) to construct a market equilibrium theory of asset prices under conditions of risk. That is, the purpose of the capital asset pricing model (CAPM) is to deduce how to price risky assets when the market is in equilibrium. The conditions under which a risky asset may be added to an already well diversified portfolio depend on the Systematic Risk of the asset, also called the undiversifiable risk of the asset. Assuming that an investor views the possible result of an investment in terms of some probability distribution, he might consider the first two moments of the distribution represented by the total utility function u = f (Ew , σw ) du > 0 and where Ew is the expected future wealth and σw the predicted standard deviation, and such that dE w Letting Wi be the quantity of the investor’s present wealth and Wt be his terminal wealth, we get du dσw < 0. Wt = Wi (1 + R) where R is the rate of return on the investment. One can therefore express the utility function in terms of R, getting u = g(ER , σR ) so that the investor can choose from a set of investment opportunities, represented by a point in the (ER , σR ) plane (with ER on the x-axis and σR on the y-axis), the one maximising his utility. Both Markowitz [1952] [1959] and Tobin [1958] derived the indifference curves by maximising the expected utility with total utility represented by a quadratic function of R with decreasing marginal utility. The investor will choose the plan placing him on the indifference curve representing the highest level of utility. A plan is said to be efficient if and only if there is no alternative with either 1. the same ER and a lower σR 2. the same σR and a hiher ER 3. a higher ER and a lower σR For example, in the case of two investment plans A and B, each with one or more assets, such that α is the proportion of the individual’s wealth placed in plan A and (1 − α) in plan B, the expected rate of return is ERc = αERa + (1 − α)ERb and the predicted standard deviation of return is q 2 + (1 − α)2 σ 2 + 2ρ α(1 − α)σ σRc = α 2 σR ab Ra σRb Rb a (2.3.3) where ρab is the correlation between Ra and Rb . In case of perfect correlation between the two plans (ρab = 1), both ERc and σRc are linearly related to the proportions invested in the two plans and the standard deviation simplifies to 87 Quantitative Analytics σRc = σRb + α(σRa − σRb ) Considering the riskless asset P with σRp = 0, an investor placing α of his wealth in P and the remainder in the risky asset A, we obtain the expected rate of return ERc = αERp + (1 − α)ERa and the standard deviation reduces to σRc = (1 − α)σRa such that all combinations involving any risky asset or combination of assets with the riskless asset must have the values (ERc , σRc ) lying along a straight line between the points representing the two components. To prove it, we set σ (1 − α) = σRRc and replace in the expected rate of return, getting a ERc = ERp + ERa − ERp σRc σRa Remark 2.3.1 The investment plan lying at the point of the original investment opportunity curve where a ray from point P is tangent to the curve will dominate. Since borrowing is equivalent to disinvesting, assuming that the rate at which funds can be borrowed equals the lending rate, we obtain the same dominant curve. To reach equilibrium conditions, Sharpe [1964] showed that by assuming a common risk-free rate with all investors borrowing or lending funds on equal terms, and homogeneity of investor expectations, capital asset prices must keep changing until a set of prices is attained for which every assets enters at least one combination lying on the capital market line (CML). While many alternative combinations of risky assets are efficient, they must be perfectly positively correlated as they lie along a linear border of the (ER , σR ) region, even though the contained individual securities are not perfectly correlated. For individual assets, the pair (ERi , σi ) for the ith asset (with ERi on the x-axis and σi on the y-axis) will lie above the capital market line (due to inefficiency of undiversified holdings) and be scattered throughout the feasible region. Given a single capital asset (point i) and an efficient combination of assets (point g) of which it is part, we can combine them in a linear way such that the expected return of the combination is E = αERi + (1 − α)ERg In equilibrium, Sharpe obtained a tangent curve to the CML at point g, leading to a simple formula relating ERi to some risk in combination g. The standard deviation of a combination of i and g is given by Equation (2.3.3) with a and b replaced with i and g, respectively. Further, at α = 0 we get σRg − ρig σRi dσ = dE ERg − ERi Letting the equation of the capital market line (CML) be σR = s(ER − P ) or ER = P + bσR 1 s, (2.3.4) with b = where P is the risk-free rate, and since we have a tangent line at point g with the pair (ERg , σRg ) lying on that line, we get σRg − ρig σRi σRg = ERg − ERi E Rg − P 88 Quantitative Analytics Given a number of ex-post observations of the return of the two investments with ERf approximated with Rf for f = i, g and total risk σRf approximated with σ, we call Big the slope of the regression line between the two returns, and observe that the response of Ri to changes in Rg account for much of the variation in Ri . This component Big of the asset’s total risk is called the Systematic Risk, and the remainder which is uncorrelated with Rg is the unsystematic component. This relationship between Ri and Rg can be employed ex-ante as a predictive model where Big is the predicted response of Ri to changes in Rg . Hence, all assets entering efficient combination g have Big and ERi values lying on a straight line (minimum variance condition) ERi = Big (ERg − P ) + P (2.3.5) where P is the risk-free rate and Big = ρig σRi Cov(Ri , Rg ) = 2 σRg σR g (2.3.6) The slope Big , also called the CAPM beta, represents the part of an asset’s risk which is due to its correlation with the return on a combination and can not be diversified away when the asset is added to the combination. Consequently, it should be directly related to the expected return ERi . This result is true for any efficient combinations because the rates of return from all efficient combinations are perfectly correlated. Risk resulting from swings in economic activity being set aside, the theory states that after diversification, only the responsiveness of an asset’s rate of return to the level of economic activity is relevant in assessing its risk. Therefore, prices will adjust until there is a linear relationship between the magnitude of such responsiveness and expected return. 2.3.1.3 Some critics and improvements of the CAPM Fama et al. [2004] discussed the CAPM and argued that whether the model’s problems reflect weakness in the theory or in its empirical implementation, the failure of the CAPM in empirical test implies that most applications of the model are invalid. The CAPM is based on the model of portfolio choice developed by Markowitz [1952] where an investor selects a portfolio at time t − 1 that produces a stochastic return at time t. Investors are risk averse in choosing among portfolios, and care only about the mean and variance of their one-period investment return. It results in algebraic condition on asset weights in mean-variance efficient portfolios (see Section (2.3.1.2)). In view of making prediction about the relation between risk and expected return Sharpe [1964] and Lintner added two assumptions, complete agreement of all investors on the joint distribution of asset returns from t − 1 to t supposed to be the true one, and that there is borrowing and lending at a risk-free rate. As a result, the market portfolio M (tangency portfolio) must be on the minimum variance frontier if the asset market is to clear and satisfy Equation (2.3.5) with g replaced by M. The slope BiM measures the sensitivity of the asset’s return to variation in the market return, or put another way, it is proportional to the risk each dollar invested in asset i contributes to the market portfolio. Consequently, it can be seen as a sensitivity risk measure relative to the market risk factor. To stress the proportionality of the normalised excess return of the risky asset with that of the market portfolio, we can rewrite Equation (2.3.5) as ERi − P ERM − P = ρiM σRi σRg Black [1972] developed a version of the CAPM without risk-free borrowing or lending by allowing unrestricted short sales of risky assets. These unrealistic simplifications were tested by Fama et al. [2004]. They were faced with numerical errors when estimating the beta of individual assets to explain average returns, and they obtained positive correlation in the residuals producing bias in ordinary least squares (OLS) estimates. Since the CAPM explains security returns, it also explains portfolio returns so that one can work with portfolios rather than securities to estimate betas. Letting wip for i = 1, .., N be the weights for the assets in some portfolio p, the expected return and market beta for the portfolio are given by 89 Quantitative Analytics ERp = N X wip ERi and βpM = i=1 N X wip βip i=1 so that the CAPM relation in Equation (2.3.5) also holds when the ith asset is a portfolio. However, grouping stocks shrinks the range of betas and reduces statistical power, so that one should sort securities on beta when forming portfolios where the first portfolio contains securities with the lowest betas, and so on, up to the last portfolio with the highest beta assets (see Black et al. [1972]). Jensen [1968] argued that the CAPM relation in Equation (2.3.5) was also a time-series regression test ERit = αi + BiM (ERM t − Rf t ) + Rf t + it (2.3.7) where Rf t is the risk-free rate at time t, it is assumed to be a white noise, and such that the intercept term in the regression, also called the Jensen’s alpha, is zero for each asset. In the CAPM equilibrium, no single asset may have abnormal return where it earns a rate of return of alpha above (or below) the risk free rate without taking any market risk. In the case where αi 6= 0 for any risky asset i, the market is not in equilibrium, and pairs (ERi , BiM ) will lie above or below the CML according to the sign of αi . If the market is not in equilibrium with an asset having a positive alpha, it should have an expected return in excess of its equilibrium return and should be bought. Similarly, an asset with a negative alpha has expected return below its equilibrium return, and it should be sold. In the CAPM, abnormal returns should not continue indefinitely, and price should rise as a result of buying pressure so that abnormal profits will vanish. Forecasting the alpha of an asset, using a regression model based on the CAPM, one can decide whether to add it or not in a portfolio. While the CAPM is a cross-sectional model, it is common to cast the model into time series context and to test the hypothesis H0 : α1 = α2 = ... = 0 using historical data on the excess returns on the assets and the excess return on the market portfolio. A large number of tests rejected the Sharpe-Lintner version of the CAPM by showing that the regressions consistently got intercept greater than the average risk-free rate as well as a beta less than the average excess market return (see Black et al. [1972], Fama et al. [1973], Fama et al. [1992]). More recently, Fama et al. [2004] considered market return for 1928-2003 to estimate the predicted line, and confirmed that the relation between beta and average return is much flatter than the Sharpe-Lintner CAPM predicts. They also tested the prediction of mean-variance efficiency of the portfolio (portfolios are entirely explained by differences in market beta) by considering additional variables with cross-section regressions and time-series regressions. They found that standard market proxies seemed to be on the minimum variance frontier, that is, market betas suffice to explain expected returns and the risk premium for beta is positive, but the idea of SL-CAPM that the premium per unit of beta is the expected market return minus the riskfree rate was consistently rejected. Nonetheless, further research on the scaling of asset prices (or ratios), such as earning-price, debt-equity and book-to-market ratios (B/M), showed that much of the variation in expected return was unrelated to market beta (see Fama et al. [1992]). Among the possible explanations for the empirical failures of the CAPM, some refers to the behaviour of investors over-extrapolating past performance, while other point to the need of a more complex asset pricing model. For example, in the intertemporal capital asset pricing model (ICAPM) presented by Merton [1973], investors prefer high expected return and low return variance, but they are also concerned with the covariances of portfolio returns with state variables, so that portfolios are multifactor efficient. The ICAPM is a generalisation of the CAPM requireing additional betas, along with a market beta, to explain expected returns, and necessitate the specification of state variables affecting expected returns (see Fama [1996]). One approach is to derive an extension to the CAPM equilibrium where the systematic risk of a risky asset is related to the higher moments of the joint distribution between the return on an asset and the return on the market portfolio. Kraus et al. [1976] considered the coskewness to capture the asymmetric nature of returns on risky asset, and Fang et al. [1997] used the cokurtosis to capture the returns leptokurtosis. In both cases, the derivation of higher moment CAPM models is based on the higher moment extension of the investor’s utility function derived in Appendix (A.7.4). Alternatively, to avoid specifying state variables, Fama et al. [1993] followed the arbitrage pricing theory by Ross [1976] and considered 90 Quantitative Analytics unidentified state variables producing undiversifiable risks (covariances) in returns not captured by the market return and priced separately from market betas. For instance, the returns on the stocks of small firms covary more with one another than with returns on the stocks of large firms, and returns on high B/M stocks covary more with one another than with returns on low B/M stocks. As a result, Fama et al. [1993] [1996] proposed a three-factor model for expected returns given by E[Rit ] − Rf t = βiM (E[RM t ] − Rf t ) + βis E[SM Bt ] + βih E[HM Lt ] where SM Bt (small minus big) is the difference between the returns on diversified portfolios of small and big stocks, HM Lt (high minus low) is the difference between the returns on diversified portfolios of high and low B/M stocks, and the betas are the slopes in the multiple regression of Rit − Rf t on RM t − Rf t , SM Bt and HM Lt . Given the time-series regression E[Rit ] − Rf t = αi + βiM (E[RM t ] − Rf t ) + βis E[SM Bt ] + βih E[HM Lt ] + it they found that the intercept αi is zero for all assets i. Estimates of αi from the time-series are used to calibrate the speed to which stock prices respond to new information as well as to measure the special information of portfolio managers such as performance. The momentum effect of Jegadeesh et al. [1993] states that stocks doing well relative to the market over the last three to twelve months tend to continue doing well for the next few months, and stocks doing poorly continue to do poorly. Even though this momentum effect is not explained by the CAPM or the three-factor model, one can add to these model a momentum factor consisting of the difference between the return on diversified portfolios of short-term winners and losers. For instance, Carhart [1997] proposed the four factor model E[Rit ] − Rf t = αi + βiM (E[RM t ] − Rf t ) + βis E[SM Bt ] + βih E[HM Lt ] + βim E[U M Dt ] + it where U M Dt is the monthly return of the style-attribution Carhart momentum factor. 2.3.2 The growth optimal portfolio The growth optimal portfolio (GOP) is a portfolio having maximal expected growth rate over any time horizon, and as such, it is sure to outperform any other significantly different strategy as the time horizon increases. As a result, it is an investment tool for long horizon investors. Calculating the growth optimal strategy is in general very difficult in discrete time (in incomplete market), but it is much easier in the continuous time continuous diffusion case and was solved by Merton [1969]. Solutions to the problem exists in a semi-explicit form and in the general case, the GOP can be characterised in terms of the semimartinale characteristic triplet. Following Mosegaard Christensen [2011], we briefly review the discrete time case, providing the main properties of the GOP and extend the results to the continuous case. Details can be found in Algoet et al. [1988], Goll et al. [2000], Becherer [2001], Christensen et al. [2005]. 2.3.2.1 Discrete time Consider a market consisting of a finite number of non-dividend paying assets. The market consists of N + 1 assets, represented by a N + 1 dimensional vector process S where S = {S(t) = (S 0 (t), .., S N (t)), t ∈ [0, 1, .., T ]} and T is assumed to be a finite number. The first asset S 0 is sometimes assumed to be risk-free from one period to the next, that is, it is a predictable process. The price of each asset is known at time t, given the information Ft . Define the return process R = {R(t) = (R0 (t), .., RN (t)), t ∈ [1, .., T ]} by 91 Quantitative Analytics Ri (t) = S i (t) −1 − 1) S i (t Often it is assumed that returns are independent over time, and for simplicity this assumption is made in this section. Investors in such a market consider the choice of a strategy b = {b(t) = (b0 (t), .., bN (t)), t ∈ [0, 1, .., T ]} where bi (t) denotes the number of units of asset i that is being held during the period (t, t + 1]. Definition 2.3.1 A trading strategy b generates the portfolio value process S b (t) = b(t).S(t). The strategy is called admissible if it satisfies the three conditions 1. Non-anticipative: the process b is adapted to the filtration F. 2. Limited liability: the strategy generates a portfolio process S b (t) which is non-negative. 3. Self-financing: b(t − 1).S(t) = b(t).S(t) for t ∈ [1, .., T ] or equivalently ∆S b (t) = b(t − 1).∆S(t). where x.y denotes the standard Euclidean inner product. The set of admissible portfolios in the market is denoted Θ(S), and Θ(S) denotes the strictly positive portfolios. It is assumed that Θ(S) 6= 0. The third part requires that the investor re-invests all money in each time step. No wealth is withdrawn or added to the portfolio. This means that intermediate consumption is not possible. Consider an investor who invests a dollar of wealth in some portfolio. At the end of period T his wealth becomes S b (T ) = S b (0) T Y (1 + Rb (j)) j=1 where Rb (t) is the return in period t. The ratio is given by S b (T ) = (1 + Rb (T )) − 1) S b (T If the portfolio fractions are fixed during the period, the right-hand-side is the product of T independent and identically distributed (i.i.d.) random variables. The geometric average return over the period is then T Y 1 (1 + Rb (j)) T j=1 Because the returns of each period are i.i.d., this average is a sample of the geometric mean value of the one-period return distribution. For discrete random variables, the geometric mean of a random variable X taking (not necessarily distinct) values x1 , ..., xS with equal probabilities is defined as G(X) = S Y xs S1 = s=1 K Y x̃fkk = eE[log X] k=1 where x̃k is the distinct values of X and fk is the frequency of which X = xk , that is, fk = P (X = xk ). In other words, the geometric mean is the exponential function of the growth rate g b (t) = E[log (1 + Rb )(t)] of some portfolio. Hence if Ω is discrete or more precisely if the σ-algebra F on Ω is countable, maximising the geometric mean is equivalent to maximising the expected growth rate. Generally, one defines the geometric mean of an arbitrary random variable by 92 Quantitative Analytics G(X) = eE[log X] assuming the mean value E[log X] is well defined. Over long stretches intuition dictates that each realised value of the return distribution should appear on average the number of times dictated by its frequency, and hence as the number of periods increase, it would hold that T Y (1 + Rb (j)) T1 1 = eT PT j=1 log S b (j) → G(1 + Rb (1)) j=1 as T → ∞. This states that the average growth rate converges to the expected growth rate. In fact this heuristic argument can be made precise by an application of the law of large numbers. In multi-period models, the geometric mean was suggested by Williams [1936] as a natural performance measure, because it took into account the effects from compounding. Instead of worrying about the average expected return, an investor who invests repeatedly should worry about the geometric mean return. It explains why one might consider the problem sup E[log ( S b (T )∈Θ S b (T ) )] S b (0) (2.3.8) Definition 2.3.2 A soulution S b to Equation (2.3.8) is called a GOP. Hence the objective given by Equation (2.3.8) is often referred to as the geometric mean criteria. Economists may view this as the maximisation of expected terminal wealth for an individual with logarithmic utility. However, the GOP was introduced because of the properties of the geometric mean, when the investment horizon stretches over several periods. For simplicity it is always assumed that S b (0) = 1, i.e. the investors start with one unit of wealth. Definition 2.3.3 An admissible strategy b is called an arbitrage strategy if S b (0) = 0 , P (S b (T ) ≥ 0) = 1 , P (S b (T ) > 0) > 0 It is closely related to the existence of a solution to problem in Equation (2.3.8), because the existence of a strategy that creates something out of nothing would provide an infinitely high growth rate. Theorem 2.3.1 There exists a GOP S b if and only if there is no arbitrage. If the GOP exists its value process is unique. The necessity of no arbitrage is straightforward as indicated above. The sufficiency will follow directly once the numeraire property of the GOP has been established. It is possible to infer some simple properties of the GOP strategy, without further specifications of the model: Theorem 2.3.2 The GOP strategy has the following properties: 1. The fractions of wealth invested in each asset are independent of the level of total wealth. 2. The invested fraction of wealth in asset i is proportional to the return on asset i. 3. The strategy is myopic To see why the GOP strategy depends only on the distribution of asset returns one period ahead note that E[log S b (T )] = log S b (0) + T X j=1 93 E[log (1 + Rb (j))] Quantitative Analytics In general, obtaining the strategy in an explicit closed form is not possible, as it involves solving a non-linear optimisation problem. To see this, we derive the first order conditions of Equation (2.3.8). Since the GOP strategy is myopic and the invested fractions are independent of wealth, one needs to solve the problem sup Et [log ( b(t) S b (t + 1) )] S b (t) for each t ∈ [0, 1, .., T − 1]. This is equivalent to solving the problem sup Et [log (1 + Rb (t + 1))] b(t) i i b (t)S (t) S b (t) Using the fractions πbi (t) = the problem can be written E[log 1 + (1 − sup πb (t)∈RN N X πbk (t))R0 (t + 1) + k=1 N X πbk (t)Rk (t + 1) ] k=1 since N X 1 + (1 − πbi (t))R0 (t + 1) + i=1 N X πbi (t)Ri (t + 1) = i=1 N X N X 1 0 b i i 0 (1 + R (t + 1))S (t) − b (t)S (t)R (t + 1) + bi (t)S i (t)Ri (t + 1) b S (t) i=1 i=1 which gives 1 + (1 − N X πbi (t))R0 (t + 1) + i=1 N X πbi (t)Ri (t + 1) = i=1 N N X X 1 0 b 0 i i (1 + R (t + 1))S (t) − (1 + R (t + 1)) b (t)S (t) + bi (t)S i (t + 1) b S (t) i=1 i=1 Since S b (t) − b0 (t)S 0 (t) = PN i=1 bi (t)S i (t), we get 1 + (1 − N X πbi (t))R0 (t + 1) + i=1 N X πbi (t)Ri (t + 1) = i=1 N X 1 0 0 0 (1 + R (t + 1))b (t)S (t) + bi (t)S i (t + 1) b S (t) i=1 and since the portfolio is self-financing, we get 1 + (1 − N X i=1 πbi (t))R0 (t + 1) + N X i=1 πbi (t)Ri (t + 1) = S b (t + 1) S b (t) The properties of the logarithm ensures that the portfolio will automatically become admissible. By differentiation, the first order conditions become 94 Quantitative Analytics Et−1 [ 1 + Rk (t) ] = 1 , k = 0, 1, .., N 1 + Rb (t) This constitutes a set of N +1 non-linearP equation to be solved simultaneously such that one of which is a consequence N of the others, due to the constraint that i=0 πbi = 1. Although these equations do not generally posses an explicit closed-form solution, there are some special cases which can be handled. 2.3.2.2 Continuous time Being a (N + 1)-dimensional semimartingale and satisfying the usual conditions, S can be decomposed as S(t) = A(t) + M (t) where A is a finite variation process and M is a local martingale. The reader is encouraged to think of these as drift and volatility respectively, but should beware that the decomposition above is not always unique. If A can be chosen to be predictable, then the decomposition is unique. This is exactly the case when S is a special semimartingale (see Protter [2004]). Following standard conventions, the first security is assumed to be the numeraire, and hence it is assumed that S 0 (t) = 1 almost surely for all t ∈ [0, T ]. The investor needs to choose a strategy, represented by the N + 1 dimensional process b = {b(t) = (b0 (t), .., bN (t)), t ∈ [0, T ]} Definition 2.3.4 An admissible trading strategy b satisfies the three conditions: 1. b is an S-integrable, predictable process. PN 2. The resulting portfolio value S b (t) = i=0 bi (t)S i (t) is nonnegative. Rt 3. The portfolio is self-financing, that is S b (t) = 0 bs dS(s). The last requirement states that the investor does not withdraw or add any funds. It is often convenient to consider portfolio fractions, i.e πb = {πb (t) = (πb0 (t), .., πbN (t))> , t ∈ [0, ∞)} with coordinates defined by bi (t)S i (t) S b (t) πbi (t) = One may define the GOP S b as the solution to the problem S b = arg sup S b ∈Θ(S) E[log ( S b (T ) )] S b (0) (2.3.9) Definition 2.3.5 A portfolio is called a GOP if it satisfies Equation (2.3.9). The essential feature of No Free Lunch with Vanishing Risk (NFLVR) is the fact that it implies the existence of an equivalent martingale measure. More precisely, if asset prices are locally bounded, the measure is an equivalent local martingale measure and if they are unbounded, the measure becomes an equivalent sigma martingale measure. Here, these measures will all be referred to collectively as equivalent martingale measures (EMM). 95 Quantitative Analytics Theorem 2.3.3 Assume that sup E[log ( Sb S b (T ) )] < ∞ S b (0) and that NFLVR holds. Then there is a GOP. A less stringent and numeraire invariant condition is the requirement that the market should have a martingale density. R A martingale density is a strictly positive process Z, such that SdZ is a local martingale. In other words, a RadonNikodym derivative of some EMM is a martingale density, but a martingale density is only the Radon-Nikodym derivative of an EMM if it is a true martingale. Modifying the definition of the GOP slightly, one may show that: Corollary 1 There is a GOP if and only if there is a martingale density. We present a simple example to get a feel of how to finf the growth optimal strategy in the continuous setting. Example : two assets Let the market consist of two assets, a stock and a bond. Specifically the SDEs describing these assets are given by dS 0 (t) = S 0 (t)rdt 1 = S 1 (t) adt + σdW (t) dS (t) where W is a Wiener process and r, a, σ are constants. Since S b (t) = b0 (t)S 0 (t) + b1 (t)S 1 (t), applying Ito’s lemma we get dS b (t) = b0 (t)S 0 (t)rdt + b1 (t)S 1 (t)adt + b1 (t)S 1 (t)σdW (t) Using fractions π 1 (t) = b1 (t)S 1 (t) , S b (t) any admissible strategy can be written dS b (t) = S b (t) (r + π 1 (t)(a − r))dt + π 1 (t)σdW (t) since dS b (t) = S b (t) rdt + b1 (t)S 1 (t) b1 (t)S 1 (t) (a − r)dt + σdW (t) b b S (t) S (t) which gives dS b (t) = (S b (t) − b1 (t)S 1 (t))rdt + b1 (t)S 1 (t)adt + b1 (t)S 1 (t)σdW (t) and since S b (t) − b1 (t)S 1 (t) = b0 (t)S 0 (t), we recover the SDE dS b (t) = b0 (t)S 0 (t)rdt + b1 (t)S 1 (t)adt + b1 (t)S 1 (t)σdW (t) Applying Ito’s lemma to Y (t) = log S b (t) we get dY (t) = 1 r + π 1 (t)(a − r) − (π 1 (t))2 σ 2 dt + π 1 (t)σdW (t) 2 Hence, assuming the local martingale with differential π 1 (t)σdW (t) to be a true martingale, it follows that Z E[log S b (T )] = E[ 0 T 1 r + π 1 (t)(a − r) − (π 1 (t))2 σ 2 dt] 2 so by maximizing the expression for each (t, ω) the optimal fraction is obtained as 96 Quantitative Analytics a−r σ2 Hence, inserting the optimal fractions into the wealth process, the GOP is described by the SDE πb1 (t) = dS b (t) = S b (t) (r + ( a−r 2 a−r ) )dt + dW (t) σ σ which we rewrite as dS b (t) = S b (t) (r + θ2 )dt + θdW (t) where θ = a−r σ is the market price of risk process. Fix a truncation function h i.e. a bounded function with compact support h : RN → RN such that h(x) = x in a neighbourhood around zero. For instance, a common choice would be h(x) = xI{|x|≤1} For such truncation function, there is a triplet (A, B, ν) describing the behaviour of the semimartingale. There exists a locally integrable, increasing, predictable process  such that (A, B, ν) can be written as Z Z A = ad , B = bd and ν(dt, dv) = dÂt F (t, dv) The process A is related to the finite variation part of the semimartingale, and it can be thought of as a generalised drift. The process B is similarly interpreted as the quadratic variation of the continuous part of S, or in other words it is the square volatility where volatility is measured in absolute terms. The process ν is the compensated jump measure, interpreted as the expected number of jumps with a given size over a small interval and F essentially characterises the jump size. Example Let S 1 be geometric Brownian Motion. Then  = t and dA(t) = S 1 (t)adt , dB(t) = (S 1 (t)σ)2 dt Theorem 2.3.4 (Goll and Kallsen [2000]) Let S have a characteristic triplet (A, B, ν) as described above. Suppose there is an admissible strategy b with corresponding fractions πb such that ak (t) − N X πbi i=1 S i (t) bi,k (t) + Z RN 1+ xk PN πbi i i=1 S i (t) x − h(x) F (t, dx) = 0 for P × d almost all (ω, t) ∈ Ω × [0, T ] where k ∈ [0, .., N ] and × denotes the standard product measure. Then b is the GOP strategy. This Equation represents the first order conditions for optimality and they would be obtained easily if one tried to solve the problem in a pathwise sense. Example Assume that discounted asset prices are driven by an m-dimensional Wiener process. The locally risk free asset is used as numeraire, whereas the remaining risky assets evolve according to 97 Quantitative Analytics dS i (t) = S i (t)ai (t)dt + m X S i (t)bi,k (t)dW k (t) k=1 i for i ∈ [1, .., N ]. Here a (t) is the excess return above the risk free rate. From this equation, the decomposition of the semimartingale S follows directly. Choosing  = t, a good version of the characteristic triplet becomes Z Z (A, B, ν) = a(t)S(t)dt, S(t)b(t)(S(t)b(t))> dt, 0 Consequently, in vector form and after division by S i (t), the above Equation yields that a(t) − (b(t)b(t)> )πb (t) = 0 In the particular case where m = N and the matrix b is invertible, we get the well-known result that π(t) = b−1 (t)θ(t) where θ(t) = b−1 (t)a(t) is the market price of risk. Generally, whenever the asset prices can be represented by a continuous semimartingale, a closed form solution to the GOP strategy may be found. The cases where jumps are included are less trivial. In general when jumps are present, there is no explicit solution in an incomplete market. In such cases, it is necessary to use numerical methods. As it was done in discrete time, the GOP can be characterised in terms of its growth properties. Theorem 2.3.5 The GOP has the following properties: 1. The GOP maximises the instantaneous growth rate of investments 2. In the long term, the GOP will have a higher realised growth rate than any other strategy, i.e. lim sup T →∞ 1 1 log S b (T ) ≤ lim sup log S b (T ) T →∞ T T for any other admissible strategy S b . The instantaneous growth rate is the drift of log S b (t). Example Given the previous example, the instantaneous growth rate g b (t) of a portfolio S b was found by applying the Ito’s formula to get dY (t) = 1 r + π(t)(a − r) − π 2 (t)σ 2 dt + π(t)σdW (t) 2 Hence, the instantaneous growth rate is 1 g b (t) = r + π(t)(a − r) − π 2 (t)σ 2 2 (2.3.10) Differentiating the instantaneous growth rate g b (t) with respect to the fraction π(t) and setting the results to zero, we recover πb1 (t) in the Example with two assets. Hence, by construction, the GOP maximise the instantaneous growth rate. As in the discrete setting, the GOP enjoys the numeraire property. However, there are some subtle differences. Theorem 2.3.6 Let S b denote any admissible portfolio process and define Ŝ b (t) = 98 S b (t) . S b (t) Then Quantitative Analytics 1. Ŝ b (t) is a supermartingale if and only if S b (t) is the GOP. 2. The process 1 Ŝ b (t) is a submartingale. 3. If asset prices are continuous, then Ŝ b (t) is a local martingale. 2.3.2.3 Discussion Mosegaard Christensen [2011] reviewed the discussion around the attractiveness of the GOP against the CAPM and concluded that there is an agreement on the fact that the GOP can neither proxi for, nor dominate other strategies in terms of expected utility, and no matter how long (finite) horizon the investor has, utility based preferences can make other portfolios more attractive because they have a more appropriate risk profile. Authors favouring the GOP believe growth optimality to be a reasonable investment goal, with attractive properties being relevant to long horizon investors (see Kelly [1956], Latane [1959]). On the other hand, authors disagreeing do so because they do not believe that every investor could be described as log-utility maximising investors (see Markowitz [1976]). To summarise, the disagreement had its roots in two very fundamental issues, namely whether or not utility theory is a reasonable way of approaching investment decisions in practice, and whether utility functions, different from the logarithm, is a realistic description of individual long-term investors. The fact that investors must be aware of their own utility functions is a very abstract statement which is not a fundamental law of nature. Once a portfolio has been build using the CAPM, it is impossible to verify ex-post that it was the right choice. On the other hand, maximising growth over time is formulated in dollars, so that one has a good idea of the final wealth he will get. 2.3.2.4 Comparing the GOP with the MV approach The main results on the comparison between mean variance (MV) and growth optimality can be found in Hakansson [1971]. Mosegaard Christensen [2011] presented a review of whether or not the GOP and MV approach could be united or if they were fundamentally different. He concluded by stating that they were in general two different things. The mean-variance efficient portfolios are obtained as the solution to a quadratic optimisation program. Its theoretical justification requires either a quadratic utility function or some fairly restrictive assumptions on the class of return distribution, such as the assumption of normally distributed returns. As a result, the GOP is in general not meanvariance efficient. Mean-variance efficient portfolios have the possibility of ruin, and they are not consistent with first order stochastic dominance. We saw earlier that the mean-variance approach was further developed into the CAPM, where the market is assumed mean-variance efficient. Similarly, it was assumed that if all agents were to maximise the expected logarithm of wealth, then the GOP becomes the market portfolio and from this an equilibrium asset pricing model appears. As with the CAPM, the conclusion of the analysis provide empirically testable predictions. As a result of assuming log-utility, the martingale or numeraire condition becomes a key element of the equilibrium model. Recall, Ri (t) is the return on the ith asset between time t − 1 and t, and Rb is the return process for the GOP. Then the equilibrium is 1 + Ri (t) ] 1 + Rb which is the first order condition for a logarithmic investor. We assume a world with a finite number of states, Ω = {ω1 , .., ωn } and define pi = P({ωi }). Then if S i (t) is an Arrow-Debreu price, paying off one unit of wealth at time t + 1, we get 1 = Et−1 [ S i (t) = Et [ I{ω=ωi } ] 1 + Rb (t + 1) and consequently summing over all states provides an equilibrium condition for the risk-free rate 1 + r(t, t + 1) = Et [ 99 1 1+ Rb (t + 1) ] Quantitative Analytics i Combining with the previous equations, defining R = Ri − r, and performing some basic calculations, we get i b Et [R (t + 1)] = βti Et [R (t + 1)] where βti = i b b b (t+1) Cov(R (t + 1), R ) Rb (t+1) (t+1) Cov(R (t + 1), R ) Rb (t+1) This is to be compared with the CAPM, where the β is given by βCAP M = Cov(Ri , R∗ ) V ar(R∗ ) In some cases only is the CAPM and the CAPM based on the GOP similar. Note, the mean-variance portfolio provides a simple trade-off between expected return and variance which can be parametrised in a closed-form, requiring only the estimation of a variance-covariance matrix of returns and the ability to invert that matrix. Further, choosing a portfolio being either a fractional Kelly strategy or logarithmic mean-variance efficient provides the same trade-off, but it is computationally more involved. In the continuous case, for simplicity of exposition, we use the notation given in Appendix (E.1) and rewrite the dynamics of the ith risky asset as dS i (t) = ait dt + σti dWt S i (t) where dWt is a column vector of dimension (M, 1) of independent Brownian motions with elements (dWtj )M j=1 , and i N i σt is a volatility matrix of dimension (1, N ) with elements (σj (t))j=1 such that < σti , dWt >= M X σji (t)dWtj j=1 with Euclidean norm |σti |2 = M X (σji (t))2 j=1 In that setting, the portfolio in Equation (E.1.1) becomes dVtb = rt Vtb dt+ < (bS)t , at − rt I > dt+ < (bS)t , σt dWt > where we let σt be an adapted matrix of dimension N × M , (bS)t corresponds to the vector with component (bi (t)Sti )1≤i≤N describing the amount to be invested in each stock. Also, S 01(t) Vtb − (bS)t is invested in the riskless asset. Writting π(t) = the portfolio become (bS)t Vtb as a (N, 1) vector with elements (π i (t))N i=1 = (bi (t)Sti )1≤i≤N Vtb dVtb = rt dt+ < π(t), at − rt I > dt+ < π(t), σt dWt > Vtb In that setting, the instantaneous mean-variance efficient portfolio is the solution to the probelem 100 , the dynamics of Quantitative Analytics sup ab (t) b∈Θ(S) s.t. σtb ≤ κ(t) where κ(t) is some non-negative adapted process. Defining the process Ytb = ln Vtb and applying Ito’s lemma, we get 1 dYtb = rt dt+ < π(t), at − rt I > dt − |π(t)σti |2 dt+ < π(t), σt dWt > 2 with instantaneous growth rate being 1 g b (t) = rt + < π(t), at − rt I > − |π(t)σti |2 2 which is a generalisation of Equation (2.3.10). By construction, the GOP maximise the instantaneous growth rate. Taking the expectation, we get Z = E[ T 1 rs + < π(s), as − rs I > − |π(s)σsi |2 ds] 2 0 Note, we can define the minimal market price of risk as E[YTb ] at − rt I σt σt> Any efficient portfolio along the straight efficient frontier can be specified by its fractional holdings of the market portfolio, called the leverage and denoted by α. The instantaneously mean-variance efficient portfolios have fractions solving the equation θ(t) = σt at − rt I σt σt> for some non-negative process α. Hence, the optimum fractions become πb (t)σt = α(t)θ(t) = α(t)σt at − rt I (2.3.11) σt σt> In the special case where we assume the volatility matrix to be of dimension (N, N ) and invertible, the market price tI and the optimum fractions simplify to of risk become θ(t) = at −r σt πb (t) = α(t) θ(t) σt Using the optimum fractions, the SDE for such leveraged portfolios become πb (t) = α(t) (2.3.12) b dVt = rt dt + α(t)|θ(t)|2 dt + α(t) < θ(t), dWt > b Vt where the volatility of the portfolio is now θt . The GOP is instantaneously mean-variance efficient,corresponding to the choice of α = 1. The GOP belongs to the class of instantaneous Sharpe ratio maximising strategies, where for some strategy b, it is defined as b MSR = bt rt + < bt , at − rt I > −rt < bt , at > +rt (b0t − 1) = 2 |(bσj )t | |(bσj )t |2 (2.3.13) 0 where (bσj )t is a weighted volatility vector with elements (bit σji (t))N i=1 . Recall, bt rt − < bt , rt I >= bt rt , so that the mean-variance portfolios consist of a position in the GOP and the rest in the riskless asset, that is, a fractional Kelly strategy. 101 Quantitative Analytics 2.3.2.5 Time taken by the GOP to outperfom other portfolios As the GOP was advocated, not as a particular utility function, but as an alternative to utility theory relying on its ability to outperform other portfolios over time, it is important to document this ability over horizons relevant to actual investors. We present a simple example illustrating the time it takes for the GOP to dominate other assets. Example Assume a two asset Black-Scholes model with constant parameters with risk-free asset S 0 (t) = ert and and solving the SDE, the stock price is given as 1 2 )t+σW (t) 1 2 )t+θW (t) S 1 (t) = e(a− 2 σ The GOP is given by the process S b (t) = e(r− 2 θ where θ = a−r σ . Some simple calculations imply that the probability P0 (t) = P (S b (t) ≥ S 0 (t)) of the GOP outperforming the savings account over a period of length t and the probability P1 (t) = P (S b (t) ≥ S 1 (t)) of the GOP outperforming the stock over a period of length t are given by 1 √ P0 (t) = N ( θ t) 2 and √ 1 P1 (t) = N ( |θ − σ| t) 2 where the cumulative distribution function of the standard Gaussian distribution N (.) are independent of the short rate. Moreover, the probabilities are increasing in the market price of risk and time horizon. They converge to one as the time horizon increases to infinity, which is a manifestation of the growth properties of the GOP. The time needed for the GOP to outperform the risk free asset for a 99% confidence level is 8659 year for a market price of risk θ = 0.05 and 87 year for θ = 0.5. Similarly, for a 95% confidence level the time is 4329 year for θ = 0.05 and 43 year for θ = 0.5. One can conclude that the long run may be very long. Hence, the argument that one should choose the GOP to maximise the probability of doing better than other portfolios is somewhat weakened. 2.3.3 Measuring and predicting performances We saw in Section (2.3.1.1) that since any point along the efficient frontier represents an efficient portfolio, the investor needs additional information in order to select the optimal portfolio. That is, the key element in mean-variance portfolio analysis being one’s view on expected return and risk, the selection of a preferred combination of risk and expected return depends on the investor. However, we saw in Section (2.3.1.2) that one can attempt at finding efficient portfolios promising the greatest expected return for a given degree of risk (see Sharpe [1966]). Hence, one must translate predictions about security performance into predictions of portfolio performance, and select one efficient portfolio based on some utility function. The process for mutual funds becomes that of security analysis and portfolio analysis given some degree of risk. As a result, there is room for major and persisting differences in the performance of different funds. Over time, security analysis moved towards evaluating the interrelationships between securities, while portfolio analysis focused more on diversification as any diversified portfolio should be efficient in a perfect market. For example, one may only require the spreading of holdings among standard industrial classes. 102 Quantitative Analytics In the CAPM presented in Section (2.3.1.2), one assumes that the predicted performance of the ith portfolio is described with two measures, namely the expected rate of return ERi and the predicted variability or risk expressed as the standard deviation of return σi . Further, assuming that all investors can invest and borrow at the risk-free rate, all efficient portfolios satisfy Equation (2.3.4) and follow the linear representation ERi = a + bσi where a is the risk-free rate and b is the risk premium. Hence, by allocating his funds between the ith portfolio and borrowing or lending, the investor can attain any point on the line ER = a + ERi − a σR σi E −a for a given pair (ER , σR ), such that the best portfolio is the one for which the slope Rσii is the greatest (see Tobin [1958]). The predictions of future performance being difficult to obtain, ex-post values must be used in the model. That is, the average rate of return of a portfolio Ri must be substituted for its expected rate of return, and the actual standard deviation σ i of its rate of return for its predicted risk. In the ex-post settings, funds with properly diversified portfolios should provide returns giving Ri and σ i lying along a straight line, but if they fail to diversify the returns will yield inferior values for Ri and σ i . In order to analyse the performances of different funds, Sharpe [1966] proposed a single measure by substituting the ex-post measures R and σ R for the ex-ante measures ER and σR obtaining the formula Ri − a σR σi which is a reward-to-variability ratio (RV) or a reward per unit of variability. The numerator is the reward provided the investor for bearing risk, and the denominator measures the standard deviation of the annual rate of return. The results of his analysis based on 34 funds on two periods, from 1944 till 1953 and from 1954 till 1963, showed that differences in performance can be predicted, although imperfectly, but one can not identifies the sources of the differences. Further, there is no assurance that past performance is the best predictor of future performance. During the period 1954-63, almost 90% of the variance of the return a typical fund of the sample was due to its comovement with the return of the other securities used to compute the Dow-Jones Industrial Average, with a similar percentage for most of the 34 funds. Taking advantage of this relationship, Treynor [1965] used the volatility of a fund as a measure of its risk instead of the total variability used in the RV ratio. Letting Bi be the volatility of the ith fund defined as the change in the rate of return of the fund associated with a 1% change in the rate of return of a benchmark or index, the Treynor index can be written as R=a+ Ri − a Bi According to Sharpe [1966], Treynor intended that his index be used both for measuring a fund’s performance, and for predicting its performance in the future. Treynor [1965] argued that a good historical performance pattern is one which, if continued in the future, would cause investors to prefer it to others. Given the level of contribution of volatility to the over-all variability, one can expect the ranking of funds on the basis of the Treynor index to be very close to that based on the RV ratio, especially when funds hold highly diversified portfolios. Differences appear in the case of undiversified funds since the TI index do not capture the portion of variability due to the lack of diversification. For this reason Sharpe concluded that the TI ratio was an inferior measure of past performance but a possibly superior measure for predicting future performance. MT I = Note, independently from Markowitz, Roy [1952] set down the same equation relating portfolio variance of return to the variances of return of the constituent securities, developing a similar mean-variance efficient set. However, while Markowitz left it up to the investor to choose where along the efficient set he would invest, Roy advised choosing the single portfolio in the mean-variance efficient set maximising 103 Quantitative Analytics µ−d 2 σM where d is a disaster level return the investor places a high priority on not falling below. It is very similar to the reward-to-variability ratio (RV) proposed by Sharpe. In its measure of quality and performance of a portfolio, Sharpe [1966] did not distinguish between time and ensemble averages. We saw in Section (2.3.2.4) that the measure is also meaningful in the context of time averages in geometric Brownian motion and derived in Equation (2.3.13) the GOP Sharpe ratio. Assuming a portfolio following the simple geometric Brownian motion in Equation (2.3.2), Peters [2011c] derived the dynamics of the leveraged portfolio, and, applying Ito’s lemma to obtain the dynamics of the log-portfolio, computed the time-average leveraged exponential growth rate as 1 1 2 < d ln Vtα >= r + αµ − α2 σM dt 2 where σM is the volatility of the market portfolio. Differentiating with respect to α and setting the result to zero, the optimum leverage becomes gαb = α∗ = µ 2 σM corresponding to the optimum fraction in Equation (2.3.12) with α = 1. Note, Peters chose to optimise the leverage rather than optimising the fraction π(t). Differing from the Sharpe ratio for the market portfolio only by a square in the volatility, the optimum leverage or GOP Sharpe ratio is also a fundamental measure of the quality and performance of a portfolio. Further, unless the Sharpe ratio, the optimum leverage is a dimensionless quantity, and as such can distinguish between fundamentally different dynamical regimes. 2.3.4 Predictable variation in the Sharpe ratio The Sharpe ratio (SR) is the most common measure of risk-adjusted return used by private investors to assess the performance of mutual funds (see Modigliani et al. [1997]). Given evidence on predictable variation in the mean and volatility of equity returns (see Fama et al. [1989]), various authors studied the predictable variation in equity market SRs. However, due to the independence of the sample mean and sample variance of independently normally distributed variables (see Theorem (B.7.3)), predictable variation in the individual moments does not imply predictable variation in the Sharpe ratio. One must therefore ask whether these moments move together, leading to SRs which are more stable and potentially less predictable than the two components individually. The intuition being that volatility in the SR is not a good proxy for priced risk. Using regression analysis, some studies suggested a negative relation between the conditional mean and volatility of returns, indicating the likelihood of substantial predictable variation in market SRs. Using linear functions of four predetermined financial variables to estimate conditional moments, Whitelaw [1997] showed that estimated conditional SRs exhibit substantial time-variation that coincides with the variation in ex-post SRs and with the phases of the business cycle. For instance, the conditional SRs had monthly values ranging from less than −0.3 to more than 1.0 relative to an unconditional SR of 0.14 over the full sample period. This variation in estimated SRs closely matches variation in ex-post SRs measured over short horizons. Subsamples chosen on the basis of in-sample regression have SRs more than three times larger than SRs over the full sample. On an out-sample basis, using 10-year rolling regressions, subsample SRs exhibited similar magnitudes. As a result, Whitelaw showed that relatively naive market-timing strategies exploiting this predictability could generate SRs more than 70% larger than a buy-and-hold strategy. These active trading strategies involve switching between the market and the risk-free asset depending on the level of the estimated SR relative to a specific threshold. This result is critical in asset allocation decisions, and it has implications for the use of SRs in investment performance evaluation. While the Sharpe ratio is regarded as a reliable measure during periods of increasing stock prices, it leads to erroneous conclusions during periods of declining share prices. However, there are still contradictions in the literature with respect to the interpretation of the SR in bear market periods. Scholz et al. [2006] showed that ex-post Sharpe 104 Quantitative Analytics ratios do not allow for meaningful performance assessment of funds during non-normal periods. Using a single factor model, they showed the resulting SRs to be subject to random market climates (random mean and standard deviation of market excess returns). Considering a sample of 532 US equity mutual funds, funds exhibiting relatively high proportions of fund-specific risk showed on average superior ranking according to the SR in bear markets, and vice versa. Using regression analysis, they ascertained that the SRs of funds significantly depend on the mean excess returns of the market. 2.4 Risk and return analysis Asset managers employ risk metrics to provide their investors with an accurate report of the return of the fund as well as its risk. Risk measures allow investors to choose the best strategies per rebalancing frequency in a more robust way. Performance evaluation of any asset, strategy, or fund tends to be done on returns that are adjusted for the average risk taken. We call active return and active risk the return and risk measured relative to a benchmark. Since all investors in funds have some degree of risk aversion and require limits on the active risk of the funds, they consider the ratio of active return to active risk in a risk adjusted performance measure (RAPM) to rank different investment opportunities. In general, RAPMs are used to rank portfolios in order of preference, implying that preferences are already embodied in the measure. However, we saw in Section (1.6.2) that to make a decision we need a utility function. While some RAPMs have a direct link to a utility function, others are still used to rank investments but we can not deduce anything about preferences from their ranking so that no decision can be based on their ranks (see Alexander [2008]). The three measures by which the risk/return framework describes the universe of assets are the mean (taken as the arithmetic mean), the standard deviation, and the correlation of an asset to other assets’ returns. Concretely, historical time series of assets are used to calculate the statistics from it, then these statistics are interpreted as true estimators of the future behaviour of the assets. In addition, following the central limit theorem, returns of individual assets are jointly normally distributed. Thus, given the assumption of a Gaussian (normal) distribution, the first two moments suffice to completely describe the distribution of a multi-asset portfolio. As a result, adjustment for volatility is the most common risk adjustment leading to Sharpe type metrics. Implicit in the use of the Sharpe ratio is the assumption that the preferences of investors can be represented by the exponential utility function. This is because the tractability of an exponential utility function allows an investor to form optimal portfolios by maximising a meanvariance criterion. However, some RAPMs are based on downside risk metrics which are only concerned with returns falling short of a benchmark or threshold returns, and are not linked to a utility function. Nonetheless these metrics are used by practitioners irrespectively of their theoretical foundation. 2.4.1 Some financial meaning to alpha and beta 2.4.1.1 The financial beta In finance, the beta of a stock or portfolio is a number describing the correlated volatility of an asset in relation to the volatility of the benchmark that this asset is being compared to. We saw in Section (2.3.1.2) that the beta coefficient was born out of linear regression analysis of the returns of a portfolio (such as a stock index) (x-axis) in a specific period versus the returns of an individual asset (y-axis) in a specific year. The regression line is then called the Security characteristic Line (SCL) SCL : Ra (t) = αa + βa Rm (t) + t where αa is called the asset’s alpha and βa is called the asset’s beta coefficient. Note, if we let Rf be a constant rate, we can rewrite the SCL as SCL : Ra (t) − Rf = αa + βa (Rm (t) − Rf ) + t Both coefficients have an important role in Modern portfolio theory. For 105 (2.4.14) Quantitative Analytics • β < 0 the asset generally moves in the opposite direction as compared to the index. • β = 0 movement of the asset is uncorrelated with the movement of the benchmark • 0 < β < 1 movement of the asset is generally in the same direction as, but less than the movement of the benchmark. • β = 1 movement of the asset is generally in the same direction as, and about the same amount as the movement of the benchmark • β > 1 movement of the asset is generally in the same direction as, but more than the movement of the benchmark We consider that a stock with β = 1 is a representative stock, or a stock that is a strong contributor to the index itself. For β > 1 we get a volatile stock, or stocks which are very strongly influenced by day-to-day market news. Higherbeta stocks tend to be more volatile and therefore riskier, but provide the potential for higher returns. Lower-beta stocks pose less risk but generally offer lower returns. For instance, a stock with a beta of 2 has returns that change, on average, by twice the magnitude of the overall market’s returns: when the market’s return falls or rises by 3%, the stock’s return will fall or rise (respectively) by 6% on average. The Beta measures the part of the asset’s statistical variance that cannot be removed by the diversification provided by the portfolio of many risky assets, because of the correlation of its returns with the returns of the other assets that are in the portfolio. Beta can be estimated for individual companies by using regression analysis against a stock market index. The formula for the beta of an asset within a portfolio is βa = Cov(Ra , Rb ) V ar(Rb ) where Ra measures the rate of return of the asset, Rb measures the rate of return of the portfolio benchmark, and Cov(Ra , Rb ) is the covariance between the rates of return. The portfolio of interest in the Capital Asset Pricing Model (CAPM) formulation is the market portfolio that contains all risky assets, and so the Rb terms in the formula are replaced by Rm , the rate of return of the market. Beta is also referred to as financial elasticity or correlated relative volatility, and can be referred to as a measure of the sensitivity of the asset’s returns to market returns, its non-diversifiable risk, its systematic risk, or market risk. On an individual asset level, measuring beta can give clues to volatility and liquidity in the market place. As beta also depends on the correlation of returns, there can be considerable variance about that average: the higher the correlation, the less variance; the lower the correlation, the higher the variance. In order to estimate beta, one needs a list of returns for the asset and returns for the index which can be daily, weekly or any period. Then one uses standard formulas from linear regression. The slope of the fitted line from the linear least-squares calculation is the estimated beta. The y-intercept is the estimated alpha. Beta is a statistical variable and should be considered with its statistical significance (R square value of the regression line). Higher R square value implies higher correlation and a stronger relationship between returns of the asset and benchmark index. Using beta as a measure of relative risk has its own limitations. Beta views risk solely from the perspective of market prices, failing to take into consideration specific business fundamentals or economic developments. The price level is also ignored. Beta also assumes that the upside potential and downside risk of any investment are essentially equal, being simply a function of that investment’s volatility compared with that of the market as a whole. This too is inconsistent with the world as we know it. The reality is that past security price volatility does not reliably predict future investment performance (or even future volatility) and therefore is a poor measure of risk. 106 Quantitative Analytics 2.4.1.2 The financial alpha Alpha is a risk-adjusted measure of the so-called active return on an investment. It is the part of the asset’s excess return not explained by the market excess return. Put another way, it is the return in excess of the compensation for the risk borne, and thus commonly used to assess active managers’ performances. Often, the return of a benchmark is subtracted in order to consider relative performance, which yields Jensen’s [1968] alpha. It is the intercept of the security characteristic line (SCL), that is, the coefficient of the constant in a market model regression in Equation (2.4.14). Therefore the alpha coefficient indicates how an investment has performed after accounting for the risk it involved: • α < 0 the investment has earned too little for its risk (or, was too risky for the return) • α = 0 the investment has earned a return adequate for the risk taken • α > 0 the investment has a return in excess of the reward for the assumed risk For instance, although a return of 20% may appear good, the investment can still have a negative alpha if it is involved in an excessively risky position. A simple observation: during the middle of the twentieth century, around 75% of stock investment managers did not make as much money picking investments as someone who simply invested in every stock in proportion to the weight it occupied in the overall market in terms of market capitalisation, or indexing. A belief in efficient markets spawned the creation of market capitalisation weighted index funds that seek to replicate the performance of investing in an entire market in the weights that each of the equity securities comprises in the overall market. This phenomenon created a new standard of performance that must be matched: an investment manager should not only avoid losing money for the client and should make a certain amount of money, but in fact he should make more money than the passive strategy of investing in everything equally. Although the strategy of investing in every stock appeared to perform better than 75% of investment managers, the price of the stock market as a whole fluctuates up and down. The passive strategy appeared to generate the marketbeating return over periods of 10 years or more. This strategy may be risky for those who feel they might need to withdraw their money before a 10-year holding period. Investors can use both Alpha and Beta to judge a manager’s performance. If the manager has had a high alpha, but also a high beta, investors might not find that acceptable, because of the chance they might have to withdraw their money when the investment is doing poorly. 2.4.2 Performance measures When considering the performance evaluation of mutual funds, one need to assess whether these funds are earning higher returns than the benchmark returns (portfolio or index returns) in terms of risk. Three measures developed in the framework of the Capital Asset Pricing Model (CAPM) proposed by Treynor [1965], Sharpe [1964] and Lintner [1965] directly relate to the beta of the portfolio through the security market line (SML). Jensen’s [1968] alpha is defined as the portfolio excess return earned in addition to the required average return, while the Treynor ratio and the Information ratio are defined as the alpha divided by the portfolio beta and by the standard deviation of the portfolio residual returns. More recent performance measures developed along hedge funds, such as the Sortino ratio, the M2 and the Omega, focus on a measure of total risk, in the continuation of the Sharpe ratio applied to the capital market line (CML). In the context of the extension of the CAPM to linear multi-factor asset pricing models, the development of measures has not been so prolific (see Hubner [2007]). The Sharpe ratio or Reward to Variability and Sterling ratio have been widely used to measure commodity trading advisor (CTA) performance. One can group investment statistics as Sharpe type combining risk and return in a ratio, or descriptive statistics (neither good nor bad) providing information about the pattern of returns. Examples of the latter are regression statistics (systematic risk), covariance and R2 . Additional risk measures exist to accommodate the risk concerns of different types of investors. Some of these measures have been categorised in Table (2.1). 107 Quantitative Analytics Table 2.1: List of measure Type Normal Regression Partial Moments Drawdown Value at Risk 2.4.2.1 Combined Return and Risk Ratio Sharpe, Information, Modified Information Apraisal, Treynor Sortino, Omega, Upside Potential, Omega-Sharpe, Prospect Calmar, Sterling, Burke, Sterling-Calmar, Pain, Martin Reward to VaR, Conditional Sharpe, Modified Sharpe The Sharpe ratio The Sharpe ratio measures the excess return per unit of deviation in an investment asset or a trading strategy defined as E[Ra − Rb ] (2.4.15) σ where Ra is the asset return and Rb is the return of a benchmark asset such as the risk free rate or an index. Hence, E[Ra − Rb ] is the expected value of the excess of the asset return over the benchmark return, and σ is the standard deviation of this expected excess return. It characterise how well the return of an asset compensates the investor for the risk taken. If we graph the risk measure with a the measure of return in the vertical axis and the measure of risk in the horizontal axis, then the Sharpe ratio simply measures the gradient of the line from the risk-free rate to the combined return and risk of each asset (or portfolio). Thus, the steeper the gradient, the higher the Sharpe ratio, and the better the combined performance of risk and return. MSR = Remark 2.4.1 The ex-post Sharpe ratio uses the above equation with the realised returns of the asset and benchmark rather than expected returns. rP − rF MSR = σP where rp is the asset/portfolio return (annualised), rF is the annualised risk-free rate, and σP is the portfolio risk or standard deviation of return. This measure can be compared with the Information ratio in finance defined in general as mean over standard deviation of a series of measurements. The Sharp ratio is directly computable from any observed series of returns without the need for additional information surrounding the source of profitability. While the Treynor ratio only works with systemic risk of a portfolio, the Sharp ratio observes both systemic and idiosyncratic risks. The SR has some shortcomings because all volatility is not equal, and the volatility taken in the measure ignores the distinction between systematic and diversifiable risks. Further, volatility does not distinguish between losses occurring in good or bad time or even between upside and downside surprises. Remark 2.4.2 The returns measured can be any frequency (daily, weekly, monthly or annually) as long as they are normally distributed, as the returns can always be annualised. However, not all asset returns are normally distributed. The SR assumes that assets are normally distributed or equivalently that the investors’ preferences can be represented by the quadratic (exponential) utility function. That is, the portfolio is completely characterised by its mean and volatility. As soon as the portfolio is invested in technology stocks, distressed companies, hedge funds or high yield bonds, this ratio is no-longer valid. In that case, the risk comes not only from volatility but also from higher moments like skewness and kurtosis. Abnormalities like kurtosis, fatter tails and higher peaks or skewness on the distribution can be problematic for the computation of the ratio as standard deviation does not have the same effectiveness when these problems exist. As a result, we can get very misleading measure of risk-return. In addition, the Sharp ratio being a dimensionless ratio it may be difficult to interpret the measure of different investments. This weakness was 108 Quantitative Analytics well addressed by the development of the Modigliani risk-adjusted performance measure, which is in units of percent returns. One need to consider a proper risk-adjusted return measure to get a better feel of risk-adjusted out-performance such as M 2 defined as M 2 = (rp − rF ) σM + rF σP where σM is the market risk or standard deviation of a benchmark return (see Modigliani et al. [1997]). It can also be rewritten as M 2 = rP + MSR (σM − σP ) where the variability can be replaced by any measure of risk and M 2 can be calculated for different types of risk measures. This statistic introduces a return penalty for asset or portfolio risk greater than benchmark risk and a reward if it is lower. 2.4.2.2 More measures of risk Treynor proposed a risk adjusted performance measure associated with abnormal returns in the CAPM. The Treynor ratio or reward to volatility is a Sharpe type ratio where the numerator (or vertical axis graphically speaking) is identical but the denominator (horizontal axis) replace total risk with systematic risk as calculated by beta MT R = rP − rF βP where βP is the market beta (see Treynor [1965]). Although well known, the Treynor ratio is less useful precisely because it ignores specific risk. It will converge to the Sharpe ratio in a fully diversified portfolio with no specific risk. The Appraisal ratio suggested by Treynor & Black [1973] is a Sharpe ratio type with excess return adjusted for systematic risk in the numerator, and specific risk and not total risk in the denominator MAR = α σ where α is the Jensen’s alpha. It measures the systematic risk adjusted reward for each unit of specific risk taken. While the Sharpe ratio compares absolute return and absolute risk, the Information ratio compares the excess return and tracking error (the standard deviation of excess return). That is, the Information ratio is a Sharpe ratio type with excess return on the vertical axis and tracking error or relative risk on the horizontal axis. As we are not using the risk-free rate, the information ratio lines radiate from the origin and can be negative indicating underperformance. 2.4.2.3 Alpha as a measure of risk The Jensen’s alpha, which is the excess return adjusted for systematic risk, was argued by Jensen to be a more appropriate measure than TR or IR for ranking the potential performance of different portfolios, implying that asset managers should view the best investment as the one with the largest alpha, irrespective of its risk. In view of keeping track of the portfolio’s returns Ross extended the CAPM to multiple risk factors, leading to the multi-factor return models commonly used to identify alpha opportunities. Some multi-factor models include size and value factors besides the market beta factor, and others include various industry and style factors for equities. In contrast to the CAPM that has only one risk factor, namely the overall market, APT has multiple risk factors. Each risk factor has a corresponding beta indicating the responsiveness of the asset being priced to that risk factor. Whatever risk factors are used, significant average loadings on any risk factor are viewed as evidence of a systematic risk tilt. Therefore, while the Jensen’s alpha is the intercept when regressing asset returns on equity market returns, it is also the intercept of any risk factor model and can be used as a metric. Howerver, it is extremely difficult to obtain a consistent ranking of portfolios using Jensen’s alpha because the estimated alpha is too dependent on the multi-factor model used. For example, as the number of factors increase, there is ever less scope for alpha. 109 Quantitative Analytics 2.4.2.4 Empirical measures of risk In the CAPM, the empirical derivation of the security market line (SML) corresponds to the market model Rie = αi + βi Rm + i where Rie = Ri − Rf denotes the excess return on the ith security. The risk and return are forecast ex-ante using a model for the risk and the expected return. They may also be estimated ex-post using some historical data on returns, assuming that investors believe that historical information are relevant to infer the future behaviour of financial assets. The ex-post (or realised) version of the SML is e Ri = α̂i + β̂i R m e e m where Ri is the average excess return for the ith security, β̂i = Ĉov(Rie , Rm ) and α̂i = Ri − β̂i R are the estimators of βi and αi , respectively. The Jensen’s alpha is measured by the α̂i in the ex post SML, while the Treynor ratio is defined as the ratio of Jensen’s alpha over the stock beta, that is, MT R (i) = α̂β̂ i . Finally, the Information Ratio is a i measure of Jensen’s alpha per unit of portfolio specific risk, measured as the standard deviation of the market model α̂i . residuals MIR = σ̂( i) The sample estimates being based on monthly, weekly or daily data, the moments in the risk measures must be annualised. However,the formula to convert returns or volatility measures from one time period to another assume a particular underlying model or process. When portfolio returns are autocorrelated, the standard deviation does not obey the square-root-of-time rule and one must use higher moments leading to Equation (3.3.11). When returns are perfectly correlated with 100% autocorrelation then a positive return is followed by a positive return and we get a trending market. On the other hand, when the autocorrelation is −100% then a positive return is followed by a negative return and we get a mean reverting or contrarian market. Therefore, assuming √ a 100% daily correlated market with 252) but the weekly volatility is 35% 1% daily return (5% weekly return), then the daily volatility is 16% (1% × √ (5% × 252) which is more than twice as large (see Bennett et al. [2012]). When the use of a single index or benchmark in a market model is not sufficient to keep track of the systematic sources of portfolio returns in excess of the risk free rate, one can consider the families of linear multi-index unconditional asset pricing models among which is the ex-post multidimensional equation e Ri = α̂i + k X β̂ij Rj = α̂i + B̂i R e j=1 where j = 1, ..., k is the number of distinct risk factors, the line vector B̂i = (β̂i1 , .., β̂ik ) and the column vector e e e R = (R1 , .., Rk )> represent risk loadings and average returns for the factors, respectively. In this setting, the alpha remains a scalar, and the standard deviation of the regression residuals is also a positive number, so that the multi-index counterparts of the Jensen’s alpha and the information ratio are similar to the performance measures applied to the single index model. To conserve the same interpretation as the original Treynor ratio, Hubner [2005] proposed the following generalisation MGT R (i) = α̂i B̂l R e B̂i R e where l denotes the benchmark portfolio against which the ith portfolio is compared. 110 Quantitative Analytics 2.4.2.5 Incorporating tail risk While the problem of fat tails is everywhere in financial risk analysis, there is no solution, and one should only consider partial solutions. Hence, one practical strategy for dealing with the messy but essential issues related to measuring and managing risk starts with the iron rule of never relying on one risk metric. Even though all of the standard metrics have well-known flaws, that does not make them worthless, but it is a reminder that we must understand where any one risk measure stumbles, where it can provide insight, and what are the possible fixes, if any. The main flaw of the Sharpe ratio (SR) is that it uses standard deviation as a proxy for risk. This is a problem because standard deviation, which is the second moment of the distribution, works best with normal distributions. Therefore, investors must have a minimal type of risk aversion to variance alone, as if their utility function was exponential. Even though normality has some validity over long periods of time, in the short run it is very unlikely (see short maturity smile on options in Section (1.7.6.1)). Note, when moving away from the normality assumption for the stock returns, only the denominator in the Sharpe ratio is modified. Hence, all the partial solutions are attempts at expressing one way or another the proper noise of the stock returns. While extensions of the SR to normality assumption have been successful, extension to different types of utility function have been more problematic. The problem is that extreme losses occur more frequently than one would expect when assuming that price changes are always and forever random (normally distributed). Put another way, statistics calculated using normal assumption might underestimate risk. One must therefore account for higher moments to get a better understanding of the shape of the distribution of returns in view of assessing the relative qualities of portfolios. Investors should prefer high average returns, lower variance or standard deviation, positive skewness, and lower kurtosis. The adjusted Sharpe ratio suggested by Pezier et al. [2006] explicitly rewards positive skewness and low kurtosis (below 3, the kurtosis of a normal distribution) in its calculation K −3 2 S MSR MASR = MSR 1 + MSR − 6 24 where S is the skew and K is the kurtosis. This adjustment will tend to lower the SR if there is negative skewness and positive excess kurtosis in the returns. Hence, it potentially removes one of the possible criticisms of the Sharpe ratio. Hodges [1997] introduced another extension of the SR accounting for non-normality and incorporating utility function. Assuming that investors are able to find the expected maximum utility E[u∗ ] associated with any portfolio, the generalised Sharpe ratio (GSR) of the portfolio is 1 MGSR = −2 ln (−E[u∗ ]) 2 One can avoid the difficulty of computing the maximum expected utility by assuming the investor has an exponential utility function. Using the fourth order Taylor approximation of the certain equivalent, and approximating the multiplicative factor Pezier et al. [2006] obtained the maximum expected utility function in that setting and showed that the GSR simplifies to the ASR. Thus, when the utility function is exponential and the returns are normally distributed, the GSR is identical to the SR. Otherwise a negative skewness and high positive kurtosis will reduce the GSR relative to the SR. 2.4.3 Some downside risk measures Downside risk measures the variability of underperformance below a minimum target rate which could be the risk free rate, the benchmark or any other fixed threshold required by the client. All positive returns are included as zero in the calculation of downside risk or semi-standard deviation. Investors being less concerned with variability on the upside, and extremely concerned about the variability on the downside, an extended family of risk-adjusted measures flourished, reflecting the downside risk tolerances of investors seeking absolute and not relative returns. Lower partial moments (LPMs) measure risk by negative deviations of the returns realised in relation to a minimal acceptable return rT . The LPM of kth-order is computed as 111 Quantitative Analytics LP M (k) = E[max (rT − r, 0)k ] = n X 1 max [rT − ri , 0]k n i=1 Kaplan et al. [2004] introduced a Sharpe type denominator with lower partial moments in the denominator given by p k LP M (k). The Kappa index of order k is rP − rT MK = p k LP M (k) Kappa indices can be tailord to the degree of risk aversion of the investor, but can not be used to rank portfolio’s performance according to investor’s preference. One possible calculation of semi-standard deviation or downside risk in the period [0, T ] is v u n uX 1 σD = t min [ri − rT , 0]2 n i=1 where rT is the minimum target return. Downside potential is simply the average of returns below target n n X X 1 1 min [ri − rT , 0] = I{rrT } (ri − rT ) n n i=1 i=1 Shadwick et al. [2002] proposed a gain-loss ratio, called Omega, that captutres the information in the higher moments of return distribution Pn 1 max (ri − rT , 0) E[max (r − rT , 0)] MΩ = = n1 Pi=1 n E[max (rT − r, 0)] i=1 max (rT − ri , 0) n This ratio implicitly adjusts for both skewness and kurtosis. It can also be used as a ranking statistics (the higher, the better). Note, the ratio is equal to 1 when rT is the mean return. Kaplan et al. [2004] showed that the Omega ratio can be rewritten as a Sharpe type ratio called Omega-Sharpe ratio MOSR = 1 n rP − rT i=1 max (rT − ri , 0) Pn which is simply Ω − 1, thus generating identical ranking than the Omega ratio. Setting rT = 0 in the Omega ratio, Bernardo et al. [1996] obtained the Bernardo Ledoit ratio (or Gain-Loss ratio) 112 Quantitative Analytics MBLR = Pn 1 max (ri , 0) n Pni=1 1 max (−ri , 0) i=1 n Sortino et al. [1991] proposed an extension of the Omega-Sharpe ratio by using downside risk in the denominator MSoR = rp − rT σD In that measure, portfolio managers will only be penalised for variability below the minimum target return, but will not be penalised for upside variability. In order to rank portfolio performance while combining upside potential with downside risk, Sortino et al. [1999] proposed the Upside Potential ratio Pn 1 i=1 max (ri − rT , 0) n MU P R = σD This measure is similar to the Omega ratio except that performance below target is penalised further by using downside risk rather than downside potential. Going further, we can replace the upside potential in the numerator with the upside risk, getting the Variability Skewness MV SR = 2.4.4 Considering the value at risk 2.4.4.1 Introducing the value at risk σU σD The Value at Risk (VaR) is a widely used risk measure of the risk of loss on a specific portfolio of financial assets. VaR is defined as a threshold value such that the probability that the mark-to-market loss on the portfolio over the given time horizon exceeds this value (assuming normal markets and no trading in the portfolio) is the given probability level. For example, if a portfolio of stocks has a one-day 5% VaR of $1 million, there is a 0.05 probability that the portfolio will fall in value by more than $1 million over a one day period if there is no trading. Informally, a loss of $1 million or more on this portfolio is expected on 1 day out of 20 days (because of 5% probability). VaR represents a percentile of the predictive probability distribution for the size of a future financial loss. That is, if you have a record of portfolio value over time then the VaR is simply the negative quantile function of those values. Given a confidence level α ∈ (0, 1), the VaR of the portfolio at the confidence level α is given by the smallest number zp such that the probability that the loss L exceeds zp is at most (1 − α). Assuming normally distributed returns, the Value-at-Risk (daily or monthly) is V aR(p) = W0 (µ − zp σ) where W0 is the initial portfolio wealth, µ is the expected asset return (daily or monthly), σ is the standard deviation (daily or monthly), and zp is the number of standard deviation at (1 − α) (distance between µ and the VaR in number of standard deviation). It ensures that P (dW ≤ −V aR(p)) = 1 − α Note, V aR(p) represents the lower bound of the confidence interval given in Appendix (B.8.6). For example, setting α = 5% then zp = 1.96 with p = 97.5 which is a 95% probability. If returns do not display a normal distribution pattern, the Cornish-Fisher expansion can be used to include skewness and kurtosis in computing value at risk (see Favre et al. [2002]). It adjusts the z-value of a standard VaR for skewness and kurtosis as follows 113 Quantitative Analytics 1 1 1 zcf = zp + (zp2 − 1)S + (zp3 − 3zp )K − (2zp3 − 5zp )S 2 6 24 36 where zp is the critical value according to the chosen α-confidence level in a standard normal distribution, S is the skewness, K is the excess kurtosis. Integrating them into the VaR measure by means of the Cornish-Fisher expansion zcf , we end up with a modified formulation for the VaR, called MVaR M V aR(p) = W0 (µ − zcf σ) 2.4.4.2 The reward to VaR We saw earlier that when the risk is only measured with the volatility it is often underestimated, because the assets returns are negatively skewed and have fat tails. One solution is to use the value-at-risk as a measure of risk, and consider Sharpe type measures using VaR. For instance, replacing the standard deviation in the denominator with the VaR ratio (Var expressed as a percentage of portfolio value rather than an amount) Dowd [2000] got the Reward to VaR rP − rF VaR ratio Note, the VaR measure does not provide any information about the shape of the tail or the expected size of loss beyond the confidence level, making it an unsatisfactory risk measure. MRV aR = 2.4.4.3 The conditional Sharpe ratio Tail risk is the possibility that investment losses will exceed expectations implied by a normal distribution. One attempt at trying to anticipate non-normality is the modified Sharpe ratio, which incorporates skewness and kurtosis into the calculation. Another possibility is the so-called conditional Sharpe ratio (CSR) or expected shortfall, which attempts to quantify the risk that an asset or portfolio will experience extreme losses. VaR tries to tell us what the possibility of loss is up to some confidence level, usually 95%. So, for instance, one might say that a certain portfolio is at risk of losing X% for 95% of the time. What about the remaining 5%? Conditional VaR, or CVaR, dares to tread into this black hole of fat taildom (by accounting for the shape of the tail). For the conditional Sharpe ratio, CVaR replaces standard deviation in the metric’s denominator MCV aR = rP − rF CV aR(p) The basic message in conditional Sharpe ratio, like that of its modified counterpart, is that investors underestimate risk by roughly a third (or more?) when looking only at standard deviation and related metrics (see Agarwal et al. [2004]). 2.4.4.4 The modified Sharpe ratio The modified Sharpe ratio (MSR) is one of several attempts at improving the limitations of standard deviation. MSR is far from a complete solution, still, it factors in two aspects of non-normal distributions, skewness and kurtosis. It does so through the use of what is known as a modified Value at Risk measure (MVaR) as the denominator. The MVaR follows the Cornish-Fisher expansion, which can adjust the VaR in terms of asymmetric distribution (skewness) and above-average frequency of earnings at both ends of the distribution (kurtosis). The modified Sharpe ratio is MM SR = rP − rF M V aR(p) Similarly to the Adjusted Sharpe ratio, the Modified Sharpe ratio uses modified VaR adjusted for skewness and kurtosis (see Gregoriou et al. [2003]). Given a 10 years example, in all cases the modified Sharpe ratio was lower than its traditional Sharpe ratio counterpart. Hence, for the past decade, risk-adjusted returns were lower than expected after 114 Quantitative Analytics adjusting for skewness and kurtosis. Note, depending on the rolling period, MSR has higher sensitivity to changes in non-normal distributions whereas the standard SR is immune to those influences. 2.4.4.5 The constant adjusted Sharpe ratio Eling et al. [2006] showed that even though hedge fund returns are not normally distributed, the first two moments describe the return distribution sufficiently well. Furthermore, on a theoretical basis, the Sharpe ratio is consistent with expected utility maximisation under the assumption of elliptically distributed returns. Taking all the previous remarks into consideration, we propose a new very simple Sharpe ratio called the Constant Adjusted Sharpe ratio and defined as MCASR = rP − rF σ(1 + S ) where S > 0 (S = 13 to recover the conditional Sharpe ratio) is the adjusted volatility defined in Section (??). In that measure, the volatility is simply modified by a constant. 2.4.5 Considering drawdown measures For an investor wishing to avoid losses, any continuous losing return period or drawdown constitutes a simple measure of risk. The drawdown measures the decline from a historical peak in some variable (see Magdon-Ismail et al. [2004]). It is the pain period experienced by an investor between peak (new highs) and subsequent valley (a low point before moving higher). If (Xt )t≥0 is a random process with X0 = 0, the drawdown D(T ) at time T is defined as D(T ) = max 0, max (Xt − XT ) t∈(0,T ) One can count the total number of drawdowns nd in the entire period [0, T ] and compute the average drawdown as D(T ) = nd 1 X Di nd i=1 where Di is the ith drawdown over the entire period. The maximum drawdown (MDD) up to time T is the maximum of the drawdown over the history of the variable (typically the Net Asset Value of an investment) M DD(τ ) = max D(τ ) τ ∈(0,T ) In a long-short portfolio, the maximum drawdown is the maximum loss an investor can suffer in the fund buying at the highest point and selling at the lowest. We can also define the drawdown duration as the length of any peak to peak period, or the time between new equity highs. Hence, the maximum drawdown duration is the worst (maximum/longest) amount of time an investment has seen between peaks. Martin [1989] developed the Ulcer index where the impact of the duration of drawdowns is incorporated by selecting the negative return for each period below the previous peak or high water mark v u n u1 X 0 (D )2 Ulcer Index = t n i=1 i 0 where Di is the drawdown since the previous peak in ith period. This way, deep, long drawdowns will have a significant impact as the underperformance since the last peak is squared. Being sensitive to the frequency of time period, this index penalises managers taking time to recovery from previous high. If the drawdowns are not squared, we get the Pain index 115 Quantitative Analytics n Pain Index = 1X 0 |D | n i=1 i which is similar to the Zephyr Pain index in discrete form proposed by Becker. We are considering measures which are modification of the Sharpe ratio in the sense that the numerator is always the excess of mean returns over risk-free rate, but the standard deviation of returns in the denominator is replaced by some function of the drawdown. The Calmar ratio (or drawdown ratio) is a performance measurement used to evaluate hedge funds which was created by T.W. Young [1991]. Originally, it is a modification of the Sterling ratio where the average annual rate of return for the last 36 months is divided by the maximum drawdown for the same period. It is computed on a monthly basis as opposed to other measures computed on a yearly basis. Note, the MAR ratio, discussed in Managed Account Reports, is equal to the compound annual return from inception divided by the maximum drawdown over the same period of time. As discussed by Bacon [2008], later version of the Calmar ratio introduce the risk-free rate into the numerator to create a Sharpe type ratio MCR = rP − rF M DD(τ ) The Sterling ratio replaces the maximum drawdowns in the Calmar ratio with the average drawdown. According to Bacon, the original definition of the Sterling ratio is MSterR = rP Dlar + 10% where Dlar is the average largest drawdown, and the 10% is an arbitrary compensation for the fact that Dlar is inevitably smaller than the maximum drawdown. In vew of generalising the measure, Bacon rewrote it in as a Sharpe type ratio given by MSterR = rP − rF D(T ) where the number of observations nd is fixed by the investor’s preference. Other variation of the Sterling ratio uses the average annual maximum drawdown M DD(τ ) in the denominator over three years. Combining the Sterling and Calmar ratio, Bacon proposed the Sterling-Calmar ratio as MSCR = rP − rF M DD(τ ) In order to penalise major drawdowns as opposed to many mild ones, Burke [1994] used the concept of the square root of the sum of the squares of each drawdown, getting rP − rF MBR = pPnd 2 i=1 Di where the number of drawdowns nd used can be restricted to a set number of the largest drawdowns. In the case where the investor is more concerned by the duration of the drawdowns, the Martin ratio or Ulcer performance index is similar to the Burke ratio but with the Ulcer index in the denominator rP − rF MM R = q P 0 d 1 2 i=1 n (Di ) and the equivalent to the Martin ratio but using the Pain index is the Pain ratio 116 Quantitative Analytics rP − rF MP R = P d 1 0 i=1 n Di In view of assessing the best measure to use, Eling et al. [2006] concluded that most of these measures are all highly correlated and do not lead to significant different rankings. For Bacon, the investor must decide ex-ante which measures of return and risk best describe his preference, and choose accordingly. 2.4.6 Some limitation 2.4.6.1 Dividing by zero Statistical inference with measures based on ratios, such as the Treynor performance measure, is delicate when the denominator tends to zero as the ratio goes to infinity. Hence, this measure provides unstable performance measures for non-directional portfolios such as market neutral hedge funds. When the denominator is not bounded away from zero, the expectation of the ratio is infinite. Further, when the denominator is negative, the ratio would assign positive performance to portfolios with negative abnormal returns. As suggested by Hubner [2007], one way arround when assessing the quality of performance measures is to consider only directional managed portfolios. However, hedge funds favour market neutral portfolios. We present two artifacts capable of handeling the beta in the denominator of a ratio. We let, βia (jδ) taking values in R, be the statistical Beta for the stock Si (jδ) at time t = jδ. We want to define 1 allocates maximum weight to stocks with β ≈ 0, and decreasing weight as a mapping βi (jδ) such that the ratio βi (jδ) the β moves away from zero. One possibility is to set βi (jδ) = a + bβia (jδ) , i = 1, .., N with a = 31 and b = 23 , but it does not stop the ratio from being negative. An alternative approach is to consider the inverse bell shape for the distribution of the Beta a βi (jδ) = a 1 − e−b(βi (jδ)) 2 +c such that for βia (jδ) = 0 we get βi (jδ) = c. In that setting βi (jδ) ∈ [c, a + c] and a good calibration gives a = 1.7, b = 0.58, and c = 0.25. Modifying the bell shape, we can directly define the ratio as a 2 1 = ae−b(βi (jδ)) βi (jδ) with a = 3 and b = 0.25. In that setting a. 2.4.6.2 1 βi (jδ) ∈ [0, a] with the property that when β = 0 we get the maximum value Anomaly in the Sharpe ratio N The (ex post) Sharpe ratio of a sequence of returns x1 , ..., xN ∈ [−1, ∞) is M (N ) = µσN where µN is the sample 2 mean and σN is the sample variance. Note, the returns are bounded from below by −1. Intuitively, the Sharpe ratio is the return per unit of risk. Another way of measuring the performance of a portfolio with the above sequence of returns is to see how this sequence of returns would have affected an initial investment of CA = 1 assuming no capital inflows and outflows after the initial investment. The final capital resulting from this sequence of returns is P N = CA N Y (1 + xi ) i=1 We are interested in conditions under which the following anomaly is possible: the Sharpe ratio M (N ) is large while PN < 1. We could also consider the condition that in the absence of capital inflows and outflows the returns x1 , ..., xN underperform the benchmark portfolio. Vovk [2011] showed that if the return is 5% over k − 1 periods, and then it is 117 Quantitative Analytics −100% in the kth period then as k → ∞ we get µk → 0.05 and σk → 0. Therefore, making k large enough, we can make the Sharpe ratio M (k) as large as we want, despite losing all the money over the k periods. In this example the returns are far from being Gaussian (strictly speaking, returns cannot be Gaussian unless they are constant, since they are bounded from below by −1). Note, this example leads to the same conclusions when the Sharpe ratio is replaced by the Sortino ratio. However, this example is somewhat unrealistic in that there is a period in which the portfolio loses almost all its money. Fortunately,Vovk [2011] showed that it is the only way a high Sharpe ratio can become compatible with losing money. That is, in the case of the Sharpe ratio, such an abnormal behaviour can happen only when some one-period returns are very close to −1. In the case of the Sortino ratio, such an abnormal behaviour can happen only when some one-period returns are very close to −1 or when some one-period returns are huge. 2.4.6.3 The weak stochastic dominance The stochastic dominance axiom of utility implies that if exactly the same returns can be obtained with two different investments A and B, but the probability of a return exceeding any threshold τ is always greater with investment A, then A should be preferred to B. That is, investment A strictly dominates investment B if and only if PA (R > τ ) > PB (R > τ )∀τ and A weakly dominates B if and only if PA (R > τ ) ≥ PB (R > τ )∀τ Hence, no rational investor should choose an investment which is weakly dominated by another one. With the help of an example, Alexandrer showed that the SR can fail to rank investment according to the weak stochastic dominance. We consider two portfolios A and B with the distribution of their returns in excess of the risk-free rate given in Table (2.2). Table 2.2: Distribution of returns Probability 0.1 0.8 0.1 Excess return A 20% 10% −20% Excess return B 40% 10% −20% The highest excess return from portfolio A is only 20%, whereas the highest excess return from portfolio B is P 40%. We show the result of the SR of the two investments in Table (2.3). The mean is given by E[R] = P R i i i and P the variance satisfies V ar(R) = i Pi Ri2 − (E[R])2 . Table 2.3: Sharpe ratios Portfolio Expected excess return Standard deviation Sharpe ratio A 8.0% 9.79% 0.8165 B 10.0% 13.416% 0.7453 Following the SR, investor would choose portfolio A, whereas the weak stochastic dominance indicates that any rational investor should prefer B to A. As a result, one can conclude that the SRs are not good metrics to use in the decision process on uncertain investments. 118 Chapter 3 Introduction to financial time series analysis For details see text books by Makridakis et al. [1989], Brockwell et al. [1991] and Tsay [2002]. 3.1 Prologue A time series is a set of measurements recorded on a single unit over multiple time periods. More generally, a time seies is a set of statistics, usually collected at regular intervals, and occurring naturally in many application areas such as economics, finance, environmental, medecine, etc. In order to analyse and model price series to develop efficient quantitative trading, we define returns as the differences of the logarithms of the closing price series, and we fit models to these returns. Further, to construct efficient security portfolios matching the risk profile and needs of individual investors we need to estimate the various properties of the securities consitituting such a portfolio. Hence, modelling and forecasting price return and volatility is the main task of financial research. Focusing on closing prices recorded at the end of each trading day, we argue that it is the trading day rather than the chronological day which is relevant so that constructing the series from available data, we obtain a process equally spaced in the relevant time unit. We saw in Section (2.1.5) that a first step towards forecasting financial time series was to consider some type of technical indicators or mathematical statistics with price forecasting capability, hoping that history trends would repeat itself. However, following this approach we can not assess the uncertainty inherent in the forecast, and as such, we can not measure the error of forecast. An alternative is to consider financial time series analysis which is concerned with theory and practice of asset valuation over time. While the methods of time series analysis pre-date those for general stochastic processes and Markov Chains, their aims are to describe and summarise time series data, fit low-dimensional models, and make forecasts. Even though it is a highly empirical discipline, theory forms the foundation for making inference. However, both financial theory and its empirical time series contain some elements of uncertainty. For instance, there are various definitions of asset volatility, and in addition, volatility is not directly observable. Consequently, statistical theory and methods play an important role in financial time series analysis. One must therefore use his knowledge of financial time series in order to use the appropriate statistical tools to analyse the series. In the rest of this section we are going to describe financial time series analysis, and we will introduce statistical theory and methods in the following sections. 119 Quantitative Analytics 3.2 An overview of data analysis 3.2.1 Presenting the data 3.2.1.1 Data description The data may consists in equity stocks, equity indices, futures, FX rates, commodities, and interest rates (Eurodollar and 10-year US Treasury Note) spanning a period from years to decade with frequency of intraday quotes, closeto-close, weeks, or months. As the contracts are traded in various exchanges, each with different trading hours and holidays, the data series should be appropriately aligned to avoid potential lead-lag effects by filling forward any missing asset prices (see Pesaran et al. [2009]). Daily, weekly or montly return series are constructed for each contract by computing the percentage change in the closing end of day, week or month asset price level. The mechanics of opening and maintaining a position on a futures contract involves features like initial margins, potential margin call, interest accured on the margin account, and no initial cash payment at the initiation of the contract (see Miffre et al. [2007]). As a result, the construction of a return data series for a futures contract does not have an objective nature and various methodologies have been used in the literature. Pesaran et al. [2009], Fuertes et al. [2010] compute returns similarly as the percentage change in the price level, wheras Pirrong [2005] and Gorton et al. [2006] also take into account interest rate accruals on a fully collateralised basis, and Miffre et al. [2007] use the change in the logarithms of the price level. Lastly, Moskowitz et al. [2012] use the percentage change in the price level in excess of the risk-free rate. Knowing the percentage returns of the time series, we can compute the annualised mean return, volatility, and Sharpe ratios. 3.2.1.2 Analysing the data We apply standard econometric theory described in Section (5.1) to test for the presence of heteroskedasticity and autocorrelation, and we adjust the models accordingly when needed. In general, there exists a great amount of crosssectional variation in mean returns and volatilities with the commodities being historically the most volatile contracts (see Pesaran et al. [2009]). Further, the distribution of buy-and-hold or buy-and-sell return series exhibits fat tails as deduced by the kurtosis and the maximum likelihood estimated degrees of freedom for a Student t-distribution. A normal distribution is almost universally rejected by the Jarque and Bera [1987] and the Lilliefors [1967] tests of normality (see Section (3.3.4.2)). It is more difficult to conclude about potential first-order time-series autocorrelation using tools such as the Ljung and Box [1978] test. However, very strong evidence of heteroscedasticity is apparent across all frequencies deduced by the ARCH test of Engle [1982]. Baltas et al. [2012b] found that this latter effect of time variation in the second moment of the return series was also apparent in the volatility. We also perform a regression analysis with ARMA (autoregressive moving average) modelling of the serial correlation in the disturbance. In addition we can perform several robustness checks. First, we check the robustness of the model through time by using a Chow [1960] test to test for stability of regression coefficients between two periods. When we find significant evidence of parameter instability, we use a Kalman filter analysis described in Section (3.2.5.2), which is a general form of a linear model with dynamic parameters, where priors on model parameters are recursively updated in reaction to new information (see Hamilton [1994]). 3.2.1.3 Removing outliers We follow an approach described by Zhu [2005] consisting in finding the general trend curve for the time series, and then calculating the spread which is the distance between each point and the trend curve. The idea is to replace each data point by some kind of local average of surrounding data points such that averaging reduce the level of noise without biasing too much the value obtained. To find the trend, we consider the Savitzky-Golay low-pass smoothing filter described in Section (4.3.3). After some experiments, Zhu [2005] found that the filter should be by degree 1 and span size 3. Given the corresponding smoothed data representing the trend of the market data we get the spread for each market data point from the trend. The search for outliers uses the histogram of (fi − f i ) with M = 10 bins of equal width. We label a threshold T and define all fi with |fi − f i | > T to be outliers. The next question is how to 120 Quantitative Analytics select the value M, and the threshold T. Suppose we are given a set of market data which contain previously known errors. Adjust M and T until we find proper pairs of M and T which can successfully find all the errors. We then can tune the parameters with more historical data from the same market. We can have an over-determined solution for the value of M and T by enough training data provided. Outliers are replaced by interpolation. On the market, one common way to deal with error data is to replace it with the previous data, that is, zeroth order interpolation. This method neglects the trend, while we usually expect movements on a liquid market. Instead of utilising much training data, an alternative to search for T is to iteratively smooth the data points. Step one, we choose a start T , say T0 , and smooth the data according to M0 and T0 . Second step we stop the iteration if the histogram has a short tail, since we believe all the outliers are removed. Else we replace the outliers by interpolations, and repeat step one. 3.2.2 Basic tools for summarising and forecasting data We assume that we have available a database from which to filter data and build numerical forecasts, that is, a table with multiple dimensions. Cross sectional data refer to measurements on multiple units, recorded in a single time period. Although forecasting practice involves multiple series, the methods we are going to examine use data from the past and present to predict future outcomes. Hence, we will first focus on the use of time series data. 3.2.2.1 Presenting forecasting methods Forecasting is about making statements on events whose actual outcomes have not yet been observed. We distinguish two main types of forecasting methods: 1. Qualitative forecasting techniques are subjective, based on opinions and judgements, and are appropriate when past data are not available. For example, one tries to verify whether there is some causal relationship between some variables and the demand. If this is the case, and if the variable is known in advance, it can be used to make a forecast. 2. On the contrary, quantitative forecasting models are used to forecast future data as a function of past data, and as such, are appropriate when past data are available. The main idea being that the evolution in the past will continue into the future. If we observe some correlations between some variables, then we can use these correlations to make some forecast. A dynamic model incorporating all the important internal and external variables is implemented and used to test different alternatives. For instance, to estimate the future demand accurately, we need to take into account facts influencing the demand. Subjective forecasts are often time-consuming to generate and may be subject to a variety of conscious or unconscious biases. In general, simple analysis of available data can perform as well as judgement procedures, and are much quicker and less expensive to produce. The effective possible choices are judgement only, quantitative method only and quantitative method with results adjusted by user judgement. All three options have their place in the forecasting lexicon, depending upon costs, available data and the importance of the task in hand. Careful subjective adjustment of quantitative forecasts may often be the best combination, but we first need to develop an effective arsenal of quantitative methods. To do so, we need to distinguish between methods and models. • A forecasting method is a (numerical) procedure for generating a forecast. When such methods are not based upon an underlying statistical model, they are termed heuristic. • A statistical (forecasting) model is a statistical description of the data generating process from which a forecasting method may be derived. Forecasts are made by using a forecast function that is derived from the model. For example, we can specify a forecasting method as Ft = b0 + b1 t 121 Quantitative Analytics where Ft is the forecast for time period t, b0 is the intercept representing the value at time zero, and b1 is the slope representing the increase in forecast values from one period to the next. All we need to do to obtain a forecast is to calibrate the model. However, we lack a basis for choosing values for the parameters, and we can not assess the uncertainty inherent in the forecasts. Alternatively, we may formulate a forecasting model as Yt = β0 + β1 t + where Y denotes the time series being studied, β0 and β1 are the level and slope parameters, and denotes a random error term corresponding to that part of the series that cannot be fitted by the trend line. Once we make appropriate assumptions about the nature of the error term, we can estimate the unknown parameters, β0 and β1 . These estimates are typically written as b0 and b1 . Thus the forecasting model gives rise to the forecast function Ft = b0 + b1 t where the underlying model enables us to make statements about the uncertainty in the forecast, something that the heuristic method do not provide. As a result, risk and uncertainty are central to forecasting, as one must indicate the degree of uncertainty attaching to forecasts. Hence, some idea about its probability distribution is necessary. For example, assuming a forecast for some demand has the distribution of Gauss (normal) with average µ and standard deviation σ, the coefficient of variation of the prediction is σµ . 3.2.2.2 Summarising the data Following Brockwell et al. [1991], we write the real-valued series of observations as ..., Y−2 , Y−1 , Y0 , Y1 , Y2 , ... a doubly infinite sequence of real-valued random variables indexed by Z. Given a set of n values Y1 , Y2 , .., Yn , we place these values in ascending order written as Y(1) ≤ Y(2) ≤ ... ≤ Y(n) . The median is the middle observation. When n is odd it can be written n = 2m + 1 and the median is Y(m+1) , and when n is even we get n = 2m and the median is 21 (Y(m) + Y(m) ). It is possible to have two very different datasets with the same means and medians. For that reason, measures of the middle are useful but limited. Another important attribute of a dataset is its dispersion or variability about its middle. The most useful measures of dispersion (or variability) are the range, the percentiles, the mean absolute deviation, and the standard deviation. The range denotes the difference between the largest and smallest values in the sample Range = Y(n) − Y(1) Therefore, the more spread out the data values are, the larger the range will be. However, if a few observations are relatively far from the middle but the rest are relatively close to the middle, the range can give a distorted measure of dispersion. Percentiles are positional measures for a dataset that enable one to determine the relative standing of a single measurement within the dataset. In particular, the pth percentile is defined to be a number such that p% of the observations are less than or equal to that number and (100 − p)% are greater than that number. So, for example, an observation that is at the 75th percentile is less than only 25% of the data. In practice, we often can not satisfy the definition exactly. However, the steps outlined below at least satisfies the spirit of the definition: 1. Order the data values from smallest to largest, including ties. 2. Determine the position k.ddd = 1 + p(n − 1) 100 3. The pth percentile is located between the kth and the (k + 1)th ordered value. Use the fractional part of the position, .ddd as an interpolation factor between these values. If k = 0, then take the smallest observation as the percentile and if k = n, then take the largest observation as the percentile. 122 Quantitative Analytics The 50th percentile is the median and partitions the data into a lower half (below median) and upper half (above median). The 25th, 50th, 75th percentiles are referred to as quartiles. They partition the data into 4 groups with 25% of the values below the 25th percentile (lower quartile), 25% between the lower quartile and the median, 25th between the median and the 75th percentile (upper quartile), and 25% bove the upper quartile. The difference between the upper and lower quartiles is referred to as the inter-quartile range. This is the range of the middle 50% of the data. Given di = Yi − Y where Y is the arithmetic mean, the Mean Absolute Deviation (MAD) is the average of the deviations about the mean, ignoring the sign M AD = 1X |di | n i The sample variance is an average of the squared deviations about the mean S2 = 1 X 2 d n−1 i i The population variance is given by σp2 = 1X (Yi − µp )2 n i where µp is the population mean. Note that the unit of measure for the variance is the square of the unit of measure for the data. For that reason (and others), the square root of the variance, called the standard deviation, is more commonly used as a measure of dispersion. Note that datasets in which the values tend to be far away from the middle have a large variance (and hence large standard deviation), and datasets in which the values cluster closely around the middle have small variance. Unfortunately, it is also the case that a dataset with one value very far from the middle and the rest very close to the middle also will have a large variance. Comparing the variance with the MAD, S gives greater weight to the more extreme observations by squaring them and it may be shown that S > M AD whenever MAD is greater than zero. A rough relationship between the two is S = 1.25M AD The standard deviation of a dataset can be interpreted by Chebychev’s Theorem (see Tchebichef [1867]): Theorem 3.2.1 For any k > 1, the proportion of observations within the interval µp ± kσp is at least (1 − 1 k2 ). Hence, knowing just the mean and standard deviation of a dataset allows us to obtain a rough picture of the distribution of the data values. Note that the smaller the standard deviation, the smaller is the interval that is guaranteed to contain at least 75% of the observations. Conversely, the larger the standard deviation, the more likely it is that an observation will not be close to the mean. Note that Chebychev’s Theorem applies to all data and therefore must be conservative. In many situations the actual percentages contained within these intervals are much higher than the minimums specified by this theorem. If the shape of the data histogram is known, then better results can be given. In particular, if it is known that the data histogram is approximately bell-shaped, then we can say • µp ± σp contains approximately 68%, • µp ± 2σp contains approximately 95%, • µp ± 3σp contains essentially all of the data values. This set of results is called the empirical rule. Several extensions of Chebyshev’s inequality have been developed, among which is the asymmetric two-sided version given by 123 Quantitative Analytics 4 (µp − k1 )(k2 − µp ) − σp2 P (k1 < Y < k2 ) ≥ (k2 − k1 )2 In mathematical statistics, a random variable Y is standardized by subtracting its expected value E[Y ] and dividing the difference by its standard deviation σ(Y ) Z= Y − E[Y ] σ(Y ) The Z-score is a dimensionless quantity obtained by subtracting the population mean µp from an individual raw score Yi and then dividing the difference by the population standard deviation σp . That is, Z= Yi − µp σp From Chebychev’s theorem, at least 75% of observations in any dataset will have Z-scores in the range [−2, 2]. The standard score is the (signed) number of standard deviations an observation or datum is above the mean, and it provides an assessment of how off-target a process is operating. The use of the term Z is due to the fact that the Normal distribution is also known as the Z distribution. They are most frequently used to compare a sample to a standard normal deviate, though they can be defined without assumptions of normality. Note, considering the Z-score, Cantelli obtained sharpened bounds given by 1 1 + k2 The Z-score is only defined if one knows the population parameters, but knowing the true standard deviation of a population is often unrealistic except in cases such as standardized testing, where the entire population is measured. If one only has a sample set, then the analogous computation with sample mean and sample standard deviation yields the Student’s t-statistic. Given a sample mean Y and sample standard deviation S, we define the standardised scores for the observations, also known as Z-scores as P (Z ≥ k) ≤ Yi − Y S The Z-score is to examine forecast errors and one proceed in three steps: Z= • Check that the observed distribution of the errors is approximately normal • If the assumption is satisfied, relate the Z-score to the normal tables – The probability that |Z| > 1 is about 0.32 – The probability that |Z| > 2 is about 0.046 – The probability that |Z| > 3 is about 0.0027 • Create a time series plot of the residuals (and/or Z-scores) when appropriate to determine which observations appear to be extreme Hence, whenever you see a Z-score greater than 3 in absolute value, the observation is very atypical, and we refer to such observations as outliers. The change in the absolute level of the series from one period to the next is called the first difference of the serries, given by DYt = Yt − Yt−1 124 Quantitative Analytics where Yt−1 is known at time t. Letting D̂t be the forecast for the difference, the forecast for Yt becomes Ft = Ŷt = Yt−1 + D̂t The growth rate for Yt is Gt = GYt = 100 Dt Yt−1 so that the forecast for Yt can be written as Ĝt 100 If we think of changes in the time series in absolute terms we should use DY and if we think of it in relative terms we should use GY . Note, reducing a chocolate ration by 50% and then increasing it by 50% does not gives you as much chocolate as before since Ft = Ŷt = Yt−1 1 + 50 50 )(1 + ) = 0.75 100 100 To avoid this asymmetry we can use the logarithm transform Lt = ln Yt with first difference in logarithm being (1 − DLt = ln Yt − ln Yt−1 converting the exponential (or proportional) growth into linear growth. If we generate a forecast of the log-difference, the forecast for the original series, given the previous value Yt−1 becomes Ŷt = Yt−1 eDL̂t 3.2.2.3 Measuring the forecasting accuracy When selecting a forecasting procedure, a key question is how to measure performance. A natural approach would be to look at the differences between the observed values and the forecasts, and to use their average as a performance measure. Suppose that we start from forecast origin t so that the forecasts are made successively (one-step-ahead) at times t + 1, t + 2, ..., t + h, there being h such forecasts in all. The one-step-ahead forecast error at time t + i may be denoted by et+i = Yt+i − Ft+i The Mean Error (ME) is given by h ME = h 1X 1X (Yt+i − Ft+i ) = et+i h i=1 h i=1 ME will be large and positive (negative) when the actual value is consistently greater (less) than the forecast. However, this measure do not reflect variability, as positive and negative errors could virtually cancel each other out, yet substantial forecasting errors could remain. Hence, we need measures that take account of the magnitude of an error regardless of the sign. The simplest way to gauge the variability in forecasting performance is to examine the absolute errors, defined as the value of the error ignoring its sign and expressed as |ei | = |Yi − Fi | We now present various averages, based upon the errors or the absolute errors. 125 Quantitative Analytics • the Mean Absolute Error h M AE = h 1X 1X |Yt+i − Ft+i | = |et+i | h i=1 h i=1 • the Mean Absolute Percentage Error h M AP E = h 100 X |et+i | 100 X |Yt+i − Ft+i | = h i=1 Yt+i h i=1 Yt+i • the Mean Square Error h M SE = h 1X 1X 2 (Yt+i − Ft+i )2 = e h i=1 h i=1 t+i • the Normalised Mean Square Error h h 1 X 1 X 2 N M SE = 2 (Yt+i − Ft+i )2 = 2 e σ h i=1 σ h i=1 t+i where σ 2 is the variance of the true sequence over the prediction period (validation set). • the Root Mean Square Error √ RM SE = M SE • the Mean Absolute Scaled Error Ph |Yt+i − Ft+i | M ASE = Phi=1 i=1 |Yt+i − Yt+i−1 | • the Directional Symmetry h DS = 1 X H(Yt+i .Ft+i ) h − 1 i=1 where H(x) = 1 if x > 0 and H(x) = 0 otherwise (Heaviside function). • the Direction Variation Symmetry h DV S = 1 X H((Yt+i − Yt+i−1 ).(Ft+i − Ft+i−1 )) h − 1 i=2 Note, the Mean Absolute Scaled Error was introduced by Hyndman et al. [2006]. It is the ratio of the MAE for the current set of forecasts relative to the MAE for forecasts made using the random walk. Hence, for M ASE > 1 the random walk forecasts are superior, otherwise the method under consideration is superior to the random walk. We now give some general comments on these measures. 126 Quantitative Analytics • MAPE should only be used when Y > 0, MASE is not so restricted. • MAPE is the most commonly used error measure in practice, but it is sensitive to values of Y close to zero. • MSE is measured in terms of (dollars), and taking the square root to obtain the RMSE restores the original units. • A value of the N M SE = 1 corresponds to predicting the unconditional mean. • The RMSE gives greater weight to large (absolute) errors. It is therefore sensitive to extreme errors. • The measure using absolute values always equals or exceeds the absolute value of the measure based on the errors, so that M AE ≥ |M E| and M AP E ≥ |M P E|. If the values are close in magnitude that suggests a systematic bias in the forecasts. • Both MAPE and MASE are scale-free and so can be used to make comparisons across multiple series. The other measures need additional scaling. • DS is the percentage of correctly predicted directions with respect to the target variable. It provides a measure of the number of times the sign of the target was correctly forecast. • DVS is the percentage of correctly predicted direction variations with respect to the target variable. 3.2.2.4 Prediction intervals So far we have considered point forecasts which are future observations for which we report a single forecast value. However, confidence in a single number is often misplaced. We assume that the predictive distribution for the series Y follows the normal law (although such an assumption is at best an approximation and needs to be checked). If we assume that the standard deviation (SD) of the distribution is known, we may use the upper 95% point of the standard normal distribution (this value is 1.645) so that the one-sided prediction interval is Ŷ + 1.645 × SD where Ŷ is the point forecast. The normal distribution being the most widely used in the construction of prediction intervals, it is critical to check that the forecast errors are approximately normally distributed. Typically the SD is unknown and must be estimated from the sample that was used to generate the point forecast, meaning that we use the RMSE to estimate the SD. We can also use the two-sided 100(1 − α) prediction intervals given by Ŷ ± z1− α2 × RM SE α 2) where z1− α2 denotes the upper 100(1 − percentage point of the normal distribution. In the case of a 95% one-stepahead prediction intervals we set α = 5% and get z1− 0.05 = 1.96. The general purpose of such intervals is to provide 2 an indication of the reliability of the point forecasts. An alternative approach to using theoretical formulae when calculating prediction intervals is to use the observed errors to show the range of variation expected in the forecasts. For instance, we can calculate the 1-step ahead errors made using the random walk forecasts which form a histogram. We can also fit a theoretical probability density to the observed errors. Other distributions (than normal) are possible since in many applications more extreme errors are observed than those suggested by a normal distribution. Fitting a distribution gives us more precise estimates of the prediction intervals which are called empirical prediction intervals. To be useful, these empirical prediction intervals need to be based on a large sample of errors. 127 Quantitative Analytics 3.2.2.5 Estimating model parameters Usually we partition the original series into two parts and refer to the first part (containing 75−80% of the observations) as the estimation sample, which is used to estimate the starting values and the smoothing parameters. The parameters are commonly estimated by minimizing the mean squared error (MSE), although the mean absolute error (MAE) or mean absolute percentage error (MAPE) are also used. The second part called hold-out sample represents the remaining 20 − 25% of the observations and is used to check forecasting performance. Some programs allow repeated estimation and forecast error evaluation by advancing the estimation sample one observation at a time and repeating the error calculations. When forecating data, we should not rely on an arbitrary pre-set smoothing parameter. Most computer programs nowdays provide efficient estimates of the smoothing constant, based upon minimizing some measure of risk such as the mean squared error (MSE) for the one-step-ahead forecasts M SE = N 1 X (Yi − Fi )2 N i=1 where Yi = Yti and Fi = Fti |ti−1 . More formally, we let ŶT +τ (T ) (or FT +τ |T ) denote the forecast of a given time series {Yt }t∈Z+ at time T + τ , where T is a specified origin and τ ∈ Z+ . In that setting, the MSE becomes M SE(T ) = T 1X (Yt − Ŷ(t−1)+1 (t − 1))2 T t=1 Similarly, we define the MAD as M AD(T ) = T 1X |Yt − Ŷ(t−1)+1 (t − 1)| T t=1 which is the forecast ŶT +τ (T ) with T = t − 1 and τ = 1. An approximate 95% prediction interval for ŶT +τ (T ) is given by ŶT +τ (T ) ± z0.25 1.25M AD(T ) where z0.25 ≈ 1.96 (see Appendix (5.7.5)). 3.2.3 Modelling time series Given the time series (Xt )t∈Z at time t, we can either decompose it into elements and estimate each components separately, or we can directly model the series with a model such as an autoregressive integrated moving average (ARIMA). 3.2.3.1 The structural time series When analysing a time series, the classical approach is to decompose it into components: the trend, the seasonal component, and the irregular term. More generally, the structural time series model proposed by Majani [1987] decomposes the time series (Xt )t∈Z at time t into four elements 1. the trend (Tt ) : long term movements in the mean 2. the seasonal effects (It ) : cyclical fluctuations related to the calendar 3. the cycles Ct : other cyclycal fluctuations (such as business cycles) 128 Quantitative Analytics 4. the residuals Et : other random or systematic fluctuations The idea being to create separate models for these four elements and to combine them either additively Xt = Tt + It + Ct + Et or multiplicatively Xt = Tt · It · Ct · Et which can be obtained by applying the logarithm. Forecasting is done by extrapolating Tt , It and Ct , and expecting E[Et ] = c ∈ R. One can therefore spend his time either modelling each seperate element and try to recombine them, or, directly modelling the process Xt . Howver, the decomposition is not unique, and the components are interrelated, making identification difficult. Several methods have been proposed to extract the components in a time series, ranging from simple weighted averages to more sophisticated methods, such as Kalman filter or exponential smoothing, Fourier transform, spectral analysis, and more recently wavelet analysis (see Kendall [1976b], Brockwell et al. [1991], Arino et al. [1995]). In economic time series, the seasonal component has usually a constant period of 12 months, and to assess it one uses some underlying assumptions or theory about the nature of the series. Longerterm trends, defined as fluctuations of a series on time scales of more than one year, are more difficult to estimate. These business cycles are found by elimination of the seasonal component and the irregular term. Further, forecasting is another reason for decomposing a series as it is generally easier to forecast components of a time series than the whole series itself. One approach for decomposing a continuous, or discrete, time series into components is through spectral analysis. Fourier analysis uses sum of sine and cosine at different wavelengths to express almost any given periodic function, and therefore any function with a compact support. However, the non-local characteristic of sine and cosine implies that we can only consider stationary signals along the time axis. Even though various methods for time-localising a Fourier transform have been proposed to avoid this problem such as windowed Fourier transform, the real improvement comes with the development of wavelet theory. In the rest of this guide, we are going to discribe various technique to model the residual components (Et ), the trend Tt , and the business cycles Ct , and we will also consider different models to forecast the process Xt directly. 3.2.3.2 Some simple statistical models Rather than modelling the elements of the time series (Xt )t∈Z we can directly model the series. For illustration purpose we present a few basic statistical models describing the data which will be used and detailed in Chapter (5). Note, each of these models has a number of variants, which are refinements of the basic models. AR process An autoregressive (AR) process is one in which the change in the variable at a point in time is linearly correlated with the previous change. In general, the correlation declines exponentially with time and desapear in a relatively short period of time. Letting Yn be the change in Y at time n, with 0 ≤ Y ≤ 1, then we get Yn = c1 Yn−1 + ... + cp Yn−p + en where |cl | ≤ 1 for l = 1, .., p, and e is a white noise series with mean 0 and variance σe2 . The restrictions on the coefficients cl ensure that the process is stationary, that is, there is no long-term trend, up or down, in the mean or variance. This is an AR(p) process where the change in Y at time n is dependent on the previous p periods. To test for the possibility of an AR process, a regression is run where the change at time n is the dependent variable, and the changes in the previous q periods (the lags) are used as independent variables. Evaluating the t-statistic for each lag, if any of them are significant at the 5% level, we can form the hypothesis that an AR process is at work. 129 Quantitative Analytics MA process time series In a moving average (MA) process, the time series is the result of the moving average of an unobserved Yn = d1 en−1 + ... + dp en−q + en where |dl | < 1 for l = 1, .., q. The restriction on the coefficients dl ensure that the process is invertible. In the case where dl > 1, future events would affect the present, and the process is statioary. Because of the moving average process, there is a linear dependence on the past and a short-term memory effect. ARMA process In an autoregressive moving average (ARM A) model, we have both some autoregressive terms and some moving average terms which are unobserved random series. We get the general ARM A(p, q) form Yn = c0 + c1 Yn−1 + ... + cp Yn−p − d1 en−1 − ... − dq Yn−q + en where p is the number of autoregressive terms, q is the number of moving average terms, and en is a random variable with a given distribution F and c0 ∈ R is the drift. ARIMA process Both AR and ARM A models can be absorbed into a more general class of processes called autoregressive integrated moving average (ARIMA) models which are specifically applied to nonstationary time series. While they have an underlying trend in their mean and variance, by taking successive differences of the data, these processes become stationary. For instance, a price series is not stationary merly because it has a long-term growth component. That is, the price will not tend towards an average value as it can grow without bound. Fortunately, in the efficient market hypothesis (EMH), it is assumed that the changes in price (or returns) are stationary. Typically, price changes are specified as percentage changes, or, log differences, which is the first difference. However, in some series, higher order differences may be needed to make the data stationary. Hence, the difference of the differences is a second-order ARIM A process. In general, we say that Yt is a homogeneous nonstationary process of order d if Zt = ∆d Yt is stationary, where ∆ represents differencing, and d represents the level of differencing. If Zt is an ARM A(p, q) process, then Yt is considered an ARIM A(p, d, q) process. The process does not have to be mixed as if Yt is an ARIM A(p, d, 0) process, then Zt is an AR(p) process. ARCH process We now introduce popular models to describe the conditional variance of market returns. The basic autoregressive conditional heteroskedasticity (ARCH) model developed by Engle [1982] became famous because • they are a family of nonlinear stochastic processes (as opposed to ARM A models) • their frequency distribution is a high-peaked, fat-tailed one • empirical studies showed that financial time series exhibit statistically significant ARCH. In the ARCH model, time series are defined by normal probability distributions but time-dependent variances. That is, the expected variance of a process is conditional on its previous value. The process is also autoregressive in that it has a time dependence. A sample frequency distribution is the average of these expanding and contracting normal distributions, leading to fat-tailed, high-peaked distribution at any point in time. The basic model follows Yn = Sn en Sn2 = α0 + α1 e2n−1 where e is a standard normal random variable, and α1 is a constant. Typical values are α0 = 1 and α1 = 12 . Once again, the observed value Y is the result of an unobserved series, e, depending on past realisations of itself. The 130 Quantitative Analytics nonlinearity of the model implies that small changes will likely be followed by other small changes, and large changes by other large changes, but the sign will be unpredictable. Further, large changes will amplify, and small changes will contrac, resulting in fat-tailed high-peaked distribution. GARCH process Bollerslev [1986] formalised the generalised ARCH (or GARCH) by making the S variable dependent on the past as well, Yn = Sn en Sn2 2 = α0 + α1 e2n−1 + β1 Sn−1 where the three values range from 0 to 1, but α0 = 1, α1 = 0.1, and β1 = 0.8 are typical values. GARCH also creates a fat-tailed high-peaked distribution. Example of a financial model The main idea behind (G)ARCH models is that the conditional standard deviations of a data series are a function of their past values. A very common model in financial econometric is the AR(1) − GARCH(1, 1) process given by rn = c0 + c1 rn−1 + an vn = α0 + α1 e2n−1 + β1 vn−1 where rn is the log-returns of the data series for each n, vn is the conditional variance of the residuals for the mean equation 1 for each n, and c0 , c1 , α0 and α1 are known parameters that need to be estimated. The GARCH process is well defined as long as the condition α1 + β1 < 1 is satisfied. If this is not the case, the variance process is non-stationary and we have to fit other processes for conditional variance such as Integrated GARCH (IGARCH) models. 3.2.4 Introducing parametric regression Given a set of observations, we want to summarise the data by fitting it to a model that depends on adjustable parameters. To do so we design a merit function measuring the agreement between the data and the model with a particular choice of parameters. We can design the merit function such that either small values represent close agreement (frequentist), or, by considering probabilities, larger values represent closer agreement (bayesians). In either case, the parameters of the model are adjusted to find the corresponding extremum in the merit function, providing best-fit parameters. The adjustment process is an optimisation problem which we will treat in Chapter (14). However, in some special cases, specific modelling exist, providing an alternative solution. In any case, a fitting procedure should provide 1. some parameters 2. error estimates on the parameters, or a way to sample from their probability distribution 3. a statistical measure of goodness of fit In the event where the third item suggests that the model is an unlikely match to the data, then the first two items are probably worthless. 1 an = rn − c0 − c1 rn−1 , an = √ vn en . 131 Quantitative Analytics 3.2.4.1 Some rules for conducting inference The central frequentist idea postulates that given the details of a null hypothesis, there is an implied population (probability distribution) of possible data sets. If the assumed null hypothesis is correct, the actual, measured, data set is drawn from that population. When the measured data occurs very infrequently in the population, then the hypothesis is rejected. Focusing on the distribution of the data sets, they neglect the concept of a probability distribution of the hypothesis. That is, for frequentists, there is no statistical universe of models from which the parameters are drawn. Instead, they identify the probability of the data given the parameters, as the likelihood of the parameters given data. Parameters derived in this way are called maximum likelihood estimators (MLE). An alternative approach is to consider Bayes’s theorem relating the conditional probabilities of two events, A and B, P (A|B) = P (A) P (B|A) P (B) (3.2.1) where P (A|B) is the probability of A given that B has occured. A and B need not to be repeatable events, and can be propositions or hypotheses, obtaining a set of consistent rules for conducting inference. All Bayesian probabilities are viewed as conditional on some collective background information I. Assuming some hypothesis H, even before any explicit data exist, we can assign some degree of plausibility P (H|I) called the Bayesian prior. When some data D1 comes along, using Equation (3.2.1), we reassess the plausibility of H as P (H|D1 I) = P (H|I) P (D1 |HI) P (D1 |I) where the numerator is calculable as the probability of a data set given the hypothesis, and the denominator is the prior predictive probability of the data. The latter is a normalisation constant ensuring that the probability of all hypotheses sums to unity. When some additional data D2 come along, we can further refine the estimate of the probability of H P (H|D2 D1 I) = P (H|D1 I) P (D2 |HD1 I) P (D2 |D1 I) and so on. From the product rule for probabilities P (AB|C) = P (A|C)P (B|AC), we get P (H|D2 D1 I) = P (H|I) P (D2 D1 |HI) P (D2 D1 |I) obtaining the same answer as if all the data D1 D2 had been taken together. 3.2.4.2 The least squares estimator Maximum likelihood estimator Given N data points (Xi , Yi ) for i = 0, .., N − 1, we want to fit a model having M adjustable parameters aj , j = 0, .., M − 1, predicting a functional relationship between the measured independent and dependent varibles, defined as Y (X) = Y (X|a0 , .., aM −1 ) Following the frequentist, given a set of parameters, if the probability of obtaining the data set is too amall, then we can conclude that the parameters are unlikely to be right. Assuming that each data point Yi has a measurement error that is independently random and distributed as a Gaussian distribution around the true model Y (X), and assuming that the standard deviations σ of these normal distributions are the same for all points, then the probability of obtaining the data set is the product of the probabilities of each point P ( data | model ) ∝ N −1 Y i=0 132 1 e− 2 ( Yi −Y (Xi ) 2 ) σ ∆Y Quantitative Analytics Alternatively, calling Bayes’ theorem in Equation (3.2.1), we get P ( model | data ) ∝ P ( data | model )P ( model ) where P ( model ) = P (a0 , .., aM −1 ) is the prior probability distribution on all models. The most probable model is to maximise the probability of obtaining the data set above, or equivalently, minimise the negative of its logarithm N −1 X i=0 1 Yi − Y (Xi ) 2 − N log ∆Y 2 σ which is equivalent to minimising the probability above since N , σ, and ∆Y are all contants. In that setting, we recover the least squares fit minimise over a0 , .., aM −1 : N −1 X (Yi − Y (Xi |a0 , .., aM −1 ))2 i=0 Under specific assumptions on measurement errors (see above), the least-squares fitting is the most probable parameter set in the Bayesian sense (assuming flat prior), and it is the maximum likelihood estimate of the fitted parameters. Relaxing the assumption of constant standard deviations, by assuming a known standard deviation σi for each data point (Xi , Yi ), then the MLE of the model parameters, and the Bayesian most probable parameter set, is given by minimising the quantity χ2 = N −1 X i=0 Yi − Y (Xi ) 2 σi (3.2.2) called the chi-square, which is a sum of N squares of normally distributed quantities, each normalised to unit variance. Note, in practice measurement errors are far from Gaussian, and the central limit theorem does not apply, leading to fat tail events skewing the least-squares fit. In some cases, the effect of nonnormal errors is to create an abundance of outlier points decreasing the probability Q that the chi-square should exceed a particular value χ2 by chance. Linear models So far we have made no assumption about the linearity or nonlinearity of the model Y (X|a0 , .., aM −1 ) in its parameters a0 , .., aM −1 . The simplest model is a straight line Y (X) = Y (X|a, b) = a + bX called linear regression. Assuming that the uncertainty σi associated with each measurement Yi is known, and that the dependent variables Xi are known excatly, we can minimise Equation (3.2.2) to determine a and b. At its minumum, derivatives of ξ 2 (a, b) with respect to a and b vanish. See Press et al. [1992] for explicit solution of a and b, covariance of a and b characterising the uncertainty of the parameter estimation, and an estimate of the goodness of fit of the data. We can also consider the general linear combination Y (X) = a0 + a1 X + a2 X 2 + ... + aM −1 X M −1 which is a polynomial of degree M − 1. Further, linear combination of sines and cosines is a Fourier series. More generally, we have models of the form Y (X) = M −1 X ak φk (X) k=0 where the quantities φ0 (X), .., φM −1 (X) are arbitrary fixed functions of X called basis functions which can be nonlinear (linear refers only to the model’s dependence on its parameters ak ). In that setting, the chi-square merit function becomes 133 Quantitative Analytics χ2 = N −1 X Yi − PM −1 k=0 ak φk (Xi ) 2 σi i=0 where σi is the measurement error of the ith data point. We can use optimisation to minimise χ2 , or in special cases we can use specific techniques. We let A be an N × M matrix constructed from the M basis functions evaluated at the N abscissas Xi , and from the N measurement errors σi with element Aij = φj (Xi ) σi This matrix is called the design matrix, and in genral N ≥ M . We also define the vector b of length N with element bi = Yσii , and denote the M vector whose components are the parameters to be fitted a0 , .., aM −1 by a. The minimum of the merit function occurs where the derivative of χ2 with respect to all M parameters ak vanishes. It yields M equations N −1 X i−0 M −1 X 1 Yi − aj φj (Xi ) φk (Xi ) = 0 , k = 0, .., M − 1 σi j=0 Interchanging the order of summations, we get the normal equations of the least-squares problem M −1 X αkj aj = βk j=0 where α = A> .A is an M × M matrix, and β = A> .b is a vector of length M . In matrix form, the normal equations become (A> .A)a = A> .b which can be solved for the vector a by LU decomposition, Cholesky decomposition, or Gauss-Jordan elimination. The inverse matrix C = α−1 is called the covariance matrix, and is closely related to the uncertainties of the estimated parameters a. These uncertainties are estimated as σ 2 (aj ) = Cjj the diagonal elements of C, being the variances of the fitted parameters a. The off-diagonal elements Cjk are the covariances between aj and ak . Nonlinear models In the case where the model depends nonlinearly on the set of M unknown parameters ak for k + 0, .., M − 1, we use the same method as above where we define a χ2 merit function and determine best-fit parameters by its minimisation. This is similar to the general nonlinear function minimisation problem. If we are sufficiently close to the minimum, we expect the χ2 function to be well approximated by a quadratic form 1 χ2 (a) ≈ γ − d.a + a.D.a 2 where d is an M -vector and D is an M × M matrix. If the approximation is a good one, we can jump from the current trial parameters acur to the minimising ones amin in a single leap amin = acur + D−1 .[−∇χ2 (acur )] However, in the where the approximation is a poor one, we can take a step down the gradient, as in the steepest descent method, getting 134 Quantitative Analytics anext = acur − cst × ∇χ2 (acur ) for small constant cst. In both cases we need to compute the gradient of the χ2 function at any set of parameters a. For amin , we also need the matrix D, which is the second derivative matrix (Hesian matrix) of the χ2 merit function, at any a. In this particular case, we know exactly the form of χ2 , since it is based on a model function that we specified, so that the Hessian matrix is known to us. 3.2.5 Introducing state-space models 3.2.5.1 The state-space form The state-space form of time series models represent the actual dynamics of a data generation process. We let Yt denote the observation from a time series at time t, related to a vector αt , called the state vector, which is possibly unobserved and whose dimension m is independent of the dimension n of Yt . The general form of a linear state-space model, is given by the following two equations Yt = Zt αt + dt + Gt t , t = 1, .., T (3.2.3) αt+1 = Tt αt + ct + Ht t where Zt is an (n × m) matrix, dt is an (n × 1) vector, Gt is an (n × (n + m)) matrix, Tt is an (m × m) matrix, and Ht is an (m × (n + m)) matrix. The process t is an ((n + m) × 1) vector of serially independent, identically distributed disturbances with E[t ] = 0 and V ar(t ) = I the identity matrix. We let the initial state vector α1 be independent of t at all time t. The first equation is the observation or measurement equation, and the second equation is transition equation. The general (first-order Markov) state equation takes the form αt = f (αt−1 , θt−1 ) + ηt−1 and the general observation equation takes the form Yt = h(αt , θt ) + t with independent error processes {ηt } and {t }. If the system matrices do not evolve with time, the state-space model is called time-invariant or time-homogeneous. If the disturbances t and initial state vector α1 are assumed to have a normal distribution, then the model is termed Gaussian. Further, if Gt Ht> = 0 for all t then the measurement and transition equations are uncorrelated. The fundamental inference mechanism is Bayesian and consists in computing the posterior quantities of interest sequentially in the following recursive calculation: 1. Letting ψt = {Y1 , .., Yt } be the information set up to time t, we get the prior distribution Z p(αt |ψt−1 ) = p(αt |αt−1 )p(αt−1 |ψt−1 )dαt−1 corresponding to the distribution of the parameters before any data is observed. 2. Then, the updating equation becomes p(αt |ψt ) = p(Yt |αt )p(αt |ψt−1 ) p(Yt |ψt−1 ) where the sampling distribution p(Yt |αt ) is the distribution of the observed data conditional on its parameters. 135 Quantitative Analytics The updates provides an analytical solution if all densities in the state and observation equation are Gaussian, and both the state and the observation equation are linear. If these conditions are met, the Kalman filter (see Section (3.2.5.2)) provides the optimal Bayesian solution to the tracking problem. Otherwise we require approximations such as the Extended Kalman filter (EKF), or Particle filter (PF) which approximates non-Gaussian densities and nonlinear equations. The particle filter uses Monte Carlo methods, in particular Importance sampling, to construct the approximations. 3.2.5.2 The Kalman filter The Kalman filter is used for prediction, filtering and smoothing. If we let ψt = {Y1 , .., Yt } denote the information set up to time t, then the problem of prediction is to compute E[αt+1 |ψt ]. Filtering is concerned with calculating E[αt |ψt ], while smoothing is concerned with estimating E[αt |ψT ] for all t < T . In the Linear Gaussian State-Space Model we assume Gt Ht> = 0 and drop the terms dt and ct from the observation and transition equations (3.2.3). Further, we let > Gt G> t = Σt , Ht Ht = Ωt and the Kalman filter recursively computes the quantities at|t = E[αt |ψt ] filtering at+1|t = E[αt+1 |ψt ] prediction Pt|t = M SE(αt |ψt−1 ) Pt+1|t = M SE(αt+1 |ψt ) where MSE is the mean-square error or one-step ahead prediction variance. Then, starting with a1|0 , P1|0 , then at|t and at+1|t are obtained by running for t = 1, .., t the recursions Vt = Yt − Zt at|t−1 , Ft = Zt Pt|t−1 Zt> + Σt at|t = at|t−1 + Pt|t−1 Zt> Ft−1 Vt Pt|t = Pt|t−1 − Pt|t−1 Zt> Ft−1 Zt Pt|t−1 at+1|t = Tt at|t Pt+1|t = Tt Pt|t Tt> + Ωt where Vt denotes the one-step-ahead error in forecasting Yt conditional on the information set at time (t − 1) and Ft is its MSE. The quantities at|t and at|t−1 are optimal estimators of αt conditional on the available information. The resulting recursions for t = 1, .., T − 1 follows at+1|t = Tt at|t−1 + Kt Vt Kt = Tt Pt|t−1 Zt> Ft−1 Pt+1|t = Tt Pt+1|t L> t + Ωt Lt = Tt − Kt Zt Parameter estimation Another application of the Kalman filter is the estimation of any unknown parameters θ that appear in the system matrices. The likelihood for data Y = (Y1 , .., YY ) can be constructed as 136 Quantitative Analytics p(Y1 , .., YY ) = p(YT |ψT −1 )...p(Y2 |ψ1 )p(Y1 ) = T Y p(Yt |ψt−1 ) t=1 Assuming that the state-space model is Gaussian, by taking conditional expectations on both sides of the observation equation, with dt = 0 we deduce that for t = 1, .., T E[Yt |ψt−1 ] = Zt at|t−1 V ar(Yt |ψt−1 ) = Ft the one-step-ahead prediction density p(Yt |ψt−1 ) is the density of a multivariate normal random variable with mean Zt at|t−1 and and covariance matrix Ft . Thus, the log-likelihood function is given by T log L = − T 1X 1 X > −1 nT log 2π − log detFt − V F Vt 2 2 t=1 2 t=1 t t where Vt = Yt − Zt at|t−1 . Numerical procedures are used in order to maximise the log-likelihood to obtain the ML estimates of the parameters θ which are consistent and asymptotically normal. If the state-space model is not Gaussian, the likelihood can still be constructed in the same way using the minimum mean square linear estimators of the state vector. However, the estimators θ̂ maximising the likelihood are the quasi-maximum likelihood (QML) estimators of the parameters. They are also consistent and asymptotically normal. Smoothing Smoothing is another application of Kalman filter where, given a fixed set of data, estimates of the state vector are computed at each time t in the sample period taking into account the full information set available. The algorithm computes at|T = E[αt |ψT ] along with its MSE, and Pt|T computed via a set of backward recursions for all t = 1, .., T − 1. To obtain at|T and Pt|T we start with aT |T and PT |T and run backwards for t = T − 1, .., 0 at|T = at|t + Pt∗ (at+1|T − at+1|t ) Pt|T = Pt|t + Pt∗ (Pt+1|T − Pt+1|t )Pt∗ , Pt∗ = Pt Tt> Pt+1|t the extensive use of the Markov chain Monte Carlo (MCMC), in particular the Gibbs sampler, has given rise to another smoothing algorithm called the simulation smoother and is also closely related to the Kalman filter. In contrast, to the fixed interval smoother, which computes the conditional mean and variance of the state vector at each time t in the sample, a simulation smoother is used for drawing samples from the density p(α0 , ..., αT |YT ). The first simulation smoother is based on the identity p(α0 , ..., αT |YT ) = p(αT |YT ) TY −1 p(αt |ψt , αt+1 ) t=0 and a draw from p(α0 , ..., αT |YT ) s recursively constructed in terms of αt . Starting with a draw α̂T ∼ N (αT |T , PT |T ), the main idea is that for a Gaussian state space model p(αt |ψt , αt+1 ) is a multivariate normal density and hence it is completely characterized by its first and second moments. The usual Kalman filter recursions are run, so that αt|t is initially obtained. Then, the draw α̂t+1 ∼ p(αt+1 |ψt , αt+2 ) is treated as m additional observations and a second set of m Kalman filter recursions is run for each element of the state vector α̂t+1 . However, the latter procedure involves the inversion of system matrices, which are not necessarily non-singular. 137 Quantitative Analytics 3.2.5.3 Model specification While state space models are widely used in time series analysis to deal with processes gradually changing over time, model specification is a challenge for these models as one has to specify which components to include and to decide whether they are fixed or time-varying. It leads to testing problems which are non-regular from the view-point of classical statistics. Thus, a classical approach toward model selection which is based on hypothesis testing such as a likelihood ratio test or information criteria such as AIC or BIC cannot be easily applied, because it relies on asymptotic arguments based on regularity conditions that are violated in this context. For example, we consider the time series Y = (Y1 , ..., YT ) for t = 1, .., T modelled with the linear trend model Yt = µt + t , t ∼ N (0, σ2 ) where µt is a random walk with a random drift starting from unknown initial values µ0 and a0 µt = µt−1 + at−1 + ω1t , ω1t ∼ N (0, θ1 ) at = at−1 + ω2t , ω2t ∼ N (0, θ2 ) In order to decide whether the drift at is time-varying or fixed we could test θ2 = 0 versus θ2 > 0. However, it is a nonregular testing problem since the null hypothesis lies on the boundary of the parameter space. Testing the null hypothesis a0 = a1 = ... = aT versus the alternative at follows a random walk is, again, non-regular because the size of the hypothesis increases with the number of observations. One possibility is to consider the Bayesian approach when dealing with such non-regular testing problems. We assume that there are K different candidates models M1 , .., MK for generating the time series Y . In a Bayesian setting each of these models is assigned a prior probability p(Mk ) with the goal of deriving the posterior model probability p(Mk |Y ) (the probability of a hypothesis Mk given the observed evidence Y ) for each model Mk for k = 1, .., K. One strategie for computing the posterior model probabilities is to determine the posterior model probabilities of each model separately by using Bayes’ rule p(Mk |Y ) ∝ p(Y |Mk )p(Mk ) where p(Y |Mk ) is the marginal likelihood for model Mk (it is the probability of observing Y given Mk ). An explicit expression for the marginal likelihood exists only for conjugate problems like linear regression models with normally distributed errors, whereas for more complex models numerical techniques are required. For Gaussian state space models, marginal likelihoods have been estimated using methods such as importance sampling, Chib’s estimator, numerical integration and bridge sampling. The modern approach to Bayesian model selection is to apply model space MCMC methods by sampling jointly model indicators and parameters, using for instance the reversible jump MCMC algorithm (see Green [1995]) or the stochastic variable selection approach (see George and McCulloch [1993] [1997]). The stochastic variable selection approach applied to model selection for regression models aims at identifying non-zero regression effects and allows parsimonious covariance modelling for longitudinal data. Fruhwirth-Schnatter et al. [2010a] considered the variable selection approach for many model selection problems occurring in state space modelling. In the above example, they used binary stochastic indicators in such a way that the unconstrained model corresponds to setting all indicators equal to 1. Reduced model specifications result by setting certain indicators equal to 0. 3.3 3.3.1 Asset returns and their characteristics Defining financial returns We consider the probability space (Ω, F, P) where Ft is a right continuous filtration including all P negligible sets in F. For simplicity, we let the market be complete and assume that there exists an equivalent martingale measure Q as defined in a mixed diffusion model by Bellamy and Jeanblanc [2000]. In the presence of continuous dividend yield, that unique probability measure equivalent to P is such that the discounted stock price plus the cumulated dividends are martingale when the riskless asset is the numeraire. In a general setting, we let the underlying process (St )t≥0 be a one-dimensional Ito process valued in the open subset D. 138 Quantitative Analytics 3.3.1.1 Asset returns Return series are easier to handle than price series due to their more attractive statistical properties and to the fact that they represent a complete and scale-free summary of the investment opportunity (see Campbell et al. [1997]). Expected returns need to be viewed over some time horizon, in some base currency, and using one of many possible averaging and compounded methods. Holding the asset for one period from date t to date (t + 1) would result in a simple gross return 1 + Rt,t+1 = St+1 St (3.3.4) where the corresponding one-period simple net return, or simple return, Rt,t+1 is given by Rt,t+1 = St+1 St+1 − St −1= St St More generally, we let ∇d St + Dt−d,t St−d Rt−d,t = be the discrete return of the underlying process where ∇d St = St − St−d with period d and where Dt−d,t is the dividend over the period [t−d, t]. For simplicity we will only consider dividend-adjusted prices with discrete dividendd St adjusted returns Rt−d,t = ∇ St−d . Hence, holding the asset for d periods between dates t − d and t gives a d-period simple gross return 1 + Rt−d,t = St St St−1 St−d+1 = × × ... × St−d St−1 St−2 St−d = (1 + Rt−1,t )(1 + Rt−2,t−1 )...(1 + Rt−d,t−d+1 ) = (3.3.5) d Y (1 + Rt−j,t−j+1 ) j=1 so that the d-period simple gross return is just the product of the d one-period simple gross returns which is called a compound return. Holding the asset for d years, then the annualised (average) return is defined as A Rt−d,t = d Y 1 (1 + Rt−j,t−j+1 ) d − 1 j=1 which is the geometric mean of the d one-period simple gross returns involved and can be computed (see Appendix (B.9.4)) by 1 A Rt−d,t = ed Pd j=1 ln (1+Rt−j,t−j+1 ) −1 It is simply the arithmetic mean of the logarithm returns (1 + Rt−j,t−j+1 ) for j = 1, .., d which is then exponentiated to return the computation to the original scale. As it is easier to compute arithmetic average than geometric mean, and since the one-period returns tend to be small, one can use a first-order Taylor expansion 2 to approximate the annualised (average) return d A Rt−d,t ≈ 2 1X Rt−j,t−j+1 d j=1 since log (1 + x) ≈ x for |x| ≤ 1 139 Quantitative Analytics Note, the arithmetic mean of two successive returns of +50% and −50% is 0%, but the geometric mean is −13% 1 since [(1 + 0.5)(1 − 0.5)] d = 0.87 with d = 2 periods. While some financial theory requires arithmetic mean as inputs (single-period Markowitz or mean-variance optimisation, single-period CAPM), most investors are interested in wealth compounding which is better captured by geometric means. In general, the net asset value A of continuous compounding is A = Cer×n where r is the interest rate per annum, C is the initial capital, and n is the number of years. Similarly, C = Ae−r×n is referred to as the present value of an asset that is worth A dollars n years from now, assuming that the continuously compounded interest rate is r per annum. If the gross return on a security is just 1 + Rt−d,t , then the continuously compounded return or logarithmic return is rL (t − d, t) = ln (1 + Rt−d,t ) = Lt − Lt−d (3.3.6) where Lt = ln St . Note, on a daily basis we get Rt = Rt−1,t and rL (t) = ln (1 + Rt ). The change in log price is the yield or return, with continuous compounding, from holding the security from trading day t − 1 to trading day t. As a result, the price becomes St = St−1 erL (t) Further, the return rL (t) has the property that the log return between the price at time t1 and at time tn is given by the sum of the rL (t) between t1 and tn n X Sn log = rL (ti ) S1 i=1 which implies that Sn = S1 e Pn i=1 rL (ti ) so that if the rL (t) are independent random variables with finite mean and variance, the central limit theorem implies that for very large n, the summand in the above equation is normally distributed. Hence, we would get a log-normal distribution for Sn given S1 . In addition, the variability of simple price changes for a given security is an increasing function of the price level of the security, whereas this is not necessarily the case with the change in log price. Given Equation (3.3.5), then Equation (3.3.6) becomes rL (t − d, t) = rL (t) + rL (t − 1) + rL (t − 2) + ... + rL (t − d + 1) (3.3.7) so that the continuously compounded multiperiod return is simply the sum of continuously compounded one-period returns. Note, statistical properties of log returns are more tractable. Moreover, in the cross section approach aggregation is done across the individual returns. Remark 3.3.1 That is, simple returns Rt−d,t are additive across assets but not over time (see Equation (3.3.5)), wheras continuously compounded returns rL (t − d, t) are additive over time but not across assets (see Equation (3.3.7)). 140 Quantitative Analytics 3.3.1.2 The percent returns versus the logarithm returns t−1 In the financial industry, most measures of returns and indices use change of returns Rt = Rt−1,t defined as StS−S t−1 where St is the price of a series at time t. However, some investors and researchers prefer to use returns based t on logarithms of prices rt = log SSt−1 or compound returns. As discussed in Section (3.3.1.1), continuous time generalisations of discrete time results are easier, and returns over more than one day are simple functions of a single day return. In order to compare change and compound returns, Longerstaey et al. [1995a] compared kernel estimates of the probability density function for both returns. As opposed to the histogram of the data, this approach spreads the frequency represented by each observation along the horizontal axis according to a chosen distribution function, called the kernel, and chosen to be the normal distribution. They also compared daily volatility estimates for both types of returns based on an exponential weighting scheme. They concluded that the volatility forecasts were very similar. They used that methodology to compute the volatility for change returns and then replaced the change returns with logarithm returns. The same analysis was repeated on correlation by changing the inputs from change returns to logarithm returns. They also used monthly time series and found little difference between the two volatility and correlation series. Note, while the one month volatility and correlation estimators based on change and logarithm returns do not coincide, the difference between their point estimates is negligible. 3.3.1.3 Portfolio returns i We consider a portfolio consisting of N instruments, and let rL (t) and Ri (t) for i = 1, 2, .., N be respectively the continuously compounded and percent returns. We assign weights ωi to the ith instrument in the portfolio together PN with a condition of no short sales i=1 ωi = 1 (it is the percentage of the portfolio’s value invested in that asset). We let P0 be the initial value of the portfolio, and P1 be the price after one period, then by using discrete compounding, we derive the usual expression for a portfolio return as P1 = ω1 P0 (1 + R1 ) + ω2 P0 (1 + R2 ) + ... + ωN P0 (1 + RN ) = N X ωi P0 (1 + Ri ) i=1 0 be the return of the portfolio for the first period and replace P1 with its value. We repeat the We let Rp (1) = P1P−P 0 process at periods t = 2, 3, ... to get the portfolio at time t as Rp (t) = ω1 R1 (t) + ω2 R2 (t) + ... + ωN RN (t) = N X ωi Ri (t) i=1 Hence, the simple net return of a portfolio consisting of N assets is a weighted average of the simple net returns of the assets involved. However, the continuously compounded returns of a portfolio do not have the above convenient property. The portfolio of returns satisfies P1 = ω1 P0 er1 + ω2 P0 er2 + ... + ωN P0 erN and setting rp = log P1 P0 , we get rp = log ω1 P0 er1 + ω2 P0 er2 + ... + ωN P0 erN Nonetheless, RiskMetrics (see Longerstaey et al. [1996]) uses logarithmic returns as the basis in all computations and the assumption that simple returns Ri are all small in magnitude. As a result, the portfolio return becomes a weighted average of logarithmic returns rp (t) ≈ N X i=1 since log (1 + x) ≈ x for |x| ≤ 1. 141 i ωi rL (t) Quantitative Analytics 3.3.1.4 Modelling returns: The random walk We are interested in characterising the future changes in the portfolio of returns described in Section (3.3.1.3), by forecasting each component of the portfolio using only past changes of market prices. To do so, we need to model 1. the temporal dynamics of returns 2. the distribution of returns at any point in time Traditionally, to get tractable statistical properties of asset returns, financial markets assume that simple returns {Rit |t = 1, .., T } are independently and identically distributed as normal with fixed mean and variance. However, while the lower bound of a simple return is −1, normal distribution may assume any value in the real line (no lower bound). Further, assuming that Rit is normally distributed, then the multi-period simple return Rit (k) is not normally distributed. At last, the normality assumption is not supported by many empirical asset returns which tend to have positive excess kurtosis. Still, the random walk is one of the widely used class of models to characterise the development of price returns. In order to guarantee non-negativity of prices, we model the log price Lt as a random walk with independent and identically distributed (iid) normally distributed changes with mean µ and variance σ 2 . It is given by Lt = µ + Lt−1 + σt , t ∼ iidN (0, 1) The use of log prices, implies that the model has continuously compounded returns, that is, rt = Lt − Lt−1 = µ + σt with mean and variance E[rt ] = µ , V ar(rt ) = σ 2 Hence, an expression for prices can be derived as St = St−1 eµ+σt and St follows the lognormal distribution. Hence, the mean and variance of simple returns become 1 2 2 2 E[Rt ] = eµ+ 2 σ − 1 , V ar(Rt ) = e2µ+σ (eσ − 1) which can be used in forecasting asset returns. There is no lower bound for rt , and the lower bound for Rt is satisfied using 1 + Rt = ert . Assuming that logarithmic price changes are i.i.d. implies that • at each point in time t the log price changes are identically distributed with mean µ and variance σ 2 implying homoskedasticity (unchanging prices over time). • log price changes are statistically independent of each other over time (the values of returns sampled at different points are completely unrelated). However, the lognormal assumption is not consistent with all the properties of historical stock returns. The above models assume a constant variance in price changes, which in practice is flawed in most financial time series data. We can relax this assumption to let the variance vary with time in the modified model Lt = µ + Lt−1 + σt t , t ∼ N (0, 1) These random walk models imply certain movement of financial prices over time. 142 Quantitative Analytics 3.3.2 The properties of returns 3.3.2.1 The distribution of returns As explained by Tsay [2002] when studying the distributional properties of asset returns, the objective is to understand the behaviour of the returns across assets and over time, in order to characterise the portfolio of returns described in Section (3.3.1.3). We consider a collection of N assets held for T time periods t = 1, .., T . The most general model for the log returns {rit ; i = 1, .., N ; t = 1, .., T } is its joint distribution function Fr r11 , ..., rN 1 ; r12 , ..., rN 2 ; ..; r1T , ..., rN T ; Y ; θ (3.3.8) where Y is a state vector consisting of variables that summarise the environment in which asset returns are determined and θ is a vector of parameters that uniquely determine the distribution function Fr (.). The probability distribution Fr (.) governs the stochastic behavior of the returns rit and the state vector Y . In general Y is treated as given and the main concern is defining the conditional distribution of {rit } given Y . Empirical analysis of asset returns is then to estimate the unknown parameter θ and to draw statistical inference about behavior of {rit } given some past log returns. Consequently, Equation (3.3.8) provides a general framework with respect to which an econometric model for asset returns rit can be put in a proper perspective. For instance, financial theories such as the Capital Asset Pricing Model (CAPM) of Sharpe focus on the joint distribution of N returns at a single time index t, that is, {r1t , ..., rN t }, while theories emphasise the dynamic structure of individual asset returns, that is, {ri1 , ..., riT } for a given asset i. When dealing with the joint distribution of {rit }Tt=1 for asset i, it is useful to partition the joint distribution as Fr (ri1 , ..., riT ; θ) = F (ri1 )F (ri2 |ri1 )...F (riT |ri,T −1 , ..., ri,1 ) = F (ri1 ) T Y F (rit |ri,t−1 , ..., ri,1 ) (3.3.9) t=2 highlighting the temporal dependencies of the log return. As a result, one is left to specify the conditional distribution F (rit |ri,t−1 , ..., ri,1 ) and the way it evolves over time. Different distributional specifications leads to different theories. In one version of the random-walk, the hypothesis is that the conditional distribution is equal to the marginal distribution F (rit ) so that returns are temporally independent and, hence, not predictable. In general, asset returns are assumed to be continuous random variables so that one need to know their probability density functions to perform some analysis. Using the relation among joint, marginal, and conditional distributions we can write the partition as fr (ri1 , ..., riT ; θ) = f (ri1 ; θ) T Y f (rit |ri,t−1 , ..., ri,1 ; θ) t=2 In general, it is easier to estimate marginal distributions than conditional distributions using past returns. Several statistical distributions have been proposed in the literature for the marginal distributions of asset returns (see Tsay [2002]). A traditional assumption made in financial study is that the simple returns {Rit }Tt=1 are independently and identically distributed as normal with fixed mean and variance. However, the lower bound of a simple return is −1 but normal distribution may assume any value in the real line having no lower bound. Further, the normality assumption is not supported by many empirical asset returns, which tend to have a positive excess kurtosis. To overcome the first problem, assumption is that the log returns rt of an asset is independent and identically distributed (iid) as normal with mean µ and variance σ 2 . The multivariate analyses are concerned with the joint distribution of {rt }Tt=1 where rt = (r1t , .., rN t )> is the log returns of N assets at time t. This joint distribution can be partitioned in the same way as above so that the analysis focusses on the specification of the conditional distribution function F (rt |rt−1 , .., r1 ; θ) 143 Quantitative Analytics in particular, how the conditional expectation and conditional covariance matrix of rt evolve over time. The mean vector and covariance matrix of a random vector X = (X1 , .., Xp ) are defined as E[X] Cov(X) = µX = (E[X1 ], .., E[Xp ])> = ΣX = E[(X − µX )(X − µX )> ] provided that the expectations involved exist. When the data {x1 , .., xT } of X are available, the sample mean and covariance matrix are defined as µ̂X = T T 1X 1X xt , Σ̂x = (xt − µ̂X )(xt − µ̂X )> T t=1 T t=1 These sample statistics are consistent estimates of their theoretical counterparts provided that the covariance matrix of X exists. In the finance literature, multivariate normal distribution is often used for the log return rt . 3.3.2.2 The likelihood function One can use the partition in Equation (3.3.9) to obtain the likelihood function of the log returns {r1 , ..., rT } for the ith asset. Assuming that the conditional distribution f (rt |rt−1 , ..., r1 ; Θ) is normal with mean µt and variance σt2 , then Θ consists of the parameters µt and σt2 and the likelihood function of the data is f (r1 , ..., rT ; Θ) = f (r1 ; Θ) T Y t=2 √ −(rt −µt ) 1 2 e 2σt 2πσt 2 where f (r1 ; Θ) is the marginal density function of the first observation r1 . The value Θ∗ maximising this likelihood function is the maximum likelihood estimate (MLE) of Θ. The log function being monotone, the MLE can be obtained by maximising the log likelihood function T ln f (r1 , ..., rT ; Θ) = ln f (r1 ; Θ) − 1 X (rt − µt )2 ln 2π + ln (σt2 ) + 2 t=2 σt2 (3.3.10) Note, even if the conditional distribution f (rt |rt−1 , ..., r1 ; Θ) is not normal, one can still compute the log likelihood function of the data. 3.3.3 Testing the series against trend We have made the assumption of independently distributed returns in Section (3.3.1.4) which is at the heart of the efficient market hypothesis (EMH), but we saw in Section (1.7.6) that the technical community totally rejected the idea of purely random prices. In fact, portfolio returns are significantly autocorrelated leading to contrarian and momentum strategies. One must therefore test time series for trends. When testing against trend we are testing the hypothesis that the members of a sequence of random variables x1 , .., xn are distributed independently of each other, each with the same distribution. Following the definition of trend given by Mann [1945], a sequence of random variables x1 , .., xn is said to have a downward trend if the variables are independently distributed so that xi has the cumulative distribution fi and fi (x) < fj (x) for every i < j and every x. Similarly, an upward trend is defined with fi (x) > fj (x) for every i < j. Since all statistical tests involve the type I error (rejecting the null hypothesis when it is true), and the type II error (not rejecting the null hypothesis when it is false), it is important to consider the power of a test, defined as one minus the probability of type II error. A powerful test will reject a false hypothesis with a high probability. Studying 144 Quantitative Analytics the existence of trends in hydrological time series, Onoz et al. [2002] compared the power of parametric and nonparametric tests for trend detection for various probability distributions estimated by Monte-Carlo simulation. The parametric test considers the linear regression of the random variable Y on time X with the regression coefficient b (or the Pearson correlation coefficient r) computed from the data. The statistic √ r n−2 b t= √ = s 1 − r2 Sqx follows the Student’s t distribution with (n − 2) degrees of freedom, where n is the sample size, s is the standard deviation of the residuals, and Sqx is the sums of squares of the independent variable (time in trend analysis). For non-parametric tests, Yue et al. [2002] showed that the Spearman’s rho test provided results almost identical to those obtained with the Mann-Kendall test. Hence, we consider only the non-parametric Mann-Kendall test for analysing trends. Kendall [1938] introduced the T-test for testing the independence in a bivariate distribution by counting the number of inequalities xi < xj for i < j and computing the distribution of T via a recursive equation. Mann [1945] introduced lower and upper bounds for the power of the T -test. He proposed a trend detection by considering the statistic n SM (t) = n−2 X n−1 X sign(yt−i − yt−j ) i=0 j=i+1 where each pair of observed values (yi , yj ) for i > j of the random variable is inspected to find out whether yi > yj or yi < yj . If P (t) is the number of the former type of pairs, and M (t) is the number of the latter type of pairs, the n (t) = P (t) − M (t). The variance of the statistic is sattistic becomes SM n V ar(SM (t)) = 1 n(n − 1)(2n + 5) 18 so that the statistic is bounded by 1 n (t) ≤ − n(n + 1) ≤ SM 2 The bounds are reached when yt < yt−i (negative trend) or yt > the normalised score n S M (t) = 1 n(n + 1) 2 yt−i (positive trend) for i ∈ N∗ . Hence, we obtain 2 S n (t) n(n + 1) M n where S M (t) takes the value 1 (or −1) if we have a perfect positive (or negative) trend. In absence of trend we get n S M (t) ≈ 0. Letting that statement be the null hypothesis (no trend), we get Z n (t) →n→∞ N (0, 1) with S n (t) Z n (t) = p M n V ar(SM (t)) The null hypothesis that there is no trend is rejected when Z n (t) is greater than z α2 in absolute value. Note, parametric tests assume that the random variable is normally distributed and homosedastic (homogeneous variance), while nonparametric tests make no assumption on the probability distribution. The t-test for trend detection is based on linear regression, thus, checks only for a linear trend. There is no such restriction for the Mann-Kendall test. Further, MK is expected to be less affected by outliers as its statistic is based on the sign of the differences, and not directly on the values of the random variable. Plotting the ratio of the power of the t-test to that of the Mann-Kendall test as 145 Quantitative Analytics function of the slope of the trend of a large number of simulated time series, Yue et al. [2002] showed that the power of the Mann-Kendall trend test was dependent on the distribution types, and was increasing with the coefficient of skewness. Onoz et al. [2002] repeated the experiment on various distributions obtaining a ratio slightly above one for the normal distribution, and for all other (non-normal) distributions the ratio was significantly less than one. For skewed distributions, the Mann-Kendall test was more powerful, especially for high coefficient of skewness. 3.3.4 Testing the assumption of normally distributed returns We saw in Section (2.3.1.1) that the mean-variance efficient portfolios introduced by Markowitz [1952] require some fairly restrictive assumptions on the class of return distribution, such as the assumption of normally distributed returns. Further, the Sharpe type metrics for performance measures described in Section (??) depend on returns of individual assets that are jointly normally distributed. Hence, one must be able to assess the suiability of the normal assumption, and to quantitfy the deviations from normality. 3.3.4.1 Testing for the fitness of the Normal distribution While changes in financial asset prices are known to be non-normally distributed, practitioners still assume that they are normally distributed because they can make predictions on their conditional mean and variance. There has been much discussion about the usefulness of the underlying assumption of normality for return series. One way foreward is to compare directly the predictions made ny the Normal model to what we observe. In general, practitiners use simple heuristics to assess model performances such as measuring • the difference between observed and predicted frequecies of observations in the tail of the normal distribution. • the difference between observed and predicted values of these tail observations. t−1 be the percent return at time t and σt = In the case of univariate tail probabilities, we let Rt = Rt−1,t = StS−S t−1 σt|t−1 be the one day forecast standard deviation of Rt . The theoretical tail probabilities corresponding to the lower and upper tail areas are given by P (Rt < −1.65σt ) = 5% and P (Rt > 1.65σt ) = 5% Letting T be the total number of returns observed over a given sample period, the observed tail probabilities are given by T T 1X 1X I{Rt <−1.65σ̂t } and I{Rt >1.65σ̂t } T t=1 T t=1 where σ̂t is the estimated standard deviation using a particular model. Having estimated the tail probabilities, we are now interested in the value of the observations falling in the tail area, called tail points. We need to check the predictable quality of the Normal model by comparing the observed tail points and the predicted values. In the case of the lower tail, we first record the value of the observations Rt < −1.65σ̂t and then find the average value of these returns. We want to derive forecasts of these tail points called the predicted values. Since we assumed normally distributed returns, the best guess of any return is simply its expected value. Therefore, the predicted value for an observation falling in the lower tail at time t is E[Rt |Rt < −1.65σt ] = −σt λ(−1.65) and λ(x) = φ(x) N (x) where φ(.) is the standard normal density, and N (.) is the standard normal cumulative distribution function. The same heuristic test must be performed on correlation. Assuming a portfolio made of two underlyings R1 and R2 , its daily earning at risks (DEaR) is given by 146 Quantitative Analytics √ DEaR(R1 , R2 ) = V > CV where V = (DEaR(R1 ), DEaR(R2 ))> is a transpose vector, and C is the 2 × 2 correlation matrix. In the bivariate case, we want to analyse the probabilities associated with the joint distribution of the two return series to assess the R2 (t) 1 (t) performance of the model. We consider the event P ( R σ1 (t) < 0 and σ2 (t) < −1.65) where the choice for R1 (t) being less than zero is arbitrary. The observed values are given by T 1X I R1 (t) T t=1 { σ1 (t) <0 and R2 (t) } σ2 (t) × 100 and the predicted probability is obtained by integrating over the bivariate density function Z 0 Z −1.65 B(0, −1.65, ρ) = φ(x1 , x2 , ρ)dx1 dx2 −∞ −∞ where φ(x1 , x2 , ρ) is the standard normal bivariate density function, and ρ is the correlation between S1 and S2 . For any pair of returns, we are now interested in the value of one return when the other is a tail point. The observed values of return S1 are the average of the R1 (t) when R2 (t) < −1.65σ2 (t). Hence, we first record the value of the observations R1 (t) corresponding to R2 (t) < −1.65σ2 (t) and then find the average value of these returns. Based on the assumption of normality for the returns we can derive the forecasts of these tail points called the predicted values. Again, the best guess is the expected value of R1 (t)|R2 (t) < −1.65σ2 (t) given by E[R1 (t)|R2 (t) < −1.65σ2 (t)] = −σ1 (t)ρλ(−1.65) In the case of individual returns, assuming an exponentially weighted moving average (EWMA) with decay factor 0.94 for the estimated volatility, Longerstaey et al. [1995a] concluded that the observed tail frequencies and points match up quite well their predictions from the Normal model. Similarly, in the bivariate case (except for money market rates), the Normal model’s predictions of frequencies and tail points coincided with the observed ones. 3.3.4.2 Quantifying deviations from a Normal distribution For more than a century, the problem of testing whether a sample is from a normal population has attracted the attention of leading figures in statistics. The absence of exact solutions for the sampling distributions generated a large number of simulation studies exploring the power of these statistics as both directional and omnibus tests (see D’Agostino et al. [1973]). A wide variety of tests are available for testing goodness of fit to the normal distribution. If the data is grouped into bins, with several counts in each bin, Pearson’s chi-square test for goodness of fit maybe applied. In order for the limiting distribution to be chi-square, the parameters must be estimated from the grouped data. On the other hand, departures from normality often take the form of asymmetry, or skewness. It happens out of this that mean and variance are no longer sufficient to give a complete description of returns distribution. In fact, skewness and kurtosis (the third and fourth central moments) have to be taken into account to describe a stock (index) returns’ probability distribution entirely. To check whether the skewness and kurtosis statistics of an asset can still be regarded as normal, the Jarque-Bera statistic (see Jarque et al. [1987]) can be applied. We are going to briefly describe the Omnibus test for normality (two sided) where the information in b1 and b2 is indicated for a general non-normal alternative. Note, when a specific alternative distribution is indicated, one can use a specific likelihood ratio test, increasing power. For instance, when information on the alternative distribution exists, a directional test using only b1 and b2 is preferable. However, the number of cases where such directional tests are available is limited for practical application. Let X1 , ..., Xn be independent random variables with absolutely continuous distributions function F . We wish to test H0 : F (x) = N ( x−µ ) , ∀x ∈ R σ 147 Quantitative Analytics versus the two sided alternative x−µ ) for at least one x ∈ R σ where N (.) is the cdf of the standard normal distribution and σ(σ > 0) may be known or unknown. In practice, the null hypothesis of normality is usually specified in composite form where µ and σ are unknown. When performing a test hypothesis, the p-value is found by using the distribution assumed for the test statistic under H0 . However, the accuracy of the p-value depends on how close the assumed distribution is to the true distribution of the test statistic under the null hypothesis. H1 : F (x) 6= N ( Suppose that we want to test the null hypothesis that the returns Ri (1), Ri (2), ..., Ri (n) for the ith asset are independent normally distributed random variables with the same mean and variance. A goodness-of-fit test can be based on the coefficient of skewness for the sample of size n Pn 1 3 m̂c3 j=1 (Ri (j) − Ri ) n = b1 = 3 S3 (m̂c2 ) 2 where mc2 and mc3 are the theoretical second and third central moments, respectively, with its sample estimates n m̂cj = 1X (Xi − X)j , j = 2, 3, 4 n i=1 The test rejects for large values of |b1 |. Remark 3.3.2 In some articles, the notation for b1 is sometime slightly different, with b1 replaced with √ b1 = m̂c3 3 (m̂c2 ) 2 . Note, skewness is a non-dimensional quantity characterising only the shape of the distribution. q For the idealised case of a normal distribution, the standad deviation of the skew coefficient b1 is approximately 15 n . Hence, it is good practice to believe in skewness only when they are several or many times as large as this. Departure of returns from the mean may be detected by the coefficient of kurtosis for the sample Pn 1 4 m̂c4 j=1 (Ri (j) − Ri ) n b2 = = (m̂c2 )2 S4 The kurtosis is also a non-dimensional quantity. To test kurtosis we can compute kurt = b2 − 3 to recover the zero-value of a normal q distribution. The standard deviation of kurt as an estimator of the kurtosis of an underlying normal distribution is 96 n. The estimates of skewness and kurtosis are used in the Jarque-Bera (JB) statistic (see Jarque et al. [1987]) to analyse time series of returns for the assumption of normality. It is a goodness-of-fit measure with an asymptotic χ2 -distribution with two degrees of freedom (because JB is just the sum of squares of two asymptotically independent standardised normals) JB ∼ χ22 , n → ∞ under H0 However, in general the χ2 approximation does not work well due to the slow convergence to the asymptotic results. Jarque et al. showed, with convincing evidence, that convergence of the sampling distributions to asynmptotic results was very slow, especially for b2 . Nonetheless, the JB test can be used to test the null hypothesis that the data are from a normal distribution. That means that H0 has to be rejected at level α if 148 Quantitative Analytics JB ≥ χ21−α,2 At the 5% significance level the critical value is equal to 5.9915. The null hypothesis is a joint hypothesis of the skewness being zero and the excess kurtosis being 0, as samples from a normal distribution have an expected skewness of 0 and an expected excess kurtosis of 0. As the definition of JB shows, any deviation from this increases the JB statistic n 2 (b2 − 3)2 b + 6 1 4 where b1 is the coefficient of skewness and b2 is the coefficient of kurtosis. Note, Urzua [1996] introduced a modification to the JB test by standardising the skewness b1 and the kurtosis b2 in the JB formula, getting JB = JBU = (b2 − eK )2 b21 + vS vK with vS = 3(n − 1) 24n(n − 2)(n − 3) 6(n − 2) , eK = , vK = (n + 1)(n + 3) (n + 1) (n + 1)2 (n + 3)(n + 5) Note, JB and JBU are asymptotically equivalent, that is, H0 has to be rejected at level α if JBU ≥ χ21−α,2 . Critical values of tests for various sample sizes n with α = 0.05 are n = 50 JB = 5.0037 , n = 100 JB = 5.4479 , n = 200 JB = 5.7275 , n = 500 JB = 5.8246 See Thadewald et al. [2004] for tables. Testing for normality, they investigated the power of several tests by considering independent random variables (model I), and the residual in the classical linear regression (model II). The power comparison was carried out via Monte Carlo simulation with a model of contaminated normal distributions (mixture of normal distributions) with varying parameters µ and σ as well as different proportions of contamination. They found that for the JB test, the approximation of critical values by the chi-square distribution did not work well. The test was superior in power to its competitors for symmetric distributions with medium up to long tails and for slightly skewed distributions with long tails. The power of the JB test was poor for distributions with short tails, especially bimodal shape. Further, testing for normality is problematic in the case of autocorrelated error terms and in the case of heteroscedastic error terms. 3.3.5 The sample moments We assume that the population is of size N and that associated with each member of the population is a numerical value of interest denoted by x1 , x2 , .., xN . We take a sample with replacement of n values X1 , ..., Xn from the population, where n < N and such that Xi is a random variable. That is, Xi is the value of the ith member of the sample, and xi is that of the ith member of the population. The population moments and the sample moments are given in Appendix (B.9.1). 3.3.5.1 The population mean and volatility While volatility is a parameter measuring the risk associated with the returns of the underlying price, local volatility is a parameter measuring the risk associated with the instantaneous variation of the underlying price. It can be deterministic or stochastic. On the other hand, historical volatility is computed by using historical data on observed values of the underlying price (opening, closing, highest value, lowest value etc...). In general, one uses standard estimators of variance per unit of time of the logarithm of the underlying price which is assumed to follow a non-centred Brownian motion (see Section (3.3.1.4)). Considering observed values uniformally allocated in time with time difference δ, the stock price a time t + 1 = (j + 1)δ is given by 149 Quantitative Analytics S(j+1)δ = Sjδ eµδ−σ(W(j+1)δ −Wjδ ) with ln S(j+1)δ = µδ − σ(W(j+1)δ − Wjδ ) Sjδ Given N period of time, the first two sample moments are µ̂N = N −1 1 X S(j+1)δ ln N j=0 Sjδ 2 σ̂N = N −1 2 S(j+1)δ 1 X ln − µ̂N N j=0 Sjδ Alternatively, we can consider the return of the underlying price given by R(j+1)δ = S(j+1)δ − Sjδ = eµδ−σ(W(j+1)δ −Wjδ ) − 1 Sjδ Considering the expansion ex ≈ 1 + x for |x| < 1 and assuming µδ − σ(W(j+1)δ − Wjδ ) to be small, we get R(j+1)δ = S(j+1)δ − Sjδ ≈ µδ − σ(W(j+1)δ − Wjδ ) Sjδ and we set µ̃N = N −1 1 X S(j+1)δ − Sjδ N j=0 Sjδ 2 σ̃N = N −1 2 1 X S(j+1)δ − Sjδ − µ̃N N j=0 Sjδ In order to use statistical techniques on market data, one must make sure that the data is stationary, and test the assumption of log-normality on the observed values of the underlying price. Note, the underlying prices rarely satisfy the Black-Scholes assumption. However, we are not trying to compute option prices in the risk-neutral measure, but we are estimating the moments of the stock returns under the historical measure. 3.3.5.2 The population skewness and kurtosis As defined in Section (B.4), skewness is a statistical measure of the asymmetry of the probability distribution of a random variable, in this case the return of a stock. Since a normal distribution is symmetrical, it exhibits exactly zero skewness. The more asymmetric and thus unlike a normal distribution, the larger the figure gets in absolute terms. Given N period of time, the sample skewness is ŜN = N −1 3 S(j+1)δ 1 X ln − µ̂N 3 N σ̂N j=0 Sjδ Kurtosis is a measure of the Peakedness of a probability distribution of random variables. As such, it discloses how concentrated a return distribution is around the mean. Higher kurtosis means more of the variance is due to infrequent 150 Quantitative Analytics extreme deviations (fat tails), lower kurtosis implies a variance composed of frequent modestly-sized deviations. Normally distributed asset returns exhibit a kurtosis of 3. To measure the excess kurtosis with regard to a normal distribution, a value of 3 is hence subtracted from the kurtosis value. A distribution with positive excess kurtosis is called leptokurtic. We can calculate the sample kurtosis of a single asset class with K̂N N −1 4 S(j+1)δ 1 X ln − µ̂N 4 N σ̂N j=0 Sjδ Under normality assumption, skew and kurtosis are distributed asymptotically as normal with mean equal to zero and variance being N6 and 24 N respectively (see Snedecor et al. [1980]). 3.3.5.3 Annualisation of the first two moments The sample estimates of the first two moments are often based on monthly, weekly or daily data, but all quantities are usually quoted in annualised terms. Annualisation is often performed on the sample estimates under the assumption that the random variables (returns) are i.i.d. We let the annualised volatility σ be the standard deviation of the instrument’s √ yearly logarithmic returns. The generalised volatility σT for time horizon T in years is expressed as σT = σ T . Therefore, if the daily logarithmic returns of a stock have a standard deviation of σSD and the time period of returns is P ( or ∆t), the annualised volatility is σSD σ= √ P A common assumption for daily returns is that P = 1/252 (there are 252 trading days in any given year). Then, if σSD = 0.01 the annualised volatility is √ 0.01 σ=q = 0.01 252 1 252 More generally, we have F N where X is the sum of all values referenced, F is the base rate of return (time period frequency) with 12 monthly, 252 daily, 52 weekly, 4 quaterly, and N is the total number of periods. For example, setting P = F1 the annualised mean and variance becomes X× µ = σ2 = µSD = µSD 252 P 2 σSD 2 = σSD 252 P This formula to convert returns or volatility measures from one time period to another assume a particular underlying model or process. These formulas are accurate extrapolations of a random walk, or Wiener process, whose steps have finite variance. However, if portfolio returns are autocorrelated, the standard deviation does not obey the squareroot-of-time rule (see Section (10.1.1)). Again, F is the time period frequency (number of returns per year), then the annualised mean return is still F times the mean return, but the standard deviation of returns should be calculated using the scaling factor s Q (F − 1)(1 − Q) − Q(1 − QF −1 ) (3.3.11) F +2 2 (1 − Q) 151 Quantitative Analytics where Q is the first order autocorrelation of the returns (see Alexander [2008]). If the autocorrelation of the returns is positive, then the scaling factor is greater than the square root of F . More generally, for natural stochastic processes, the precise relationship between volatility measures for different time periods is more complicated. Some researchers use the Levy stability exponent α (linked to the Hurst exponent) to extrapolate natural processes 1 σT = T α σ If α = 2 we get the Wiener process scaling relation, but some people believe α < 2 for financial activities such as stocks, indexes and so on. Mandelbrot [1967] followed a Levy alpha-stable distribution with α = 1.7. Given our previous example with P = 1/252 we get 1 σ = 0.01(252) α We let αW = 2 for the Wiener process and αM = 1.7 for the Levy alpha-stable distribution. Since α̂M = α1M = α̂W + ξ we get (252)α̂M = (252)α̂W (252)ξ so that 1 αM > 1 αW we get σM = 0.01(252)α̂N (252)ξ with ξ = 0.09 and (252)ξ = 1.64. Hence, we get the Mandelbrot annualised volatility √ σM = σSD 252(1 + S ) = σW (1 + S ) where S ≥ 0 is the adjusted volatility. 3.4 Introducing the volatility process 3.4.1 An overview of risk and volatility 3.4.1.1 The need to forecast volatility When visualising financial time series, one can observe heteroskedasticity 3 , with periods of high volatility and periods of low volatility, corresponding to periods of high and low risks, respectively. We also observe returns having very high absolute value compared with their mean, suggesting fat tail distribution for returns, with large events having a larger probability to appear when compared to returns drawn from a Gaussian distribution. Hence, besides the return series introduced in Section (3.3.1), we must also consider the volatility process and the behaviour of extreme returns of an asset (the large positive or negative returns). The negative extreme returns are important in risk management, whereas positive extreme returns are critical to holding a short position. Volatility is important in risk management as it provides a simple approach to calculating the value at risk (VaR) of a financial position. Further, modelling the volatility of a time series can improve the efficiency in parameter estimation and the accuracy in interval forecast. As returns may vary substantially over time and appear in clusters, the volatility process is concerned with the evolution of conditional variance of the return over time. When using risk management models and measures of preference, users must make sure that volatilities and correlations are predictable and that their forecasts incorporate the most useful information available. As the forecasts are based on historical data, the estimators must be flexible enough to account for changing market conditions. One simple approach is to assume that returns are governed by the random walk 2 model described in Section (3.3.1.4), and that the sample standard deviation σ̂N or the sample variance σ̂N of returns for N periods of time can be used as a simple forecast of volatility of returns, rt , over the future period [t + 1, t + h] for some positive integer h. However, volatility has some specific characteristics such as • volatility clusters: volatility may be high for certain time periods and low for other periods. • continuity: volatility jumps are rare. 3 Heteroskedastic means that a time series has a non-constant variance through time. 152 Quantitative Analytics • mean-reversion: volatility does not diverge to infinity, it varies within some fixed range so that it is often stationary. • volatility reacts differently to a big price increase or a big price drop. These properties play an important role in the development of volatility models. As a result, there is a large literature on econometric models available for modelling the volatility of an asset return, called the conditional heteroscedastic (CH) models. Some univariate volatility models include the autoregressive conditional heteroscedastic (ARCH) model of Engle [1982], the generalised ARCH (GARCH) model of Bollerslev [1986], the exponential GARCH (EGARCH) of Nelson [1991], the stochastic volatility (SV) models and many more. Tsay [2002] discussed the advantages and weaknesses of each volatility model and showed some applications of the models. Following his approach, we will describe some of these models in Section (5.6). Unfortunately, stock volatility is not directly observable from returns as in the case of daily volatility where there is only one observation in a trading day. Even though one can use intraday data to estimate daily volatility, accuracy is difficult to obtain. The unobservability of volatility makes it difficult to evaluate the forecasting performance of CH models and heuristics must be developed to estimate volatility on small samples. 3.4.1.2 A first decomposition As risk is mainly given by the probability of large negative returns in the forthcoming period, risk evaluation is closely related to time series forecasts. The desired quantity is a forecast for the probability distribution (pdf) p̃(r) of the possible returns r over the risk horizon ∆T . This problem is generally decomposed into forecasts for the mean and variance of the return probability distribution r∆T = µ∆T + a∆T with a∆T = σ∆T where the return r∆T over the period ∆T is a random variable, µ∆T is the forecast for the mean return, and σ∆t is the volatility forecast. The term a∆T = r∆T − µ∆T is the mean-corrected asset return. The residual , which corresponds to the unpredictable part, is a random variable distributed according to a pdf p∆T (). The standard assumption is to let (t) be an independent and identically distributed (iid) random variable. In general, a risk methodology will set the mean µ to zero and concentrate on σ and p(). To validate the methodology, we set r−µ σ compute the right hand side on historical data, and obtain a time series for the residual. We can then check that is independent and distributed according to p(). For instance, we can test that is uncorrelated, and that given a risk threshold α (say, 95%), the number of exceedance behaves as expected. However, when the horizon period ∆T increases, it becomes very difficult to perform back testing due to the lack of data. Alternatively, we can consider a process to model the returns with a time increment δt of one day, computing the forecasts using conditional averages. We can then relate daily data with forecasts at any time horizon, and the forecasts depend only on the process parameters, which are independent of ∆T and are consistent across risk horizon. The quality of the volatility forecasts is the major determinant factor for a risk methodology. The residuals can then be computed and their properties studied. = 3.4.2 The structure of volatility models The above heuristics being poor estimates of the future volatility, one must rely on proper volatility models such as the conditional heteroscedastic (CH) models. Since the early 80s, volatility clustering spawned a large literaturure on a new class of stochastic processes capturing the dependency of second moments in a phenomenological way. As the 153 Quantitative Analytics lognormal assumption is not consistent with all the properties of historical stock returns, Engle [1982] first introduced the autoregressive conditional heteroscedasticity model (ARCH) which has been generalised to GARCH by Bollerslev [1986]. We let rt be the log return of an asset at time t, and assume that {rt } is either serially uncorrelated or with minor lower order serial correlations, but it is dependent. Volatility models attempt at capturing such dependence in the return series. We consider the conditional mean and conditional variance of rt given the filtration Ft−1 defined by µt = E[rt |Ft−1 ] , σt2 = V ar(rt |Ft−1 ) = E[(rt − µt )2 |Ft−1 ] Since we assumed that the serial dependence of a stock return series was weak, if it exists at all, µt should be simple and we can assume that rt follows a simple time series model such as a stationary ARM A(p, q) model. That is rt = µt + at , µt = φ0 + p X i=1 φi rt−i − q X θi at−i (3.4.12) i=1 where at is the shock or mean-corrected return of an asset return 4 . The model for µt is the mean equation for rt , and the model for σt2 is the volatility equation for rt . Remark 3.4.1 Some authors use ht to denote the conditional variance of rt , in which case the shock becomes at = √ ht t . The paramereters p and q are non-negative integers, and the order (p, q) of the ARMA model may depend on the frequency of the return series. The excess kurtosis values, measuring deviation from the normality of the returns, are indicative of the long-tailed nature of the process. Hence, one can then compute and plot the autocorrelation functions for the returns process rt as well as the autocorrelation functions for the squared returns rt2 . 1. If the securities exhibit a significant positive autocorrelation at lag one and higher lags as well, then large (small) returns tend to be followed by large (small) returns of the same sign. That is, there are trends in the return series. This is evidence against the weakly efficient market hypothesis which asserts that all historical information is fully reflected in prices, implying that historical prices contain no information that could be used to earn a trading profit above that which could be attained with a naive buy-and-hold strategy which implies further that returns should be uncorrelated. In this case, the autocorrelation function would suggest that an autoregressive model should capture much of the behaviour of the returns. 2. The autocorrelation in the squared returns process would suggest that large (small) absolute returns tend to follow each other. That is, large (small) returns are followed by large (small) returns of unpredictable sign. It implies that the returns series exhibits volatility clustering where large (small) returns form clusters throughout the series. As a result, the variance of a return conditioned on past returns is a monotonic function of the past returns, and hence the conditional variance is heteroskedastic and should be properly modelled. The conditional heteroscedastic (CH) models are capable of dealing with this conditional heteroskedasticity. The variance in the model described in Equation (3.4.12) becomes σt2 = V ar(rt |Ft−1 ) = V ar(at |Ft−1 ) Since the way in which σt2 evolves over time differentiate one volatility model from another, the CH models are concerned with the evolution of the volatility. Hence, modelling conditional heteroscdasticity (CH) amounts to augmenting a dynamic equation to a time series model to govern the time evolution of the conditional variance of the shock. We distinguish two types or groups of CH models, the first one using an exact function to govern the evolution of σt2 , and the second one using a stochastic equation to describe σt2 . For instance, the (G)ARCH model belongs to the former, and the stochastic volatility (SV) model belongs to the latter. In general, we estimate the conditional mean and variance equations jointly in empirical studies. 4 since at = rt − µt 154 Quantitative Analytics 3.4.2.1 Benchmark volatility models The ARCH model, which is the first model providing a systematic framework for volatility modelling, states that 1. the mean-corrected asset return at is serially uncorrelated, but dependent 2. the dependence of at can be described by a simple quadratic function of its lagged values. Specifically, setting µt = 0 for simplicity, an ARCH(p) model assumes that 1 2 2 rt = ht2 t , ht = α0 + α1 rt−1 + ... + αp rt−p where {t } is a sequence of i.i.d. random variables with mean zero and variance 1, α0 > 0, and αi ≥ 0 for i > 0. In practice, t follows the standard normal or a standardised Student-t distribution. Generalising the ARCH model, the main idea behind (G)ARCH models is to consider asset returns as a mixture of normal distributions with the current variance being driven by a deterministic difference equation 1 rt = ht2 t with t ∼ N (0, 1) (3.4.13) and ht = α0 + p X i=1 2 αi rt−i + q X βj ht−j , α0 > 0 , αi , βj > 0 (3.4.14) j=1 Pmax (p,q) where α0 > 0, αi ≥ 0, βj ≥ 0, and i=1 (αi + βi ) < 1. The latter constraint on αi + βi implies that the unconditional variance of rt is finite, whereas its conditional variance ht evolves over time. In general, empirical applications find the GARCH(1, 1) model with p = q = 1 to be sufficient to model financial time series 2 ht = α0 + α1 rt−1 + β1 ht−1 , α0 > 0 , α1 , β1 > 0 (3.4.15) When estimated, the sum of the parameters α1 + β1 turns out to be close to the non-stationary case, that is, mostly only a constraint on the parameters prevents them from exceeding 1 in their sum, which would lead to non-stationary behaviour. Different extensions of GARCH were developed in the literature with the objective of better capturing the financial stylised facts. Among them are the Exponential GARCH (EGARCH) model proposed by Nelson [1991] accounting for asymmetric behaviour of returns, the Threshold GARCH (TGARCH) model of Rabemananjara et al. [1993] taking into account the leverage effects, the regime switching GARCH (RS-GARCH) developed by Cai [1994], and the Integrated GARCH (IGARCH) introduced by Engle et al allowing for capturing high persistence observed in returns time series. Nelson [1990] showed that Ito diffusion or jump-diffusion processes could be obtained as a continuous time limit of discrete GARCH sequences. In order to capture stochastic shocks to the variance process, Taylor [1986] introduced the class of stochastic volatility (SV) models whose instantaneous variance is driven by ln (ht ) = k + φ ln (ht−1 ) + τ ξt with ξt ∼ N (0, 1) (3.4.16) This approach has been refined and extended in many ways. The SV process is more flexible than the GARCH model, providing more mixing due to the co-existence of shocks to volatility and return innovations. However, one drawback of the GARCH models and extension to Equation (3.4.16) is their implied exponential decay of the autocorrelations of measures of volatility which is in contrast to the very long autocorrelation discussed in Section (10.4). Both the GARCH and the baseline SV model are only characterised by short-term rather than long-term dependence. In order to capture long memory effects, the GARCH and SV models were expanded by allowing for an infinite number of lagged volatility terms instead of the limited number of lags present in Equations (3.4.14) and (3.4.16). To obtain a compact characterisation of the long memory feature, a fractional differencing operator was used in both extensions, leading to the fractionally integrated GARCH (FIGARCH) model introduced by Baillie et al. [1996], and the long-memory stochastic volatility model of Breidt et al. [1998]. As an intermediate approach, Dacorogna et al. [1998] proposed 155 Quantitative Analytics the heterogeneous ARCH (HARCH) model, considering returns at different time aggregation levels as determinants of the dynamic law governing current volatility. In this model, we need to replace Equations (3.4.14) with ht = c0 + n X 2 cj rt,t−∆t y j=1 where rt,t−∆ty = ln (pt ) − ln (pt−∆tj ) are returns computed over different frequencies. This model was motivated by the finding that volatility on fine time scales can be explained to a larger extend by coarse-grained volatility than vice versa (see Muller et al. [1997]). Thus, the right hand side of the above equation covers local volatility at various lower frequencies than the time step of the underlying data (∆tj = 2, 3, ..). Note, multifractal models have a closely related structure but model the hierarchy of volatility components in a multiplicative rather than additive format. 3.4.2.2 Some practical considerations As an example, we are breifly discussing the (G)ARCH models, which are assumed to be serially uncorrelated. However, before these models are used one must remove the autocorrelation present in the returns process. One can remove the autocorrelation structure from the returns process by fitting Autoregressive models. For instance, we can consider the AR(p) model rt − µ = φ1 (rt−1 − µ) + φ2 (rt−2 − µ) + ... + φp (rt−p − µ) + ut where µ is the sample mean of the series {rt } and the error {ut } are assumed to be from an i.i.d. process. One can use the Yule-Walker method to estimate the model parameters. To discern between models we use the AIC criterion which while rewarding a model fitting well (large maximum likelihood) also penalises for the inclusion of too many parameter values, that is, overfitting. We then obtain models of order p with associated standard errors of the parameter values. Again one has to study the normality of the errors by computing kurtosis statistics as well as the autocorrelation function. One expect the residuals to be uncorrelated not contradicting the Gaussian white noise hypothesis. However, it may happen that the squares of the residuals are autocorrelated. That is, the AR(p) model did not account for the volatility clustering present in the returns process. Even if the residuals from returns are uncorrelated, but still show some evidence of volatility clustering, we can attempt to model the residuals with (G)ARCH processes. Hence, we can remove the autocorrelation by modelling the first order moment with AR(p) models, and we can model the second order moments using (G)ARCH models. (G)ARCH models can explain the features of small autocorrelations, positive and statistically significant autocorrelations in the squares and excess kurtosis present in the residuals of the AR model. For an adequate fit, the residuals from the (G)ARCH models should have white noise properties. Hence, we fit (G)ARCH models to the residuals of the AR models {ut } getting 1 µt − ν = ht2 t where {t } is Gaussian with zero mean and constant variance. Letting ν be the mean, we get ht = α0 + p X αi (ut−i − ν)2 + i=1 q X βj ht−j j=1 For q = 0 the process reduces to the ARCH(p) process and for p = q = 0 the process is a Gaussian white noise. In the ARCH(p) process the conditional variance is specified as a linear function of past sample variances only, whereas the GARCH(p, q) process allows lagged conditional variances to enter as well. Once the (G)ARCH models have been fitted, we can discern between (nested) competing models using the Likelihood Ratio Test. To discern between two competing models where neither is nested in the other, we resort to examining the residuals of the models. For an adequate model, the residuals should ressemble a white noise process being uncorrelated with constant variance. In addition, the autocorrelation of the squared residuals should also be zero. We should favour simpler models when two models appear adequate from an examination of the residuals. 156 Quantitative Analytics 3.4.3 Forecasting volatility with RiskMetrics methodology 3.4.3.1 The exponential weighted moving average As volatility of financial markets changes over time, we saw that forecasting volatility could be of practical importance when computing the conditional variance of the log return of the undelying asset. The historical sample variance computed in Section (3.3.5) assigns weights of zero to squared deviations prior to a chosen cut-off date and an equal weight to observations after the cut-off date. In order to benefit from closing auction prices, one should consider close-to close volatility, with a large number of samples to get a good estimate of historical volatility. Letting D be the number of past trading days used to estimate the volatility, the daily log-return at time t is r(t) = rt−1,t = C(t) − C(t − 1) where C(t) is the closing log-price at the end of day t, and the annualised D-day variance of return is given by 2 σST DEV (t; D) = Csf D−1 1 X (r(t − i) − r(t))2 D i=0 where the scalar Csf scales the variance to be annual, and where r(t) = authors set Csf = 252 while others set it to Csf = 261. 1 D PD−1 i=0 r(t − i) is the sample mean. Some While for large sample sizes the standard close to close estimator is best, it can obscure short-term changes in volatility. That is, volatility reacts faster to shocks in the market as recent data carry more weight than data in the distant past. Further, following a shock (a large return), the volatility declines exponentially as the weight of the shock observation falls. As a result, the equally weighted moving average leads to relatively abrupt changes in the standard deviation once the shock falls out of the measurement sample, which can be several months after it occurs. On the other hand, the weighting scheme for GARCH(1,1) in Equation (3.4.15) and the Exponential Weighted Moving Average (EWMA) (see details in Section (5.7.1)) are such that weights decline exponentially in both models. Therefore, RiskMetrics (see Longerstaey et al. [1996]) let the ex-ante volatility σt be estimated with the exponentially weighted lagged squared daily returns (similar to a simple univariate GARCH model). It assigns the highest weight to the latest observations and the least to the oldest observations in the volatility estimate. The assignment of these weights enables volatility to react to large returns (jumps) in the market, so that following a jump the volatility declines exponentially as the weight of the jump falls. Specifically, the ex-ante annualised variance σt2 is calculated as follows: σt2 (t; D) = Csf ∞ X ωi (rt−1−i − rt )2 i=0 i where the weights ωi = (1 − δ)δ add up to one, and where rt = ∞ X ωi r(t − i) i=0 is the exponentially weighted average return computed similarly. The parameter δ with 0 < δ < 1 is called the decay factor and determines the relative weights that are assigned to returns (observations) the effective amount of data Pand ∞ δ used in estimating volatility. It is chosen so that the center of mass of the weights i=0 (1 − δ)δ i i = (1−δ) is equal P∞ i to 30 or 60 days (since i=0 (1 − δ)δ = 1). The volatility model is the same for all assets at all times. To ensure no look-ahead bias contaminates our results, we use the volatility estimates at time t − 1 applied to time t returns throughout the analysis, that is, σt = σt−1|t . The formula above being an infinite sum, in practice we estimate the volatility σ with the Exponential Weighted Moving Average model (EWMA) for a given sequence of k returns as 157 Quantitative Analytics 2 σEW M A (t)(t; D) = Csf k−1 X ωi (rt−i − r)2 i=0 The latest return has weight (1 − δ) and the second latest (1 − δ)δ and so on. The oldest return appears with weight (1 − δ)δ k−1 . The decay factor δ is chosen to minimise the error between observed volatility and its forecast over some sample period. 3.4.3.2 Forecasting volatility One advantage of the exponentially weighted estimator is that it can be written in recursive form, allowing for volatility forecasts. If we assume the sample mean r is zero and that infinite amounts of data are available, then by using the recursive feature of the exponential weighted moving average (EWMA) estimator, the one-day variance forecast satisfies 2 2 2 σ1,t+1|t = δσ1,t|t−1 + (1 − δ)r1,t 2 where σ1,t+1|t denotes 1-day time t + 1 forecast given information up to time t. It is derived as follow 2 σ1,t+1|t ∞ X 2 δ i r1,t−i = (1 − δ) = 2 2 2 (1 − δ) r1,t + δr1,t−1 + δ 2 r1,t−2 + .... = 2 2 2 2 (1 − δ)r1,t + δ(1 − δ) r1,t−1 + δr1,t−2 + δ 2 r1,t−3 + ... i=0 2 2 = δσ1,t|t−1 + (1 − δ)r1,t Taking the square root of both sides of the equation we get the one day volatility forecast σ1,t+1|t . For two return series, the EWMA estimate of covariance for a given sequence of k returns is given by 2 σ1,2 (t; D) = Csf k−1 X ωi (r1,t−i − r1 )(r2,t−i − r2 ) i=0 Similarly to the variance forecast, the covariance forecast can also be written in recursive form. The 1-day covariance forecast between two return series r1,t and r2,t is 2 2 σ12,t+1|t = δσ12,t|t−1 + (1 − δ)r1,t r2,t In order to get the correlation forecast, we apply the corresponding covariance and volatility forecast. The 1-day correlation forecast is given by ρ12,t+1|t = 2 σ12,t+1|t σ1,t+1|t σ2,t+1|t Using the EWMA model, we can also construct variance and covariance forecast over longer time horizons. The T-period forecasts of the variance and covariance are, respectively, 2 2 σ1,t+T |t = T σ1,t+1|t and 2 2 σ12,t+T |t = T σ12,t+1|t 158 Quantitative Analytics implying that the correlation forecasts remain unchanged irrespective of the forecast horizon, that is, ρt+T |t = ρt+1|t . We observe that in the EWMA model, multiple day forecasts are simple multiples of one-day forecasts. Note, the square root of time rule results from the assumption that variances are constant. However, the above derivation of volatilities and covariances vary with time. In fact, the EWMA model implicitly assume that the variance process is non-stationary. In the literature, this model is a special case the integrated GARCH model (IGARCH) described in Section (5.6.3). In practice, scaling up volatility estimates prove problematic when • rates/prices are mean-reverting. • boundaries limit the potential movements in rates and prices. • estimates of volatilities optimised to forecast changes over a particular horizon are used for another horizon. The cluster properties are measured by the lagged correlation of volatility, and the decay of that correlation quantifies the memory shape and magnitude. Based on statistical analysis, Zumbach [2006a] [2006b] found the lagged correlog ∆T lation of volatility to decay logarithmically as 1 − log ∆T0 in the range from 1 day to 1 year for all assets. That is, the memory of the volatility decays very slowly, so that a volatility model must capture its long memory. He considered a multi-scales long memory extention of IGARCH called the Long-Memory ARCH (LMARCH) process. The main idea being to measure the historical volatilities with a set of exponential moving averages (EMA) on a set of time horizons chosen according to a geometric series. The feed-back loop of the historical returns on the next random return is similar to a GARCH(1, 1) process, but the volatilities are measured at multiple time scales. Computing analytically the conditional expectations related to the volatility forecasts, we get ∆T X ∆T 2 λ( , i)rt−iδt δt i δt P with weights λ( ∆T process equations and satisfying i λ( ∆T δt , i) derived from theq δt , i) = 1. We see that the leading P ∆T 2 term of the forecast is given by σ∆T |t ≈ i λ(i)r (i) is a measure δt which is the Normal square root scaling, and of the past volatility constructed as a weighted sum of the past return square. We saw in Section (3.4.2) that more complicated nonlinear modelling of volatility exists such as GARCH, stochastic volatility, applications of chaotic dynamics etc. We will details all these models in Section (5.6). 2 σ∆T |t = 3.4.3.3 Assuming zero-drift in volatility calculation Pk−1 Given the logarithmic return in Equation (3.3.6) and the k-days period, the sample mean return r = k1 i=0 rt−i is the estimate of the mean µ. An important issue arising in the estimation of the historical variance is the noisy estimate of the mean return. This is due to the fact that the mean logarithmic return depends on the range (length) of the return series in the sense that r= k−1 k−1 1X 1X rt−i = (Lt − Lt−i ) k i=0 k i=0 Thus, the mean return does not take into account the price movements or the number of prices within the period. Therefore, while a standard deviation measures the dispersion of the observations around its mean, in practice, it may be difficult to obtain a good estimate of the mean. As a result, some authors suggested to measure volatility around zero rather than the sample mean. Assuming a EWMA model to estimate volatiliy, Longerstaey et al. [1995a] proposed to study the difference between results given by the sample mean and zero-mean centred estimators. They considered the one-day volatility forecast referred to as the estimated mean estimator, and given by 2 σ̂t2 = δσ̂t−1 + δ(1 − δ)(Rt − Rt−1 )2 159 Quantitative Analytics where Rt is the percentage change return and Rt−1 is an exponentially weighted mean. The zero-men estimator is derived in Section (3.4.3.2) is given by 2 σ̃t2 = (1 − δ)Rt2 + δσ̃t−1 Setting up a Monte Carlo experiment, they studied the forecast difference of the two models σ̂t2 and σ̃t2 at any time t. Defining the arithmetic diffenence ∆t as ∆t = σ̃t2 − σ̂t2 Ri =0 for i = t, t − 1, ... we get ∆t = Rt2 (1 − δ)2 so that the one-day volatility forecast for δ = 0.94 becomes δt = 0.0036Rt2 . Assuming zero sample mean, for sufficiently small percentage return Rt , the difference ∆t is negligible, and one should not expect significant differences between the two models. Considering a database consisting of eleven time series, Longerstaey et al. [1995a] concluded that the relative differences between the two models are quite small. Further, investigating the differences of the one-day forecasted correlation between 1990 and 1995, they found very small deviations. They extended the analysis of the difference between the estimated mean and zero-mean estimators to one month horizons and obtained relatively small differences between the two estimates. As a result, the zero-mean estimator is a viable alternative to the estimated mean estimator, which is simpler to compute and not sensitive to short-term trends. Note, assuming a conditional zero mean of returns is consistent with the financial theory of the efficient market hypothesis (EMH). We will see in Chapter (10) that financial markets are multifractal and that conditional mean of returns experience long term trends. In fact, Zumbach [2006a] [2006b] showed that neglecting the mean return forecast was not correct, particularly for interest rates and stock indexes. For the former, the yields can follow a downward or upward trend for very long periods, of the order of a year or more, and the latter can follow an overall upward trend related to interest rates. These long trends introduce correlations, equivalent to some predictability in the rates themselves. Even though these effects are quantitatively small, they introduce clear deviations from the random walk with ARCH effect on the volatility. 3.4.3.4 Estimating the decay factor We now need to estimate the sample mean and the exponential decay factor δ. The largest sample size available should be used to reduce the standard error. Choosing a suitable decay factor is a necessity in forecasting volatility and correlations. One important issue in this estimation is the determination of an effective number of days (k) used in forecasting. It is postulated in RiskMetrics that the volatility model should be determined by using the metric Ωk = (1 − δ) ∞ X δt t=k where Ωk is set to the tolerance level α. We can now solve for k. Expanding the summation we get α = δ k (1 − δ)[1 + δ + δ 2 + ...] and taking the natural logarithms on both sides we get ln α = k ln δ + ln (1 − δ) + ln [1 + δ + δ 2 + ...] Since log (1 ± x) ≈ ±x − 21 x2 for |x| < 1 we get k≈ ln α ln δ 160 Quantitative Analytics In principle, we can find a set of optimal decay factors, one for each covariance can be determined such that the estimated covariance matrix is symmetric and positive definite. RiskMetrics presented a method for choosing one optimal decay factor to be used in estimation of the entire covariance matrix. They found δ = 0.94 to be the optimal decay factor for one-day forecast and δ = 0.97 to be optimal for one month (25 trading days) forecast. 3.4.4 Computing historical volatility Computing historical volatility is not an easy task as it depends on two parameters, the length of time and the frequency of measurement. As volatility mean revert over a period of months, it is difficult to define the best period of time to obtain a fair value of realised volatility. Further, in presence of rare events, the best estimate of future volatility is not necessary the current historical volatility. While historical volatility can be measured monthly, quarterly or yearly, it is usually measured daily or weekly. In presence of independent stock price returns, then daily and weekly historical volatility should on average be the same. However, when stock price returns are not independent there is a difference due to autocorrelation. If we assume that daily volatility should be preferable to weekly volatility because there are five times as many data points available then intraday volatility should always be preferred. However, intraday volatility is not constant as it is usually greatest just after the market open and just before the market close and falling in the middle of the day, leading to noisy time series. Hence, traders taking into account intraday prices should depend on advanced volatility measures. One approach is to use exponential weighted moving average (EWMA) model described in Section (3.4.3) which avoids volatility collapse of historic volatility. It has the advantage over standard historical volatility (STDEV) to gradually reduce the effect of a spike on volatility. However, EWMA models are rarely used, partly due to the fact that they do not properly handle regular volatility driving events such as earnings. That is, previous earnings jumps will have least weight just before an earnings date (when future volatility is most likely to be high), and most weight just after earnings (when future volatility is most likely to be low). The availability of intraday data allows one to consider volatility estimators making use of intraday information for more efficient volatility estimates. Using the theory of quadratic variation, Andersen et al. [1998] and BarndorffNielsen et al. [2002] introduced the concept of integrated variance and showed that the sum of squared high-frequency intraday log-returns is an efficient estimator of daily variance in the absence of price jumps and serial correlation in the return series. However, market effects such as lack of continuous trading, bid/ask spread, price discretisation, swamp the estimation procedure, and in the limit, microstructure noise dominates the result. The research on high-frequency volatility estimation and the effects of microstructure noise being extremely active, we will just say that intervals between 5 to 30 minutes tend to give satisfactory volatility estimates. We let Nday (t) denote the number of active price quotes during the trading day t, so that S1 (t), .., SNday (t) denotes the intraday quotes. Assuming 30 minutes quotes, the realised variance (RV) model is Nday 2 σ̂RV (t) = X 2 log Sj (t) − log Sj (t − 1) j=2 One simple heuristic to define advanced volatility measures making use of intraday information is to consider range estimators that use some or all of the open (O), high (H), low (L) and close (C). In that setting we define • opening price: O(t) = log S1 (t) • closing price: C(t) = log SNday (t) • high price: H(t) = log (maxj=1,..,Nday Sj (t)) • low price: L(t) = log (minj=1,..,Nday Sj (t)) • normalised opening price: o(t) = O(t) − C(t − 1) = log 161 S1 (t) SNday (t−1) Quantitative Analytics • normalised closing price: c(t) = C(t) − O(t) = log SNday (t) S1 (t) • normalised high price: h(t) = H(t) − O(t) = log (maxj=1,..,Nday • normalised low price: l(t) = L(t) − O(t) = log (minj=1,..,Nday Sj (t) S1 (t) ) Sj (t) S1 (t) ) We are going to discuss a few of them below, introduced by Parkinson [1980], Garman et al. [1980], Rogers et al. [1994], Yang et al. [2000]. We refer the readers to Baltas et al. [2012b] and Bennett [2012] for a more detailed list with formulas. • close to close (C): the most common type of calculation benefiting only from reliable prices at closing auctions. • Parkinson (HL): it is the first to propose the use of intraday high and low prices to estimate daily volatility σ̂P2 K (t) = 1 (h(t) − l(t))2 4 log 2 The model assumes that the asset price follows a driftless diffusion process and it is about 5 times more efficient than STDEV. • Garman-Klass (OHLC): it is an extention of the PK model including opening and closing prices. It is the most powerful estimate for stocks with Brownian motion, zero drift and no opening jumps. The GK estimator is given by 1 (h(t) − l(t))2 − (2 log 2 − 1)c2 (t) 2 and it is about 7.4 times more efficient than STDEV. 2 σ̂GK (t) = • Rogers-Satchell (OHLC): being similar to the GK estimate, it benefits from handling non-zero drift in the price process. However, opening jumps are not well handled. The estimator is given by 2 σ̂RS (t) = h(t)(h(t) − c(t)) + l(t)(l(t) − c(t)) Rogers-Satchell showed that GK is just 1.2 times more efficient than RS. • Garman-Klass Yang-Zhang extension (OHLC): Yang-Zhang extended the GK method by incorporating the difference between the current opening log-price and the previous day’s closing log-price. The estimator becomes robust to the opening jumps, but still assumes zero drift. The estimator is given by 2 σ̂GKY Z = σGK + (O(t) − C(t − 1))2 • Yang-Zhang (OHLC): Having a multi-period specification, it is an unbiased volatility estimator that is independent of both the opening jump and the drift of the price process. It is the most powerful volatility estimator with minimum estimation error. It is a linear combination of the RS estimator, the standard deviation of past daily log-returns (STDEV), and a similar estimator using the normalised opening prices instead of the close-to-close log-returns. Since these estimators provide daily estimates of variance/volatility, an annualised D-day estimator is therefore given by the average estimate over the past D days σl2 (t; D) = D−1 Csf X 2 σ̂ (t − i) D i=0 l 162 Quantitative Analytics for l = {RV, P K, GK, GKY Z, RS}. The Yang-Zhang estimator is given by 2 2 2 σY2 Z (t : D) = σopen (t : D) + kσST DEV (t : D) + (1 − k)σRS (t; D) PD−1 C 2 where σopen (t; D) = Dsf i=0 (o(t − i) − o(t))2 . The parameter k is chosen so that the variance of the estimator is minimised. YZ showed that for the value k= 0.34 D+1 1.34 + D−1 their estimator is 1 + k1 times more efficient than the ordinary STDEV estimator. Brandt et al. [2005] showed that the range-based volatility estimates are approximately Gaussian, whereas return-based volatility estimates are far from Gaussian, which is is an advantage when calibrating stochastic volatility models with likelihood procedure. Bennett [2012] defined two measures to determine the quality of a volatility measure, namely, the efficiency and the bias. The former is defined by (σe2 ) = 2 σST DEV σl2 where σl is the volatility of the estimate and σST DEV is the volatility of the standard close to close estimate. It describes the volatility of the estimate, and decreases as the number of samples increases. The latter is the difference between the estimated variance and the average volatility. It depends on the sample size and the type of distribution of the underlying. Generally, for small sample sizes the Yang-Zhang estimator is best overall, and for large sample sizes the standard close to close estimator is best. Setting aside the realised variance, the Yang-Zhang estimator is the most efficient estimator, it exhibits the smallest bias when compared to the realised variance, and it generates the lowest turnover. While the optimal choice for volatility estimation is the realised variance (RV) estimator, the Yang-Zhang estimator constitute an optimal tradeoff between efficiency, turnover, and the necessity of high frequency data, as it only requires daily information on opening, closing, high and low prices. 163 Part II Statistical tools applied to finance 164 Chapter 4 Filtering and smoothing techniques 4.1 4.1.1 Presenting the challenge Describing the problem Dynamical systems are characterised by two types of noise, where the first one is called observational or additive noise, and the second one is called dynamical noise. In the former, the system is unaffected by this noise, instead the noise is a measurement problem. The observer has trouble precisely measuring the output of the system, leading to recorded values with added noise increment. This additive noise is external to the process. In the latter, the system interprets the noisy output as an input, leading to dynamical noise because the noise invades the system. Dynamical noise being inherent to financial time series, we are now going to summarise some of the tools proposed in statistical analysis and signal processing to filter it out. In financial time series analysis, the trend is the component containing the global change, while the local changes are represented by noise. In general, the trend is characterised by a smooth function representing long-term movement. Hence, trends should exhibit slow changes, while noise is assumed to be highly volatile. Trend filtering (TF) attempts at differentiating meaningful information from exogenous noise. The separation between trend and noise lies at the core of modern statistics and time series analysis. TF is generally used to analyse the past by transforming any noisy signal into a smoother one. It can also be used as a predictive tool, but it can not be performed on any time series. For instance, trend following predictions suppose that the last observed trend influences future returns, but the trend may not persist in the future. A physical process can be described either in the time domain, by the values of some quantity h as a function of time h(t), or in the frequency domain where the process is specified by giving its amplitude H as a function of frequency f , that is, H(f ) with −∞ < f < ∞. One can think of h(t) and H(f ) as being two different representations of the same function, and the Fourier transform equations are a tool to go back and forth between these two representations. There are several reasons to filter digitally a signal, such as applying a high-pass or low-pass filtering to eliminate noise at low or high frequencies, or requiring a bandpass filter if the interesting part of the signal lies only in a certain frequency band. One can either filter data in the frequency domain or in the time domain. While it is very convenient to filter data in the former, in the case where we have a real-time application the latter may be more appropriate. In the time domain, the main idea behind TF is to replace each data point by some kind of local average of surrounding data points such that averaging reduce the level of noise without biasing too much the value obtained. Observations can be averaged using many different types of weightings, some trend following methods are referred to as linear filtering, while others are classified as nonlinear. Depending on whether trend filtering is performed to 165 Quantitative Analytics explain past behaviour of asset prices or to forecast future returns, one will consider different estimator and calibration techniques. In the former, the model and parameters can be selected by minimising past prediction error or by considering a benchmark estimator and calibrating another model to be as close as possible to the benchmark. In the later, trend following predictions assume that positive (or negative) trends are more likely to be followed by positive (or negative) returns. That is, trend filtering solve the problem of denoising while taking into account the dynamics of the underlying process. Bruder et al. [2011] tested the persistence of trends for major financial indices on a period ranging from January 1995 till October 2011 where the average one-month returns for each index is separated into a set including onemonth returns immediately following a positive three-month return and another set for negative three-month returns. The results showed that on average, higher returns can be expected after a positive three-month return than after a negative three-month period so that observation of the current trend may have a predictive value for the indices under consideration. Note, on other time scales or for other assets, one may obtain opposite results supporting contrarian strategies. The main goal of trend filtering in finance is to design portfolio strategies benefiting from these trends. However, before computing an estimate of the trend, one must decide if there is a trend or not in the series. We discussed in Section (3.3.3) the power of statistical tests for trend detection, and concluded that the Mann-Kendall test was more powerful than the parametric t-test for high coefficient of skewness. Given an established trend, one approach is to use the resulting trend indicator to forecast future asset returns for a given horizon and allocate accordingly the portfolio. For instance, an investor could buy assets with positive return forecasts and sell them when the forecasts are negative. The size of each long or short position is a quantitative problem requiring a clear investment process. As explained in Section (), the portfolio allocation should take into account the individual risks, their correlations and the expected return of each asset. 4.1.2 Regression smoothing A regression curve describes a general relationship between an explanatory variable X, which may be a vector in Rd , and a response variable Y , and the knowledge of this relation is of great interest. Given n data points, a regression curve fitting a relationship between variables {Xi }ni=1 and {Yi }ni=1 is commonly modelled as Yi = m(Xi ) + i , i = 1, .., n where is a random variable denoting the variation of Y around m(X), the mean regression curve E[Y |X = x] when we try to approximate the mean response function m. By reducing the observational errors, we can concentrate on important details of the mean dependence of Y on X. This curve approximation is called smoothing. Approximating the mean function can be done in two ways. On one hand the parametric approach assume that the mean curve m has some prespecified functional form (for example a line with unknown slope and intercept). On the other hand we try to estimate m nonparametrically without reference to a specific form. In the former, the functional form is fully described by a finite set of parameters, which is not the case in the latter, offering more flexibility for analysing unknown regression relationship. It can be used to predict observations without referencing to a fixed parametric model, to find spurious observations by studying the influence of isolated points, and to substitute missing values or interpolate between adjacent points. As an example, Engle et al. [1986] considered a nonlinear relationship between electricity sales and temperature using a parametric-nonparametric estimation approach. The prediction of new observations is of particular interest to time series analysis. In general, classical parametric models are too restrictive to give reasonable explanations of observed phenomena. For instance, Ullah [1987] applied kernel smoothing to a time series of stock market prices and estimated certain risk indexes. Deaton [1988] used smoothing methods to examine demand patterns in Thailand and investigated how the knowledge of those patterns affects the assessment of pricing policies. Smoothing of a data set {(Xi , Yi )}ni=1 involves the approximation of the mean response curve m(x) which should 166 Quantitative Analytics be any representative point close to the point x. This local averaging procedure, which is the basic idea of smoothing, can be defined as m̂(x) = n−1 n X Wni (x)Yi i=1 where {Wni (x)}ni=1 denotes a sequence of weights which may depend on the whole vector {Xi }ni=1 . The amount of averaging is controlled by the weight sequence which is tuned by a smoothing parameter regulating the size of the neighborhood around x. In the special case where the weights {Wni (x)}ni=1 are positive and sum to one for all x, that is, n−1 n X Wni (x) = 1 i=1 then m̂(x) is a least squares estimate (LSE) at point x since it is the solution of the minimisation problem min n−1 θ n X Wni (x)(Yi − θ)2 = n−1 i=1 n X Wni (x)(Yi − m̂(x))2 i=1 where the residuals are weighted quadratically. Thus, the basic idea of local averaging is equivalent to the procedure of finding a local weighted least squares estimate. In the random design model, we let {(Xi , Yi )}ni=1 be independent, identically distributed variables, and we concentrate on the average dependence of Y on X = x, that is, we try to estimate the conditional mean curve R yf (x, y)dy m(x) = E[Y |X = x] = f (x) R where f (x, y) is the joint density of (X, Y ), and f (x) = f (x, y)dy is the marginal density of X. Note that for a normal joint distribution with mean zero, the regression curve is linear and m(x) = ρx with ρ = Corr(X, Y ). By contrast, the fixed design model is concerned with controlled, non-stochastic X-variables, so that Yi = m(Xi ) + i , 1 ≤ i ≤ n {i }ni=1 where denotes zero-mean random variables with variance σ 2 . Although the stochastic mechanism is different, the basic idea of smoothing is the same for both random and nonrandom X-variables. 4.1.3 Introducing trend filtering 4.1.3.1 Filtering in frequency We consider the removal of noise from a corrupted signal by assuming that we want to measure the uncorrupted signal u(t), but that the measurement process is imperfect, leading to the corrupted signal c(t). On one hand the true signal u(t) may be convolved with some known response function r(t) to give a smeared signal s(t) Z ∞ s(t) = r(t − τ )u(τ )dτ or S(f ) = R(f )U (f ) −∞ where S, R, U are the Fourier transforms of s, r, u respectively. On the other hand the measured signal c(t) may contain an additional component of noise n(t) (dynamical noise) c(t) = s(t) + n(t) 167 (4.1.1) Quantitative Analytics While in the first case we can devide C(f ) by R(f ) to get a deconvolved signal, in presence of noise we need to find the optimal filter φ(t) or Φ(f ) producing the signal ũ(t) or Ũ (f ) as close as possible to the uncorrupted signal u(t) or U (f ). That is, we want to estimate Ũ (f ) = in the least-square sense, such that Z C(f )Φ(f ) R(f ) ∞ 2 Z ∞ |Ũ (f ) − U (f )|2 df |ũ(t) − u(t)| dt = −∞ −∞ is minimised. In the frequency domain we get Z ∞ Z ∞ (S(f ) + N (f ))Φ(f ) |S(f )|2 |1 − Φ(f )|2 + |N (f )|2 |Φ(f )|2 S(f ) 2 | df − | df = R(f ) R(f ) |R(f )|2 −∞ −∞ if S and N are uncorrelated. We get a minimum if and only if the integrand is minimised with respect to Φ(f ) at every value of f . Differentiating with respect to Φ and setting the result to zero, we get Φ(f ) = |S(f )|2 |S(f )|2 + |N (f )|2 (4.1.2) involving the smearded signal S and the noise N but not the true signal U . Since we can not estimate separately S and N from C we need extra information or assumption. One way forward is to sample a long stretch of data c(t) and plot its power spectral density as it is proportional to |S(f )|2 + |N (f )|2 |S(f )|2 + |N (f )|2 ≈ Pc (f ) = |C(f )|2 , 0 ≤ f < fc which is the modulus squared of the discrete Fourier transform of some finite sample. In general, the resulting plot shows the spectral signature of a signal sticking up above a continuous noise spectrum. Drawing a smooth curve through the signal plus noise power, the difference between the two curves is the smooth model of the signal power. After designing a filter with response Φ(f ) and using it to make a respectable guess at the signal Ũ (f ) we might regard Ũ (f ) as a new signal to improve even further with the same filtering technique. However, the scheme converges to a signal of S(f ) = 0. Alternatively, we take the whole data record, FFT it, multiply the FFT output by a filter function H(f ) (constructed in the frequency domain), and then do an inverse FFT to get back a filtered data set in the time domain. 4.1.3.2 Filtering in the time domain As discussed above, even though it is very convenient to filter data in the frequency domain, in the case where we have a real-time application the time domain may be more appropriate. A general linear filter takes a sequence yk of input points and produce a sequence xn of output points by the formula xn = M X ck yn−k + N X dj xn−j j=1 k=0 where the M + 1 coefficients ck and the N coefficients dj are fixed and define the filter response. This filter produces each new output value from the current and M previous input values, and from its own N previous output values. In the case where N = 0 the filter is called nonrecursive or finite impulse response (FIR), and if N 6= 0 it is called recursive or infinite impulse response (IIR). The relation between the ck ’s and dj ’s and the filter response function H(f ) is 168 Quantitative Analytics PM H(f ) = k=0 ck e 1− PN j=1 −2πik(f ∆) dj e−2πij(f ∆) where ∆ is the sampling interval and f ∆ is the Nyquist interval. To determine a filter we need to find a suitable set of c’s and d’s from a desired H(f ), but like many inverse problem it has no all-purpose solution since the filter is a continuous function while the short list of the c’s and d’s represents only a few adjustable parameters. When the denominator in the filter H(f ) is unity, we recover a discrete Fourier transform. Nonrecursive filters have a frequency response that is a polynomial in the variable z1 where z = e2πi(f ∆) while the recursive filter’s frequency response is a rational function in z1 . However, nonrecursive filters are always stable but recursive filters are not necessarily stable. Hence, the problem of designing recursive filters is an inverse problem with an additional stability constraint. See Press et al. [1992] for a sketch of basic techniques. 4.2 Smooting techniques and nonparametric regression As opposed to pure parametric curve estimations, smoothing techniques provide flexibility in data analysis. In this section, we are going to consider the statistical aspects of nonparametric regression smoothing by considering the choice of smoothing parameters and the construction of confidence bands. While various smoothing methods exist, all smoothing methods are in an asymptotic sense equivalent to kernel smoothing. 4.2.1 Histogram The density function f tells us where observations cluster and occur more frequently. Nonparametric approach does not restrict the possible form of the density function by assuming f to belong to a prespecified family of functions. The estimation of the unknown density function f provides a way of understanding and representing the behaviour of a random variable. 4.2.1.1 Definition of the Histogram Histogram combines neighbouring needles by counting how many fall into a small interval of length h called a bin. The probability for observations of x to fall into the interval [− h2 , h2 ) equals the shaded area under the density h h P (X ∈ [− , )) = 2 2 Z h 2 f (x)dx (4.2.3) −h 2 Histogram as a frequency counting curve Histogram counts the relative frequency of observations falling into a prescribed mesh and normalised so that the resulting function is a density. The relative frequency of observations in this interval is a good estimate of the probability in Equation (4.2.3), which we divide by the number of observations to get 1 h h h h P (X ∈ [− , )) ' #(Xi ∈ [− , )) 2 2 n 2 2 where n is the sample size. Applying the mean value theorem to Equation (4.2.3), we obtain Z h 2 −h 2 h h f (x)dx = f (ξ)h , ξ ∈ [− , ) 2 2 169 Quantitative Analytics so that h h P (X ∈ [− , )) = 2 2 h 2 Z f (x)dx = f (ξ)h −h 2 h h 1 h h P (X ∈ [− , )) ' #(Xi ∈ [− , )) 2 2 n 2 2 Equating the two equations, we arrive at the density estimate 1 h h h h fˆh (x) = #(Xi ∈ [− , )) , x ∈ [− , ) nh 2 2 2 2 The calculation of the histogram is characterised by the following two steps 1. divide the real line into bins Bj = [x0 + (j − 1)h, x0 + jh) , j ∈ z 2. count how many data fall into each bin fˆh (x) = (nh)−1 n X X i=1 The histogram as a Maximum Likelihood Estimate observations I{Xi ∈Bj } I{x∈Bj } j We want to find a density fˆ maximising the likelihood in the n Y fˆ(Xi ) i=1 However, this task is ill-posed, and we must restrict the class of densities in order to obtain a well-defined solution. Varying the binwidth By varying the binwidth h we can get different shapes for the density fˆh (x) • h → 0 : needleplot, very noisy representation of the data • h = : smoother less noisy density estimate • h → ∞ : box-shaped, overly smooth We now need to choose the binwidth h in practice. It can be done by working out the statistics of the histogram. Statistics of the histogram We need to find out if the estimate fˆh is unbiased, and if it matches on average the unknown density. If x ∈ Bj = [(j − 1), jh), the histogram for x (i.i.d.) is given by fˆh = (nh)−1 n X i=1 where n is the sample size. 170 I{Xi ∈Bj } Quantitative Analytics Bias of the histogram Since the Xi are identically distributed, the expected value of the estimate is given by E[fˆh (x)] = (nh)−1 n X 1 E[I{Xi ∈Bj } ] = h i=1 Z jh f (u)du (j−1)h We define the bias as Bias(fˆh (x)) = E[fˆh (x)] − f (x) (4.2.4) which becomes in our setting Bias(fˆh (x)) = 1 h Z f (u)du − f (x) Bj Rewriting the bias of the histogram in terms of the binwidth h and the density f , we get 0 1 1 Bias(fˆh (x)) = ((j − )h − x)f ((j − )h) + o(h) , h → 0 2 2 The stability of the estimate is measured by the variance which we are now going to calculate. Variance of the histogram If the index function I{Xi ∈Bj } is a Bernoulli variable, the variance is given by V ar(fˆh (x)) = V ar((nh)−1 n X IBj (Xj )) i=1 = (nh)−1 f (x) + o((nh)−1 ) , nh → ∞ Clearly, the variance decreases when nh increases, so that we have a dilema between the bias and the variance. Hence, we are going to consider the Mean Square Error (MSE) as a measure of accuracy of an estimator. The Mean Squared Error of the histogram The Mean Squared Error of the estimate is given by M SE(fˆh (x)) = E[(fˆh (x) − f (x))2 ] = V ar(fˆh (x)) + Bias2 (fˆh (x)) = (4.2.5) 0 1 1 1 1 f (x) + ((j − )h − x)2 f ((j − )h)2 + o(h) + o( ) nh 2 2 nh The minimisation of the MSE with respect to h denies a compromise between the problem of oversmoothing (if we choose a large binwidth h to reduce the variance) and undersmoothing (for the reduction of the bias by decreasing the binwidth h). We can conclude that the histogram fˆh (x) is a consistent estimator for f (x) since h → 0 , nh → ∞ implies M SE(fˆh (x)) → 0 and p fˆh (x) − → f (x) However, the application of the MSE formula is difficult in practice, since it contains the unkown density function f both in the variance and the squared bias. M SE = estimate in one particular point x 171 Quantitative Analytics The Mean Integrated Squared Error of the histogram Another measure we can consider is the Mean Integrated Squared Error (MISE). It is a measure of the goodness of fit for the whole histogram defined as Z ∞ M SE(fˆh (x))dx M ISE(fˆh ) = −∞ measuring the average MSE deviation. The speed of convergence of the MISE in the asymptotic sense is given by h2 0 1 M ISE(fˆh ) = (nh)−1 + kf k22 + o(h2 ) + o( ) 12 nh where kf (x)k2 = R∞ −∞ |f (x)|2 dx. The leading term of the MISE is the asymptotic MISE given by h2 0 A − M ISE(fˆh ) = (nh)−1 + kf k22 12 We can minimise the A-MISE by differentiating it with respect to h and equating the result to zero ∂ A − M ISE(fˆh ) = 0 ∂h getting h0 = 6 13 nkfˆ0 k2 (4.2.6) 2 Therefore, choosing theoretically 1 h0 ∼ n− 3 we obtain 1 M ISE ∼ n− 3 >> n−1 , for n sufficiently large 0 The calculation of h0 requires the knowledge of the unkown parameter kf k22 . One approach is to use the plug-in 0 method, which mean that we take an estimate of kf k22 and plug it into the asymptotic formula in Equation (4.2.6). 0 However, it is difficult to estimate this functional form. A practical solution is for kf k22 to take a reference distribution and to calculate h0 by using this reference distribution. 4.2.1.2 Smoothing the histogram by WARPing One of the main criticism of the histogram is its dependence on the choice of the origin. This is because if we use one of these histograms for density estimation, the choice is arbitrary. To get rid of this shortcoming, we can average these histograms, which is known in a generalised form as Weighted Averaging of Rounded Points (WARPing). It is based on a smaller bin mesh, by discretising the data first into a finite grid of bins and then smoothing the binned data l l Bj,l = (j − 1 + )h, (j + )h , l ∈ 0, ..., M − 1 M M The bins Bj,l are generated by shifting each Bj by the amount of on these shifted bins fˆh,l (x) = (nh)−1 n X X i=1 lh M to the right. We now have M histograms based I{x∈Bj,l } I{Xi ∈Bj,l } j The WARPing idea is to calculate the average over all these histograms 172 Quantitative Analytics fˆh (x) = M −1 M −1 X (nh)−1 n X X i=1 l=0 I{x∈Bj,l } I{Xi ∈Bj,l } j We can inspect the double sum over the two index functions more closely by assuming for a moment that x, and Xi are given and fixed, In that case, we get l+1 l ∗ )h, (j − 1 + )h = Bj,l x ∈ (j − 1 + M M l+K l+K +1 ∗ Xi ∈ (j − 1 + )h, (j − 1 + )h = Bj,l+K M M for j, K ∈ z , l ∈ 0, ..., M − 1 ∗ where Bj,l is generated by dividing each bin Bj of binwidth h into M subbins of binwidth M −1 X X l=0 IBj,l (Xi )IBj,l (x) = X z j M −1 X IBz∗ (x) h M = δ. Hence,we get ∗ IBz+K (Xi )(M − |K|) K=1−M z h, z+1 where Bz∗ = [ M M h). This leads to the WARPed histogram fˆh (x) = −1 (nM h) n X X i=0 = (nh)−1 X j I Bj∗ M −1 X (x) j ∗ IBj+K (Xi )(M − |K|) K=1−M M −1 X IBj∗ (x) WM (K)nj+K K=1−M Pn |K| ∗ (Xi ) and WM (K) = 1 − where nK = i=1 IBK M . The explicit specification of the weighting function WM (•) allows us to approximate a bigger class of density estimators such as the Kernel. 4.2.2 Kernel density estimation Rosenblatt [1956] proposed putting smooth Kernel weights in each of the observations. That is, around each observation Xi a Kernel function Kh (• − Xi ) is centred. Like histogram, instead of averaging needles, one averages Kernel functions, and we have a smoothing parameter, called the bandwidth h, regulating the degree of smoothness for Kernel smoothers. 4.2.2.1 Definition of the Kernel estimate A general Kernel K is a real function defined as 1 x K( ) h h Averaging over these Kernel functions in the observations leads to the Kernel density estimator Kh = n n 1X 1 X x − Xi fˆh (x) = Kh (x − Xi ) = nK( ) n i=1 nh i=1 h See Hardle [1991] for a short survey of some other Kernel functions. Some of the properties of the Kernel functions are 173 Quantitative Analytics • Kernel functions are symmetric around 0 and integrate to 1 • since the Kernel is a density function, the Kernel estimate is a density too Z Z K(x)dx = 1 implies Varying the Kernel fˆh (x)dx = 1 The property of smoothness of the Kernel K is inherited by the corresponding estimate fˆh (x) • the Uniform Kernel is not continuous in −1 and 1, so that fˆh (x) is discountinuous and not differentiable in Xi − h and Xi + h. • the Triangle Kernel is continuous but not differentiable in −1, 0, and 1, so that fˆh (x) is continuous but not differentiable in Xi − h, Xi , and Xi + h. • the Quartic Kernel is continuous and differentiable everywhere. Hence, we can approximate f by using different Kernels which gives qualitatively different estimates fˆh . Varying the bandwidth We consider the bandwidth h in Kernel smoothing such that • h → 0 : needleplot, very noisy representation of the data • h small : a smoother, less noisy density estimate • h big : a very smooth density estimate • h → ∞ : a very flat estimate of roughly the shape of the chosen Kernel 4.2.2.2 Statistics of the Kernel density Kernel density estimates are based on two parameters 1. the bandwidth h 2. the Kernel density function We now provide some guidelines on how to choose h and K in order to obtain a good estimate with respect to a given goodness of fit criterion. We are interested in the extent of the uncertainty or at what speed the convergence of the smoother actually happens. In general, the extent of this uncertainty is expressed in terms of the sampling variance of the estimator, but in nonparametric smoothing situation it is not enough as there is also a bias to consider. Hence, we should consider the pointwise mean squared error (MSE), the sum of variance and squared bias. A variety of distance measures exist, both uniform and pointwise, but we will only describe the mean squared error and the mean integrated squared error. Bias of the Kernel density We first check the asymptotic unbiasedness of fˆh (x) using Equation (4.2.4). The expected value of the estimate is n E[fˆh (x)] = 1X E[Kh (x − Xi )] n i=1 with the property 174 Quantitative Analytics if h → 0 , E[fˆh (x)] → f (x) The estimate is thus asymptotically unbiased, when the bandwidth h converges to zero. We can look at bias analysis by using a Taylor expansion of f (x + sh) in x, getting Bias(fˆh (x)) = h2 00 f (x)µ2 (K) + o(h2 ) , h → 0 2 R∞ where µ2 (K) = −∞ u2 K(u)du. The bias is quadratic in h. Hence, we have to choose h small enough to reduce the 00 bias. The size of the bias depends on the curvature of f in x, that is, on the absolute value of f (x). Variance of the Kernel density stability of such estimates We compute the variance of the Kernel density estimation to get insight into the V ar(fˆh (x)) −2 n X nKh (x − Xi )) i=1 (nh)−1 kKk22 f (x) + o((nh)−1 ) = n = V ar( , nh → ∞ The variance being proportional to (nh)−1 , we want to choose h large. This contradicts the aim of decreasing the bias by decreasing the bandwidth h. Therefore we must consider h as a compromise of both effects, namely the M SE(fˆh (x)) or M ISE(fˆh (x)). The Mean Squared Error of the Kernel density Kernel density defined in Equation (4.2.5) We are now looking at the Mean Squared Error (MSE) of the h4 00 1 f (x)kKk22 + (f (x)µ2 (K))2 + o((nh)−1 ) + o(h4 ) , h → 0 , nh → ∞ M SE(fˆh (x)) = nh 4 The MSE converges to zero if h → 0, nh → ∞. Thus, the Kernel density estimate is consistent p fˆh (x) − → f (x) We define the optimal bandwidth h0 for estimating f (x) by h0 = arg min M SE(fˆh (x)) h We can rewrite the MSE as 1 M SE(fˆh (x)) = (nh)−1 c1 + h4 c2 4 with Setting the derivative ∂ ˆ ∂h M SE(fh (x)) c1 = f (x)kKk22 c2 = 00 (f (x))2 (µ2 (K))2 to zero, yields the optimum h0 as h0 = ( 51 c1 1 f (x)kKk22 )5 = 00 2 2 c2 n (f (x)) (µ2 (K)) n 175 Quantitative Analytics Thus, the optimal rate of convergence of the MSE is given by M SE(fˆh0 (x)) = 1 5 f (x)kKk22 00 (f (x)µ2 (K))2 5 4 n 00 Again, the formula includea the unknown functions f (•) and f (•). The Mean Integrated Squared Error of the Kernel density We are now looking at the Mean Integrated Squared Error (MISE) of the Kernel density 00 1 h4 M ISE(fˆh (x)) = kKk22 + (µ2 (K))2 kf k22 + o((nh)−1 ) + o(h4 ) , h → 0 , nh → ∞ nh 4 The optimal bandwidth h0 which minimise the A-MISE with respect to the parameter h is given by h0 = 15 kKk22 2 2 kf k2 (µ2 (K)) n 00 The optimal rate rate of convergence of the MISE is given by 2 00 4 4 5 (kKk22 ) 5 µ2 (K)kf k22 5 n− 5 4 We have not escaped from the circulus virtuosis of estimating f , by encountering the knowledge of a function of f , 00 here f . Fortunately, there exists ways of computing good bandwidths h, even if we have no knowledge of f . A comparison of the speed of convergence of MISE for histogram and Kernel density estimation is given by Hardle. The speed of convergence is faster for the Kernel density than for the histogram one. A − M ISE(fˆh0 (x)) = 4.2.2.3 Confidence intervals and confidence bands To obtain confidence intervals, we derive the asymptotic distribution of the kernel smoothers and use either their asymptotic quantiles or bootstrap approximations for these quantiles. The estimate fˆh (x) is asymptotically normally 1 distributed as n increases and the bandwidth h decreases in the order of n− 2 . Using the bias and the variance of the Kernel, we can derive the following theorem. 00 1 Theorem 4.2.1 Suppose that f (x) exists and hn = cn− 5 . Then the Kernel density estimate fˆh (x) is asymptotically normally distributed. 2 c2 00 n 5 (fˆhn (x) − f (x)) → N f (x)µ2 (K), c−1 f (x)kKk22 , n → ∞ 2 This theorem enables us to compute a confidence interval for f (x). An asymptotical (1 − a) confidence interval for f (x) is given by h 2 00 2 00 i 2 c 2 c fˆh (x) − n− 5 f (x)µ2 (K) + da , fˆh (x) − n− 5 f (x)µ2 (K) − da 2 2 p with da = u1− a2 c−1 f (x)kKk22 and u1− a2 is the (1 − a2 ) quantile of a standard normal distribution. Again, it 00 00 includes the functions f (x) and f (x). A more practical way is to replace f (x) and f (x) with estimates fˆh (x) and 00 00 00 fˆg (x) orcorresponding values of reference distributions. The estimate fˆg (x) can be defined as [fˆg (x)] , where the bandwidth g is not the same as h. If we use a value of two as quantile for an asymptotic 95% confidence interval q q h 2 00 2 00 i 2 c 2 c fˆg (x)µ2 (K) + 2 c−1 f (x)kKk22 , fˆh (x) − n− 5 fˆg (x)µ2 (K) − 2 c−1 f (x)kKk22 fˆh (x) − n− 5 2 2 176 Quantitative Analytics this technique yields a 95% confidence interval for f (x) and not for the whole function. In order to get a confidence 1 band for the whole function Bicket et al. suggested choosing a smaller bandwidth than of order n− 5 to reduce the bias, such that the limiting distribution of the estimate has an expectation equal to f (x). 4.2.3 Bandwidth selection in practice The choice of the bandwidth h is the main problem of the Kernel density estimation. So far we have derived formulas 00 for optimal bandwidths that minimise the MSE or MISE, but employ the unknown functions f (•) and f (•). We are now considering how to obtain a reasonable choice of h when we do not know f (•). 4.2.3.1 Kernel estimation using reference distribution We can adopt the technique using reference distribution for the choice of the binwidth of the histogram described 00 above. We try to estimate kf k22 , assuming f to belong to a prespecified class of density functions. For example, we can choose the normal distribution with parameter µ and σ kf 00 k22 = σ −5 Z 00 (Q (x))2 dx 3 = σ −5 √ ≈ 0.212σ −5 8 π 00 We can then estimate kf k22 through an estimator σ̂ for σ. For instance, if we take the Gaussian Kernel we obtain the following rule of thumb ĥ0 = = kQk22 15 kfˆ 1 4σ̂ 5 ≈ 1.06σ̂n− 5 3n 00 k22 µ22 (Q)n Note, we can use instead of σ̂ a more robust estimate for the scale parameter of the distribution. For example, we can take the interquartile range R̂ defined as R̂ = X[0.75n] − X[0.25n] The rule of thumb is then modified to 1 ĥ0 = 0.79R̂n− 5 We can combine both rules to get the better rule ĥ0 = 1.06 min (σ̂, 1 R̂ )n− 5 1.34 since for Gaussian data R̂ ≈ 1.34σ̂. 4.2.3.2 Plug-in methods 00 Another approach is to directly estimate kf k22 , but doing so we move the problem from the estimation of f to the 00 estimation of f . The plug-in procedure is based on the asymptotic expansion of the squared error kernel smoothers. 177 Quantitative Analytics 4.2.3.3 Cross-validation Maximum likelihood cross-validation We want to test for a specific h the hypothesis fˆh (x) = f (x) vs. fˆh (x) 6= f (x) The likelihood ratio test would be based on the rest statistic f (x) fˆh (x) and should be close to 1, or the average over X, EX [log ( fˆf )(X)] h should be 0. Thus, a good bandwidth minimising this measure of accuracy is in effect optimising the Kullback-Leibler information Z f dKL (f, fˆh ) = (x)f (x)dx fˆh We are not able to compute dKL (f, fˆh ) from the data, since it requires the knowledge of f . However, from a theoretical point of view, we can investigate this distance for the choice of an appropriate bandwidth h minimising dKL (fˆ, f ). If Q we are given additional observations Xi , the likelihood for these observations i fˆh (Xi ) for different h would indicate which value of h is preferable, since the logarithm of this statistic is close to dKL (fˆh , f ). In the case where we do not have additional observations, we can base the estimate fˆh on the subset {Xj }j6=i and to calculate the likelihood for Xi . Denote the Leave-One-Out estimate by fˆh,i (Xi ) = (n − 1)−1 h−1 X Xi − Xj ) h K( j6=i The likelihood is n Y fˆh,i (Xi ) = (n − 1)−n h−n i=1 n X Y K( i=1 j6=i Xi − Xj ) h We take the logarithm of this statistic normalised with the factor n−1 to get the maximum likelihood CV CVKL (h) = n−1 n X i=1 log [fˆh,i (Xi )] + n−1 n X log [ i=1 X K( j6=i Xi − Xj )] − log [(n − 1)h] h so that ĥKL = arg max CVKL (h) and E[CVKL ] ≈ −E[dKL (f, fˆh )] + Z log [f (x)]f (x)dx For more details see Hall [1982]. Least-squares cross-validation We consider an alternative distance measure between fˆ and f called the Integrated Squared Error (SSE) defined as Z dI (h) = (fˆh − f )2 (x)dx which is a quadratic measure of accuracy. Hence, we get Z Z Z dI (h) − f 2 (x)dx = fˆh2 (x)dx − 2 (fˆh f )(x)dx 178 Quantitative Analytics and Z (fˆh f )(x)dx = EX [fˆh (x)] The leave-one-out estimate is EX [fˆh (x)] = n−1 n X fˆh,i (Xi ) i=1 It determines a good bandwidth h minimising the right hand side of the above equation using the leave-one-out estimate. This leads to the least-squares cross-validation Z CV (h) = n 2Xˆ fh,i (Xi ) fˆh2 (x)dx − n i=1 The bandwidth minimising this function is ĥCV = arg min CV (h) Scott et al. [1987] call the function CV an unbiased cross-validation criterion, since E[CV (h)] = M ISE(fˆh ) − kf k22 defines a sequence of bandwidths ĥn = h(X1 , .., Xn ) to be asymptotically optimal if dI (hn ) →1,n→∞ inf h≥0 dI (h) If the density f is bounded, then ĥCV is asymptotically optimal. Note, the minimisation of CV (h) is independent from the order of differentiability p of f . So, this technique is more general to apply than the plig-in method, which requires f to be exactly of the same order of differentiability p. For the computation of the score function, note that Z fˆh2 (x)dx = n−2 h−2 n X n X K ∗ K( i=1 j=1 Xj − Xi ) h where K ∗ K(u) is the convolution of the Kernel function K. As a result, we get CV (h) n X n X n Xj − Xi 2Xˆ )− fh,i (Xi ) h n i=1 = n−2 h−2 = n X n X Xj − Xi 2 Xj − Xi i 2 hn K ∗ K(0) + K ∗ K( ) − K( ) n2 h 2 h n−1 h i=1 j=1 i=1 j=1 K ∗ K( Biased cross-validation The biased cross-validation introduced by Scott et al. [1987] is based on the idea of a direct estimate of A − M ISE(fˆh ) given by 00 h4 A − M ISE(fˆh ) = (nh)−1 kKk22 + µ22 (K)kf k22 4 00 where we have to estimate kf k22 . So, we get 179 Quantitative Analytics BCV1 (h) = (nh)−1 kKk22 + 00 h4 2 µ (K)kfˆ k22 4 2 1 The minimisation of the M ISE(fˆh ) requires a sequence of bandwidths proportional to n− 5 . We can use a bandwidth of this order for the optimisation of BCV1 (h) 00 V ar(fˆh (x)) = V ar(h−3 n X 00 K ( i=1 00 x − Xi )) ∼ n−1 h−5 kK k22 h 00 1 Hence, the variance of fˆh does not converge to zero for this choice of h ∼ n− 5 so that the BCV1 (h) can not 00 approximate the M ISE(fˆh ). This is because the same bandwidth h is used for the estimation of kf k22 and that of f . Hence, we have to employ different bandwidths. For this bias in the estimation of the L2 norm, the method is called 00 biased CV . We have a formula for the expectation of kfˆ k22 given by Scott et al. [1987] 00 00 E[kfˆh k22 ] = kf k22 + 00 1 kK k22 + o(h2 ) nh5 Therefore, we correct the above bias by 00 00 kfˆ k22 = kfˆh k22 − 00 1 kK k22 nh5 1 It is asymptotically unbiased when we let h ∼ n− 5 → 0. The biased cross-validation is given by BCV (h) = 00 00 1 h4 1 kKk22 + µ22 (K)kfˆh k22 − kK k22 5 nh 4 nh where ĥBV C = arg min BCV (h) is an estimate for the optimal bandwidth ĥ0 minimising dI (h). Scott et al. [1987] showed that ĥBV C is asymptotically optimal. The optimal bandwidth ĥBV C has a smaller standard deviation than ĥCV and hence, gives satisfying results for the estimation of the A-MISE. On the other hand, for some skewed distributions biased cross-validation tends to oversmooth where CV (h) is still quite close to the A-MISE optimal bandwidth. 4.2.4 Nonparametric regression A regression curve fitting a relationship between variables {Xi }ni=1 and {Yi }ni=1 , where the former is the explanatory variable and the latter is the response variable, is commonly modelled as Yi = m(Xi ) + i , i = 1, .., n where is a random variable denoting the variation of Y around m(X), the mean regression curve E[Y |X = x] when we try to approximate the mean response function m. By reducing the observational errors, we can concentrate on important details of the mean dependence of Y on X. This curve approximation is called smoothing. Approximating the mean function can be done in two ways. On one hand the parametric approach assume that the mean curve m has some prespecified functional form (a line with unknown slope and intercept). On the other hand we try to estimate m nonparametrically without reference to a specific form. In the former, the functional form is fully described by a finite set of parameters, which is not the case in the latter offering more flexibility for analysing unknown regression relationship. For regression curve fitting we are interested in weighting the response variable Y in a certain neighbourhood of x. Hence, we weight the observations Yi depending on the distance of Xi to x using the estimator 180 Quantitative Analytics m̂(x) = n−1 n X Wn (x; X1 , .., Xn )Yi i=1 Since in general most of the weight Wn (x; X1 , .., Xn ) is given to the observation Xi , we can abbreviate it to Wni (x), so that m̂(x) = n−1 n X Wni (x)Yi i=1 where {Wni (x)}ni=1 denotes a sequence of weights which may depend on the whole vector {Xi }ni=1 . We call smoother the regression estimator m̂h (x), and smooth the outcome of the smoothing procedure. We consider the random design model, where the X-variables have been randomly generated, and we let {(Xi , Yi )}ni=1 be independent, identically distributed variables. We concentrate on the average dependence of Y on X = x, that is, we try to estimate the conditional mean curve R yf (x, y)dy m(x) = E[Y |X = x] = f (x) R where f (x, y) is the joint density of (X, Y ), and f (x) = f (x, y)dy is the marginal density of X. Following Hardle [1990], we now present some common choice for the weights Wni (•). 4.2.4.1 The Nadaraya-Watson estimator We want to find an estimate of the conditional expectation m(x) = E[Y |X = x] where R Z yf (x, y)dy m(x) = R = yf (y|x)dy f (x, y)dy R since f (x) = f (x, y)dy and f (y|x) = ff(x,y) (x) is the conditional density of Y given X = x. While various smoothing methods exist, all smoothing methods are in asymptotic sense equivalent to kernel smoothing. We therefore choose the Kernel density K to represent the weight sequence {Wni (x)}ni=1 . We saw in Section (4.2.2) how to estimate the denominator using the Kernel density estimate. For the numerator, we could estimate the joint density f (x, y) by using the multiplicative Kernel fˆh1 ,h2 = n−1 n X Kh1 (x − Xi )Kh2 (x − Xi ) i=1 We can work out an estimate of the numerator as Z y fˆh1 ,h2 (x, y)dy = n−1 n X Kh1 (x − Xi )Yi i=1 Hence, employing the same bandwidth h for both estimates, we can estimate the conditional expectation m(x) by combining the estimates of the numerator and the denominator. This method was proposed by Nadaraya [1964] and Watson [1964] and gave the Nadaraya-Watson estimator Pn n−1 i=1 Kh (x − Xi )Yi m̂h (x) = −1 Pn n j=1 Kh (x − Xj ) In terms of the general nonparametric regression curve estimate, the weights have the form 181 Quantitative Analytics i h−1 K( x−X h ) fˆh (x) Whi (x) = where the shape of the Kernel weights is determined by K, and the size of the weights is parametrised by h. A variety of Kernel functions exist, but both practical and theoretical considerations limit the choice. A commonly used Kernel function is of the parabolic shape with support [−1, 1] (Epanechnikov) K(u) = 0.75(1 − u2 )I{|u|≤1} but it is not differentiable at u = ±1. The Kernel smoother is not defined for a bandwidth with fˆh (x) = 0. If such 00 case occurs, one defines m̂h (x) as being zero. Assuming that the kernel estimator is only evaluated at the observations {Xi }ni=1 , then as h → 0, we get m̂h (Xi ) → K(0)Yi = Yi K(0) i so that small bandwidths reproduce the data. In the case where h → ∞, and K has support [−1, 1], then K( x−X h )→ K(0), and m̂h (x) → Pn n X n−1 i=1 K(0)Yi −1 P = n Yi n n−1 i=1 K(0) i=1 resulting in an oversmooth curve, the average of the response variables. Statistics of the Nadaraya-Watson estimator The numerator and denominator of this statistic are both random variables so that their analysis is done separately. We first define Z r(x) = yf (x, y)dy = m(x)f (x) (4.2.7) The estimate is r̂h (x) = n−1 n X Kh (x − Xi )Yi i=1 The regression curve estimate is thus given by r̂h (x) fˆh (x) m̂h (x) = We already analised the properties of fˆh (x), and can work out the expectation and variance of r̂h (x) E[r̂h (x)] = E[n−1 n X Kh (x − Xi )Yi ] i=1 Z Kh (x − u)r(u)du = Similarly to the density estimation with Kernels, we get E[r̂h (x)] = r(x) + h2 00 r (x)µ2 (K) + o(h2 ) , h → 0 2 182 Quantitative Analytics To compute the variance of r̂h (x) we let s2 (x) = E[Y 2 |X = x], so that V ar(r̂h (x)) = V ar(n−1 n X Kh (x − Xi )Yi ) = n−2 i=1 = n −1 Z Kh2 (x ≈ n−1 h−1 Z n X V ar(Kh (x − Xi )Yi ) i=1 Z − u)s (u)f (u)du − ( Kh (x − u)r(u)du)2 2 K 2 (u)s2 (x + uh)f (x + uh)du Using the techniques of splitting up integrals, the variance is asymptotically given by V ar(r̂h (x)) = n−1 h−1 f (x)s2 (x)kKk22 + o((nh)−1 ) , nh → ∞ and the variance tends to zero as nh → ∞. Thus, the MSE is given by M SE(r̂h (x)) = h4 00 1 f (x)s2 (x)kKk22 + (r (x)µ2 (K))2 + o(h4 ) + o((nh)−1 ) , h → 0 , nh → ∞ nh 4 (4.2.8) Hence, if we let h → 0 such that nh → ∞, we have M SE(r̂h (x)) → 0 so that the estimate is consistent p r̂h (x) − → m(x)f (x) = r(x) The denominator of m̂h (x), the Kernel density estimate fˆh (x), is also consistent for the same asymptotics of h. Hence, using Slutzky’s theorem (see Schonfeld [1969]) we obtain m̂h (x) = r̂h (x) p r(x) m(x)f (x) = = m(x) , h → 0 , nh → ∞ − → ˆ f (x) f (x) fh (x) and m̂h (x) is a consistent estimate of the regression curve m(x), if h → 0 and nh → ∞. In order to get more insight into how m̂h (x) behaves, such as its speed of convergence, we can study the mean squared error dM (x, h) = E[(m̂h (x) − m(x))2 ] at a point x. Theorem 4.2.2 Assume the fixed design model with a one-dimensional predictor variable X, and define Z Z cK = K 2 (u)du , dK = u2 K(u)du Further, assume K has support [−1, 1] with K(−1) = K(1) = 0, m ∈ C 2 , maxi |Xi − Xi−1 | = o(n−1 ), and var(i ) = σ 2 for i = 1, .., n. Then dM (x, h) ≈ (nh)−1 σ 2 cK + 00 h4 2 dK (m (x))2 , h → 0 , nh → ∞ 4 183 Quantitative Analytics which says that the bias, as a function of h, is increasing whereas the variaiance is decreasing. To understand this result, we note that the estimator m̂h (x) is a ratio of random variables, such that the central limit theorem can not directly be applied. Thus, we linearise the estimator as follows m̂h (x) − m(x) = = fˆh (x) fˆh (x) r̂h (x) − m(x) + (1 − ) f (x) f (x) fˆh (x) f (x) − fˆh (x) r̂h (x) − m(x)fˆh (x) + (m̂h (x) − m(x)) f (x) f (x) 1 By the above consistency property of m̂h (x) we can choose h ∼ n− 5 . Using this bandwidth we can state r̂h (x) − m(x)fˆh (x) = (r̂h (x) − r(x)) − m(x)(fˆh (x) − f (x)) = op (n− 5 ) + m(x)op (n− 5 ) = op (n− 5 ) 2 2 2 such that (m̂h (x) − m(x))(f (x) − fˆh (x)) 2 = op (1)op (n− 5 ) = 2 op (n− 5 ) The leading term in the distribution of m̂h (x) − m(x) is (f (x))−1 (r̂h (x) − m(x)fˆh (x)) and the MSE of this leading term is (f (x))−2 E[(r̂h (x) − m(x)fˆh (x))2 ] leading to the approximate mean squared error 0 M SE(m̂h (x)) = 0 00 1 σ 2 (x) h4 m (x)f (x) 2 2 kKk22 + m (x) + 2 µ2 (K) + o((nh)−1 ) + o(h4 ) , h → 0 , nh → ∞ nh f (x) 4 f (x) 4 1 The MSE is of order o(n− 5 ) when we choose h ∼ n− 5 . The second summand corresponds to the squared bias of 00 m̂h (x) and is either dominated by the second derivative m (x) when we are near to a local extremum of m(x), or by 0 the first derivative m (x) when we are near to a deflection point of m(x). Confidence intervals The asymptotic confidence intervals for m(x) is computed using the formulas of the asymptotic variance and bias of m̂h (x). The asymptotic distribution of m̂h (x) is given by the following theorem Theorem 4.2.3 The Nadaraya-Watson Kernel smoother m̂h (xj ) at the K different locations x1 , .., xK converges in distribution to a multivariate normal random vector with mean B and identity covariance matrix n oK 1 m̂h (xj ) − m(xj ) (nh) 2 σ2 (x )kKk2 1 → N (B, I) j 2 2 j=1 ( f (x ) j) where 184 Quantitative Analytics 0 0 n 00 m (xj )f (xj ) oK B = µ2 (K) m (xj ) + 2 f (xj ) j=1 We can use this theorem to compute an asymptotic (1 − a) confidence interval for m(x), when we employ estimates 0 0 of the unknown functions σ(x), f (x), f (x), m(x), and m (x). One way forward is to assume that the bias of m̂h (x) is of negligible size compared with the variance, so that B is set equal to the zero vector, leaving only σ(x) and f (x) to be estimated. Note, f (x) can be estimated with the Kernel density estimator fˆh (x), and the conditional variance σ 2 (x) can be defined as σ̂ 2 (x) = n−1 n X Whi (x)(Yi − m̂h (x))2 i=1 We then compute the interval [clo, cup] around m̂h (x) at the K distinct points x1 , .., xk with 1 2 clo = m̂h (x) − ca cK σ̂(x) 1 (nhfˆh (x)) 2 σ̂(x) 1 cup = 2 m̂h (x) + ca cK 1 (nhfˆh (x)) 2 1 If the bandwidth is h ∼ n− 5 , then the computed interval does not lead asymptotically to an exact confidence interval 1 for m(x). A bandwidth sequence of order less than n− 5 must be chosen such that the bias vanishes asymptotically. For simultaneous error bars, we can use the technique based on the golden section bootstrap which is a delicate resampling technique used to approximate the joint-distribution of m̂h (x) − m(x) at different points x. 0 Fixed design model This is the case where the density f (x) = F (x) of the predictor variable is known, so that the Kernel weights become Whi (x) = Kh (x − Xi ) f (x) and the estimate can be written as m̂h = r̂h (x) f (x) We can employ the previous results concerning r̂h (x) to derive the statistical properties of this smoother. If the X observations are taken at regular distances, we may assume that they are uniformly U (0, 1) distributed. In the fixed design model of nearly equispaced, nonrandom {Xi }ni=1 on [0, 1], Priestley et al. [1972] and Benedetti [1977] introduced the weight sequence Whi (x) = n(Xi − Xi−1 )Kh (x − Xi ) , X0 = 0 The spacing (Xi − Xi−1 ) can be interpreted as an estimate of n−1 f −1 from the Kernel weight above. Gasser et al. [1979] considered the weight sequence Z Si Kh (x − u)du Whi (x) = n Si−1 where Xi−1 ≤ Si−1 ≤ Xi is chosen between the odered X-data. It is related to the convolution smoothing proposed by Clark [1980]. 185 Quantitative Analytics 4.2.4.2 Kernel smoothing algorithm Computing kernel smoothing at N distinct points for a kernel with unbounded support would result in o(N n) operations. However, using kernels with bounded support, say [−1, 1] would result in o(N nh) operations since about 2nh points fall into an interval of length 2h. One computational approach consists in using the WARPing defined in Section (4.2.1.2). Another one uses the Fourier transforms Z g̃(t) = g(x)e−itx dx where for g(x) = n−1 Pn i=1 Kh (x − Xi )Yi , the Fourier transform becomes g̃(t) = K̃(th) n X e−itXi Yi i=1 Using the Gaussian kernel u2 1 K(u) = √ e− 2 2π t2 we get K̃(th) = e− 2 . Decoupling the smoothing operation from the Fourier transform of the data we can use the Fast Fourier Transform described in Appendix () with o(N log N ) operations. 4.2.4.3 Pn i=1 e−itXi Yi , The K-nearest neighbour Definition of the K-NN estimate Regression by Kernels is based on local averaging of observations Yi in a fixed neighbourhood around x. Rather than considering this fixed neighbourhood, the K-NN employs varying neighbourhood in the X-variables which are among the K-nearest neighbours of x in Euclidean distance. Introduced by Loftsgaarden et al. [1965], it is defined in the form of the general nonparametric regression estimate m̂K (x) = n−1 n X WKi (x)Yi i=1 where the weight sequence {WKi (x)}ni=1 is defined through the set of indices Jx = {i : Xi is one of the K nearest observations to x} This set of neighboring observations defines the K-NN weight sequence n K if i ∈ Jx WKi (x) = 0 otherwise where the smoothing parameter K regulates the degree of smoothness of the estimated curve. Assuming fixed n, in the case where K becomes larger than n, the the K-NN smoother is equal to the average of the response variables. In the case K = 1 we obtain a step function with a jump in the middle between two observations. Statistics of the K-NN estimate Again, we face a trade-off between a good approximation to the regression function and a good reduction of observational noise. It can be expressed formally by an expansion of the mean squared error of the K-NN estimate. Lai (1977) proposed the following theorem (See Hardle [1990] for references and proofs). Theorem 4.2.4 Let K → ∞, K n → 0, n → ∞. Bias and variance of the K-NN estimate m̂K with weights as in the K-NN weight sequence, are given by 186 Quantitative Analytics E[m̂K (x)] − m(x) ≈ 00 K 0 0 1 (m f + 2m f )(x) ( )2 3 24f (x) n and V ar(m̂K (x)) ≈ σ 2 (x) K We observe that the bias is increasing and the variance is decreasing in the smoothing parameter K. To balance this 4 trade-off in an asymptotic sense, we should choose K ∼ n 5 . We then obtain for the mean squared error (MSE) a rate 4 of convergence to zero of the order K −1 = n− 5 . Hence, for this choice of K, the MSE is of the same order as for the Kernel regression. In addition to the uniform weights above, Stone [1977] defined triangular and quadratic K-NN weights. In general, the weights can be thought of as being generated by a Kernel function WRi (x) = KR (x − Xi ) fˆR (x) where n X fˆR (x) = n−1 KR (x − Xi ) i=1 is a Kernel density estimate of f (x) with Kernel sequence KR (u) = R−1 K( u ) R and R is the distance between x and its kth nearest neighbour. 4.2.5 Bandwidth selection While the accuracy of kernel smoothers, as estimators of m or of derivatives of m, is a function of the kernel K and the bandwidth h, it mainly depends on the smoothing parameter h. So far in choosing the smoothing parameter h we tried to compute sequences of bandwidths which approximate the A-MISE minimising bandwidth. However, the A-MISE of the Kernel regression smoother m̂h (x) is not the only candidate for a reasonable measure of discrepancy between the unknown curve m(x) and the approximation m̂h (x). A list of distance measurements is given in Hardle [1991] together with the Hardle et al. [1986] theorem showing that they all lead asymptotically to the same level of smoothing. For convenience, we will only consider the distance that can be most easily computed, namely the average squared error (ASE). 4.2.5.1 Estimation of the average squared error A typical representative quadratic measure of accuracy is the Integrated Squared Error (ISE) defined as Z dI (m, m̂) = (m(x) − m̂(x))2 f (x)W (x)dx where W denotes a nonnegative weight function. Taking the expectation of dI with respect to X yields the MISE dM (m, m̂) = E[dI (m, m̂)] A discrete approximation to dI is the averaged squared error (ASE) defined as dA (m, m̂) = ASE(h) = n−1 n X (m(Xi ) − m̂h (Xi ))2 W (Xi ) i=1 187 (4.2.9) Quantitative Analytics To illustrate the distribution of ASE(h) we look at the M ASE(h), the conditioned squared error of m̂h (x), conditioned on the given set of predictor variables X1 , .., Xn , and express it in terms of a variance component and a bias component. dC (m, m̂) = M ASE(h) = E[ASE(h)|X1 , .., Xn ] n X = n−1 V ar(m̂h (Xi )|X1 , .., Xn ) + Bias2 (m̂h (Xi )|X1 , .., Xn ) W (Xi ) i=1 where distance dC is a random distance through the distribution of the Xs. The expectation of ASE(h), dC , contains a variance component ν(h) ν(h) = n−1 n X n−2 n X i=1 2 Whj (Xi )σ 2 (Xj ) W (Xi ) j=1 2 and a squared bias component b (h) b2 (h) = n−1 n n X −1 X 2 2 n Whj (Xi )m(Xj ) − m(Xi ) W (Xi ) i=1 j=1 The squared bias b2 (h) increases with h, while ν(h) proportional to h−1 decreases. The sum of both components is M ASE(h) which shows a clear minimum. We therefore need to approximate the bandwidth minimising ASE. To do this we consider the averaged squared error (ASE) defined in Equation (4.2.9), and expand it dA (h) = n−1 n X m2 (Xi )W (Xi ) + n−1 i=1 n X m̂2h (Xi )W (Xi ) − 2n−1 i=1 n X m(Xi )m̂h (Xi )W (Xi ) i=1 where the first term is independent of h, the second term cam be entirely computed from the data, and the third term could be estimated if it was vanishing faster than dA tends to zero. A naive estimate of this distance can be based on the replacement of the unknown value m(Xi ) by Yi leading to the so-called Resubstitution estimate P (h) = n−1 n X (Yi − m̂h (Xi ))2 W (Xi ) i=1 Unfortunately, P (h) is a biased estimate of ASE(h). The intuitive reason for this bias being that the observation Yi is used in m̂h (Xi ) to predict itself. To get a deeper insight, denote i = Yi − m(Xi ) the ith error term and consider the expansion P (h) = n−1 n X 2i W (Xi ) + ASE(h) − 2n−1 i=1 n X i (m̂h (Xi ) − m(Xi ))2 W (Xi ) i=1 Thus, the approximation of ASE(h) by P (h) would be fine if the last term had an expectation which is asymptotically of negligible size in comparison with the expectation of ASE(h). This is unfortunately not the case as n n X X E −2n−1 i (m̂h (Xi ) − m(Xi ))2 W (Xi )|X1 , .., Xn = −2n−1 E[i |X1 , .., Xn ] i=1 − n−1 n X i=1 n X n X Whj m(Xj ) − m(Xi ) W (Xi ) − 2n−2 Whj (Xi )E[i j |X1 , .., Xn ]W (Xi ) j=1 i=1 j=1 188 Quantitative Analytics The error i are independent random variables with expectation zero and variance 2 (Xi ). Hence, n n X X E −2n−1 i (m̂h (Xi ) − m(Xi ))2 W (Xi )|X1 , .., Xn = −2n−1 Whi (Xi )2 (Xi )W (Xi ) i=1 i=1 This quantity tends to zero at the same rate as the variance component ν(h) of ASE(h). Thus, P (h) is biased by this additional variance component. We can use this naive estimate P (h) to construct an asymptotically unbiased estimate of ASE(h). We shall discuss two techniques, namely the concept of penalising functions which improve the estimate P (h) by introducing a correcting term for this estimate, and the cross-validation where the computation is based on the leave-one-out estimate m̂hi (Xi ), the Kernel smoother without (Xi , Yi ). 4.2.5.2 Penalising functions With the goal of asymptotically cancelling the bias, the prediction error P (h) is adjusted by the correction term Ξ(n−1 Whi (Xi )) to give the penalising function selector G(h) = n−1 n X (Yi − m̂h (Xi ))2 Ξ(n−1 Whi (Xi ))W (Xi ) i=1 The form of the correction term Ξ(n −1 Whi (Xi )) is restricted by the first order Taylor expansion of Ξ Ξ(u) = 1 + 2u + o(u2 ) , u → 0 Hence, the correcting term can be written as Ξ(n−1 Whi (Xi )) 1 + 2n−1 Whi (Xi ) + o((nh)−2 ) , nh → ∞ K(0) + o((nh)−2 ) = 1 + 2(nh)−1 ˆ fh (Xi ) = penalising values of h too low. We can work out the leading terms of G(h) ignoring terms of lower order G(h) = + n−1 2n n X 2i W (Xi ) + ASE(h) i=1 n X −1 i (m(Xi ) − m̂h (Xi ))W (Xi ) + 2n−2 i=1 n X 2i Whi (Xi )W (Xi ) i=1 The first term is independent of h, and the expectation of the third summand (in equation above) is the negative expected value of the last term in the leading terms of G(h). Hence, the last two terms cancel asymptotically so that G(h) is roughly equal to ASE(h), and as a result G(h) is an unbiased estimator of ASE(h). This gives rise to a lot of penalising functions which lead to asymptotically unbiased estimates of the ASE minimising bandwidth. The simplest function is of the form Ξ(u) = 1 + 2u The objective of these selector functions is to penalise too small bandwidths. Any sequence of optimising bandwidths of one of these penalising functions is asymptotically optimal, that is, the ratio of the expected loss to the minimum loss tends to one. Denote ĥ as the minimising bandwidth of G(h) and ĥ0 as the ASE optimal bandwidth. Then ASE(ĥ) ASE(ĥ0 ) p − →1, 189 ĥ ĥ0 p − →1 Quantitative Analytics 1 However, the speed of convergence is slow. The relative difference between the estimate ĥ and ĥ0 is of rate n− 10 and we can not hope to derive a better one, since the relative difference between ĥ0 and the MISE optimal bandwidth h0 is of the same size. 4.2.5.3 Cross-validation Cross-validation employs the leave-one-out estimates m̂hi (Xi ) in the formula of the prediction error instead of the original estimates. That is, one observation, say the ith one, is left out X m̂hi (Xi ) = n−1 Whj (Xi )Yj j6=i This leads to the score function of cross-validation CV (h) = n−1 n X 2 Yi − m̂hi (Xi ) W (Xi ) i=1 The equation of the leading terms of G(h) showed that P (h) contains a component of roughly the same size as the variance of ASE(h), but with a negative sign, so that the effect of the variance cancels. When we use the leave-one-out estimates of m̂h (Xi ) we arrive at n X E −2n−1 i m̂hi (Xi ) − m(Xi ) W (Xi )|X1 , .., Xn i=1 = −2n−1 (n − 1)−1 n X X Whj (Xi )E[i j |X1 , .., Xn ]W (Xi ) = 0 i=1 j6=i The cross-validation can also be understood in terms of penalising functions. Assume that fˆhi (Xi ) 6= 0 and m̂hi (Xi ) 6= Yi for all i, then we note that CV (h) = n −1 n X Yi − m̂h (Xi ) 2 m̂h (Xi ) − Yi −2 W (Xi ) m̂hi (Xi ) − Yi Yi − m̂h (Xi ) 2 i=1 = n−1 n X −2 1 − n−1 Whi (Xi ) W (Xi ) i=1 Thus, the score function for CV can be rewritten as a penalising function with the selector of generalised crossvalidation. Hence, a sequence of bandwidths on CV (h) is asymptotically optimal and yields the same speed of convergence as the other techniques. 4.3 4.3.1 Trend filtering in the time domain Some basic principles We are now going to filter, in the time domain, the corrupted signal defined in Equation (4.1.1) in the case of financial time series. Slightly modifying notation, we let yt be a stochastic process made of two different unobservable components, and assume that in its simplest form its dynamics are yt = xt + t 190 (4.3.10) Quantitative Analytics where xt is the trend, and the noise t is a stochastic process. We are now concerned with estimating the trend xt . We let y = {..., y−1 , y0 , y1 , ...} be the ordered sequence of observations of the process yt and x̂t be the estimator of the unobservable underlying trend xt . A filtering procedure consists in applying a filter L to the data y x̂ = L(y) with x̂ = {..., x̂−1 , x̂0 , x̂1 , ..}. In the case of linear filter we have x̂ = Ly with the normalisation condition 1 = L1. Further, if the signal yt is observed at regular dates, we get x̂t = ∞ X Lt,t−i yt−i i=−∞ and the linear filter may be viewed as a convolution. Imposing some restriction on the coefficients Lt,t−i , to use only past and present values, we get a causal filter. Further, considering only time invariant filters, we get a simple convolution of observed signal yt with a window function Li x̂t = n−1 X Li yt−i (4.3.11) i=0 corresponding to the nonrecursive filter (or FIR) in Section (4.1.3.2). That is, a linear filter is characterised by a window kernel Li and its support n where the former defines the type of filtering and the latter defines the range of the filter. When it is not possible to express the trend as a linear convolution of the signal and a window function, the filters are called nonlinear filters. Bruder et al. [2011] provide a detailed description of linear and non-linear filter. As an example of linear filter, in the well known moving average (MA), we take a square window on a compact support [0, T ] with T = n∆ 1 , the width of the averaging window, and get the kernel 1 I{i n2 , the trend is approximated by µ̂t ≈ 2 (ŷ n2 − ŷtn1 ) (n1 − n2 )∆ t which is positive when the short-term moving average is higher than the long-term moving average. Hence, the sign of the approximated trend changes when the short-term MA crosses the long-term one. Note, this estimator may be viewed as a weighted moving average of asset returns. Inverting the derivative window li we recover the operator Li as l0 if i = 0 li + Li−1 if i = 1, ..., n − 1 Li = −ln−1 if i = n and one can then interpret the estimator in terms of asset returns. The weighting of each return in the estimator forms a triangle where the biggest weighting is given at the horizon of the smallest MA. Hence, the indicator can be focused towards the current trend (if n2 is small) or towards past trends (if n2 is as large as n21 ). In order to improve the uniform MA estimator, we can consider the kernel function 4 n sign( − i) 2 n 2 where the estimator µ̂t takes into account all the dates of the window period. Taking the primitive of the function li , the filter becomes li = 4 n n ( − |i − |) 2 n 2 2 Other types of MA filter exists which are characterised by an asymmetric form of the convolution kernel. For instance, one can take an asymmetric window function with a triangular form Li = 2 (n − i)I{i .A).a = A> .f or a = (A> .A)−1 .(A> .f ) where Aij = ij , i = −nL , .., nR , j = 0, .., M We also have the specific forms {A> .A}ij = {A> .f }j = nR X Aki Akj = nR X k i+j k=−nL k=−nL nR X Akj fk = k=−nL nR X k j fk k=−nL Since the coefficient cn is the component a0 when f is replaced by the unit vector en for −nL ≤ n ≤ nR , we have cn = {(A> .A)−1 .(A> .en )}0 = M X {(A> .A)−1 }0m nm m=0 meaning that we only need one row of the inverse matrix (numerically we can get this by LU decomposition with only a single back-substitution). A higher degree polynomial makes it possible to achieve a high level of smoothing without attenuation of real data features. Hence, within limits, the Savitzky-Golay filtering manages to provides smoothing without loss of resolution. When dealing with irregularly sampled data, where the values fi are not uniformly spaced in time, there is no way to obtain universal filter coefficients applicable to more than one data point. Note, the Savitzky-Golay technique can also be used to compute numerical derivatives. In that case, the desired order is usually m = M = 4 or larger where m is the order of the smoothing polynomial, also equal to the highest conserved moment. Numerical experiments are usually done with a 33 point smoothing filter, that is nL = nR = 16. 4.3.4 The least squares filters 4.3.4.1 The L2 filtering An alternative to averaging observations is to impose a model on the process yt and its trend xt (see Section (4.1.2)). For instance, the Lanczos filter in the previous section may be considered as a local linear regression. Given a model for the process yt , least squares methods are often used to define trend estimators n {x̂1 , ..., x̂n } = arg min 1X (yt − x̂t )2 2 t=1 but the problem is ill-posed and one must impose some restrictions on the underlying process yt or on the filtered trend x̂t to obtain a solution. For instance, we can consider the deterministic constant trend xt = xt−1 + µ 195 Quantitative Analytics such that the process yt becomes yt = xt−1 + µ + t . Iterating with x0 = 0 2 , we get the process yt = µt + t (4.3.13) and estimating the filtered trend x̂t is equivalent to estimating the coefficient µ Pn tyt µ̂ = Pt=1 n 2 t=1 t In the case where the trend is not constant one can consider the Hodrick-Prescott filter (or L2 filter) where the objective function is n n−1 X 1X (yt − x̂t )2 + λ (x̂t−1 − 2x̂t + x̂t+1 )2 2 t=1 t=2 where λ > 0 is a regularisation parameter controlling the trade off between the smoothness of x̂t and the noise (yt − x̂t ). Rewriting the objective function in vectorial form, we get 1 ky − x̂k22 + λkDx̂k22 2 where the operator D is the (n − 2) × n matrix 1 −2 1 0 ... 0 0 0 1 −2 1 ... 0 0 ... ... ... ... ... ... ... D= 0 0 0 0 ... 1 −2 0 0 0 0 ... 0 1 0 0 0 0 ... 1 0 −2 1 so that the estimator becomes x̂ = I + 2λD> D 4.3.4.2 −1 y The L1 filtering One can generalise the Hodrick-Prescott filter to a larger class of filters by using the Lp penalty condition instead of the L2 one (see Daubechies et al. [2004]). If we consider an L1 filter, the objective function becomes n n−1 X 1X 2 (yt − x̂t ) + λ |x̂t−1 − 2x̂t + x̂t+1 | 2 t=1 t=2 which is expressed in vectorial form, as 1 ky − x̂k22 + λkDx̂k1 2 Kim et al. [2009] showed that the dual problem of the L1 filter scheme is a quadratic program with some boundary constraints. Since the L1 norm imposes the condition that the second derivative of the filtered signal must be zero, we obtain a set of straight trends and breaks. Hence, the smoothing parameter λ plays an important role in detecting the number of breaks. 2 yt = xt−n + nµ + t , with xt−n = x0 . 196 Quantitative Analytics 4.3.4.3 The Kalman filters Another approach to estimating the trend is to consider the Kalman filter where the trend µt is a hidden process following a given dynamics (see details in Appendix (C.4)). For instance, we can assume it follows the dynamics Rt = µt + σR R (t) µt = µt−1 + σµ µ (t) (4.3.14) where Rt is the observable signal of realised returns and the hidden process µt follows a random walk. Hence, it follows a Markov model. If we let the conditional trend be µ̂t|t−1 = Et−1 [µt ] and the estimation error be Pt|t−1 = Et−1 [(µ̂t|t−1 − µt )2 ], then we get the forecast estimator µ̂t+1|t = (1 − Kt )µ̂t|t−1 + Kt Rt where Kt = Pt|t−1 2 Pt|t−1 + σR which is the Kalman gain. The estimation error is given by the Riccati’s equation Pt+1|t = Pt|t−1 + σµ2 − Pt|t−1 Kt with stationary solution P∗ = q 1 2 σµ σµ + σµ2 + 4σR 2 and the filter equation becomes µ̂t+1|t = (1 − κ)µ̂t|t−1 + κRt with κ= 2σ q µ 2 σµ + σµ2 + 4σR Note, the Kalman filter in Equation (4.3.14) can be rewritten as an exponential moving average (EMA) filter with parameter λ = − ln (1 − κ) for 0 < κ < 1 and λ > 0. In this setting, the estimator is given by µ̂t = (1 − e−λ ) ∞ X e−λi Rt−i i=0 with µ̂t = Et [µt ] so that the 1-day forecast estimator is µ̂t+1|t = µ̂t . From our discussion above, the filter of the trend x̂t is given by the equation x̂t = (1 − e−λ ) ∞ X e−λi yt−i i=0 and the derivative of the trend may be related to the signal yt by the following equation µ̂t = (1 − e−λ )yt − (1 − e−λ )(eλ − 1) ∞ X i=1 197 e−λi yt−i Quantitative Analytics One can relate the regression model in Equation (4.3.13) with the Markov model in Equation (4.3.14) by notting that they are special cases of the structural models described in Appendix (C.4.12). More precisely, the regression model in Equation (4.3.13) is equivalent to the state space model yt = xt + σy y (t) xt = xt−1 + µ If we let the tend be stochastic we get the local level model yt = xt + σy y (t) xt = xt−1 + µ + σx x (t) Further, assuming that the slope of the trend is stochastic, we obtain the local linear trend model yt = xt + σy y (t) xt = xt−1 + µt−1 + σx x (t) µt = µt−1 + σµ µ (t) (4.3.15) and setting σy = 0 we recover the Markov model in Equation (4.3.14). These examples are special case of structural models which can be solved by using the Kalman filter. Note, the Kalman filter is optimal in the case of the linear Gaussian model in Equation (), and it can be regarded as an efficient computational solution of the least squares method (see Sorenson [1970]). Remark 4.3.2 The Kalman filter can be used to solve more sophisticated process than the Markov model, but some nonlinear or non Gaussian models may be too complex for Kalman filtering. To conclude, the Kalman filter can be used to derive an optimal smoother as it improves the estimate of x̂t−i by using all the information between t − i and t. 4.3.5 Calibration When filtering trends from time series, one must consider the calibration of the filtering parameters. We briefly discuss two possible calibration schemes, one where the calibrated parameters incorporate our prediction requirement and the other one where they can be mapped to a known benchmark estimator. To illustrate the approach of statistical inference we consider the local linear trend model in Equation (4.3.15). We estimate the set of parameters (σy , σx , σµ ) by maximising the log-likelihood function n l= v2 1X ln 2π + ln Ft + t 2 t=1 Ft where vt = yt − Et−1 [yt ] is the (one-day) innovative process and Ft = Et−1 [vt2 ] is the variance of vt . In order to look at longer trend, the innovation process becomes vt = yt − Et−h [yt ] where h is the horizon time. In that setting, we calibrate the parameters θ by using a cross-validation technique. We divide our historical data into an in-sample set and an out-sample set charaterised by two time parameters T1 and T2 where the size of the former controls the precision of the calibration to the parameter θ. We compute the value of the expectation Et−h [yt ] in the in-sample set which are used in the out-sample set to estimate the prediction error 198 Quantitative Analytics e(θ; h) = n−h X 2 yt − Et−h [yt ] t=1 which is directly related to the prediction horizon h = T2 for a given strategy. Minimising the prediction error, we get the optimal value θ∗ of the filter parameter used to predict the trend for the test set. The estimator of the slope of the trend µ̂t is a random value defined by a probability distribution function, and based on the sample data, takes a value called the estimate of the slope. If we let µ0t be the true value of the slope, the quality of the slope is defined by the mean squared error (MSE) M SE(µ̂t ) = E[(µ̂t − µ0t )2 ] (1) The estimator µ̂t (2) is more efficient than the estimator µ̂t (1) µ̂t (2) µ̂t if its MSE is lower (1) (2) ⇔ M SE(µ̂t ) ≤ M SE(µ̂t ) Decomposing the MSE into two components we get M SE(µ̂t ) = E[(µ̂t − E[µ̂t ])2 ] + E[(E[µ̂t ] − µ0t )2 ] where the first component is the variance of the estimator V ar(µ̂t ) while the second one is the square of the bias B(µ̂t ). When comparing unbiased estimators, we are left with comparing their variances. Hence, the estimate of a trend may not be significant when the variance of the estimator is too large. 4.3.6 Introducing linear prediction 0 We let {yα } be a set of measured values for some underlying set of true values of a quantity y, denoted {yα }, related to these true values by the addition of random noise 0 yα = yα + ηα The Greek subscript indexing the vales indicates that the data points are not necessarily equally spaced along a line, or even ordered. We want to construct the best estimate of the true value of some particular point y∗ as a linear combination of the known, noisy values. That is, given X 0 y∗ = d∗α yα + x∗ (4.3.16) α we want to find coefficients d∗α minimising the discepancy x∗ . Remark 4.3.3 In the case where we let y∗ be one of the existing yα ’s the problem becomes one of optimal filtering or estimation. On the other hand, if y∗ is a completely new point then the problem is that of a linear prediction. One way forward is to minimise the discrepancy x∗ in the statistical mean square sense. That is, assuming that the noise is uncorrelated with the signal (< ηα yβ >= 0), we seek d∗α minimising < x2∗ > = < X d∗α (yα + ηα ) − y∗ 2 > α = X X (< yα yβ > + < ηα ηβ >)d∗α d∗β − 2 < y∗ yα > d∗α + < y∗2 > α αβ 199 Quantitative Analytics where <> is the statistical average, and β is a subscript to index another member of the set. Note, < yα yβ > and < y∗ yα > describe the autocorrelation structure of the underlying data. For point to point uncorrelated noise we get < ηα ηβ >=< ηα2 > δαβ where δ. is the Dirac function. One can think of the various correlation quantities as comprising matrices and vectors φαβ =< yα yβ > , φ∗α =< y∗ yα > , ηαβ =< ηα ηβ > or < ηα2 > δαβ Setting the derivative with respect to the d∗α ’s equal to zero in the above equation, we get the set of linear equations X [φαβ + ηαβ ]d∗β = φ∗α β Writing the solution as a matrix inverse and omitting the minimised discrepancy x∗ , the estimation of Equation (4.3.16) becomes X 0 y∗ ≈ φ∗α [φµν + ηµν ]−1 (4.3.17) αβ yβ αβ We can also calculate the expected mean square value of the discrepancy at its minimum X X < x2∗ >0 =< y∗2 > − d∗β φ∗β =< y∗2 > − φ∗α [φµν + ηµν ]−1 αβ φ∗β β β Replacing the star with the Greek index γ, the above formulas describe optimal filtering. In the case where the noise amplitudes ηα goes to zero, so does the noise autocorrelations ηαβ , cancelling a matrix times its inverse, Equation 0 (4.3.17) simply becomes yγ = yγ . In the case where the matrices φαβ and ηαβ are diagonal, Equation (4.3.17) becomes yγ = 0 φγγ y φγγ + ηγγ γ (4.3.18) which is Equation (4.1.2) with S 2 → φγγ and N 2 → ηγγ . For the case of equally spaced data points, and in the Fourier domain, autocorrelations simply become squares of Fourier amplitudes (Wiener-Khinchin theorem), and the optimal filter can be constructed algebraically, as Equation (4.3.18), without inverting any matrix. In the time domain, or any other domain, an optimal filter (minimising the square of the discrepancy from the underlying true value in the presence of measurement noise) can be constructed by estimating the autocorrelation matrices φαβ and ηαβ , and applying Equation (4.3.17) with ∗ → γ. Classical linear prediction (LP) specialises to the case where the data points yβ are equally spaced along a line yi for i = 1, ., N and we want to use M consecutive values of yi to predict the M + 1 value. Note, stationarity is assumed, that is, the autocorrelation < yj yk > is assumed to depend only on the difference |j − k|, and not on j or k individually, so that the autocorrelation φ has only a single index φj =< yi yi+j >≈ N −j 1 X yi yi+j N − j i=1 However, there is a better way to estimate the autocorrelation. In that setting the estimation Equation (4.3.16) is yn = M X dj yn−j + xn (4.3.19) j=1 so that the set of linear equations above becomes the set of M equations for the M unknown dj ’s, called the linear prediction (LP) coefficients 200 Quantitative Analytics M X φ|j−k| dj = φk , k = 1, .., M j=1 Note, results obtained from linear prediction are remarkably sensitive to exactly how the φk ’s are estimated. Even though the noise is not explicitly included in the equations, it is properly accounted for, if it is point-to-point uncorrelated. Note, φ0 above estimates the diagonal part of φαα + ηαα , and the mean square discrepancy < x2n > is given by < x2n >= φ0 − φ1 d1 − ... − φM dM Hence, we first compute the dj ’s with the equations above, then calculate the mean square discrepancy < x2n >. If the discrepancies are small, we continue applying Equation (4.3.19) right on into the future, assuming future discrepancies xi to be zero. This is a kind of extrapolation formula. Note, Equation (4.3.19) being a special case of the general linear filter, the condition for stability is that the characteristic polynomial zN − N X dj z N −j = 0 j=1 has all N of its roots inside the unit circle |z| ≤ 1 If the data contain many oscillations without any particular trend towards increasing or decreasing amplitude, then the complex roots of the polynomial will generally all be rather close to the unit circle. When the instability is a problem, one should massage the LP coefficients by 1. solving numerically the polynomial for its N complex roots 2. moving the roots to where we think they should be inside or on the unit circle 3. reconstructing the modified LP coefficients Assuming that the signal is truly a sum of undamped sine and cosine waves, one can simply move each root zi onto the unit circle zi → zi |zi | Alternatively, one can reflect a bad root across the unit circle zi → 1 zi∗ preserving the amplitude of the output of Equation (4.3.19) when it is driven by a sinusoidal set of xi ’s. Note, the choice of M , the number of LP coefficients to use, is an open problem. Linear prediction is successful at extrapolating signals that are smooth and oscillatory, not necessarily periodic. 201 Chapter 5 Presenting time series analysis 5.1 Basic principles of linear time series We consider the asset returns to be a collection of random variables over time, obtaining the time series {rt } in the case of log returns. Linear time series analysis is a first step to understanding the dynamic structure of such a series (see Box et al. [1994]). That is, for an asset return rt , simple models attempt at capturing the linear relationship between rt and some information available prior to time t. For instance, the information may contain the historical values of rt and the random vector Y that describes the economic environment under which the asset price is determined. As a result, correlations between the variable of interest and its past values become the focus of linear time series analysis, and are referred to as serial correlations or autocorrelations. Hence, Linear models can be used to analyse the dynamic structure of such a series with the help of autocorrelation function, and forecasting can then be performed (see Brockwell et al. [1996]). 5.1.1 Stationarity While the foundation of time series analysis is stationarity, autocorrelations are basic tools for studying this stationarity. A time series {xt , Z} is said to be strongly stationary, or strictly stationary, if the joint distribution of (xt1 , .., xtk ) is identical to that of (xt1 +h , .., ytk +h ) for all h (xt1 , .., xtk ) = (xt1 +h , .., ytk +h ) where k is an arbitrary positive integer and (t1 , .., tk ) is a collection of k positive integers. Thus, strict stationarity requires that the joint distribution of (xt1 , .., xtk ) is invariant under time shift. Since this condition is difficult to verify empirically, a weaker version of stationarity is often assumed. The time series {xt , Z} is weakly stationary if both the mean of xt and the covariance between xt and xt−k are time-invariant, where k is an arbitrary integer. That is, {xt } is weakly stationary if E[xt ] = µ and Cov(xt , xt−k ) = γk where µ is constant and γk is independent of t. That is, we assume that the first two moments of xt are finite. In the special case where xt is normally distributed, then the weak stationarity is equivalent to strict stationarity. The covariance γk is called the lag-k autocovariance of xt and has the following properties: • γ0 = V ar(xt ) • γ−k = γk 202 Quantitative Analytics The latter holds because Cov(xt , xt−(−k) ) = Cov(xt−(−k) , xt ) = Cov(xt+k , xt ) = Cov(xt1 , xt1 −k ), where t1 = t + k. In the finance literature, it is common to assume that an asset return series is weakly stationary since a stationary time series is easy to predict as its statistical properties are constant. However, financial time series such as rates, FX, and equity are non-stationary. The non-stationarity of price series is mainly due to the fact that there is no fixed level for the price which is called unit-root non-stationarity time series. It is well known that these underlyings are prone to different external shocks. In a stationary time series, these shocks should eventually die away, meaning that a shock occurring at time t will have a smaller effect at time t + 1, and an even smaller effect at time t + 2 gradually dying out. However, if the data is non-stationary, the persistence of shocks will always be infinite, meaning that a shock at time t will not have a smaller effect at time t + 1, t + 2 and so on. 5.1.2 The autocorrelation function Studies often mention the problem of timely dependence in returns series of stocks or indices. Typically, estimates for non existent return figures are then set equal to the last reported transaction price. This results in serial correlation for stock prices, which further causes distortions in the parameter estimates, especially the standard deviation. When the linear dependence between xt and xt−i is of interest, we consider a generalisation of the correlation called the autocorrelation. Definition 5.1.1 ACF The autocorrelation function (ACF), ρ(k) for a weakly-stationary time series, {xt : t ∈ N} is given by ρ(k) = E[(xt − µ)(xt+k − µ)] σ2 where E[xt ] is the expectation of xt , µ is the mean and σ 2 is the variance. Following Eling [2006], we compute the first order autocorrelation value for all stocks and then use the Ljung-Box statistic (see Ljung et al. [1978]) to check whether this value is statistically significant. It test for high order serial correlation in the residuals. Given two random variables X and Y , the correlation coefficient between these two variables is ρx,y = p Cov(X, Y ) V ar(X)V ar(Y ) =p E[(X − µx )(Y − µy )] E[(X − µx )2 ]E[(Y − µy )2 ] where µx and µy are the mean of X and Y , and with −1 ≤ ρx,y ≤ 1 and ρx,y = ρy,x . Given the sample {(xt , yt )}Tt=1 , then the sample correlation can be consistently estimated by PT (xt − x)(yt − y) ρ̂x,y = qP t=1 PT T 2 2 t=1 (xt − x) t=1 (yt − y) PT PT where x = T1 t=1 xt and y = T1 t=1 yt are respectively the sample mean of X and Y . Similarly, given the weakly stationary time seris {xt }, the lag-k autocorrelation of xt is defined by Cov(xt , xt−k ) Cov(xt , xt−k ) γk ρk = p = = V ar(xt ) γ0 V ar(xt )V ar(xt−k ) since V ar(xt ) = V ar(xt−k ) for a weakly stationary series. We have ρ0 = 1, ρk = ρ−k , and −1 ≤ ρk ≤ 1. Further, a weakly stationary series xt is not serially correlated if and only if ρk = 0 for all k > 0. Again, we let {xt }Tt=1 be a given sample of X, and estimate the autocorrelation coefficient at lag k with 203 Quantitative Analytics ρ̂(k) = 1 T −k−1 PT t=k+1 (xt − PT 1 t=1 (xt T −1 x)(xt−k − x) − x)2 ,0≤k 0, then we get the decomposition p xt = g(Ft−1 ) + h(Ft−1 )t where t = σatt is a standardised shock. In the linear model, g(.) is a linear function of elements of Ft−1 and h(.) = σ 2 . Nonlinear models involves making extensions such that if g(.) is nonlinear, xt is nonlinear in mean, and if h(.) is timevariant, then xt is nonlinear in variance. 5.2.2 The autoregressive models 5.2.2.1 Definition Letting xt = rt and observing that monthly returns of equity index has a statistically significant lag-1 autocorrelation indicates that the lagged return rt−1 may be useful in predicting rt . A simple autoregressive (AR) model designed to use such a predictive power is rt = φ0 + φ1 rt−1 + at where {at } is a white noise series with mean zero and variance σ 2 . This is an AR(1) model where rt is the dependent variable and rt−1 is the explanatory variable. In this model, conditional on the past return rt−1 , we have E[rt |rt−1 ] = φ0 + φ1 rt−1 , V ar(rt |rt−1 ) = V ar(at ) = σ 2 This is a Markov property such that conditional on rt−1 , the return rt is not correlated with rt−i for i > 1. In the case where rt−1 alone can not determine the conditional expectation of rt , we can use a generalisation of the AR(1) model called AR(p) model defined as rt = φ0 + φ1 rt−1 + ... + φp rt−p + at where p is a non-negative integer. In that model, the past p values {rt−i }i=1,..,p jointly determine the conditional expectation of rt given the past data. The AR(p) model is in the same form as a multiple linear regression model with lagged values serving as explanatory variables. 5.2.2.2 Some properties Given the conditional mean of the AR(1) model in Section (5.2.2.1), under the stationarity condition we get E[rt ] = E[rt−1 ] = µ, so that µ = φ0 + φ1 µ or E[rt ] = φ0 1 − φ1 As a result, the mean of rt exists if φ1 6= 1, and it is zero if and only if φ0 = 0, implying that the term φ0 is related to the mean of rt . Further, using φ0 = (1 − φ1 )µ, we can rewrite the AR(1) model as rt − µ = φ1 (rt−1 − µ) + at By repeated substitutions, the prior equation implies rt − µ = at + φ1 at−1 + φ21 at−2 + ... = ∞ X φi1 at−i i=0 such that rt − µ is a linear function of at−i for i ≥ 0. From independence of the series {at }, we get E[(rt − µ)at+1 ] = 0, and by the stationarity assumption we get Cov(rt−1 , at ) = E[(rt−1 − µ)at ] = 0. Taking the square, we obtain 206 Quantitative Analytics V ar(rt ) = φ21 V ar(rt−1 ) + σ 2 since the covariance between rt−1 and at is zero. Under the stationarity assumption V ar(rt ) = V ar(rt−1 ), we get V ar(rt ) = σ2 1 − φ21 provided that φ21 < 1 which results from the fact that the variance of a random variable is bounded and non-negative. One can show that the AR(1) model is weakly stationary if |φ1 | < 1. Multiplying the equation for rt − µ above by at , and taking the expectation we get E[at (rt − µ)] = E[at (rt−1 − µ)] + E[a2t ] = E[a2t ] = σ 2 where σ 2 is the variance of at . Repeating the process for (rt−k − µ) and using the prior result, we get φ1 γ1 + σ 2 if k = 0 γk φ1 γk−1 if k > 0 where we use γk = γ−k . As a result, we get V ar(rt ) = γ0 = σ2 and γk = φ1 γk−1 for k > 0 1 − φ21 Consequently, the ACF of rt satisfies ρk = φ1 ρk−1 for k ≥ 0 φk1 Since ρ0 = 1, we have ρk = stating that the ACF of a weakly stationary AR(1) series decays exponentially with rate φ1 and starting value ρ0 = 1. Setting p = 2 in the AR(p) model and repeating the same technique as that of the AR(1) model, we get E[rt ] = µ = φ0 1 − φ1 − φ2 provided φ1 + φ1 6= 1. Further, we get γk = φ1 γk−1 + φ2 γk−2 for k > 0 called the moment equation of a stationary AR(2) model. Dividing this equation by γ0 , we get ρk = φ1 ρk−1 + φ2 ρk−2 for k > 0 for the ACF of rt . It satisfies the second order difference equation 1 − φ1 B − φ2 B 2 ρk = 0 where B is the back-shift operator Bρk = ρk−1 . Corresponding to the prior difference equation, we can solve a second order polynomial equation leading to the characteristic roots ωi for i = 1, 2. In the case of an AR(p) model, the mean of a stationary series satisfies E[rt ] = φ0 1 − φ1 − ... − φp provided that the denominator is not zero. The associated polynomial equation of the model is xp − φ1 xp−1 − ... − φp = 0 207 Quantitative Analytics so that the series rt is stationary if all the characteristic roots of this equation are less than one in modulus. For a stationary AR(p) series, the ACF satisfies the difference equation 1 − φ1 B − φ2 B 2 − ... − φp B p ρk = 0 5.2.2.3 Identifying and estimating AR models The order determination of AR models consists in specifying empirically the unknown order p of the time series. We briefly discuss two approaches, one using the partial autocorrelation function (PACF), and the other one using some information criterion function. Different approaches to order determination may result in different choices for p, and there is no evidence suggesting that one approach is better than another one in real application. The partial autocorrelation function One can introduce PACF by considering AR models expressed in the form of a multiple linear regression and arranged in a sequential order, which enable us to apply the idea of partial F test in multiple linear regression analysis rt = φ0,1 + φ1,1 rt−1 + 1t rt = φ0,2 + φ1,2 rt−1 + φ2,2 rt−2 + 2t rt = φ0,3 + φ1,3 rt−1 + φ2,3 rt−2 + φ3,3 rt−3 + 3t ... = ... where φ0,j , φi,j , and {jt } are the constant term, the coefficient of rt−i , and the error term of an AR(j) model. The estimate φ̂j,j of the jth equation is called the lag-j sample PACF of rt . The lag-j PACF shows the added contribution of rt−j to rt over an AR(j − 1) model, and so on. Therefore, for an AR(p) model, the lag-p sample PACF should not be zero, but φ̂j,j should be close to zero for all j > p. Under some regularity conditions, it can be shown that the sample PACF of an AR(p) model has the following properties • φ̂p,p converges to φp as the sample size T goes to infinity. • φ̂k,k converges to zero for all k > p. • the asymptotic variance of φ̂k,k is 1 T for k > T . That is, for an AR(p) series, the sample PACF cuts off at lag p. The information criteria All information criteria available to determine the order p of an AR process are likelihood based. For example, the Akaike Information Criterion (AIC), proposed by Akaike [1973], is defined as −2 2 ln (likelihood) + (number of parameters) T T where the likelihood function is evaluated at the maximum likelihood estimates, and T is the sample size. The second term of the equation above is called the penalty function of the criterion because it penalises a candidate model by the number of parameters used. Different penalty functions result in different information criteria. For a Gaussian AR(p) model, the AIC simplifies to AIC = 2k T 2 2 where σ̂k is the maximum likelihood estimate of σ the variance of at . In practice, one computes AIC(k) for k = 0, ..., P where P is a prespecified positive integer, and then selects the order p∗ that has the minimum AIC value. AIC(k) = ln (σ̂k2 ) + 208 Quantitative Analytics 5.2.2.4 Parameter estimation One usually use the conditional least squares methods when estimating the parameters of an AR(p) model, which starts with the (p + 1)th observation. Conditioning on the first p observations, we have rt = φ0 + φ1 rt−1 + ... + φp rt−p + at , t = p + 1, .., T which can be estimated by the least squares method (see details in Section (3.2.4.2)). Denotting φ̂i the estimate of φi , the fitted model is r̂t = φ̂0 + φ̂1 rt−1 + ... + φ̂p rt−p and the associated residual is ât = rt − r̂t The series {ât } is called the residual series, from which we obtain σ̂ 2 = T X 1 â2 T − 2p − 1 t=p+1 t If the model is adequate, the residual series should behave as a white noise. If a fitted model is inadequate, it must be refined. The ACF and the Ljung-Box statistics of the residuals can be used to check the closeness of ât to a white noise. In the case of an AR(p) model, the Ljung-Box statistic Q(h) follows asymptotically a chi-squared distribution with (h − p) degrees of freedom. 5.2.3 The moving-average models One can consider another simple linear model called moving average (MA) which can be treated either as a simple extension of white noise series, or as an infinite order AR model with some parameter constraints. In the latter, we can write rt = φ0 − θ1 rt−1 − θ12 rt−2 − ... + at where the coefficients depend on a single parameter θ1 via φi = −θ1i for i ≥ 1. To get stationarity, we must have |θ1 | < 1 since θ1i → 0 as i → ∞. Thus, the contribution of rt−i to rt decays exponentially as i increases. Writing the above equation in compact form we get rt + θ1 rt−1 + θ12 rt−2 + ... = φ0 + at repeating the process for rt−1 , multiplying by θ1 and subtracting the result from the equation for rt , we obtain rt = φ0 (1 − θ1 ) + at − θ1 at−1 which is a weighted average of shocks at and at−1 . This is the M A(1) model with c0 = φ0 (1 − θ1 ). The M A(q) model is rt = c0 + at − θ1 at−1 − ... − θq at−q where q > 0. MA models are always weakly stationary since they are finite linear combinations of a white noise sequence for which the first two moments are time-invariant. For example, in the M A(1) model, E[rt ] = c0 and V ar(rt ) = σ 2 + θ12 σ 2 = (1 + θ12 )σ 2 209 Quantitative Analytics where at and at−1 are uncorrelated. In the M A(q) model, E[rt ] = c0 and V ar(rt ) = 1 + θ12 + ... + θq2 σ 2 Assuming C0 = 0 for an M A(1) model, multiplying the model by rt−k we get rt−k rt = rt−k at − θ1 rt−k at−1 and taking expectation γ1 = −θ1 σ 2 and γk = 0 for k > 1 Given the variance above, we have ρ0 = 1 , ρ1 = −θ1 , ρk = 0 for k > 1 1 + θ12 Thus, the ACF of an M A(1) model cuts off at lag 1. This property generalises to other MA models, so that an M A(q) series is only linearly related to its first q lagged values. Hence, it is a finite-memory model. The maximum likelihood estimation is commonly used to estimate MA models. 5.2.4 The simple ARMA model We described in Section (5.2.2) the autoregressive models and in Section (5.2.3) the moving-average models. We can then combine the AR and MA models in a compact form so that the number of parameters used is kept small. The general ARM A(p, q) model (see Box et al. [1994]) is defined as yt = φ0 + p X φi yt−i + t − i=1 q X θi t−i i=1 where {t } is a white noise series and p and q are non-negative integers. Using the back-shift operator, we can rewrite the model as 1 − φ1 B − ... − φp B p yt = 1 − θ1 B − ... − θq B q t and we require that there are no common factors between the AR and MA polynomials, so that the order (p, q) of the model can not be reduced. Note, the AR polynomial introduces the characterisic equation of an ARMA model. Hence, if all the solutions of the characteristic equation are less than 1 in absolute value, then the ARMA model is weakly stationary. In this case, the unconditional mean of the model is E[yt ] = φ0 1 − φ1 − ... − φp Both the ACF and PACF are not informative in determining the order of an ARMA model, but one can use the extended autocorrelation function (EACF) to specify the order of an ARMA process(see Tsay et al. [1984]). It states that if we can obtain a consistent estimate of the AR component of an ARMA model, then we can derive the MA component and use ACF to identify its order. The output of EACF is a two-way table where the rows correspond to AR order p and the columns to MA order q. Once an ARM A(p, q) model is specified, its parameters can be estimated by either the conditional or exact likelihood method. Then the Ljung-Box statistics of the residuals can be used to check the adequacy of the fitted model. In the case where the model is correctly specified, then Q(h) follows asymptotically a chi-squared distribution with (h − g) degrees of freedom, where g is the number of parameters used. The representation of the ARM A(p, q) model using the back-shift operator is compact and useful in parameter estimation. However, other long division of two polynomials. That is, given two Pprepresentations exist usingPthe q polynomials φ(B) = 1 − i=1 φi B i and θ(B) = 1 − i=1 θi B i , we get by long division 210 Quantitative Analytics θ(B) φ(B) φ(B) θ(B) = 1 + ψ1 B + ψ2 B 2 + ... = ψ(B) = 1 − π1 B − π2 B 2 − ... = π(B) From the definition, ψ(B)π(B) = 1, and making use of the fact that Bc = c for any constant, we have φ0 φ0 φ0 φ0 = and = θ(1) 1 − θ1 − ... − θq φ(1) 1 − φ1 − ... − φq Using the results above, the ARM A(p, q) model can be written as an AR model yt = φ0 + π1 yt−1 + π2 yt−2 + ... + t 1 − θ1 − ... − θq showing the dependence of the current value yt to the past values yt−i for i > 0. To show that the contribution of the lagged value yt−i to yt is diminishing as i increases, the πi coefficient should decay to zero as i increases. An ARM A(p, q) model having this property is invertible. A sufficient condition for invertibility is that all the zeros of the polynomial θ(B) are greater than unity in modulus. Using the AR representation, an invertible ARM A(p, q) series yt is a linear combination of the current shock t and a weighted average of the past values, with weights decaying exponentially. Similarly, the ARM A(p, q) model can also be written as an MA model yt = µ + t + ψ1 t−1 + ψ2 t−2 + ... = µψ(B)t φ0 1−φ1 −...−φp . It shows explicitly the impact of the past shock t−i , i > 0, on the current value yt . where µ = E[yt ] = The coefficients {ψi } are called the impulse response function of the ARMA model. For a weakly stationary series, the ψi decay exponentially as i increases. The MA representation provides a simple proof of mean reversion of a stationary time series, since the speed at which ŷt+k|t approaches µ determines the speed of mean reversion. 5.3 Forecasting The ultimate objective of using a stochastic process to model time series is for forecasting. In the construction of forecasts the idea of conditional expectations is very important. The conditional expectation has the property of being the minimum mean square error (MMSE) forecast. This means that if the model specification is correct, there is no other forecast which will have errors whose squares have a lower expected value ŷt+k|t = E[yt+k |Ft ] with forecast horizon k. Therefore given a set of observations, the optimal predictor k steps ahead is the expected value of yt+k conditional on the information at time t. The predictor k is said to be optimal because it has minimum mean square error. In order to prove this statement, the forecasting error can be split as yt+k − ŷt+k|t = yt+k − E[yt+k|t ] + E[yt+k|t ] − ŷt+k|t and it follows that 2 M SE(ŷt+k|t ) = V ar(ŷt+k|t ) + ŷt+k − E[ŷt+k|t ] The conditional variance of yt+k does not depend on ŷt+k|t , and therefore, the MMSE of yt+k is given by the conditional mean. 211 Quantitative Analytics 5.3.1 Forecasting with the AR models For the AR(p) model, with forecast origin t, and forecast horizon k, we let ŷt+k|t be the forecast of yt+k using the minimum squared error loss function. That is, ŷt+k|t is chosen such that E[yt+k − ŷt+k|t ] ≤ min E[(yt+k − g)2 ] g where g is a function of the information available at time t (inclusive). In the AR(p) model, for the 1-step ahead forecast, we have yt+1 = φ0 + φ1 yt + ... + φp yt+1−p + t+1 where yt corresponds to rt and t to at when considering returns. Under the minimum squared error loss function, the point forecast of yt+1 , given the model and observations up to time t, is the conditional expectation ŷt+1|t = E[yt+1 |yt , yt−1 , ...] = φ0 + p X φi yt+1−i i=1 and the associeated forecast error is et+1|t = yt+1 − ŷt+1|t = t+1 The variance of the 1-step ahead forecast error is V ar(et+1 |t) = V ar(t+1 ) = σ 2 . Hence, if t is normally distributed, then a 95% 1-step ahead interval forecast of yt+1 is ŷt+1|t ± 1.96 × σ Note, t+1 is the 1-step ahead forecast error at the forecast origin t, and it is referred to as the shock of the series at time t + 1. Further, in practice, estimated parameters are often used to compute point and interval forecast, resulting in a Conditional Forecast since it does not take into consideration the uncertainty in the parameter estimates. Considering parameter uncertainty is a much more involved process. When the sample size used in estimation is sufficiently large, then the conditional forecast is close to the unconditional one. In the general case, we have yt+k = φ0 + φ1 yt+k−1 + ... + φp yt+k−p + t+k The k-step ahead forecast based on the minimum squared error loss function is the conditional expectation of yt+k given {yt−i }∞ i=0 obtained as ŷt+k|t = φ0 + p X φi ŷt+k−i|t i=1 where ŷt+i|t = yt+i for i ≤ 0. This forecast can be computed recursively using forecast ŷt+i|t for i = 1, .., k − 1. The k-step ahead forecast error is et+k|t = yt+k − ŷt+k|t . It can be shown that for a stationary AR(p) model, ŷt+k|t converges to E[yt ] as k → ∞, meaning that for such a series, long-term point forecast approaches its unconditional mean. This property is called mean-reversion in the finance literature. The variance of the forecast error approaches the unconditional variance of yt . 5.3.2 Forecasting with the MA models Since the MA model has finite memory, its point forecasts go to the mean of the series very quickly. For the 1-step ahead forecast of an M A(1) process at the forecast origin t, we get yt+1 = c0 + t+1 − θ1 t 212 Quantitative Analytics and taking conditional expectation, we have ŷt+1|t = E[yt+1 |yy , yt−1 , ..] = c0 − θ1 t et+1|t = yt+1 − ŷt+1|t = t+1 The variance of the 1-step ahead forecast error is V ar(et+1|t ) = σ 2 . To compute t one can assume that 0 = 0 and get 1 = y1 − c0 , and then compute h for 2 ≤ h ≤ t recursively by using h = yh − c0 + θ1 h−1 . For the 2-step ahead forecast we get ŷt+2|t = c0 and the variance of the forecast error is V ar(et+2|t ) = (1 + θ1 )2 σ 2 , so that the 2-step ahead forecast of the series is simply the unconditional mean of the model. More generally ŷt+k|t = c0 for k ≥ 2. Hence, the forecast ŷt+k|t versus k form a horizontal line on a plot after one step. In general, for an M A(q) model, multistep ahead forecasts go to the mean after the first q steps. 5.3.3 Forecasting with the ARMA models The forecasts of an ARM A(p, q) model have similar characteristics to those of an AR(p) model, after adjusting for the impacts of the MA component on the lower horizon forecasts. For the 1-step ahead forecast of yt+1 , with forecast origin t, we have ŷt+1|t = E[yt+1 |yt , yt−1 , ...] = φ0 + p X φi yt+1−i − i=1 q X θi t+1−i i=1 and the associated forecast error is et+1|t = yt+1 − ŷt+1|t = t+1 . The variance of the 1-step ahead error is V ar(et+1|t ) = σ 2 . For the k-step ahead forecast of yt+k|t , with forecast origin t, we have ŷt+k|t = E[yt+k |yt , yt−1 , ...] = φ0 + p X φi ŷt+k−i|t − i=1 q X θi ˆt+k−i|t i=1 where ŷt+k−i|t = yt+k−i if k − i ≤ 0 and ˆt+k−i|t = 0 if k − i > 0 t+k−i if k − i ≤ 0 Thus, the multi-step ahead forecasts of an ARMA model can be computed recursively, and the associated forecast error is et+k|t = yt+k − ŷt+k|t 5.4 5.4.1 Nonstationarity and serial correlation Unit-root nonstationarity When modelling equity stocks, interest rates, or foreign excange rates, the two most considered models for characterising their non-stationarity have been the random walk model with a drift yt = µ + φyt−1 + t (5.4.1) yt = α + βt + t (5.4.2) and the trend-stationary process where {t } is a white noise series. In the random walk model the value of φ can have different effects on the stock process 213 Quantitative Analytics 1. φ < 1 → φT → 0 as T → ∞ 2. φ = 1 → φT = 1 for all T 3. φ > 1 In case (1) the shocks in the system gradually die away which is called the stationarity case. In case (2) the shocks persist in the system and do not die away, leading to yt = y0 + ∞ X t as T → ∞ t=0 That is, the current value of y is an infinite sum of the past shocks added to the starting value of y. This case is known as the unit root case. In the case (3) the shocks become more influential as time goes on. 5.4.1.1 The random walk A time series {yt } is a random walk if it satisfies yt = yt−1 + t where the real number y0 is the starting value of the process and {t } is a white noise series. The random walk is a special AR(1) model with coefficient φ1 of yt−1 being equal to unity, so that it does not satisfies the weak stationarity of an AR(1) model. Hence, we call it a unit-root nonstationarity time series. Under such a model, the stock price is not predictable or mean reverting. The 1-step ahead forecast of the random walk at the origin t is ŷt+1|t = E[yt+1 |yt , yt−1 , ...] = yt which is the value at the forecast origin, and thus, has no practical value. For any forecast horizon k > 0 we have ŷt+k|t = yt so that point forecasts of a random walk model are simply the value of the series at the forecast origin, and the process is not mean-reverting. The MA representation of the random walk is yt = ∞ X t−i i=0 and the k-step ahead forecast error is et+k|t = t+k + ... + t+1 with V ar(et+k|t ) = kσ 2 , which diverges to infinity as k → ∞. Hence, the usefulness of point forecast ŷt+k|t diminishes as k increases, implying that the model is not predictable. Further, as the variance of the forecast error approaches infinity when k increases, the unconditional variance of yt is unbounded, meaning that it can take any real value for sufficiently large t which is questionable for indexes. At last, since ψi = 1 for all i, then the impact of any past shock t−i on yt does not decay over time, and the series has a strong memory as it remembers all of the past shocks. That is, the shocks have a permanent effect on the series. 214 Quantitative Analytics 5.4.1.2 The random walk with drift When a time series experience a small and positive mean, we can consider a random walk with drift yt = µ + yt−1 + t where µ = E[yt − yt−1 ] is the time-trend of yt , or drift of the model, and {t } is a white noise series. Assuming initial value y0 , we can rewrite the model as yt = tµ + y0 + t + t−1 + ... + 1 Pt Pt 2 consisting of the time-trend tµ and a pure √ random walk process i=1 i . Also, since V ar( i=1 i ) = tσ , the conditional standard deviation of yt is tσ which grows at a slower rate than the conditional expectation of yt . Plotting yt against the time index t, we get a time-trend with slop equal to µ. We can analyse the constant term in the series by noting that for an M A(q) model the constant term is the mean of the series. In the case of a stationary AR(p) model or ARM A(p, q) model, the constant term is related to the mean via µ= 1− φ P0p i=1 φi These differences in interpreting the constant term reflects the difference between the dynamic and linear regression models. In the general case, allowing the AR polynomial to have 1 as a characteristic root, we get the autoregressive integrated moving average ARIM A model which is unit-root nonstationary because its AR polynomial has a unit root. An ARIM A model has a strong memory because the ψi coefficients in its M A representation do not decay over time to zero, so that the past shocks t−i of the model has a permanent effect on the series. A conventional approach for handling unit root nonstationarity is to use differencing. 5.4.1.3 The unit-root test To test whether the value yt follows a random walk or a random walk with a drift, the unit-root testing problem (see Dickey et al. [1979]) employs the models yt = φ1 yt−1 + t yt = φ0 + φ1 yt−1 + t where t denotes the error term, and consider the null hypothesis H0 : φ1 = 1 versus the alternative hypothesis H1 : φ1 < 1 A convenient test statistic is the t ratio of the least squares (LS) estimate of φ1 under the null hypothesis. The LS method fot the first equation above gives PT φ̂1 = Pt=1 T yt−1 yt t=1 2 yt−1 T , σ̂2 = 1 X (yt − φ̂1 yt−1 )2 T − 1 t=1 where y0 = 0 and T is the sample size. The t ratio is PT yt−1 t DF = t-ratio = = qt=1 P T 2 std(φ̂1 ) σ̂ t=1 yt−1 φ̂1 − 1 215 Quantitative Analytics which is referred to as the Dickey-Fuller test. If {t } is a white noise series with finite moments of order slightly greater than 2, then the DF-statistic converge to a function of the standard Brownian motion as T → ∞ (see Chan et al. [1988]). If φ0 = 0, but the model is still used, the resulting t ratio for testing φ1 = 1 will converge to another nonstandard asymptotic distribution. If φ0 6= 0, and the model is still used, the t ratio for testing φ1 = 1 is asymptotically normal, but large sample sizes is required. 5.4.2 Regression models with time series The relationship between two time series is of major interest, for instance the Market model in finance relates the return of an individual stock to the return of a market index. In general, we consider the linear regression r1t = α + βr2t + t where rit for i = 1, 2 are two time series and t is the error term. The least squares (LS) method is often used to estimate the model parameters (see details in Section (3.2.4.2)). If {t } is a white noise series, then the least square method (LS) produces consistent estimates. However, in practice the error term {t } is often serially correlated, so that we get a regression model with time series errors. Even though this approach is widely used in finance, it is a misused econometric model when the serial dependence in t is overlooked. On can look at the time plot and ACF of the two series residuals to detect patterns of a unit-root nonstationarity time series. When two time series are unitroot nonstationary, the behaviour of the residuals indicates that the series are not co-integrated. In that case the data fail to support the hypothesis that there exists a long-term equilibrium between the two series. One way forward for building a linear regression model with time series errors, is to use a simple time series model for the residual series and estimate the whole model jointly. For example, considering the modified series c1t = r1t − r1,t−1 = (1 − B)r1t for t ≥ 2 c2t = r2t − r2,t−1 = (1 − B)r2t for t ≥ 2 we can specify a M A(1) model for the residuals and modify the linear regression model to get c2t = α + βc1t + t , t = at − θ1 at−1 where {at } is assumed to be a white noise series. The M A(1) model is used to capture the serial dependence in the error term. More complex time series models can be added to a linear regression equation to form a general regression model with time series error. One can consider the Cochran-Orcutt estimator to handle the serial dependence in the residuals (see Greene [2000]). When the time series model used is stationary and invertible, one can estimate the model jointly by using the maximum likelihood method (MLM). Note, one can use the Durbin-Watson (DW) statistic to check residuals for serial correlation, but it only consider the lag-1 serial correlation. For a residual series t with T observations, the Durbin-Watson statistic is PT DW = 2 t+2 (t − t−1 ) PT 2 t+1 t which is approximated by DW ≈ 2(1 − ρ̂1 ) where ρ̂1 is the lag-1 ACF of {t }. When residual serial dependence appears at higher order lags (seasonal behaviour), one can use the Ljung-Box statistics. 216 Quantitative Analytics 5.4.3 Long-memory models Even though for a stationary time series the ACF decays exponentially to zero as lag increases, for a unit-root nonstationary time series, Tiao et al. [1983] showed that the sample ACF converges to 1 for all fixed lags as the sample size increases. There exist some time series, called long-memory time series, whose ACF decays slowly to zero at a polynomial rate as the lag increases. For instance, Hosking [1981] proposed the fractionally differenced process defined by 1 1 − 12 , then xt is invertible and has the infinite AR representation xt = ∞ X πi xt−i + at i=1 with πk = (k − d − 1)! −d(1 − d)...(k − 1 − d) = k! k!(−d − 1)! • for − 12 < d < 12 , the ACF of xt is ρk = in particular, ρ1 = d 1−d d(1 + d)...(k − 1 + d) , k = 1, 2, ... (1 − d)(2 − d)...(k − d) and ρk ≈ • for − 12 < d < 12 , the PACF of xt is φk,k = • for − 12 < d < satisfies 1 2, (−d)! 2d−1 k as k → ∞ (d − 1)! d (k−d) for k = 1, 2, .. the spectral density function f (w) of xt , which is the Fourier transform of the ACF of xt , f (w) ∼ w−2d as w → 0 where w ∈ [0, 2π] denotes the frequency. In the case where d < 12 , the property of the ACF of xt says that ρk ∼ k 2d−1 , which decays at a polynomial rate rather than an exponential one. Note, in the spectral density above, the spectrum diverges to infinity as w → 0, but it is bounded for all w ∈ [0, 2π] in the case of a stationary ARMA process. If the fractionally differenced series (1 − B)d xt follows an ARM A(p, q) model, then xt is called an ARF IM A(p, d, q) process, which is a generalised ARIMA model by allowing for noninteger d. One can estimate d by using either a maximum likelihood method or a regression method with logged periodigram at the lower frequency. 217 Quantitative Analytics 5.5 5.5.1 Multivariate time series Characteristics For an investor holding multiple assets, the dynamic relationships between returns of the assets play an important role in the process of decision. Vector or multivariate time series analysis are methods used to study jointly multiple return series. As multivariate time series are made of multiple single series referred as components, vector and matrix are the necessary tools. We let rt = (r1t , r2t , .., rN t )> be the log returns of N assets at time t. The series rt is weakly stationary if its first two moments are time-invariant. Hence, the mean vector and covariance matrix of a weakly stationary series are constant over time. Assuming weakly stationarity of rt , the mean vector and covariance matrix are given by µ = E[rt ] , Γ0 = E[(rt − µt )(rt − µt )> ] where the expectation is taken element by element over the joint distribution of rt . The mean µ is a N-dimensional vector, and the covariance matrix Γ0 is a N × N matrix. The ith diagonal element of Γ0 is the variance of rit , and the (i, j)th element of Γ0 for i 6= j is the covariance between rit and rjt . We then write µ = (µ1 , .., µN )> and Γ0 = [Γij (0)] when describing the elements. p p We let D = diag[ Γ11 (0), ..., ΓN N (0)] be a N × N diagonal matrix consisting of the standard deviation of rit for i = 1, .., N . The lag-zero cross-correlation matrix of rt is ρ0 = [ρij (0)] = D−1 Γ0 D−1 with (i, j)th element being Γij (0) Cov(rit , rjt ) ρij (0) = p = σ(rit )σ(rjt ) Γii (0)Γjj (0) and corresponding to the correlation between rit and rjt where ρij (0) = ρji (0), −1 ≤ ρij (0) ≤ 1, and ρii (0) = 1 for 1 ≤ i, j ≤ N . In order to understand the lead-lag relationships between component series, the cross-correlation matrices are used to measure the strength of linear dependence between time series. The lag-k cross-covariance matrix of rt is defined as Γk = [Γij (k)] = E[(rt − µ)(rt−k − µ)> ] where µ is the mean vector of rt . For a weakly stationary series, the cross-covariance matrix Γk is a function of k, but not the time t. The lag-k cross-correlation matrix (CCM) of rt is defined as ρk = [ρij (k)] = D−1 Γk D−1 with (i, j)th element being ρij (k) = p Γij (k) Cov(rit , rj,t−k ) = σ(rit )σ(rjt ) Γii (0)Γjj (0) and corresponding to the correlation between rit and rj,t−k . When k > 0 it measures the linear dependence between rit and rj,t−k occurring prior to time t such that when ρij (k) 6= 0 the series rjt leads the series rit at lag k. This result is reversed for ρji (k), and the diagonal element of ρii (k) is the lag-k autocorrelation of rit . In general, when k > 0 we get ρij (k) 6= ρji (k) for i 6= j because the two correlation coefficients measure different linear relationships between {rit } and {rjt }, and Γk and ρk are not symmetric. Further, from Cov(rit , rj,t−k ) = Cov(rj,t−k , rit ) and by the weak stationarity assumption Cov(rj,t−k , rit ) = Cov(rj,t , ri,t+K ) = Cov(rjt , ri,t−(−k) ) 218 Quantitative Analytics we have Γij (k) = Γji (−k). Since Γji (−k) is the (j, i)th element of the matrix Γ−k , and since the equality holds > for 1 ≤ i, j ≤ N , we have Γk = Γ> −k and ρk = ρ−k . Hence, unlike the univariate case, ρk 6= ρ−k for a general vector time series when k > 0. As a result, it suffices to consider the cross-correlation matrices ρk for k ≥ 0. Given the information contained in the cross-correlation matrices {ρk }k=0,1,2,.. of a weakly stationary vector time series, if ρij (k) = 0 for all k > 0, then rit does not depend linearly on any past value rj,t−k of the rjt series. Given the data {rt }Tt=1 , the cross-covariance matrix Γk is computed as Γ̂k = T 1 X (rt − r)(rt−k − r)> , k ≥ 0 T t=k+1 where r = 1 T PT t=1 rt is the vector sample mean. The cross-correlation matrix ρk is estimated by ρ̂k = D̂−1 Γ̂k D̂−1 , k ≥ 0 where D̂ is the N × N diagonal matrix of the sample standard deviation of the component series. The asymptotic properties of the sample cross-correlation matrix ρ̂k have been investigated under various assumptions (see Fuller [1976]). For asset return series, the presence of conditional heteroscedasticity and high kurtosis complexify the finite sample distribution of ρ̂k , and proper bootstrap resampling methods should be used to get an approximate estimate of the distribution. The univariate Ljung-Box statistic Q(m) has been generalised to the multivariate case by Hosking [1980] and Li et al. [1981]. 5.5.2 Introduction to a few models The vector autoregressive (VAR) model is considered a simple vector model when modelling asset returns. A multivariate time series rt is a VAR process of order 1 or V AR(1) if it follows the model rt = φ0 + Φrt−1 + at where φ0 is a N-dimentional vector, Φ is a N × N matrix, and {at } is a sequence of serially uncorrelated random vectors with mean zero and positive definite covariance matrix Σ. For example, in the bivariate case with N = 2, rt = (r1t , r2t )> and at = (a1t , a2t )> , we get the equations r1t = φ10 + Φ11 r1,t−1 + Φ12 r2,t−1 + a1t r2t = φ20 + Φ21 r1,t−1 + Φ22 r2,t−1 + a2t where Φij is the (i, j)th element of Φ and φi0 is the ith element of φ0 . The coefficient matrix Φ measures the dynamic dependence of rt , and the concurrent relationship between r1t and r2t is shown by the off-diagonal element σ12 of the covariance matrix Σ of at . The V AR(1) model is called a reduced-form model because it does not show explicitly the concurrent dependence between the component series. Assuming weakly stationarity, and using E[at ] = 0, we get E[rt ] = φ0 + ΦE[rt−1 ] Since E[rt ] is time-invariant, we get µ = E[rt ] = (I − Φ)−1 φ0 provided that I − Φ is non-singular, where I is the N × N identity matrix. Hence, using φ0 = (I − Φ)µ, we can rewrite the AR(1) model as (rt − µ) = Φ(rt−1 − µ) + at 219 Quantitative Analytics Letting r̃t = rt − µ be the mean-corrected time series, the V AR(1) model becomes r̃t = Φr̃t−1 + at By repeated substitutions, the V AR(1) model becomes r̃t = at + φat−1 + φ2 at−2 + ... characterising the V AR(1) process. We can generalise the V AR(1) model to V AR(p) models and get their characteristics. Another approach is the generalise univariate ARMA models to handle vector time series and obtain VARMA models. However, these models suffer from identifiability problem as they are not uniquely defined. Hence, building a VARMA model for a given data set requires some attention. 5.5.3 Principal component analysis Another important statistic in multivariate time series analysis is the covariance (or correlation) structure of the series. Given a N-dimensional random variable r = (r1 , .., rN )> with covariance matrix Σr , a principal component analysis (PCA) is concerned with using a few linear combinations of ri to explain the structure of Σr . PCA applies to either the covariance matrix Σr or the correlation matrix ρr of r. The correlation matrix being the covariance matrix of the standardised random vector r∗ = D−1 r where D is the diagonal matrix of standard deviations of the components of r, we apply PCA to the covariance matrix. Let ci = (ci1 , ..., ciN )> be a N-dimensional vector, where i = 1, .., N such that yi = c> i r = N X cij rj j=1 is a linear combination of the random vector r. In the case where r consists of the simple returns of N stocks, then yi is the return of a portfolio assigning weight cij to the jth stock. Without modifying the proportional allocation of the PN 2 portfolio, we can standardise the vector ci so that c> i ci = j=1 cij = 1. Using the properties of a linear combination of random variables, we get V ar(yi ) Cov(yi , yj ) = c> i Σr ci , i = 1, .., N = c> i Σr cj , i, j = 1, .., N The idea of PCA is to find linear combinations ci such that yi and yj are uncorrelated for i 6= j and the variances of yi are as large as possible. Specifically 1. the first principal component of r is the linear combination y1 = c> 1 r maximising V ar(y1 ) under the constraint c> c = 1. 1 1 2. the second principal component of r is the linear combination y2 = c> 2 r maximising V ar(y2 ) under the constraint c> c = 1 and Cov(y , y ) = 0. 1 2 2 2 3. the ith principal component of r is the linear combination yi = c> i r maximising V ar(yi ) under the constraint c> c = 1 and Cov(y , y ) = 0 for j = 1, ..., i − 1. i j i i Since the covariance matrix Σr is non-negative definite, it has a spectral decomposition (see Appendix (A.6)). Hence, letting (λ1 , e1 ), ..., (λN , eN ) be the eigenvalue-eigenvector pairs of Σr , where λ1 ≥ λ2 ≥ ... ≥ λN ≥ 0, then the ith PN principal component of r is yi = e> i r = j=1 eij rj for i = 1, .., N . Moreover, we get 220 Quantitative Analytics V ar(yi ) Cov(yi , yj ) = e> i Σr ei = λi , i = 1, .., N = e> i Σr ej = 0 , i 6= j In the case where some eigenvalues λi are equal, the choices of the corresponding eigenvectors ei and hence yi are not unique. Further, we have N X V ar(ri ) = tr(Σr ) = i=1 N X λi = i=1 N X V ar(yi ) i=1 This result says that λi V ar(yi ) = PN λ + .. + λN 1 V ar(r ) i i=1 so that the proportion of total variance in r explained by the ith principal component is simply the ratio between the ith eigenvalue and the sum of all eigenvalues of Σr . Since tr(ρr ) = N , the proportion of variance explained by the ith principal component becomes λNi when the correlation matrix is used to perform the PCA. A byproduct of the PCA is that a zero eigenvalue of Σr or ρr indicates the existence of an exact linear relationship between the components of r. For instance, if the smallest eigenvalue λN = 0, then from the previous result V ar(yN ) = 0, and therefore PN yN = j=1 eN j rj is a constant and there are only N − 1 random quantities in r, reducing the dimension of r. Hence, PCA has been used as a tool for dimension reduction. In practice, the covariance matrix Σr and the correlation matrix ρr of the return vector r are unknown, but they can be estimated consistently by the sample covariance and correlation matrices under some regularity conditions. Assuming that the returns {rt }Tt=1 are weakly stationary, we get the estimates Σ̂r = [σ̂ij,r ] = T T 1 X 1X (rt − r)(rt − r)> , r = rt T − 1 t=1 T t=1 and ρ̂r = D̂−1 Σ̂r D̂−1 p p where D̂ = diag{ σ̂11,r , .., σ̂N N,r } is the diagonal matrix of sample standard errors of rt . Methods to compute eigenvalues and eigenvectors of a symmetric matrix can then be used to perform PCA. An informal technique to determine the number of principal components needed in an application is to examine the scree plot, which is the time plot of the eigenvalues λ̂i ordered from the largest to the smallest, that is, a plot of λ̂i versus i. By looking for an elbow in the scree plot, indicating that the remaining eigenvalues are relatively small and all about the same size, one can determine the appropriate number of components. Note, except for the case in which λj = 0 for j > i, selecting the first i principal components only provides an approximation to the total variance of the data. If a small i can provide a good approximation, then the simplification becomes valuable. 5.6 Some conditional heteroscedastic models Following the notation in Section (3.4.2) we are going to describe a few conditional heteroscedastic (CH) models. 5.6.1 The ARCH model Starting with the ARCH model proposed by Engle, the main idea is that 221 Quantitative Analytics 1. the mean-corrected asset return at is serially uncorrelated, but dependent, and 2. the dependence of at can be described by a simple quadratic function of its lagged values. Formally, an ARCH(m) model is given by at = σt t , σt2 = α0 + α1 a2t−1 + ... + αm a2t−m (5.6.3) where {t } is a sequence of i.i.d. random variables with mean zero and variance 1, α0 > 0, and αi ≥ 0 for i > 0. The coefficients αi must satisfy some regularity conditions to ensure that the unconditional variance of at is finite. In practice, t is often assumed to follow the standard normal or a standardised Student-t distribution. From the structure 2 of the model, one can see that large past squared shocks {a2t−i }m i=1 imply a large conditional variance σt for the mean-corrected return at , so that at tends to assume a large value (in modulus). Hence, in the ARCH model large shocks tend to be followed by another large shock similarly to the volatility clustering observed in asset returns. For simplicity of exposition, we consider the ARCH(1) model given by at = σt t , σt2 = α0 + α1 a2t−1 where α0 > 0 and α1 ≥ 0. The unconditional mean of at remains zero because E[at ] = E[E[at |Ft−1 ]] = E[σt E[t ]] = 0 Further, the unconditional variance of at can be obtained as V ar(at ) = E[a2t ] = E[E[a2t |Ft−1 ]] = E[α0 + α1 a2t−1 ] = α0 + α1 E[a2t−1 ] Since at is a stationary process with E[at ] = 0, V ar(at ) = V ar(at−1 ) = E[a2t−1 ], so that V ar(at ) = α0 + α0 . As the variance of at must be positive, we need 0 ≤ α1 < 1. Note, in some α1 V ar(at ) and V ar(at ) = 1−α 1 applications, we need higher order moments of at to exist, and α1 must also satisfy additional constraints. For example, when studying the tail behaviour we need the fourth moment of at to be finite. Under the normality assumption of t we have E[a4t |Ft−1 ] = 3 E[a2t |Ft−1 ] 2 = 3 α0 + α1 a2t−1 2 Therefore, we get 2 E[a4t ] = E[E[a4t |Ft−1 ]] = 3E[ α0 + α1 a2t−1 ] = 3E[α02 + 2α0 α1 a2t−1 + α12 a4t−1 ] If at is fourth-order stationary with m4 = E[a4t ], then we have α1 m4 = 3 α02 + 2α0 α1 V ar(at ) + α12 m4 = 3α02 (1 + 2 ) + 3α12 m4 1 − α1 so that we get m4 = 3α02 (1 + α1 ) (1 − α1 )(1 − 3α12 ) As a result, 1. since m4 is positive, then α1 must also satisfy the condition 1 − 3α12 > 0, that is, 0 ≤ α12 < 2. the unconditional kurtosis of at is 3α02 (1 + α1 ) (1 − α1 )2 1 − α12 E[a4t ] = =3 >3 4 2 2 V ar(at ) (1 − α1 )(1 − 3α1 ) α0 1 − 3α12 222 1 3 Quantitative Analytics Thus, the excess kurtosis of at is positive and its tail distribution is heavier than that of a normal distribution. That is, the shock at of a conditional Gaussian ARCH(1) model is more likely than a Gaussian white noise to produce outliers in agreement with the empirical findings on asset returns. These properties continues to hold for general ARCH models. Note, a natural way of achieving positiveness of the conditional variance is to rewrite an ARCH(m) model as at = σt t , σt2 = α0 + A> m,t−1 ΩAm,t−1 where Am,t−1 = (at−1 , .., at−M )> and Ω is a m×m non-negative definite matrix. Hence, we see that the ARCH(m) model requires Omega to be diagonal, and that Engle’s model uses a parsimonious approach to approximate a quadratic function. A simple way to achieve the diagonality constraint on the matrix Ω is to employ a random coefficient model for at as done in the CHARMA and RCA models. Further, ARCH models also have some weaknesses • the model assumes that positive and negative shocks have the same effects on volatility because it depends on the square of the previous shocks. • the model is rather restrictive, since in the case of an ARCH(1) the parameter α12 is constraint to be in the interval [0, 13 ] for the series to have a finite fourth moment. • the model is likely to overpredict the volatility because it slowly responds to large isolated shocks to the return series. A simple way for building an ARCH model consists of three steps 1. build an econometric model (for example an ARMA model) for the return series to remove any linear dependence in the data, and use the residual series to test for ARCH effects 2. specify the ARCH order and perform estimation 3. check carefully the fitted ARCH model and refine it if necessary To determine the ARCH order, we define ηt = a2t − σt2 since it was shown that {ηt } is an uncorrelated series with zero mean. The ARCH model then becomes a2t = α0 + α1 a2t−1 + ... + αm a2t−m + ηt which is the form of an AR(m) model for a2t , except that {ηt } is not a i.i.d. series. As a result, the least squares estimates of the prior model are consistent, but not efficient. The PACF of a2t , which is a useful tool for determining the order m, may not be effective in the case of small sample size. Forecasts of the ARCH model in Equation (5.6.3) are obtained recursively just like those of an AR model. Given 2 the ARCH(m) model, at the forecast origin h, the 1-step ahead forecast of σh+1 is σh2 (1) = α0 + α1 a2h + ... + αm a2h+1−m 2 and the l-step ahead forecast for σh+l is σh2 (l) = α0 + m X i=1 where σh2 (l − i) = a2h+l−i if l − i ≤ 0. 223 αi σh2 (l − i) Quantitative Analytics 5.6.2 The GARCH model In the GARCH model, given a log return series rt , we assume that the mean equation of the process can be adequately described by an ARMA model. Then, the mean-corrected log return at follows a GARCH(m, s) model if at = σt t , σt2 = α0 + m X αi a2t−i + i=1 s X 2 βj σt−j (5.6.4) j=1 where {t } is a sequence of i.i.d. random variables with zero mean and variance 1, α0 > 0, αi ≥ 0, βj ≥ 0, and Pmax (m,s) (αi + βi ) < 1 implying that the unconditional variance of at is finite, whereas its conditional variance i=1 σt2 evolves over time. In general, t is assumed to be a standard normal or standardised Student-t distribution. To 2 = a2t−i −ηt−i understand the properties of GARCH models we let ηt = a2t −σt2 so that σt2 = a2t −ηt . By plugging σt−i for i=0,..,s into Equation (5.6.4), we get max (m,s) X a2t = α0 + (αi + βi )a2t−i + ηt − i=1 s X βj ηt−j (5.6.5) j=1 Note, while {ηt } is a martingale difference series (E[ηt ] = 0 and Cov(ηt , ηt−j ) = 0 for j ≥ 1), in general it is not an i.i.d. sequence. Since the above equation is an ARMA form for the squared series a2t , a GARCH model can be regarded as an application of the ARMA idea to the squared series a2t . Hence, using the unconditional mean of an ARMA model, we have E[a2t ] = 1− α0 Pmax (m,s) i=1 (αi + βi ) provided that the denominator of the prior fraction is positive. For simplicity of exposition we now consider the GARCH(1, 1) model given by 2 σt2 = α0 + α1 a2t−1 + β1 σt−1 , 0 ≤ α1 , β1 ≤ 1, (α1 + β1 ) < 1 2 We see that a large a2t−1 or σt−1 gives rise to a large σt2 meaning that a large a2t−1 tends to be followed by another 2 large at . It can also be shown that if 1 − 2α12 − (α1 + β1 )2 > 0, then 3 1 − (α1 + β1 )2 E[a4t ] >3 2 = 1 − (α1 + β1 )2 − 2α12 E[a2 ] t so that, similarly to ARCH models, the tail distribution of a GARCH(1, 1) process is heavier than that of a normal distribution. Further, the model provides a simple parametric function that can be used for describing the volatility evolution. Forecasts of a GARCH model can be obtained in a similar way to those of the ARMA model. For example, in the GARCH(1, 1) model, with forecast origin h, for a 1-step ahead forecast we have 2 σh+1 = α0 + α1 a2h + β1 σh2 where ah and σh2 are known at the time index h. Hence, the 1-step ahead forecast is given by σh2 (1) = α0 + α1 a2h + β1 σh2 In the case of multiple steps ahead, we use a2t = σt2 2t and rewrite the volatility equation as 2 σt+1 = α0 + (α1 + β1 )σt2 + α1 σt2 (2t − 1) Setting t = h + 1, since E[2h+1 − 1|Fh ] = 0, the 2-step ahead volatility forecast becomes σh2 (2) = α0 + (α1 + β1 )σh2 (1) 224 (5.6.6) Quantitative Analytics and the l-step ahead volatility forecast satisfies the equation σh2 (l) = α0 + (α1 + β1 )σh2 (l − 1) , l > 1 (5.6.7) which is the same result as that of an ARM A(1, 1) model with AR polynomial 1 − (α1 + β1 )B. By repeated substitution of the above equation (5.6.7), the l-step ahead forecast can be rewritten as α0 1 − (α1 + β1 )l−1 2 σh (l) = + (α1 + β1 )l−1 σh2 (1) 1 − α1 − β1 such that σh2 (l) → α0 as l → ∞ 1 − α1 − β1 provided that α1 + β1 < 1. As a result, the multistep ahead volatility forecasts of a GARCH(1, 1) model converge to the unconditional variance of at as the forecast horizon increases to infinity, provided that V ar(at ) exists. Note, the GARCH models encounter the same weaknesses as the ARCH models, such as responding equally to positive and negative shocks. While the approach used to build ARCH models can be used for building GARCH models, it is difficult to specify the order of the latter. Fortunately, only lower order GARCH models are used in most applications. The conditional maximum likelihood method still applies provided that the starting values of the volatility {σt2 } are assumed to be known. In some applications, the sample variance of at is used as a starting value. 5.6.3 The integrated GARCH model If the AR polynomial of the GARCH representation in Equation (5.6.5) has a unit root, then we have an IGARCH model. That is, IGARCH models are unit-root GARCH models. As for ARIMA models, a key feature of IGARCH 2 models is that the impact of past squared shocks ηt−i = a2t−i − σt−i for i > 0 on a2t is persistent. For example, the IGARCH(1, 1) model is given by 2 at = σt t , σt2 = α0 + β1 σt−1 + (1 − β1 )a2t−1 where {t } is defined as before, and 1 > β1 > 0. In some applications, the unconditional variance of at , hence that of rt , is not defined in this model. From a theoretical point of view, the IGARCH phenomenon might be caused by occasional level shifts in volatility. When α1 + β1 = 1 in Equation ((5.6.7)), repeated substitutions in the l-step ahead volatility forecast equation of GARCH models gives σh2 (l) = σh2 (1) + (l − 1)α0 , l ≥ 1 such that the effect of σh2 (1) on future volatility is also persistent, and the volatility forecasts form a straight line with slope α0 . Note, the process σt2 is a martingale for which some nice results are available (see Nelson [1990]). Under certain conditions, the volatility process is strictly stationary, but not weakly stationary as it does not have the first two moments. Further, in the special case α0 = 0 in the IGARCH(1, 1) model, the volatility forecasts are simply σh2 (1) for all forecast horizons (see Equation (5.6.6)). This is the volatility model used in RiskMetrics (see details in Section (3.4.3)), which is an approach for calculating Value at Risk (VaR) (see details in Scetion (9.5.2)). 5.6.4 The GARCH-M model In general, asset return should depend on its volatility, and one way forward is to consider the GARCH-M model, which is a GARCH in mean. A simple GARCH(1, 1) − M model is given by rt σt2 = µ + cσt2 + at , at = σt t 2 = α0 + α1 a2t−1 + β1 σt−1 225 Quantitative Analytics where µ and c are constants. The parameter c is called the risk premium, with a positive value indicating that the return is positively related to its past volatility. The formulation of the above model implies serial correlations in the return series rt introduced by those in the volatility process σt2 . Thus, the existence of risk premium is, therefore, another reason for historical stock returns to have serial correlations. 5.6.5 The exponential GARCH model Nelson [1991] proposed the exponential GARCH (EGARCH) model allowing for asymmetric effects between positive and negative asset returns. He considered a weighted innovation which can be written as (θ + γ)t − γE[|t |] if t ≥ 0 g(t ) = (θ − γ)t − γE[|t |] if t < 0 where θ and γ are real constants. Both t and |t |−E[|t |] are zero-mean i.i.d. sequences with q continuous distributions, so that E[g(t )] = 0. For the standard Gaussian random variable t , we have E[|t |] = model can be written as 2 π. An EGARCH(m, s) 1 + β1 B + ... + βs B s g(t−1 ) 1 − α1 B − ... − αm B m where α0 is a constant, B is the back-shift (or lag) operator such that Bg(t ) = g(t−1 ), and both the numerator and denominator above are polynomials with zeros outside the unit circle (absolute values of the zeros are greater than one) and have no common factors. Since the EGARCH model uses the ARMA parametrisation to describe the evolution of the conditional variance of at , some properties of the model can be obtained in a similar manner as those of the GARCH model. For instance, the unconditional mean of ln (σt2 ) is α0 . However, the EGARCH model uses logged conditional variance to relax the positiveness constraint of model coefficients, and the use of g(t ) enables the model to respond asymmetrically to positive and negative lagged values of at . For example, in the simple EGARCH(1, 0) we get at = σt t , ln (σt2 ) = α0 + at = σt t , (1 − αB) ln (σt2 ) = (1 − α)α0 + g(t−1 ) where {t } are i.i.d. standard normal and the subscript of α1 is omitted. In this case, E[|t |] = ln (σt2 ) q 2 π and the model for becomes (1 − αB) ln (σt2 ) = α∗ + (θ + γ)t−1 if t−1 ≥ 0 α∗ + (θ − γ)t−1 if t−1 < 0 q where α∗ = (1 − α)α0 − π2 γ. Note, this is a nonlinear function similar to that of the threshold autoregressive (TAR) model of Tong [1990]. In this model, the conditional variance evolves in a nonlinear manner depending on the sign of at−1 , that is, √at−1 2 (θ+γ) σt−1 if at−1 ≥ 0 e 2α α∗ at−1 σt2 = σt−1 e (θ−γ) √ 2 σ t−1 if a e t−1 < 0 The coefficients (θ ± γ) show the asymmetry in response to positive and negative at−1 , and the model is nonlinear when γ 6= 0. In presence of higher orders, the nonlinearity becomes much more complicated. Now, given the EGARCH(1, 0) model, assuming known model parameters and that the innovations are standard Gaussian, we have 2 ln (σt2 ) = (1 − α1 )α0 + α1 ln (σt−1 ) + g(t−1 ) r 2 g(t−1 ) = θt−1 + γ |t−1 | − π 226 Quantitative Analytics Taking exponential, the model becomes 2α1 (1−α1 )α0 g(t−1 ) e e σt2 = σt−1 and the 1-step ahead forecast, with forecast origin h, satisfies 2 σh+1 = σh2α1 e(1−α1 )α0 eg(h ) where all the quantities on the right-hand side are known. Thus, the 1-step ahead volatility forecast at the forecast 2 origin h is simply σ̂h1 (1) = σh+1 . Repeating for the 2-step ahead forecast, and taking conditional expectation at time h, we get σ̂h2 (2) = σ̂h2α1 (1)e(1−α1 )α0 Eh [eg(h+1 ) ] where Eh [•] denotes the conditional expectation at the time origin h. After some calculation, the prior expectation is given by √2 1 2 2 1 E[eg() ] = e−γ π e 2 (θ+γ) N (θ + γ) + e 2 (θ−γ) N (θ − γ) where f (•) and N (•) are the probability density function and CDF of the standard normal distribution, respectively. As a result, the 2-step ahead volatility forecast becomes √2 1 2 2 1 σ̂h2 (2) = σ̂h2α1 (1)e(1−α1 )α0 e−γ π e 2 (θ+γ) N (θ + γ) + e 2 (θ−γ) N (θ − γ) Repeating this procedure, we obtain a recursive formula for the j-step ahead forecast 1 2 2 1 σ̂h2 (j) = σ̂h2α1 (j − 1)ew e 2 (θ+γ) N (θ + γ) + e 2 (θ−γ) N (θ − γ) q where w = (1 − α1 )α0 − γ π2 . 5.6.6 The stochastic volatility model An alternative approach for describing the dynamics of volatility is to introduce the innovation vt to the conditional variance equation of at obtaining a stochastic volatility (SV) model (see Melino et al. [1990], Harvey et al. [1994]). Using ln (σt2 ) to ensure positivity of the conditional variance, a SV model is defined as at = σt t , 1 − α1 B − ... − αm B m ln (σt2 ) = α0 + vt where t are i.i.d. NP (0, 1), vt are i.i.d. N (0, σv2 ), {t } and {vt } are independent, α0 is a constant, and all zeros of m the polynomial 1 − i=1 αi B i are greater than 1 in modulus. While the innovation vt substantially increases the flexibility of the model in describing the evolution of σt2 , it also increases the difficulty in parameter estimation since for each shock at the model uses two innovations t and vt . To estimate a SV model, one need a quasi-likelihood method via Kalman filtering or a Monte Carlo method. Details on SV models and their parameters estimation can be found in Taylor [1994]. Properties of the model can be found in Jacquier et al. [1994] when m = 1. In that setting, we have ln (σt2 ) ∼ N ( α0 σv2 , ) = N (µh , σh2 ) 1 − α1 1 − α12 and E[a2t ] = e µh + 1 2σ 2 h 2 2 2 , E[a4t ] = 3e2µh +2σh , Corr(a2t , a2t−i ) = 227 i eσh α1 − 1 2 3eσh − 1 Quantitative Analytics While SV models often provide improvements in model fitting, their contributions to out-of-sample volatility forecasts received mixed results. Note, using the idea of fractional difference (see Section (5.4.3)), SV models have been extended to allow for long memory in volatility. This extension has been motivated by the fact that autocorrelation function of the squared or absolute-valued series of asset returns often slowly decay, even though the return series has no serial correlation (see Ding et al. [1993]). A simple long-memory stochastic volatility (LMSV) model can be defined as 1 at = σt t , σt = σe 2 ut , (1 − B)d ut = ηt where σ > 0, t are i.i.d. N (0, 1), ηt are i.i.d. N (0, ση2 ) and independent of t , and 0 < d < 12 . The feature of long memory stems from the fractional difference (1 − B)d implying that the ACF of ut decays slowly at a hyperbolic, instead of an exponential rate as the lag increases. Using these settings we have ln (a2t ) = = ln (σ 2 ) + ut + ln (2t ) ln (σ 2 ) + E[ln (2t )] + ut + ln (2t ) − E[ln (2t )] = µ + ut + et so that the ln (a2t ) series is a Gaussian long-memory signal plus a non-Gaussian white noise (see Breidt et al. [1998]). Estimation of the long-memory stochastic volatility model is difficult, but the fractional difference parameter d can be estimated by using either a quasi-maximum likelihood method or a regression method. Using the log series of squared daily returns for companies in S&P 500 index, Bollerslev et al. [1999] and Ray et al. [2000] found the median estimate of d to be about 0.38. Further, Ray et al. studied common long-memory components in daily stock volatilities of groups of companies classified according to various characteristics, and found that companies in the same industrial or business sector tend to have more common long-memory components. 5.6.7 Another approach: high-frequency data Due to the availability of high-frequency financial data, especially in the foreign exchange markets, alternative approach for volatility estimation using high-frequency data to calculate volatility of low frequency returns developed (see French et al. [1987]). For example, considering the monthly volatility of an asset for which daily returns are available, we let rtm be the monthly log return of the asset at month t. Assuming n trading days in the month t, the daily log returns of the asset in the month are {rt,i }ni=1 . Using properties of log returns, we have rtm = n X rt,i i=1 Assuming that the conditional variance and covariance exist, we have V ar(rtm |Ft−1 ) = n X V ar(rt,i |Ft−1 ) + 2 i=1 X Cov(rt,i , rt,i |Ft−1 ) i 1 with E1 = P1 and where Pt is the value at a time period t, and Et is the value of the EMA at any time period t. The coefficient α ∈ [0, 1] represents the degree of weighting decrease. A higher α discounts older observations faster. Alternatively, α may be expressed in terms of N time periods, where α = (N2+1) . For example, if N = 19 it is N equivalent to α = 0.1, the half-life of the weights is approximately 2.8854 . Note, E1 is undefined, and it may be initialised in a number of different ways, most commonly by setting E1 to P1 , though other techniques exist, such as setting E1 to an average of the first 4 or 5 observations. The prominence of the E1 initialisation’s effect on the resultant moving average depends on α; smaller α values make the choice of E1 relatively more important than larger α values, since a higher α discounts older observations faster. By repeated application of this formula for different times, we can eventually write Et as a weighted sum of the datum points Pt as: Et = α Pt−1 + (1 − α)Pt−2 + (1 − α)2 Pt−3 + .. + (1 − α)k Pt−(k+1) + (1 − α)k+1 Et−(k+1) for any suitable k = 0, 1, 2, ... The weight of the general datum point Pt−i is α(1 − α)i−1 . We can show how the EMA steps towards the latest datum point, but only by a proportion of the difference (each time) Et = Et−1 + α(Pt − Et−1 ) Expanding out Et−1 each time results in the following power series, showing how the weighting factor on each datum point p1 , p2 , ... decreases exponentially: Et = α p1 + (1 − α)p2 + (1 − α)2 p3 + ... where p1 = Pt , p2 = Pt−1 , ... Note, the weights α(1 − α)t decrease geometrically, and their sum is unity. Using a property of geometric series, we get α t−1 X (1 − α)i = α i=0 t X (1 − α)i−1 = α i=1 1 − (1 − α)t = 1 − (1 − α)t 1 − (1 − α) t and limt→∞ (1 − α) = 0. As a result, we get α ∞ X (1 − α)i−1 = 1 i=1 Focusing on the term α, we get 233 Quantitative Analytics ∞ Et = p1 + (1 − α)p2 + (1 − α)2 p3 + ... 1 X = ωi pi norm norm i=1 where ωi = (1 − α)i−1 and ∞ X 1 = norm = 1 + (1 − α) + (1 − α)2 + ... = (1 − α)i−1 α i=1 This is an infinite sum with decreasing terms. The N periods in an N-day EMA only specify the α factor. N is not a stopping point for the calculation in the way it is in an SMA or WMA. For sufficiently large N, the first N datum points in an EMA represent about 86% of the total weight in the calculation α 1 + (1 − α) + (1 − α)2 + ... + (1 − α)N 2 = 1 − (1 − )N +1 2 ∞ N +1 α 1 + (1 − α) + (1 − α) + ... + (1 − α) and lim 1 − (1 − N →∞ 2 )N +1 = 1 − e−2 ≈ 0.8647 N +1 since limn→∞ (1 + nx )n = ex . This power formula can give a starting value for a particular day, after which the successive days formula above can be applied. The question of how far back to go for an initial value depends, in the worst case, on the data. Large price values in old data will affect on the total even if their weighting is very small. The weight omitted by stopping after k terms can be used in the fraction weight omitted by stopping after k terms = (1 − α)k total weight For example, to have 99.9% of the weight, set the ratio equal to 0.1% and solve for k: k= log (0.001) log (1 − α) As the Taylor series of log (1 − α) = −α − 21 α2 − ... tends to −α we get the limit limN →∞ log (1 − α) = − (N2+1) , and the computation simplifies to k = − log (0.001) for this example and 5.7.2 1 2 (N + 1) 2 log (0.001) = −3.45. Introducing exponential smoothing models Given the recorded observations Y1 , Y2 , ..., Yt over t time periods, which represent all the data currently available, our interest lies in forecasting the series Yt+1 , .., Yt+h over the next h weeks, known as the forecasting horizon. The (point) forecasts for future series are all made at time t, known as the forecast origin, so the first forecast will be made one step ahead, the second two steps ahead, and so on. We let Ft+h|t be the forecast for Yt+h made at time t. The subscripts always tell us which time period is being forecast and when the forecast was made. When no ambiguity arises, we will use Ft+1 to represent the one-step-ahead forecast Ft+1|t . 234 Quantitative Analytics 5.7.2.1 Linear exponential smoothing Following Brown [1959] and Holt [1957] on exponential smoothing, to avoid the continuation of global patterns, we are now considering tools that project trends more locally. Given the straight-line equation Yt = L0 + Bt where Lt is the level of series at time t and Bt is slope of series at time t. In our example, as we have a constant slope Bt = B then the value of the series starts out at the value L0 at time zero and increases by an amount B in each time period. Another way of writing the right-hand side of this expression is to state directly that the new level, Lt is obtained from the previous level by adding one unit of slope B Lt = L0 + Bt = Lt−1 + B We may then define the variable Yt in terms of the level and the slope as Yt = Lt−1 + B Further, we can see that if we go h periods ahead, we can define the variable at time (t + h) in terms of the level at time t − 1 and the appropriate number of slope increments Yt+h = L0 + B(t + h) = Lt + Bh There is a lot of redundancy in these expressions, since we are considering the error-free case. When we turn back to the real problem with random errors and changes over time in the level and the slope, these equations suggest that we consider forecasts of the form Ft+h|t = Lt + hBt (5.7.10) which is a straight line. Thus, the one-step-ahead forecast made at time (t − 1) is Ft|t−1 = Ft = Lt−1 + Bt−1 We can now consider updating the level and the slope using equations like those we used for SES. We define the observed error t as the difference between the newly observed value of the series and its previous one-step-ahead forecast t = Yt − Ft = Yt − (Lt−1 + Bt−1 ) Given the latest observation Yt we update the expressions for the level and the slope by making partial adjustments that depend upon the error Lt = Lt−1 + Bt−1 + αt = αYt + (1 − α)(Lt−1 + Bt−1 ) Bt = Bt−1 + αβt (5.7.11) The new slope is the old slope plus a partial adjustment (weight αβ) for the error. These equations are known as the error correction form of the updating equations. As may be checked by substitution, the slope update can also be expressed as Bt = Bt−1 + β(Lt − Lt−1 − Bt−1 ) where Lt − Lt−1 represents the latest estimate of the slope such that (Lt − Lt−1 − Bt−1 ) is the latest error made if the smoothed slope is used as an estimate instead. Hence, a second round of smoothing is applied to estimate the slope which has led some authors to describe the method as double exponential smoothing. 235 Quantitative Analytics To start the forecast process we need starting values for the level and slope, and values for the two smoothing constants α and β. The smoothing constants may be specified by the user, and conventional wisdom decrees using 0.05 < α < 0.3 and 0.05 < α < 0.15. These values are initial values in a procedure to select optimal coefficients by minimising the MSE over some initial sample. As for SES, different programs use a variety of procedures to set starting values (see Gardner [1985]). One can use B3 = Y3 − Y1 2 for the slope and Y1 + Y2 + Y3 Y3 − Y1 + 3 2 for the level, corresponding to fitting a straight line to the first three observations. Thus, the first three observations were used to set initial values for the level and slope. Once the initial values are set, equations (5.7.11) are used to update the level and slope as each new observation becomes available. When time series show a very strong trend, we would expect LES to perform much better than SES. L3 = The LES method requires that the series is locally linear. That is, if the trend for the last few time periods in the series appears to be close to a straight line, the method should work well. However, in many cases this assumption is not realistic. For example, in the case of exponential growth, any linear approximation will undershoot the true function sooner or later. A first approach would be to use a logarithmic transformation. Given Yt = γYt−1 where γ is some constant, the log transform becomes ln Yt = ln γ + ln Yt−1 and the log-transform produces a linear trend to which we can apply LES. We must then transform back to the original series to obtain the forecasts of interest. Writing Zt = ln Yt the reverse transformation is Yt = eZt In general, SES should not be used for strongly trending series; whether to use LES on the original or transformed series, or to use SES on growth rates, remains a question for further examination in any particular study. 5.7.2.2 The damped trend model Some time series have a history of growth, possibly later followed by a decline, other series may have a strong tendency to increase over time, while other time series relates to the returns on an investment. Based on the findings of the M competition, Makridakis et al. [1982] showed that the practice of projecting a straight line trend indefinitely into the future was often too optimistic (or pessimistic). Hence, one can either convert the series to growth over time and forecast the growth rate, or we need to develop forecasting methods that account for trends. When the growth rate slow down and then decline we can accommodate such effects by modifying the updating equations for the level and slope. Assuming that the series flatten out unless the process encounters some new stimulus, the slope should approach zero. We consider the damped trend model introduced by Gardner and McKenzie [1985] which proved to be very effective (see Makridakis and Hibon [2000]). This is achieved by introducing a dampening factor φ in equations (5.7.11), getting Lt = Lt−1 + φBt−1 + αt Bt = φBt−1 + αβt 236 Quantitative Analytics where φ ∈ [0, 1] multiplies each slope term Bt−1 shifting that term towards zero, or dampening it. Computing the forecast function for h-steps ahead, we get Ft+h|t = Lt + (φ + φ2 + .. + φh )Bt Bt This forecast levels out over time approaching the limiting value Lt + 1−φ provided the dampening factor is less than one. This is to contrast with the case φ = 1 when the forecast keeps increasing so that Ft+h|t = Lt + hBt . Robert Brown [1959] was the original developer of exponential smoothing methods where his initial derivation of exponential smoothing used a least squares argument which, for a local linear trend reduces to the use of LES with α = β. In general, there is no particular benefit to imposing this restriction. However, the discounted least squares approach is particularly useful when complex non-linear functions are involved and updating equations are not readily available. If we set β = 0 the updating equations (5.7.11) become Lt = Lt−1 + B + αt Bt = Bt−1 = B which may be referred to as SES with drift, since the level increases by a fixed amount each period (see SES in Equation (5.7.10)). This method being just a special case of LES, the simpler structure makes it easier to derive an optimal value for B using the estimation sample (see Hyndman and Billah [2003]). Trigg and Leach [1967] introduced the concept of a tracking signal, whereby not only are the level and slope updated each time, but also the smoothing parameters. In the case of SES, we can use the updated value for α given by P Et−1 Et P , αt = α̂t = Mt Mt−1 where Et and Mt are smoothed values of the error and the absolute error respectively given by Et = δt + (1 − δ)Et−1 Mt = δ|t | + (1 − δ)Mt−1 where δ ∈ [0.1, 0.2]. If a string of positive errors occurs, the value of αt increases, to speed up the adjustment process, the reverse occurs for negative errors. A generally preferred approach is to update the parameter estimate regularly, which is no longer much of a computational problem even for large numbers of series. One alternative to SES is look at the successive differences in the series Yt − Yt−1 and take a moving average of t−n these values to estimate the slope. The net effect is to estimate the slope by Yt −Y for a n-term moving average. n Again, LES usually provides better forecasts. 5.7.3 A summary Gardner [2006] reviewed the state of the art in exponential smoothing (ES) up to date. He classified and gave formulations for the standard methods of ES which can be modified to create state-space models. For each type of trend, and for each type of seasonality, there are two sections of equations. We first consider recurrence forms (used in the original work by Brown [1959] and Holt [1957]) and then we give error-correction forms (notation follows Gardner [1985]) which are simpler and give equivalent forecasts. Note, there is still no agreement on notation for ES. The notation by Hyndman et al. [2002] and extended by Taylor [2003] is helpful in describing the methods. Each 237 Quantitative Analytics Table 5.1: List of ES models Trend Component N (none) A (additive) DA (damped-additive) M (multiplicative) DM (damped-multiplicative) N (none) NN AN DA-N MN DM-N A (additive) NA AA DA-A MA DM-A M (multiplicative) NM AM DA-M MM DM-M method is denoted by one or two letters for the trend and one letter for seasonality. Method (N-N) denotes no trend with no seasonality, or simple exponential smoothing (SES). The other nonseasonal methods are additive trend (A-N), damped additive trend (DA-N), multiplicative trend (M-N), and damped multiplicative trend (DM-N). All seasonal methods are formulated by extending the methods in Winters [1960]. Note that the forecast equations for the seasonal methods are valid only for a forecast horizon (h) less than or equal to the length of the seasonal cycle (p). Given the smoothing parameter for the level of the series α ∈ [0, 1], the smoothing parameter for the trend γ ∈ [0, 1], the smoothing parameter for seasonal indices δ, the autoregressive or damping parameter φ ∈ [0, 1], we let t = Yt − Ft be the one-step-ahead forecast error with Ft = Ft|t−1 = Ŷt−1 (1) is the one-step ahead forecast, and we get 1. (N-N) St = αYt + (1 − α)St−1 Ŷt (h) = Ft+h|t = St and St = St−1 + αt Ft+h|t = St 2. (A-N) St = αYt + (1 − α)(St−1 + Tt−1 ) Tt = γ(St − St−1 ) + (1 − γ)Tt−1 Ft+h|t = St + hTt and St = St−1 + Tt−1 + αt Tt = Tt−1 + αγt Ft+h|t = St + hTt 3. (DA-N) St = αYt + (1 − α)(St−1 + φTt−1 ) Tt = γ(St − St−1 ) + (1 − γ)φTt−1 Ft+h|t = St + h X i=1 238 φi Tt Quantitative Analytics and St = St−1 + φTt−1 + αt Tt = φTt−1 + αγt Ft+h|t = St + h X φi Tt i=1 4. (M-N) St = αYt + (1 − α)St−1 Rt−1 St + (1 − γ)Rt−1 Rt = γ St−1 Ft+h|t = St Rth and St = St−1 Tt−1 + αt t Rt = Rt−1 + αγ St−1 Ft+h|t = St Rth 5. (DM-N) φ St = αYt + (1 − α)St−1 Rt−1 St φ Rt = γ + (1 − γ)Rt−1 St−1 Ph Ft+h|t = St Rt i=1 φi and φ St = St−1 Rt−1 + αt t φ Rt = Rt−1 + αγ St−1 Ph Ft+h|t = St Rt i=1 φi 6. (N-A) St = α(Yt − It−p ) + (1 − α)St−1 It = δ(Yt − St ) + (1 − δ)It−p Ft+h|t = St + It−p+h and St = St−1 + αt It = It−p + δ(1 − α)t Ft+h|t = St + It−p+h 239 Quantitative Analytics 7. (A-A) St = α(Yt − It−p ) + (1 − α)(St−1 + Tt−1 ) Tt = γ(St − St ) + (1 − γ)Tt−1 It = δ(Yt − St ) + (1 − δ)It−p Ft+h|t = St + hTt + It−p+h and St = St−1 + Tt−1 + αt Tt = Tt−1 + αγt It = It−p + δ(1 − α)t Ft+h|t = St + hTt + It−p+h 8. (N-M) Yt + (1 − α)St−1 It−p Yt It = δ + (1 − δ)It−p St Ft+h|t = St It−p+h St = α and St = St−1 + α t It−p It = It−p + δ(1 − α) t St Ft+h|t = St It−p+h 9. (A-M) Yt + (1 − α)(St−1 + Tt−1 ) It−p Tt = γ(St − St ) + (1 − γ)Tt−1 Yt It = δ + (1 − δ)It−p St Ft+h|t = (St + hTt )It−p+h St = α and St = St−1 + Tt−1 + α Tt = Tt−1 + αγ t It−p t It−p It = It−p + δ(1 − α) t St Ft+h|t = (St + hTt )It−p+h where St is the smoothed level of the series, Tt is the smoothed additive trend at the end of period t, Rt is the smoothed multiplicative trend, It is the smoothed seasonal index at time t, h is the number of periods in the forecast lead-time, and p is the number of periods in the seasonal cycle. 240 Quantitative Analytics Remark 5.7.3 When forecasting time series with ES, it is generally assumed that the most common time series in business are inherently non-negative. Therefore, it is of interest to consider the properties of the potential stochastic models underlying ES when applied to non-negative data. It is clearly a problem when forecasting financial returns as the multiplicative error models are not well defined if there are zeros or negative values in the data. The (DA-N) method can be used to forecast multiplicative trends with the autoregressive or damping parameter φ restricted to the range 1 < φ < 2, a method sometimes called generalised Holt. In hopes of producing more robust forecasts, Taylor’s [2003] methods (DM-N, DM-A, and DM-M) add a damping parameter φ < 1 to Pegels’ [1969] multiplicative trends. Each exponential smoothing method above is equivalent to one or more stochastic models. The possibilities include regression, ARIMA, and state-space models. The most important property of exponential smoothing is robustness. Note, the damped multiplicative trends are the only new methods creating new forecast profiles since 1985. The forecast profiles for Taylor’s methods will eventually approach a horizontal nonseasonal or seasonally adjusted asymptote, but in the near term, different values of φ can produce forecast profiles that are convex, nearly linear, or even concave. There are many equivalent state-space models for each of the methods described in the above table. In the framework of Hyndman et al. [2002] each ES method in the table (except the DM methods) has two corresponding state-space models, each with a single source of error (SSOE), one with an additive error and the other with a multiplicative error. The methods corresponding to the framework of Hyndman et al. are the same as the ones in the table appart from two exceptions where one has to modify all multiplicative seasonal methods and all damped additive trend methods. Each ES method in the table is equivalent to one or more stochastic models, including regression, ARIMA, and state-space models. In large samples, ES is equivalent to an exponentially-weighted or DLS regression model. General exponential smoothing (GES) also relies on DLS regression with one or two discount factor to fit a variety of functions of time to the data, including polynomials, exponentials, sinusoids, and their sums and products (see Gardner [1985]). Gijbels et al. [1999] and Taylor [2004c] showed that GES can be viewed in a kernel regression framework. For instance simple smoothing (N −N ) is a zero-degree local polynomial kernel model. They showed that choosing the minimum-MSE parameter in simple smoothing is equivalent to choosing the regression bandwidth by cross-validation, a procedure that divides the data into two disjoint sets, with the model fitted in one set and validated in another. All linear exponential smoothing methods have equivalent ARIMA models which can be easily shown through the DA-N method containing at least six ARIMA models as special cases (see Gardner et al. [1988]). If 0 < θ < 1 then the DA-N method is equivalent to the ARIMA (1, 1, 2) model, which can be written as (1 − B)(1 − φB)Yt = 1 − (1 + φ − α − φαγ)B − φ(α − 1)B 2 t We obtain an ARIM A(1, 1, 1) model by setting α = 1. When α = γ = 1 the model is ARIM A(1, 1, 0). When φ = 1 we have a linear trend (A-N) and the model is ARIM A(0, 2, 2) (1 − B)2 Yt = 1 − (2 − α − αγ)B − (α − 1)B 2 t When φ = 0 we have simple smoothing (N-N) and the equivalent ARIM A(0, 1, 1) model (1 − B)Yt = 1 − (1 − α) t The ARIM A(0, 1, 0) random walk model can be obtained from the above equation by choosing α = 1. Note, ARIMA-equivalent seasonal models for the linear exponential smoothing methods exist. The equivalent ARIMA models do not extend to the nonlinear exponential smoothing methods. Prior to the work by Ord et al. [1997] (OKS), state-space models for ES were formulated using multiple sources of error (MSOE). For instance, the exponential smoothing (N-N) is optimal for a model with two sources of error (see Muth [1960]) where observation and state equations are given by 241 Quantitative Analytics Yt = Lt + νt Lt = Lt−1 + ηt so that the unobserved state variable Lt denotes the local level at time t, and the error terms νt and ηt are generated by independent white noise processes. Various authors showed that simple smoothing SES is optimal with α determined by the ratio of the variances of the noise processes (see Chatfield [1996]). Harvey [1984] also showed that the Kalman filter for the above equations reduces to simple smoothing in the steady state. Due to the limitation of the MSOE, Ord et al. [1997] created a general, yet simple class of state-space models with a single source of error (SSOE). For example, the SSOE model with additive errors for the (N-N) model is given by Yt = Lt−1 + t Lt = Lt−1 + αt where the error term t in the observation equation is the one-step ahead forecast error assuming knowledge of the level at time t − 1. For the multiplicative error (N-N) model, we alter the additive-error SSOE model and get Yt = Lt−1 + Lt t Lt = Lt−1 (1 + αt ) = Lt−1 + αLt−1 t where the one-step ahead forecast error is still Yt − Lt−1 which is no-longer the same as t . Hence, the above state equation becomes Lt = Lt−1 + αLt−1 Yt − Lt−1 = Lt−1 + α(Yt − Lt−1 ) Lt−1 where the multiplicative error state equation can be written in the error correction form of simple smoothing. As a result, the state equations are the same in the additive and multiplicative error cases, and this is true for all SSOE models. Hyndman et al. [2002] extended the class of SSOE models by Ord et al. [1997] to include all the methods of ES in the above table except from the DM methods. The theoretical advantage of the SSOE approach to ES is that the errors can depend on the other components of the time series. That is, each of the linear exponential smoothing (LES) models with additive errors has an ARIMA equivalent, but the linear models with multiplicative errors and the nonlinear models are beyond the scope of the ARIMA class. The equivalent models help explain the general robustness of exponential smoothing. Simple smoothing (N-N) is certainly the most robust forecasting method and has performed well in many types of series not generated by the equivalent ARIM A(0, 1, 1) process. Such series include the common first-order autoregressive processes and a number of lower-order ARIMA processes. Bossons [1966] showed that simple smoothing is generally insensitive to specification error, especially when the misspecification arises from an incorrect belief in the stationarity of the generating process. Similarly, Hyndman [2001] showed that ARIMA model selection errors can inflate MSEs compared to simple smoothing. Using AIC to select the best model, the ARIMA forecast MSEs were significantly larger than those of simple smoothing due to incorrect model selections, and becoming worse when the errors were non-normal. 5.7.4 Model fitting When considering method selection, the definitions of aggregate and individual method selection in the work of Fildes [1992] are useful in exponential smoothing. Aggregate selection is the choice of a single method for all time series 242 Quantitative Analytics in a population, while individual selection is the choice of a method for each series. While in aggregate selection it is difficult to beat the damped-trend version of exponential smoothing, in individual selection it may be possible to beat the damped trend, but it is not clear how one should proceed. Even though individual method selection can be done in a variety of ways, such as time series characteristics, the most sophisticated approach to method selection is through information criteria. Various expert systems for individual selection have been proposed, among which the Collopy et al. [1992] including 99 rules constructed from time series characteristics and domain knowledge, combining the forecasts from four methods: a random walk, time series regression, double exponential smoothing, and the (A-N) method. This approach requiring considerable human intervention in identifying features of time series, Vokurka et al. [1996] developed a completely automatic expert system selecting from a different set of candidate methods: the (N-N) and (DA-N) methods, classical decomposition, and a combination of all candidates. Testing their systems using 126 annual time series from the M 1 competition, they concluded that they were more accurate than various alternatives. Gardner [1999] considered the aggregate selection of the (DA-N) method and showed that it was more accurate at all forecast horizons than either version of rule-based forecasting. Numerous information criteria that can distinguish between additive and multiplicative seasonality are available for selection of an ES method, but the computational burden can be significant. For instance, Hyndman et al. [2002] recommended fitting all models (from their set of 24 alternatives) to time series, then selecting the one minimising the AIC. In the 1, 001 series (M 1 and M 3 data), for the average of all forecast horizons, the (DA-N) method was better than individual selection using the AIC. Later work by Billah et al. [2005] compared eight information criteria used to select from four ES methods, including AIC, BIC, and other standards, as well as two Empirical Information Criteria (EIC) (a linear and a non-linear function) penalising the likelihood of the data by a function of the number of parameters in the model. Although state-space models for exponential smoothing dominate the recent literature, very little has been done on the identification of such models as opposed to selection using information criteria. Koehler et al. [1988] identified and fitted MSOE state-space models to 60 time series from the 111 series in the M 1 competition with a semi-automatic fitting routine. In general, the identification process was disappointing. Rather than attempt to identify a model, we could attempt to identify the best exponential smoothing method directly. Chatfield et al. [1988] call this a thoughtful use of exponential smoothing methods that are usually regarded as automatic. They gave a common-sense strategy for identifying the most appropriate method for the Holt-Winters class (see also Chatfield [2002]). Gardner 2006 gave the strategy in a nutshell. 1. We plot the series and look for trend, seasonal variation, outliers, and changes in structure that may be slow or sudden and may indicate that ES is not appropriate in the first place. We should examine any outliers, consider making adjustments, and then decide on the form of the trend and seasonal variation. At this point, we should also consider the possibility of transforming the data, either to stabilise the variance or to make the seasonal effect additive. 2. We fit an appropriate method, produce forecasts, and check the adequacy of the method by examining the onestep-ahead forecast errors, particularly their autocorrelation function. 3. The findings may lead to a different method or a modification of the selected method. In order to implement an ES method, the user must choose parameters, either fixed or adaptive, as well as initial values and loss functions. Parameter selection is not independent of initial values and loss functions. Note, in the trend and seasonal models, the response surface is not necessarily convex so that one need to start any search routine from several different points to evaluate local minima. We hope that our search routine comes to rest at a set of invertible parameters, but this may not happen. Invertible parameters create a model in which each forecast can be written as a 243 Quantitative Analytics linear combination of all past observations, with the absolute value of the weight on each observation less than one, and with recent observations weighted more heavily than older ones. If we view an ES method as a system of linear difference equations, a stable system has an impulse response that decays to zero over time. The stability region for parameters in control theory is the same as the invertibility region in time series analysis. In the linear non-seasonal methods, the parameters are always invertible if they are chosen in the interval [0, 1]. The same conclusion holds for quarterly seasonal methods, but not for monthly seasonal methods, whose invertibility regions are complex (see Sweet [1985]). Non-invertibility usually occurs when one or more parameters fall near boundaries, or when trend and/or seasonal parameters are greater than the level parameter. For all seasonal ES methods, we can test parameters for invertibility using an algorithm by Gardner et al. [1989] assuming that additive and multiplicative invertible regions are identical, but the test may fail to eliminate some troublesome parameters. Archibald [1990] found that some combination of [0, 1] parameters near boundaries fall within the ARIMA invertible region, but the weights on past data diverge. Hence, they concluded that one should be skeptical of parameters near boundaries in all seasonal models. Once the parameters have been selected, another problem is deciding how frequently they should be updated. Fildes et al. [1998] compared three options for choosing parameters in the (N-N), (A-N), and (DA-N) methods 1. arbitrarily 2. optimise once at the first time origin 3. optimise each time forecasts are made and found that the best option was to optimise each time forecasts were made. The term adaptive smoothing mean that the parameters are allowed to change automatically in a controlled manner as the characteristics of the time series change. For instance, the Kalman filter can be used to compute the parameter in the (N-N) method. The only adaptive method that has demonstrated significant improvement in forecast accuracy compared to the fixed-parameter (N-N) method is Taylor’s [2004a] [2004b] smooth transition exponential smoothing (STES). Smooth transition models are differentiated by at least one parameter that is a continuous function of a transition variable Vt . The formula for the adaptive parameter αt is a logistic function (see details in Appendix (A.2)) αt = 1 1 + ea+bVt with several possibilities for Vt including t , |t |, and 2t . Whatever the transition variable, the logistic function restricts αt to [0, 1]. The drawback to STES is that model-fitting is required to estimate a and b; thereafter, the method adapts to the data through Vt . In Taylor [2004a], STES was arguably the best method overall in volatility forecasting of stock index data compared to the fixed-parameter version of (N-N) and a range of GARCH and autoregressive models. Note, with financial returns, the mean is often assumed to be zero or a small constant value, and attention turns to predicting the variance. Following the advice of Fildes [1998], Taylor evaluated forecast performance across time. Using the last 18 observations of each series, he computed successive one-step ahead monthly forecasts, for a total of 25, 704 forecasts, and judged by MAPE and median APE, STES was the most accurate method tested, with best results for the MAPE. Standard ES methods are usually fitted in two steps, by choosing fixed initial values, followed by an independent search for parameters. In contrast, the new state-space methods are usually fitted using maximum likelihood where initial values are less of a concern because they are refined simultaneously with the smoothing parameters during the optimisation process. However, this approach requires significant computation times. The nonlinear programming model introduced by Sergua et al. [2001] optimise initial values and parameters simultaneously. Examining the M 1 series, Makridakis et al. [1991] measured the effect of different initial values and loss functions in fitting (N-N), (A-N), and (DA-N) methods, using seasonal-adjusted data where appropriate. Initial values were computed by least squares, backcasting, and several simple methods. Loss functions included the MAD, MAPE. median APE, MSE, the sum of cubed errors, and a variety of non-symmetric functions computed by weighting the errors in different ways. 244 Quantitative Analytics They concluded that initialising by least squares, choosing parameters from the [0, 1] interval, and fitting models to minimise the MSE provided satisfactory results. 5.7.5 Prediction intervals and random simulation Hyndman et al. [2008] [2008b] provided a taxonomy of ES methods with forecasts equivalent to the one from a state space model. This equivalence allows 1. easy calculation of the likelihood, the AIC and other model selection criteria 2. computation of prediction intervals for each method 3. random simulation from the state space model Following their notation, the ES point forecast equations become lt = αPt + (1 − α)Qt bt = βRt + (φ − β)bt−1 st = γTt + (1 − γ)st−m where lt is the series level at time t, bt is the slope at time t, st is the seasonal component of the series and m is the number of seasons in a year. The values of Pt , Qt , Rt and Tt vary according to which of the cells the method belongs, and α, β, γ and φ are constants. For example, for the (N-N) method we get Pt = Yt , Qt = lt−1 , φ = 1 and Ft+h = lt . Rewriting these equations in their error-correction form, we get lt = Qt + α(Pt − Qt ) bt = φbt−1 + β(Rt − bt−1 ) st = st−m + γ(Tt − st−m ) Setting α = 0 we get the method with fixed level (constant over time), setting β = 0 we get the method with fixed trend, and the method with fixed seasonal pattern is obtained by setting γ = 0. Hyndman et al. [2008] extended the work of Ord et al. [1997] (OKS) in SSOE to cover all the methods in the classification of the ES and obtained two models, one with additive error and the other one with multiplicative errors giving the same forecasts but different prediction intervals. The general OKS framework involves a state vector Xt and state space equations of the form Yt = h(Xt−1 ) + k(Xt−1 )t Xt = f (Xt−1 ) + g(Xt−1 )t where {t } is a Gaussian white noise process with mean zero and variance σ 2 . Defining (lt , bt , st , st−1 , .., st−(m−1) ), et = k(Xt−1 )t and µt = h(Xt−1 ), we get Yt = µt + et For example, in the (N-N) method we get µt = lt−1 and lt = lt−1 + αt . Note, the model with additive errors is written Yt = µt + t where µt = F(t−1)+1 is the one-step ahead forecast at time t − 1, so that k(Xt−1 ) = 1. The t) model with multiplicative errors is written as Yt = µt (1 + t ) with k(Xt−1 ) = µt and t = µett = (Ytµ−µ which is t a relative error. Note, the multiplicative error models are not well defined if there are zeros or negative values in the data. Further, we should not consider seasonal methods if the data are not quarterly or monthly (or do not have some other seasonal period). 245 Quantitative Analytics Model parameters are usually estimated with the maximum likelihood function (see Section (3.3.2.2)) while the Akaike Information Criterion (AIC) (Akaike [1973]) and the bias-corrected version (AICC) (Hurvich et al. [1989]) are standard procedures for model selection (see Appendix (??)). The use of the OKS enables easy calculation of the likelihood as well as model selection criteria such as the AIC. We let L∗ be equal to twice the negative logarithm of the conditional likelihood function L∗ (θ, X0 ) = n log n X t=1 n X e2t + 2 log |k(xt−1 )| k 2 (xt−1 ) t=1 with parameters θ = (α, β, γ, φ) and initial states X0 = (l0 , b0 , s0 , s−1 , .., s−m+1 ). They can be estimated by minimising L∗ . Estimates can also be obtained by minimising the one-step MSE, the one-step MAPE, the residual variance σ 2 or by using other criterions measuring forecast error. Models are selected by minimising the AIC among all the ES methods AIC = L∗ (θ̂, X̂0 ) + 2p where p is the number of parameters in θ, and θ̂ and X̂0 are the estimates of θ and X0 . Note, the AIC penalises against models containing too much parameters, and also provides a method for selecting between the additive and multiplicative error models because it is based on likelihood and not a one-step forecasts. Given initial values for the parameters θ and following a heuristic scheme for the initial state X0 , bla obtained a robust automatic forecasting algorithm (AFA) • For each series, we apply the appropriate models and optimise the parameters in each case. • Select the best model according to the AIC. • Produce forecasts using the best model for a given number of steps ahead • to obtain prediction intervals, we use a bootstrap method by simulating 5000 future sample paths for {Yn+1 , .., Yn+h } and finding the α2 and 1 − α2 percentiles of the simulated data at each forecasting horizon. The sample paths are generated by using the normal distribution for errors (parametric bootstrap) or by using the resampled errors (ordinary bootstrap). Application of the AFA to the M and M 3 competition data showed that the methodology was very good at short term forecasts (up to about 6 periods ahead). 5.7.6 Random coefficient state space model Gardner [2009] considered a damped linear trend model with additive errors with ES point equations given by yt = lt−1 + φbt−1 + t lt = lt−1 + φbt−1 + (1 − α)t bt = φbt−1 + (1 − β)t (5.7.12) where {yt } is the observed series, {lt } is its level, {bt } is the gradient of the linear trend, and {t } is the single source of error. Note, these notations are slightly different from the ones in Section (5.7.5) to simplify some of the results. In the special case where φ = 1 we recover the linear trend model corresponding to the ARIM A(0, 2, 2) model (1 − B)2 yt = t − (α + β)t−1 + αt−2 where the gradient of the trend is a random walk. Otherwise for φ 6= 1 we get the ARIM A(1, 1, 2) model 246 Quantitative Analytics (1 − φB)(1 − B)yt = t − (α + φβ)t−1 + φαt−2 where the gradient of the trend follows an AR(1) process, and as a result, changes in a stationary way. With φ close to 1 the linear trend is highly persistent, but as φ moves away from 1 towards zero the trend becomes weakly persistent, and for φ = 0 there is absence of a linear trend. Consequently, we can interpret φ as a direct measure of the persistence of the linear trend. In order to assume a locally constant model (Brown), Gardner postulated that we can consider the linear trend model (φ = 1) with a revised gradient each time the local segment of the series changes in a sudden way. He modelled the revision gradient as bt = At bt−1 + (1 − β)t where {At } is a sequence of i.i.d. binary random variates with P (At = 1) = φ and P (At = 0) = (1 − φ). In the case of a strongly persistent trend the sequence {At } will consist of long runs of 1s interrupted by occasional 0s and vice versa if not persistent. We get a mixture when phi is between 0 and 1 with mean length of such runs given by φ (1−φ) . We obtain the random coefficient state space model by replacing φ with At in the above Equation (5.7.12) and setting (α∗ , β ∗ ) to distinguish from the two models. We get a stochastic mixture of two well known forms, the ARIM A(0, 2, 2) with probability φ and the ARIM A(0, 1, 1) with probability (1 − φ). Gardner [2009] proved that the forecasts in the standard damped trend model as well as the ones in the random coefficient state-space model are optimal, with the same parameter value φ, but with different values of α and β. That is, the damped trend forecasts are also optimal for such a more general and broader class of models. This reasoning can be applied to similar models with linear trend component such as the additive seasonal model or linear trend models with multiplicative errors. 247 Chapter 6 Filtering and forecasting with wavelet analysis 6.1 Introducing wavelet analysis 6.1.1 From spectral analysis to wavelet analysis 6.1.1.1 Spectral analysis We presented in Section (4.3) the basic principles of trend filtering in the time domain and argued that filtering in the frequency domain was more appropriate. That is, another way of estimating the trend xt in Equation (4.3.10) is to denoise the signal yt by using spectral analysis. Fourier analysis (see details in Appendix (F.1)) uses sum of sine and cosine at different wavelengths to express almost any given periodic function, and therefore any function with a compact support. We can use the Fourier transform, which is an alternative representation of the original signal yt , expressed by the frequency function y(w) = n X yt e−iwt t=1 where y(w) = F(y) with w a frequency, and such that y = F −1 (y) with F −1 the inverse Fourier transform. Given the sample {y0 , .., yn−1 } of a time series, and assuming that the mean has been removed before the analysis, from the Parseval’s theorem for the discrete Fourier transform, it follows that the sample variance of {yt } is s2 = n−1 n−1 1X 1X 2 yt = |y(wj )|2 n t=0 n j=0 n 1 where y(w) is the discrete Fourier transform of {yt } and wj = 2πj n for j = 0, 1, .., [ 2 ] are the Fourier frequencies. Hence, the variance of the series can be decomposed into contributions given by a set of frequencies. The expression 1 2 n |y(wj )| , as a function of wj , is the periodogram of the series, which is an estimator of the true spectrum f (w) of the process, providing an alternative way of looking at the series in the frequency domain rather than in the time domain. If the spectrum of the series peaks at the frequency w0 , it can be concluded that in its Fourier decomposition the component with the frequency w0 accounts for a large part of the variance of the series. Hence, denoising in spectral analysis consists in setting some coefficients y(w) to zero before reconstructing the signal. Selected parts of the frequency spectrum can be manipulated by filtering tools, some can be attenuated and others may be completely 1 [x] denotes the integer part of x. 248 Quantitative Analytics removed. Hence, a smoothing signal can be generated by applying a low-pass filter, that is, by removing the higher frequencies. However, while the Fourier analysis remains an important mathematical tool in many fields of science, the decomposition of a function into simple harmonics of the form Aeinw has some drawbacks. One problem with the Fourier transform is the bad time location for low frequency signals and the bad frequency location for the high frequency signals making it difficult to localise when the trend (located in low frequencies) reverses. That is, the Fourier representation of local events related to a series requires many terms of the form Aeinw . Hence, the nonlocal characteristic of sine and cosine implies that we can only consider stationary signals along the time axis (see Oppenheim et al. [2009]). Even though various methods for time-localising a Fourier transform have been proposed to avoid this problem, such as windowed Fourier transform, the real improvement comes with the development of wavelet theory. 6.1.1.2 Wavelet analysis Wavelets are the building blocks of wavelet transformations (WT) in the same way that the functions einx are the building blocks of the ordinary Fourier transformation. Haar [1910] constructed the first known wavelet basis by showing that any continuous function f (y) on [0, 1] could be approximated by a series of step functions. Later, Grossmann et al. [1984] introduced Wavelet transform in seismic data analysis, as a solution for analysing time series in terms of the time-frequency dimension. They are defined over a finite domain, localised both in time and in scale, allowing for the data to be described into different frequency component for individual analysis. Wavelets can be (or almost can be) supported on an arbitrarily small closed time interval, making them a very powerful tool in dealing with phenomena rapidly changing in time. A wavelet basis is made of a father wavelet representing the smooth baseline trend and a mother wavelet that is dilated and shifted to construct different level of detail. At high scales, the wavelets have small time support, enabling them to zoom on details and short-lived phenomena. Their abilities to switch between time and scale allow them to escape the Heisenberg’s curse stating that one can not analyse both time and frequency with high accuracy. One can then separate signal trends and details using different levels of resolution or different sizes/scales of detail. That is, the transform generate a phase space decomposition defined by two parameters, the scale and location, as opposed to the Fourier decomposition. Several methods exists to compute the wavelet coefficients such as the cascade algorithm of Mallat [1989] and the low-pass and high-pass filters of order 6 proposed by Daubechies [1992]. In digital signal processing, Mallat [1989] discovered the relationship between quadrature mirror filters (QMF) and orthonormal wavelet bases leading to multiresolution analysis which builds on an iterative filter algorithm (pyramid algorithm). It is the cornerstone of the fast wavelet transform (FWT). The last important step in the evolution of wavelet theory is due to Daubechies [1988] who constructed consumer-ready wavelets with a preassigned degree of smoothness. Shensa [1992] clarified the relationship between discrete and continuous wavelet transforms, bringing together two separately motivated implementations of the wavelet transform, namely the algorithme a trous for non-orthogonal wavelets (see Holschneider et al. [1989] and Dutilleux [1989]) and the multiresolution approach of Mallat employing orthonormal wavelets. 6.1.2 The a trous wavelet decomposition A naive approach to obtaining a detailed picture of the underlying process would be to apply to the data a bank of filters with varying frequencies and widths. However, choosing the proper number and type of filters for this, is a very difficult task. Wavelet transforms (WT) provide a sound mathematical principles for designing and spacing filters, while retaining the original relationships in the time series. While the continuous wavelet transform (CWT) of a continuous function produces a continuum of scales as output, the output of a discrete wavelet transform (DWT) can take various forms. For instance, a triangle can be used as a result of decimation, or the retaining, of one sample out of every two, so that just enough information is kept to allow exact reconstruction of the input data (see details in Appendix (F.3)). Even though this approach is ideal for data compression, it can not simply relate information at a given time point at the different scales. Further, it is not possible to have shift invariance. We can get around this problem by means of a redundant, or, non-decimated wavelet transform, such as the a trous algorithm (see details in Appendix (F.4)). Since translation invariant wavelet transform can produce a good local representation of the signal 249 Quantitative Analytics both in the time domain and frequency domain, they have been used to preprocess the data (see Aussem et al. [1998], Gonghui et al. [1999]). We assume that a function f is known only through the time series {xt } consisting of discrete measurements at fixed intervals. We define the signal S0 (t) as the scalar product at samples t of the function f (x) with a scaling function φ(x) S0 (t) =< f (x), φ(x − t) > where the scaling function satisfies the dilation equation (F.3.17). There exists several ways of constructing a redundant discrete wavelet transform. For instance, we can consider that the successive resolution levels are • formed by convolving with an increasingly dilated wavelet function which looks like a Mexican hat (central bump, symmetric, two negative side lobes). • constructed by smoothing with an increasingly dilated scaling function looking like a Gaussian function defined on a fixed support (a B3 spline). • constructed by taking the difference between successive versions of the data which are smoothed in this way. In the a trous wavelet transform (see Shensa [1992]), the input data is decomposed into a set of band-pass filtered components, the wavelet details (or coefficients) plus a low-pass filtered version of the data called residual (or smooth). The smoothed data Sj (t), at a given resolution j and position t, is the scalar product x−t 1 < f (x), φ( j ) > 2j 2 j which corresponds to Equation (F.3.13) with m = j and n = t2 . It is equivalent to performing successive convolutions with the discrete lowpass filter h Sj (t) = Sj+1 (t) = ∞ X h(l)Sj (t + 2j l) l=−∞ where the finest scale is the original series S0 (t) = xt . The distance between levels increases by a factor 2 from one scale to the next. The name a trous (with holes) results from the increase in the distances between the sampled points (2j l). Hence, we can think of the successive convolutions as a moving average of 2j l increasingly distant points. 1 1 3 1 1 Here, smoothing with a B3 spline, the lowpass filter, h, is defined as 16 , 4 , 8 , 4 , 16 , which has compact support and is point symmetric. From the sequence of smoothed representations of the signal, we take the difference between successive smoothed versions, obtaining the wavelet details (or wavelet coefficients) dj (t) = Sj−1 (t) − Sj (t) which we can also, independently, express as 1 x−t < f (x), ψ( j ) > 2j 2 corresponding to the discrete wavelet transform for the resolution level j. The original data is then expanded (reconstructed) as dj (t) = x(t) = Sp (t) + p X dj (t) (6.1.1) j=1 for a fixed number of scales p. At each scale j, we obtain a set called wavelet scale, having the same number of samples as the original signal. 250 Quantitative Analytics Figure 6.1: Decomposing the original data with the a trous wavelet decomposition algorithm. 6.2 6.2.1 Some applications A brief review Wavelets are ideal for frequency domain analysis in time-series econometrics as their capability to simultaneously capture long-term movements and high frequency details are very useful when dealing with non-stationary and complex functions. They can also be used in connection with fractionally integrated process having long-memory properties. It was shown that when decomposing time series with long-term memory, the processes of wavelet coefficients at each scale lack this feature (see Soltani et al. [2000]), enhancing forecasting. Further, decomposing a time series into different scales may reveal details that can be interpreted on theoretical grounds and can be used to improve forecast accuracy. In the former, economic actions and decision making take place at different scales, and in the latter, forecasting seems to improve at the scale level as models like autoregressive moving average (ARMA) or neural networks can extract information from the different scales that are hidden in the aggregate. Using wavelet transform (WT) we can decompose a time series into a linear combination of different frequencies and then hopefully quantify the influence of patterns with certain frequencies at a certain time, thus, improving the quality of forecasting. For instance, Conejo et al. [2005] decomposed the time series into a sum of processes with different frequencies, and forecasted the individual time series before adding up the results. It is assumed that the motions on different frequencies follow different underlying processes and that treating them separately could increase the forecasting quality. As a result, several approaches have been proposed for time-series filtering and prediction by the wavelet transform (WT), based on neural networks (see Aussem et al. [1998], Zheng et al. [1999]), Kalman filtering (see Cristi et al. [2000]), AR and GARCH models (see Soltani et al. [2000], Renaud et al. [2002]). 251 Quantitative Analytics There exists different wavelet based forecasting methods such as using WT to eliminate noise in the data or to estimate the components in a structural time series model (STSM) (see Section (3.2.3.1)). Alternatively, we can perform the forecasting directly on the wavelet generated time series decomposition, or we can use locally stationary wavelet processes. We are going to discuss three wavelet based forecasting methods 1. Wavelet denoising: it is based on the assumption that a data set (Xt )t=1,..,T can be written as Xt = Yt + t where Yt is a deterministic function and t ∼ N (0, σ 2 ) is a white noise component. Reducing the noise via thresholding yields a modified Xt on which the standard forecasting methods can be applied (see Alrumaih et al. [2002]). More recently, tree-based wavelet denoising methods were developed in the context of image denoising, which exploit tree structures of wavelet coefficients and parent-child correlations. 2. Decomposition tool: we can also decompose the process Xt into components (STSM), such as Xt = Tt + It + t where Tt is a trend and It is a seasonality component, and we can do the forecasting by extrapolating from polynomial functions. For example, Wong et al. [2003] used the hidden periodicity analysis to estimate the trend and fitted an ARIM A(1, 0) to forecast the noise. 3. Forecasting wavelet coefficients: we can decompose the time series Xt with the wavelet coefficients T (a, b) with a ∈ A, b = 1, .., T where A denotes a scale discretisation. For each a, the corresponding vector T (a) = (T (a, 1), .., T (a, T )) is treated as a time series, and standard techniques like ARMA-based forecasting are 0 applied to obtain wavelet coefficient forecasts, which are subsequently added to the matrix T (a, b) (see Conejo et al. [2005]). Note, Renaud et al. [2002] [2005] only used specific coefficients for this forecast which is more 0 efficient but increases the forecasting error. The extended matrix T is then inverted and we yield a forecast X̂t+1 for the value Xt in the series. 6.2.2 Filtering with wavelets When filtering out white noise in spectral analysis, hard thresholding consists in setting equal to zero all coefficients in the frequency domain below a certain bandwidth. The filtered series are then transformed back into the time domain. While the method of denoising is the same as for the Fourier analysis, the estimation of the trend xt can be done in three steps 1. compute the wavelet transform T of the original signal yt to obtain the wavelet coefficients w = T (y) 2. modify the wavelet coefficients according to the denoising rule D, that is, w∗ = D(w) 3. convert the modified wavelet coefficients into a new signal using the inverse wavelet transform x = T −1 (w∗ ) Hence, to perform this method we first need to specify the mother wavelet, and then we must define the denoising rule. Wavelet shrinkage in statistics was introduced and explored in a series of papers by Donoho et al. [1995] [1995b]. It consists in shrinking the wavelet image of the original data set and returning the shrunk version of the data domain by the inverse wavelet transformation. This results in the original data being denoised or compressed. More specifically, given the thresholds w− and w+ two scalars with 0 < w− < w+ acting as tuning parameters of the wavelet shrinkage, Donoho et al. [1995] defined several shrinkage methods 252 Quantitative Analytics • Hard shrinkage: consists in setting to 0 all wavelet coefficients having an absolute value lower than a threshold w+ . wi∗ = wi I{|wi |>w+ } • Soft shrinkage: consists in replacing each wavelet coefficient by the value w∗ where wi∗ = sign(wi )(|wi | − w+ )+ where (x)+ = max (x, 0). • Semi-soft shrinkage 0 if |wi | ≤ w− ∗ sign(wi )(w+ − w− )−1 w+ (|wi | − w− ) if w− < |wi | ≤ w+ wi = wi if |wi | > w+ • Quantile shrinkage is a hard shrinkage method where w+ is the qth quantile of the coefficients |wi | Several thresholds as well as several thresholding policies have been proposed (see Vidakovic [1999]). The main advantage of wavelet shrinkage is that denoising is carried out without smoothing out sharp structures such as spikes and cusps. 6.2.3 Non-stationarity The hierarchical construction of wavelets means that non-stationary components of time series are absorbed by the lower scales, while non-lasting disturbances are captured by the higher scales, leading to the whitening property (see Vidakovic [1999]). For example, when generating a sample data from an ARIM A(2, 1, 1), the autocorrelation function shows almost no decay over 20 period, since the process contains a unit root. However, the autocorrelation of the differenced ARM A(2, 1) shows a drop after two periods. Computing the autocorrelation functions of the six highest layers of the original series decomposed with wavelet transform, the ninth scale resemble white noise, while scale six and four show autocorrelation at all included lags. 6.2.4 Decomposition tool for seasonality extraction One of the fundamental advantages of wavelet analysis is its capacity to decompose time series into different components. Forecasting is one of the reasons for decomposing a series, since it can be easier to forecast the components of the series than the whole series itself. Arino et al. [1995] used the scalogram to decompose the energy into level components in order to detect and separate periodic components in time series. To illustrate their approach, they considered two perfect periodic functions with different frequencies added up together. To filter each component of the combined signal, they used the scalogram and looked at how much energy was contained in each scale of the wavelet transform. Since two peakes were observed, they split the wavelet decomposition d of the time series {yt } into two new wavelet decompositions, d(1) and d(2) , such that the coefficients dj,k of d which are in level j close to the first (1) (2) peak are assigned to d(1) (dj,k = dj,k ). The corresponding coefficients in d2 are set to zero (dj,k = 0). The same is done for the coefficients close to the second peak. When a level occurs between the two peaks, the coefficients of that level split in two according to two different methods. In the first one, the split is additive with respect to energies but not with respect to wavelet coefficients (1) (2) (dj,k )2 = (dj,k )2 + (dj,k )2 It is not additive in the scale domain. In the second one, the split is additive with respect to wavlet coefficients but does not preserve energies 253 Quantitative Analytics (1) (2) dj,k = dj,k + dj,k Following the same approach, Schleicher [2002] illustrated the separation of frequency levels on two sine functions with different frequencies added up. It was done by adding up the squared coefficients in each scale to get a scalogram. Doing so, he observed two spikes, one at the third level and one at the sixth level. Since slow-moving, low frequency components are represented with larger support, he conjectured that level three represented the wavelet transform for function one, and that level six represented that for function two. To filter out function one, he kept only the first four levels and pad the rest of the wavelet transform to zeros, and then took the inverse transform. Conversely, levels five to nine for the second function were kept and pad the first four levels with zeros. As many economic data are likely generated as aggregates of different scales, separating these scales and analysing them individually provides interesting insights and can improve the forecasting accuracy of the aggregate series. Renaud et al. [2003] divided the original time series to multiresolution crystals and forecasted these crystals separately. The forecasts are combined to achieve an aggregate forecast for the original time series. Genacy et al. [2001a] investigated the scaling properties of foreign exchange rates using wavelet methods. They decomposed the variance of the process and found that FX volatilities can be described by different scaling laws on different horizons. Using the maximal overlap discrete wavelet transform (MODWT), Genacy et al. [2001b] constructed a method for seasonality extraction from a time series, which is free of model selection parameters, translationally invariant, and associated with a zero-phase filter. Following the same ideas, Genacy et al. [2003] [2005] proposed a new approach for estimating the systematic risk of an asset and found that the estimation of CAPM could be flawed due to the multiscale nature of risk and return. 6.2.5 Interdependence between variables Wavelets have been widely used to study interdependence of economic and financial time series. Genacy et al. [2001a] analysed the dependencies between foreign exchange markets and found an increase of correlation from intra-day scale towards the daily timescale stabilising for longer time scale. Fernandez [2005] studied the return spillovers in major stock markets on different time scales and concluded that G7 countries significantly affect global markets but that the reverse reaction is much weaker. Kim et al. [2005] [2006] have conducted many studies in finance using the wavelet variance, wavelet correlation and cross-correlation and found a positive relationship between stock returns and inflation on a scale of one month and 128 months, and a negative relationship between these scales. Studying the relationship between stock and futures markets with the MODWT based estimator of wavelet cross-correlation, In et al. [2006] found a feedback relationship between them on every scale, and correlation increasing with increasing time scale. 6.2.6 Introducing long memory processes We have seen earlier that it was important to differentiate between stationary I(0) and non-stationary I(1) processes. However, there exist another type of processes, the fractionally integrated I(d) processes, lying between the two sharpedged alternatives of I(0) and I(1). Long-memory processes, corresponding to d ∈ [0, 0.5], are processes with finite variance but autocovariance function decaying at a much slower rate than that of a stationary ARMA process. When d ∈ [0.5, 1], the variance becomes infinite, but the processes still return to their long-run equilibrium. A fractionally integrated process, I(d), can be defined as (1 − L)d y(t) = (t) where (t) is white noise or follows an ARMA process. Since long-memory processes have a very dense covariance matrix, direct maximum likelihood estimation is not feasible for large data sets, and one generally uses a nonparametric approach, which regress the log values of the periodigram on the log Fourier frequencies to estimate d (see Geweke et al. [1983] (GPH)). Alternatively, McCoy et al. [1996] found a log-linear relationship between the variance of the wavelet coefficients and its scale, and developed a maximum likelihood estimator. Jensen [1999] developed an ordinary least square (OLS) estimator based on the observation that for a mean zero I(d) process, |d| < 0.5, the 254 Quantitative Analytics wavelet coefficients, wjk (for scale j and translation k), are asymptotically normally distributed with mean zero and variance σ 2 2−2jd as j goes to zero. That is, the wavelet transform of these kind of processes have a sparse covariance matrix which can be approximated at high precision with a diagonal matrix, such that the calculation of the likelihood function is of an order smaller than calculations with the exact MLE methods. Taking logs, we can estimate d using the linear relationship ln R(j) = ln σ 2 − d ln 22j where R(j) is the sample estimate of the covariance in each scale. The wavelet estimators have a higher small-sample bias than the GPH estimator, but they have a mean-squared error about six times lower. 6.3 6.3.1 Presenting wavelet-based forecasting methods Forecasting with the a trous wavelet transform Knowing the individual time series resulting from the decomposition in Equation (6.1.1), several approaches exist to estimate xt+k , where k is a look-ahead period, from the observations xt , xt−1 , .., x1 . For instance, • if the residual vector Sp is sufficiently smooth, we can use a linear approximation of the data, or a carbon copy (xt → xt+k ) of it. • we can make independent predictions to the resolution scales di and Sp and use the additive property of the reconstruction equation to fuse predictions in an additive manner. • we can also test a number of short-memory and long-memory predictions at each resolution level, and retain the method performing best. Note, the symmetric property of the filter function does not support the fact that time is a fundamentally asymmetric variable. In prediction studies, very careful attention must be given to the boundaries of the signal. Assuming a time series of size N , values at times N, N − 1, N − 2, ... are of great importance. When handling boundary (or edge), any symmetric wavelet function is problematic, as we can not use wavelet coefficients estimated from unknown future data values. One way around is to hypothesise future data based on values in the nearest past. Further, for both symmetric and asymmetric functions, we have to use some variant of the transform to deal with the problem of edges. We can use the mirror or periodic border handling, or even the transformation of the border wavelets and scaling functions (see Cohen et al. [1992]). For instance, Aussem et al. [1998] chose the boundary condition S(N + k) = S(N − k) (6.3.2) and described a novel approach for time-varying data. Two types of feature were considered 1. Decomposition-based approach: wavelet coefficients at a particular time point were taken as a feature vector. 2. Scale-based approach: modelling and prediction were run independently at each resolution level, and the results were combined. They performed the feature selection with feature vector xt = {d1 (t), d2 (t), .., dp (t), Sp (t)}. Since they are using a wrap-around approach to defining the WT at the boundary region of the data, they considered data up to point t = t0 and used xt0 as a feature vector. The succession of feature vectors, xt0 , corresponding to successive values of t0 , is not the same as a single WT of the input data. While these special coefficients better represent the true wavelet coefficients, they do not sum to zero at each level. However, they do retain the additive decomposition property of the reconstruction equation, and they do not use unknown future data. The scale-based approach used the dynamic recurrent neural network (DRNN) which is endowed with internal memory using additional information 255 Quantitative Analytics on the past time series. They found that the wavelet coefficients at higher frequency levels (lower scales) provided some benefit for estimating variation at less high frequency levels. For instance, to model and predict at scale 2, the target value is d2 (t − 15), d2 (t − 14), .., d2 (t) combined with the input vector d1 (t − 15), d1 (t − 14), .., d1 (t). The use of d1 for prediction of d2 is of benefit, since the more noisy and irregular the data, the more demanding the prediction task, and the more useful the neural network. On the final smooth trend curve Sp (t), they found that the linear extrapolation Ŝp (t + 5) = Sp (t) + α(Sp (t) − Sp (t − 1)) with α = 5 performed better than the NN solution. They considered three performance criteria to test the forecasting method, the normalised mean squared error (NMSE), the directional symmetry (DS), and the direction variation symmetry (DVS) (see details in Section (3.2.2.3)). Recombining all wavelet estimates, they obtained 0.72 for NMSE, 0.73% for the DS, and 0.6% for the DVS. In conclusion, when forecasting, the features revealed by the individual wavelet coefficient series are meaningful when considered individually. However, when using wavelet coefficients at a given level to forecast the coefficient at the next level, we introduce positive correlation between the prediction residuals, and a single forecast error at a particular level can propagate, impacting the other predictors. Consequently, individual forecasts should be provided by different forecasting models to avoid output discrepancy correlation resulting from model misspecification. Further, the way to deal with the edge is problematic in prediction applications as it adds artifacts in the most important part of the signal, namely, its right border values. It is interesting to note that years later, Murtagh et al. [2003] did not recommend the use of this algorithm. 6.3.2 The redundant Haar wavelet transform for time-varying data Smoothing with a B3 spline to construct the a trous wavelet transform, as described above, is not appropriate for a directed (time-varying) data stream since future data values can not be used in the calculation of the wavelet transform. We could use the Haar wavelet transform due to the asymmetry of the wavelet function, but it is a decimated one. Alternatively, Zheng et al. [1999] developed a non-decimated, or redundant, version of this transform corresponding to the a trous algorithm discussed above, but with a different pair of scaling and wavelet functions. The non-decimated Haar algorithm uses the simple filter h = ( 21 , 12 ), which is non-symmetric, with l = −1, 0 in the a trous algorithm. We can then derive the (j + 1) wavelet resolution level from the (j) level by convolving the latter with h, getting Sj+1 (t) = 1 Sj (t − 2j ) + Sj (t) 2 and dj+1 (t) = Sj (t) − Sj+1 (t) Hence, at any point, t, we never use information after t when computing the wavelet coefficients (see Percival et al. [2000]), obtaining a computationally straightforward solution to the problem of boundary conditions at time point t. Since at a given time t and scale (j + 1) we need two values from the previous scale (j), namely Sj (t) and Sj (t − 2j ), the window length must be equal to 2j for scale (j). Further, the smooth data Sj (t) can be written as a moving average of the original signal as follow j 2 −1 1 X S0 (t − l) Sj (t) = j 2 l=0 This method has the following advantages • The computational requirement is O(N ) per scale, and in practice the number of scales is set as a constant. • Since we do not shift the signal, the wavelet coefficients at any scale j of the signal (X1 , .., Xt ) are strictly equal to the first t wavelet coefficients at scale j of the signal (X1 , .., XN ) for N > t. 256 Quantitative Analytics As a result, we get linearity in terms of the mapping of inputs defined by wavelet coefficients vis a vis the output target value. Note the following properties of the multiresolution transform • all wavelet scales are of zero mean • the smooth trend is generally much larger-valued than the max-min ranges of the wavelet coefficients 6.3.3 The multiresolution autoregressive model In order to capture short-range and long-range dependencies of time series, Renaud et al. [2002] proposed a multiresolution autoregressive (MAR) model to forecast time-series. They considered the non-decimated Haar a trous wavelet transform described in Section (6.1.2), and used a linear prediction based on some coefficients of the decomposition of the past values. We saw in the previous section that the window length in the Haar WT must be equal to 2j for scale (j), introducing redundancy. Hence, when selecting the number of coefficients at different scales, we should exclude these redundant points. After some investigation, Renaud et al. found that the wavelet and scaling function coefficients that should be used for the prediction at time N + 1 should have the form dj,N −2j (k−1) and SJ,N −2J (k−1) for positive value of k. For each N , this subgroup of coefficients is part of an orthogonal transform. We now want to allow for adaptivity in the numbers of wavelet coefficients selected from different resolution scales and used in the prediction. 6.3.3.1 Linear model Stationary process We let the window size at scale (j) be denoted Aj . Assuming a stationary signal X = Pp (X1 , .., XN ), the one-step forward prediction of an AR(p) process is X̂N +1 = k=1 φ̂k XN −(k−1) (see details in Section (5.3.1)). In order to use the wavelet decomposition in Equation (6.1.1), Renaud et al. modified the prediction to the AR multiscale prediction as X̂N +1 = Aj J X X AJ+1 âj,k dj,N −2j (k−1) + j=1 k=1 X âJ+1,k SJ,N −2J (k−1) k=1 where D = d1 , .., dJ , SJ represents the Haar a trous wavelet transform of X. Note, we have one AR(p) process per scale j = 1, .., J with {âj,k }1≤j≤J,1≤k≤Aj parameters for the details and {âJ+1,k }1≤k≤AJ+1 parameters for the residual. Put another way, if on each scale the lagged coefficients follow an AR(Aj ) process, the addition of the predictions on each level would lead to the same prediction formula than the above one. That is, the MAR prediction model is linear. In the special case where Aj = 1 for all resolution levels j, the prediction simplifies to X̂N +1 = J X âj dj,N + âJ+1 SJ,N j=1 PJ+1 In this model, we need to estimate the Q = j=1 Aj unkown parameters which we grouped in the vector α, so that 0 0 we can solve the equation A Aα = A S where A 0 0 L α S 0 0 = (LN −1 , .., LN −M ) = (d1,t , .., d1,t−2A1 , .., d2,t , .., d2,t−22 A2 , ..., dJ,t , .., dJ,t−2J AJ , SJ,t , ..., SJ,t−2J AJ+1 ) = (a1,1 , .., a1,A1 , a2,1 , .., a2,A2 , .., aJ,1 , .., aJ,Aj , .., aJ+1,1 , .., aJ+1,AJ+1 ) = (XN , .., Xt+1 , .., XN −M +1 ) 257 Quantitative Analytics where A is a Q × M matrix (M rows Lt , each with Q elements), α and S are respectively Q and M -size vectors, and Q is larger than M . Non-stationary process When a trend is present in the time-series, we use the fact that the multiscale decomposition automatically separates the trend from the signal. As a result, we can predict both the trend and the stochastic part within the multiscale decomposition. In general, the trend affects the low frequency components, while the high frequencies are purely stochastic. Hence, we separate the signal X into low (L) and high (H) frequencies, getting L = SJ and H = X − L = J X dj j=1 XN +1 = LN +1 + HN +1 In that setting, the signal H has zero-mean, and the MAR model gives ĤN +1 = Aj J X X aj,k dj,N −2j (k−1) j=1 k=1 and the estimation of the Q unkown parameters is as before, except that the coefficients S are not used in Li and that S is based on Ht+1 . Since L is very smooth, a polynomial fitting can be used for prediction, or one can use an AR process as for H. Since the frequencies are non-overlapping in each scale, one can select the parameters Aj independently on each scale with AIC, AICC, or BIC methods. Hence, the general method consists in fitting an AR model to each scale of the multiresolution transform. In the case where the true process is AR, thisforecasting procedure will converge to the optimal procedure, since it is asymptotically equivalent to the best forecast. 6.3.3.2 Non-linear model Note, Murtagh et al. [2003] generalised the MAR formula to the nonlinear case leading to a learning algorithm. Assuming a standard multilayer perceptron with a linear transfer function at the output node, and L hidden layer neurons, they obtained the following X̂N +1 = L X l=1 âl g Aj J X X AJ+1 âj,k dj,N −2j (k−1) + j=1 k=1 X âJ+1,k SJ,N −2J (k−1) k=1 where the sigmoidal function g(•) is used from the feedforward multilayer perceptron (see details in Section (13.3.1)). 6.3.4 The neuro-wavelet hybrid model Zhang et al. [2001] developed a neuro-wavelet hybrid system incorporating multiscale wavelet analysis into a set of neural networks for a multistage time series prediction. Their approach consists of some three stage prediction scheme. Considering a shift invariant WT, they used the autocorrelation shell representation (ASR) introduced by Beylkin et al. [1992] which we described in Appendix (F.4.3). Then, they performed the prediction of each scale of the wavelet coefficients with the help of a separate feedforward neural network. That is, the prediction results for the wavelet coefficients can either be directly combined from the linear additive reconstruction property of ASR, or, can be combined from another neural network (NN). The main goal of the latter being to adaptively choose the weight of each scale in the final prediction. For the prediction of different scale wavelet coefficients, they applied the Bayesian method of automatic relevance determination (ARD) to learn the different significance of a specific length of past window and wavelet scale. 258 Quantitative Analytics The additive form of reconstruction of the ASR allows one to combine the predictions in a simple additive manner. In order to deal with the boundary condition of using the most recent data to make predictions, Zhang et al. followed the approach proposed by Aussem et al. [1998] described in Section (6.3.1), and used a time-based a trous filters algorithm on the signal x1 , x2 , .., xN where N is the present time-point. The steps are as follow: 1. For index k sufficiently large, carry out the a trous transform in Equation (F.4.32) on the signal using a mirror extension of the signal when the filter extends beyond k (see Equation (6.3.2)). 2. Retain the coefficient values (details) as well as the residual values for the kth time point only, that is, Dk1 , Dk2 , .., Dkp , Skp . The summation of these values gives xk . 3. If k is less than N , set k to k + 1 and return to step 1). This process produces an additive decomposition of the signal xk , xk+1 , ..., xN , which is similar to the a trous wavelet transform decomposition on x1 , x2 , .., xN . However, as discussed in Section (6.3.1), the boundary condition in Equation (6.3.2) is not appropriate when forecasting financial data, as we can not use future data in the calculation of the wavelet transform. In general, the appropriate size for the time-window size of inputs of a regression problem is a difficult choice as there are many possible input variables, some of which may be irrelevant. This problem also applies to time series forecasting with neural networks (NN). Zhang et al. used the ARD method for choosing the length of past windows to train the NN. 6.4 6.4.1 Some wavelets applications to finance Deriving strategies from wavelet analysis Given the properties of time series in the frequency and scale domain, we can apply Fourier and wavelet analysis to perform pattern recognition and denoising around time series. As explained above, we want to statistically study wavelets coefficients in order to compare them. We choose to concentrate the information (energy) of market signal in a small number of coefficients at a certain scale. We therefore need to use a mother wavelet minimising the number of levels and coefficients containing significant information. We can apply wavelet analysis to forecast time series. By decomposing time series into different scales and adding up the squared coefficients within each level, we can measure the energy constant of each scale (power spectral density in the Fourier analysis). Using the properties of the multiscale analysis, we then decompose the time series into two series which we then forecast using an ARIMA model. The forecast of the original series is obtained by aggregating the forecast of the individual series. Combining wavelet analysis with other tools, such as Neural Network, has now gained wide acceptance in major scientific fields. To apply wavelet network, we first decompose the time series into different scales, and each scale is then used to train a recurrent neural network that will provide the forecast. Aggregating the results we recover the original signal. In both cases, wavelets are used to extract periodic information within individual scales which is used by other techniques. 6.4.2 Literature review Wavelet analysis can be used on financial time series which are typically highly nonstationary, exhibit high complexity and involve both (pseudo) random processes and intermittent deterministic processes. A good overview of the application of wavelets in economics and finance is given by Ramsey [1999]. Davidson et al. [1998] used the orthogonal dyadic Haar transform to perform semi-nonparametric regression analysis of commodity price behaviour. Ramsey 259 Quantitative Analytics et al. [1995] searched for evidence of self-similarity in the US stock market price index. Investigating the power law scaling relationship between the wavelet coefficients and scale, they found some evidence of quasi-periodicity in the occurrence of some large amplitude shocks to the system, concluding that there may be a modest amount of predictability in the data. Further, Ramsey et al. [1998] highlighted the importance of timescale decomposition in analysing economic relationships. Wavelet-based methods to remove hidden cycles from within financial time series have been developed by Arino et al. [1995] where they first decompose the signal into its wavelet coefficients and then compute the energy associated with each scale. Defining dominant scales as those with the highest energies, new coefficient sets are produced related to each of the dominant scales by either one of two methods developed by the authors. For the signal containing two dominant scales, two new complete sets of wavelet coefficients are computed which are used to reconstruct two separate signals, corresponding to each dominant scale. Arneodo et al. [1998] found evidence for a cascade mechanism in market dynamics attributed to the heterogeneity of traders and their different time horizons causing an information cascade from long to short timescales, the lag between stock market fluctuations and long-run movements in dividends, and the effect of the release (monthly, quaterly) of major economic indicators which cascades to fine timescales. Aussem et al. [1998] used wavelet transformed financial data as the input to a neural network which was trained to provide five-days ahead forecasts for the S&P 500 closing prices. They examined each wavelet series individually to provide separate forecasts for each timescale and recombined these forecasts to form an overall forecast. Ramsey et al. [1996] decomposed the S&P 500 index using matching pursuits and found data are characterised by periods of quiet interspersed with intense activity over short periods of time. They found that fewer coefficients were required to specify the data than for a purely random signal, signifying some form of deterministic structure to the signal. Ramsey et al. [1997] also applied matching pursuits to foreign exchange rate data sets, the Deutschmark-US dollar, yen-US dollar and yen-Deutschmark, and found underlying traits of the signal. Even though most of the energy of the system occored in localised burst of activity, they could not predict their occurence and could not improve forecasting. Combining wavelet transforms, genetic algorithms and artificial neural networks, Shin et al. [2000] forecasted daily Korean-US dollar returns one-day ahead of time and showed that the genetic-based wavelet thresholder outperformed cross-validation, best level and best bias. Gencay et al. [2001b] filtered out intraday periodicities in exchange rate time series using the maximal overlap discrete wavelet transform. 260 Part III Quantitative trading in inefficient markets 261 Chapter 7 Introduction to quantitative strategies The market inefficiency and the asymmetrical inefficiency of the long-only constraint in portfolio construction led some authors to revise the modern portfolio theory developed by Markowitz, Sharpe, Tobin and others. The notion of active, or benchmark-relative, performance and risk was introduced by Grinold [1989] [1994] and the source of excess risk-adjusted return for an investment portfolio was examined. 7.1 7.1.1 Presenting hedge funds Classifying hedge funds Due to the various ways of selecting and risk managing a portfolio (see details in Section (2.1)), there is a large number of Hedge Funds in the financial industry classified by the type of strategies used to manage their portfolios. Considering single strategies, we are going to list a few of them. • Macro: Macro strategies concentrate on forecasting how global macroeconomic and political events affect the valuations of financial instruments. The strategy has a broad investment mandate. With the ability to hold positions in practically any market with any instrument, profits are made by correctly anticipating price movements in global markets. • Equity Hedge: also known as long/short equity, combine core long holdings of equities with short sales of stock or stock index options and may be anywhere from net long to net short depending on market conditions. The source of return is similar to that of traditional stock picking on the upside, but the use of short selling and hedging attempts to outperform the market on the downside. • Equity Market Neutral: Using complex valuation models, equity market neutral fund managers strive to identify under/overvalued securities. Accordingly, they are long in undervalued positions while selling overvalued securities short. In contrast to equity hedge, equity neutral has a total net exposure of zero. The strategy intends to neutralise the effect that a systematic change will have on values of the stock market as a whole. • Relative Value: Generally, a relative value strategy makes Spread Trades in similar or related securities when their values, which are mathematically or historically interrelated, are temporarily distorted. Profits are derived when the skewed relationship between the securities returns to normal. • Statistical Arbitrage: As a trading strategy, statistical arbitrage is a heavily quantitative and computational approach to equity trading involving data mining and statistical methods, as well as automated trading systems. StatArb evolved out of the simpler pairs trade strategy, but it considers a portfolio of a hundred or more stocks, some long and some short, that are carefully matched by sector and region to eliminate exposure to beta and other risk factors. 262 Quantitative Analytics 7.1.2 Some facts about leverage 7.1.2.1 Defining leverage There are numerous ways leverage is defined in the investment industry, and there is no consensus on exactly how to measure it. Leverage can be defined as the creation of exposure greater in magnitude than the initial cash amount posted to an investment, where leverage is created through borrowing, investing the proceeds from short sales, or through the use of derivatives. Thus, leverage may be broadly defined as any means of increasing expected return or value without increasing out-of-pocket investment. There are three primary types of leverage 1. Financial Leverage: This is created through borrowing leverage and/or notional leverage, both of which allow investors to gain cash-equivalent risk exposures greater than those that could be funded only by investing the capital in cash instruments. 2. Construction Leverage: This is created by combining securities in a portfolio in a certain manner. The way one constructs a portfolio will have a significant effect on overall portfolio risk, depending on the amount and type of diversification in the portfolio, and the type of hedging applied (e.g., offsetting some or all of the long positions with short positions). 3. Instrument Leverage: This reflects the intrinsic risk of the specific securities selected, as different instruments have different levels of internal leverage. Leverage allows hedge funds to magnify their exposures and thus magnify their risks and returns. However, a hedge fund’s use of leverage must consider margin and collateral requirements at the transaction level, and any credit limits imposed by trading counterparties such as prime brokers. Therefore, hedge funds are often limited in their use of leverage by the willingness of creditors and counterparties to provide the leverage. 7.1.2.2 Different measures of leverage Leverage may be quoted as a ratio of assets to capital or equity (e.g., 4 to 1), as a percentage (e.g., 400%), or as an incremental percentage (e.g., 300%). The Gross Market Exposure is defined as Long + Short 100% Capital or Equity Gross Market Exposure = For example, Hedge Fund A has $1 million of capital, borrows $250, 000 and invests the full $1, 250, 000 in a portfolio of stocks (i.e., the Fund is long $1.25 million). At the same time, Hedge Fund A sells short $750, 000 of stocks. Then 1.25 + 0.75 2 100% = 100% = 200% 1 1 Many investors do not consider the 200% Gross Market Exposure in the above example to be leverage per se. For example, assume Hedge Fund A has capital of $1 million and is $1 million long and $1 million short. This results in Gross Market Exposure of 200%, but Net Market Exposure of zero, which is the typical exposure of an equity market-neutral fund. That is, the Net Market Exposure is defined as Gross Market Exposure = Net Market Exposure = Long − Short 100% Capital or Equity Given the previous example, the Net Market Exposure is 1.25 − 0.75 1/2 100% = 100% = 50% 1 1 One should ask hedge fund managers the following types of questions regarding leverage: Net Market Exposure = 263 Quantitative Analytics • Does the manager have prescribed limits for net market exposure and for gross market exposure? • What drives the decision to go long or short, and to use more or less leverage? • What leverage and net market exposure was used to generate the manager’s track record? • What is the attribution of return between security selection, market timing and the use of leverage? 7.1.2.3 Leverage and risk We must distinguish between the concepts of leverage and risk, as there is a common misconception that a levered asset is always riskier than an unlevered asset. In general, risk is defined by the portfolio’s stock market risk (beta), and when investors are confronted to several equity portfolios they have to identify the one with the greatest risk. Even though equity portfolios may have the same market risk, as each portfolio has the same aggregate beta, the key point is that the same risk level is achieved through different types of leverage. The relationship between risk and leverage is complex, in particular when comparing different investments, a higher degree of leverage does not necessarily imply a higher degree of risk. Leverage is the link between the underlying or inherent risk of an asset and the actual risk of the investor’s exposure to that asset. Thus, the investor’s actual risk has two components: 1. The market risk (beta) of the asset being purchased 2. The leverage that is applied to the investment For example, which is more risky: a fund with low net market exposure and borrowing leverage of 1.5 times capital, or a fund with 100% market exposure and a beta of 1.5 but no borrowing leverage? For a given capital base, leverage allows investors to build up a larger investment position and thus a higher exposure to specific risks. Buying riskier assets or increasing the leverage ratio applied to a given set of assets increases the risk of the overall investment, and hence the capital base. Therefore, if a portfolio has very low market risk then higher leverage may be more acceptable for these strategies than for strategies that have greater market exposure, such as long-short equity or global macro. In fact, a levered portfolio of low-risk assets may well carry less risk than an unlevered portfolio of high-risk assets. Therefore, investors should not concern themselves with leverage per se, but rather focus on the risk/return relationship that is associated with a particular portfolio construction. In this way, investors can determine the optimal allocation to a specific strategy in a diversified portfolio. 7.2 Different types of strategies 7.2.1 Long-short portfolio 7.2.1.1 The problem with long-only portfolio Some form of risk constraints are generally placed on fund managers by investors or fund administrators, such as sizeneutrality, sector neutrality, value-growth neutrality, maximum total number of positions and long-only constraints. Clarke et al. [2002] found that the long-only constraint is the most significant restriction placed on portfolio managers. While most investors focus on the management of long portfolios and the selection of winning securities, the identification of winning securities ignores by definition a whole class of losing securities. As explained in Section (2.1.1), excess returns come from active security weights, that is, portfolio weights differing from benchmark weights. An active long-only portfolio holds securities expected to perform above average at higher-than-benchmark weights and those expected to perform below average at lower-than-benchmark weights. Without short-selling, it can not underweight many securities by enough to achieve significant negative active weights. Hence, restricting short sales prevents managers from fully implementing their complete information set when constructing their portfolios. As explained by Jacobs et al. [1999], the ability to sell short frees the investor from taking advantage of the full array 264 Quantitative Analytics of securities and the full complement of investment insights by holding expected winners long and selling expected losers short. Active fund managers expresses their investment view on the assets in their investment universe by holding an over-, neutral or under-weight position (wa,i > 0, wa,i = 0, wa,i < 0) in these assets relative to their assigned benchmark wa,i = wf,i − wb,i where wa,i is the active weight in asset i, wf,i is the weight in asset i,and wb,i is the weight of the benchmark in asset i. Since the conventional long-only fund manager can only expand a negative position to the point of excluding the asset from the fund (wf,i ≥ 0), then the most negative active weight possible in any particular asset, in a long-only fund, is the negative of the asset’s benchmark weight (wa,i ≥ −wb,i ). It results in a greater scope for expressing positive investment views in each asset than negative views, leading to the asymmetry in the long-only active manager’s opportunity set. On the other hand, the unconstrained investor benefits from a symmetrical investment opportunity set with respect to implementing negative active investment weights. The extent to which the fund manager can expand a positive active weight is limited only by a particular mandate restrictions and the ability to finance the total positive active positions in the portfolio with sufficient negative positions in other assets. 7.2.1.2 The benefits of long-short portfolio The benefits of long-short portfolio are to a large extent dependent on proper portfolio construction, and only an integrated portfolio can maximise the value of investors’ insights. Much of the incremental cost associated with a given long-short portfolio reflects the strategy’s degree of leverage. Although most existing long-short portfolios are constructed to be neutral to systematic risk, neutrality is neither necessary nor optimal. Further, long-short portfolio do not constitute a separate asset class and can be constructed to include a desired exposure to the return of any existing asset class. Long-short portfolio should not be considered as a two portfolio strategy but as a one portfolio strategy in which the long and short positions are determined jointly within an optimisation that takes into account the expected returns of the individual securities, the standard deviations of those returns, and the correlations between them, as well as the investor’s tolerance for risk (see Jacobs et al. [1995] and [1998]). Within integrated optimisation, there is no need to converge to securities’ benchmark weights in order to control risk. Rather, offsetting long and short positions can be used to control portfolio risk. For example, if an investor has some strong insight about oil stocks, some of which are expected to do very well and some other very poorly, he does not need to restrict weights to index-like weights and can allocate much of the portfolio to oil stocks. The offsetting long and short positions control the portfolio’s exposure to the oil factor. On the other hand, if he has no insights into oil stock behaviour, the long-short investor can totally exclude oil stocks from the portfolio. The risk is not increased because in that setting it is independent of any security’s benchmark weight. The absence of restrictions imposed by securities’s benchmark weights enhances the long-short investor’s ability to implement investment insights. An integrated optimisation that considers both long and short positions simultaneously, not only frees the investor from the non-negativity constraint imposed on long-only portfolios, but also frees the long-short portfolio from the restrictions imposed by securities’s benchmark weights. To see this we follow Jacobs et al. [1999] and consider an obvious (suboptimal) way of constructing a long-short portfolio. To do so, we combine a long-only portfolio with a short-only portfolio resulting in a long-plus-short portfolio and not a true long-short portfolio. The long side of this portfolio being identical to a long-only portfolio, it offers no benefits in terms of incremental return or reduced risk. Further, the short side is statistically equivalent to the long side, hence to the long-only portfolio. In effect, assuming symmetry of inefficiencies across attractive and unattractive stocks, and, assuming identical and separate portfolio construction for the long and short sides, we get αL = αS = αLO σe,L = σe,S = σe,LO 265 Quantitative Analytics where αl for l = L, S, LO is the alpha of the long, short, and long-only portfolio, and σe,l for l = L, S, LO is the residual risk of the respective portfolios. The excess return, or alpha, of the long side of the long-plus-short portfolio will equal the alpha of the short side, which will equal the alpha of the long-only portfolio. This is also true of the residual risk σe . It means that all the three portfolios are constructed relative to a benchmark index. Each portfolio is active in pursuing excess return relative to the underlying index only insofar as it holds securities in weights that depart from their index weights. This portfolio construction is index-constrained. Assuming that the beta of the short side equals the beta of the long side, the ratio of the performance of the long-plus-short portfolio to that of the long-only portfolio can be expressed as s 2 IRL+S = IRLO 1 + ρL+S where the information ratio IR is a measure of risk-adjusted outperformance. It is the ratio of excess return over the benchmark divided by the residual risk (tracking error) 1 α (7.2.1) σe and ρL+S is the correlation between the alphas of the long and short sides of the long-plus-short portfolio. Hence, the advantage of a long-plus-short portfolio is curtailed by the need to control risk by holding or shorting securities in index-like weights. Benefits only apply if there is a less-than-one correlation between the alphas of its long and short sides. In that case, the long-plus-short portfolio will enjoy greater diversification and reduced risk relative to the long-only portfolio. IR = Advocates of long-short portfolios also point to the diversification benefits provided by the short side. According to them, a long-short strategy includes a long and a short portfolio; if the two portfolios are uncorrelated, the combined strategy would have a higher information ratio than the two separate portfolios as a result of diversification. Jacobs et al. [1995] addressed the diversification argument by observing that long and short alphas are not separately measurable in an integrated long-short optimisation framework. They suggested that the correlation between the separate long and short portfolios is not relevant. More recently, the centre stage of the long-short debate has focused on whether efficiency gains result from relaxing the long-only constraint. Grinold et al. [2000] showed that information ratios decline when one moves from a long-short to a long-only strategy. 7.2.2 Equity market neutral An investment strategy or portfolio is considered market-neutral if it seeks to entirely avoid some form of market risk, typically by hedging. A portfolio is truly market-neutral if it exhibits zero correlation with the unwanted source of risk, and it is seldom possible in practice. Equity market-neutral is a hedge fund strategy that seeks to exploit investment opportunities unique to some specific group of stocks while maintaining a neutral exposure to broad groups of stocks defined, for example, by sector, industry, market capitalisation, country, or region. The strategy holds long-short equity positions, with long positions hedged with short positions in the same and related sectors, so that the equity market-neutral investor should be little affected by sector-wide events. For example, a hedge fund manager will go long in the 10 biotech stocks that should outperform and short the 10 biotech stocks that will underperform. Therefore, what the actual market does will not matter (much) because the gains and losses will offset each other. Equivalently, the process of stock picking can be realised with complex valuation models. This places, in essence, a bet that the long positions will outperform their sectors (or the short positions will underperform) regardless of the strength of the sectors. As an example, a delta neutral strategy describes a portfolio of related financial securities, in which the portfolio value remains unchanged due to small changes in the value of the underlying security. The term delta hedging is the 1 The tracking error refers to the standard deviation of portfolio returns against the benchmark return. Hence, risk refers to the deviation of the portfolio returns from the benchmark returns. 266 Quantitative Analytics process of setting or keeping the delta of a portfolio as close to zero as possible. It may be accomplished by buying or selling an amount of the underlier that corresponds to the delta of the portfolio. By adjusting the amount bought or sold on new positions, the portfolio delta can be made to sum to zero, and the portfolio is then delta neutral (see Wilmott et al. [2005]). Another example is the pairs trade or pair trading which corresponds to a market neutral trading strategy enabling traders to profit from virtually any market conditions: uptrend, downtrend, or sideways movement. This strategy is categorised as a statistical arbitrage and convergence trading strategy. The pair trading was pioneered by Gerry Bamberger and later led by Nunzio Tartaglia’s quantitative group at Morgan Stanley in the early to mid 1980s (see Gatev et al. [2006], Bookstaber [2007]). The idea was to challenge the Efficient Market Hypothesis and exploit the discrepancies in the stock prices to generate abnormal profits. The strategy monitors performance of two historically correlated securities. When the correlation between the two securities temporarily weakens, that is, one stock moves up while the other moves down, the pairs trade would be to short the outperforming stock and to long the underperforming one, betting that the spread between the two would eventually converge. There are many ways in which to invest in market neutral strategies, all of which seek to take systematic risk out of the investment equation. Among the most common market neutral approaches is long-short equity. Long-short equity investing has several benefits. The strategy is uncorrelated to other asset classes. The alpha generated by long-short managers is uncorrelated to the alpha generated by index equity managers. Moreover, the alpha generated by longshort managers has low correlation to one another providing an excellent diversifying strategy. Long-short equity also provides flexibility in asset allocation and rebalancing due to the portability of the alpha generated by long-short equity and, moreover, market neutral in general. Over the longer term, long-short equity investing should provide attractive risk adjusted returns as well as greater diversification and flexibility within investment programs. A portfolio which appears to be market-neutral may exhibit unexpected correlations as market conditions change leading to basis risk. Equity market-neutral managers recognise that the markets are dynamic and take advantage of sophisticated mathematical techniques to explore new opportunities and improve their methodology. The fact that there are many different investment universes globally makes this strategy less susceptible to alpha decay. The abundance of data lends itself well to rigorous back-testing and the development of new algorithms. 7.2.3 Pairs trading We saw in Section (7.2.2) that Equity Market Neutral is not just a single trading strategy, but it is an umbrella term used for a broad range of quantitative trading strategies such as pairs trading. Pairs trading is one of Wall Street’s quantitative methods of speculation which dates back to the mid-1980s (see Vidyamurthy [2004]). Market neutral strategies are generally known for attractive investment properties, such as low exposure to the equity markets and relatively low volatility. The industry practice for market neutral hedge funds is to use a daily sampling frequency and standard cointegration techniques 2 to find matching pairs (see Gatev et al. [2006]). The general description of the technique is that a pair of shares is formed, where the investor is long one share and short another share. The rational is that there is a long-term equilibrium (spread) between the share prices, and thus the share prices fluctuate around that equilibrium level (the spread has a constant mean). The investor evaluates the current position of the spread based on its historical fluctuations and when the current spread deviates from its historical mean by a pre-determined significant amount (measured in standard deviations), the spread is subsequently altered and the legs are adjusted accordingly. Studying the effectiveness of this type of strategy, Gatev et al. [2006] conducted empirical tests on pair trading using common stocks and found that the strategy was profitable even after taking the transaction costs into account. Jurek et al. [2007] improved performance by deriving a mean reversion strategy. Investigating the usefulness of pair trading applied to the energy futures market, Kanamura et al. [2008] obtained high total profits due to strong mean reversion and high volatility in the energy markets. 2 Cointegration is a quantitative technique based on finding long-term relations between asset prices introduced in a seminal paper by Engle and Granger [1987]. Another approach was developed by Johansen [1988], which can be applied to more than two assets at the same time. The result is a set of cointegrating vectors that can be found in the system. If one only deals with pairs of shares, it is preferable to use the simpler Engle and Granger [1987] methodology. 267 Quantitative Analytics In practice, the investor bets on the reversion of the current spread to its historical mean by shorting/going long an appropriate amount of each share in pair. That amount is expressed by the variable beta, which tells the investor the number of the shares X he has to short/go long, for each 1 share Y. There are various ways of calculating beta, it can either be fixed, or it can be time-varying. In the latter, one can use rolling ordinary least squares (OLS) regression, double exponential smoothing prediction (DESP) model and the Kalman filter. As an example, Dunis and Shannon [2005] use time adaptive betas with the Kalman filter methodology (see Hamilton [1994] or Harvey [1989] for a detailed description of the Kalman filter implementation). It is a forward looking methodology, as it tries to predict the future position of the parameters as opposed to using a rolling OLS regression (see Bentz [2003]). Later, Dunis et al. [2010] applied a long-short strategy to compare the profit potential of shares sampled at 6 different frequencies, namely 5-minute, 10-minute, 20-minute, 30-minute, 60-minute and daily sampling intervals. They considered an approach enhancing the performance of the basic trading strategy by selecting the pairs for trading based on the best in-sample information ratios and the highest in-sample t-stat of the Augmented Dickey-Fuller (ADF) unit root test of the residuals of the cointegrating regression sampled a daily frequency. As described by Aldridge [2009] one advantage of using the high-frequency data is higher potentially achievable information ratio compared to the use of daily closing prices. Assuming the pairs belong to the same industry, we follow the description given by Dunis et al. calculate the spread between two shares as [2010] and Zt = PtY − βt PtX where Zt is the value of the spread at time t, PtY is the price of share Y at time t, PtX is the price of share X at time t, and βt is the adaptive coefficient beta at time t. In general, the spread is normalised by subtracting its mean and dividing by its standard deviation. The mean and the standard deviation are calculated from the in-sample period and are then used to normalise the spread both in the in- and out-of-sample periods. Dunis et al. sell (buy) the spread when it is 2 standard deviations above (below) its mean value and the position is liquidated when the spread is closer than 0.5 standard deviation to its mean. They chose the investment to be money-neutral, so that the amounts of euros to be invested on the long and short side of the trade is the same. They did not assume rebalancing once they entered into the position. Therefore, after an initial entry into the position with equal amounts of euros on both sides of the trade, even when due to price movements both positions stop being money-neutral, they did not rebalance the position. Only two types of transactions were allowed, entry into a new position, and total liquidation of the position they were in previously. Dunis et al. [2010] explained the different indicators calculated in the in-sample period, trying to find a connecting link with the out-of-sample information ratio and as a consequence proposed a methodology for evaluating the suitability of a given pair for arbitrage trading. All the indicators are calculated in the in-sample period. The objective being to find the indicators with high predictive power of the profitability of the pair in the out-of-sample period. According to Do et al. [2006], the success of pairs trading depends heavily on the modelling and forecasting of the spread time series. For instance, the Ornstein-Uhlenbeck (OU) equation can be used to calculate the speed and strength of mean reversion dZt = k µ − Zt dt + σdWt where µ is the long-term mean of the spread, Zt is the value of the spread at particular point in time, k is the strength of mean reversion, and σ is the standard deviation. The parameters of the process are estimated on the in-sample spread. This SDE is just the supplementary equation from which we calculate the half-life of mean reversion of the pairs. The half-life of mean reversion in number of periods can be calculated as ln 2 k Intuitively speaking, it is half the average time the pair usually takes to revert back to its mean. Thus, pairs with low half-life should be preferred to high half-lives by traders. The information ratio (IR) gives us an idea of the quality k 12 = − 268 Quantitative Analytics of the strategy. An annualised information ratio of 2 means that the strategy is profitable almost every month, while strategies with an information ratio around 3 are profitable almost every day (see Chan [2009]). In the case of intraday trading, the annualised information ratio is Rp hd × 252 σ where hd is the number of hours traded per day (for a day hd 6= 24). However, it overestimates the true information ratio if returns are autocorrelated (see Alexander [2008]). MIR = Pairs trading is not a risk-free strategy as the difficulty comes when prices of the two securities begin to drift apart, that is, the spread begins to trend instead of reverting to the original mean. Dealing with such adverse situations requires strict risk management rules, which have the trader exit an unprofitable trade as soon as the original setup, a bet for reversion to the mean, has been invalidated. This can be achieved by forecasting the spread and exiting at forecast error bounds. Further, the market-neutral strategies assume that the CAPM model is valid and that beta is a correct estimate of systematic risk. If this is not the case, the hedge may not properly protect us in the event of a shift in the markets. In addition, measures of market risk, such as beta, are historical and could vary from their past behaviour and become be very different in the future. Hence, in a mean reversion strategy where the mean is assumed to remain constant, then a change of mean is referred to as drift. 7.2.4 Statistical arbitrage Statistical arbitrage (abbreviated as Stat Arb) refers to a particular category of hedge funds based on highly technical short-term mean-reversion strategies involving large numbers of securities (hundreds to thousands, depending on the amount of risk capital), very short holding periods (measured in days to seconds), and substantial computational, trading, and information technology (IT) infrastructure. As a trading strategy, statistical arbitrage is a heavily quantitative and computational approach to equity trading involving data mining and sophisticated statistical methods and mathematical models, as well as automated trading systems to generate a higher than average profit for the traders. StatArb evolved out of the simpler pairs trade strategy (see Section (7.2.3)), but it considers a portfolio of a hundred or more stocks, some long and some short, that are carefully matched by sector and region to eliminate exposure to beta and other risk factors. Broadly speaking, StatArb is actually any strategy that is bottom-up, beta-neutral in approach and uses statistical/econometric techniques in order to provide signals for execution. The mathematical concepts used in Statistical Arbitrage range from Time Series Analysis, Principal Components Analysis (PCA), Co-integration, neural networks and pattern recognition, covariance matrices and efficient frontier analysis to advanced concepts in particle physics such as free energy and energy minimisation. Signals are often generated through a contrarian mean-reversion principle, but they can also be designed using such factors as lead/lag effects, corporate activity, short-term momentum, etc. This is usually referred to as a multi-factor approach to StatArb. Because of the large number of stocks involved, the high portfolio turnover and the fairly small size of the effects one is trying to capture, the strategy is often implemented in an automated fashion and great attention is placed on reducing trading costs. As an example, an automated portfolio may consists of two phases. In the scoring phase, each stock in the market is assigned a numeric score or rank reflecting its desirability; high scores indicate stocks that should be held long and low scores indicate stocks that are candidates for shorting. The details of the scoring formula vary and are highly proprietary, but, generally (as in pairs trading), they involve a short term mean reversion principle so that stocks having done unusually well in the past week receive low scores and stocks having underperformed receive high scores. In the second or risk reduction phase, the stocks are combined into a portfolio in carefully matched proportions so as to eliminate, or at least greatly reduce, market and factor risk. Statistical arbitrage is subject to model weakness as well as stock or security-specific risk. The statistical relationship on which the model is based may be spurious, or may break down due to changes in the distribution of returns 269 Quantitative Analytics on the underlying assets. Factors, which the model may not be aware of having exposure to, could become the significant drivers of price action in the markets, and the inverse applies also. The existence of the investment based upon model itself may change the underlying relationship, particularly if enough entrants invest with similar principles. The exploitation of arbitrage opportunities themselves increases the efficiency of the market, thereby reducing the scope for arbitrage, so continual updating of models is necessary. Further, StatArb has developed to a point where it is a significant factor in the marketplace, that existing funds have similar positions and are in effect competing for the same returns. 7.2.5 Mean-reversion strategies Mean reversion strategies have been very popular since 2009. They have performed exceptionally well for the past 10 years, performing well even during the 2008-09 bear market. Different versions have been popularised, notably by Larry Connors and Cezar Alvarez (David Varadi, Michael Stokes). Some of the indicators used are • the RSI indicator (Relative Strength Index) • a short term simple moving average • the boillinger bands The concept is the same: If price moved up today, it will tend to revert (come down) tomorrow. Example on RSI (on GSPC index): Analysing data since 1960, for the last 10 years (2000-2010) the market has changed and has become mean reverting: buy on oversold and sell on overbought. Mean-reverting strategies have not performed as well starting 2010. Let’s say we traded the opposite strategy. Buy if short term RSI is high, sell if it’s low (trend). As expected, it does well up to 2000, then it’s a disaster. 7.2.6 Adaptive strategies An adaptive strategy depends on a Master Strategy and some Allocation Rules: 1. Master Strategy • Instead of deciding on which RSI period and thresholds (sample sizes) to use, we use 6 different versions (RSI(2), RSI(3) and RSI(4), each with different thresholds). • One Non-Mean-Reverting strategy: If RSI(2) crosses 50 up then buy. If it crosses below, sell 2. Allocation Rules • We measure risk adjusted performance for the last 600 bars for each of the 7 strategies. • The top 5 get allocated capital; Best gets 50% of account to trade with, then 2nd gets 40%, 3rd gets 30% etc. Total allocation is 150%, meaning if all strategies were trading we would have to use 1.5x leverage. Based on the previous example, up to 2002 the system takes positions mostly in the trend following strategy while starting as early as 1996 mean-reverting strategies start increasing positions and eventually take over by 2004. There is a 3 year period (2000-2003) of continuous draw-down as the environment changes and the strategy tries to adapt. Notice that the trend-following RSI strategy (buy on up, sell on down) briefly started traded in August 2011, after being inactive for 9 years. 270 Quantitative Analytics 7.2.7 Constraints and fees on short-selling Many complications are related to the use of short-selling in the form of constraints and fees. For instance, a pair trading strategy requiring one to be long one share and short another, is called self-financing strategy (see Alexander et al. [2002]). That is, an investor can borrow the amount he wants to invest, say from a bank, then to be able to short a share, he deposits the borrowed amount with the financial institution as collateral and obtains borrowed shares. Thus, the only cost he has to pay is the difference between borrowing interest rates paid by the investor and lending interest rates paid by the financial institution to the investor. Subsequently, to go short a given share, the investor sells the borrowed share and obtains cash in return. From the cash he finances his long position. On the whole, the only cost is the difference between both interest rates (paid vs. received). A more realistic approach is the situation where an investor does not have to borrow capital from a bank in the beginning (e.g. the case of a hedge fund that disposes of capital from investors) allows us to drop the difference in interest rates. Therefore, a short position would be wholly financed by an investor. However, in that case the investor must establish an account with a prime broker who arranges to borrow stocks for short-selling. The investor may be subject to buy-in and have to cover the short positions. The financial intermediation cost of borrowing including the costs associated with securing and administrating lendable stocks averages 25 to 30 basis points. This cost is incurred as a hair-cut on the short rebate received from the interest earned on the short sale proceeds. Short-sellers may also incur trading opportunity costs because exchange rules delay or prevent short sales. For example, dealing with the 50 most liquid European shares, we can consider conservative total transaction costs of 0.3% one-way in total for both shares (see Alexander et al. [2002]) consisting of transaction costs 0.1% of brokerage fee for each share (thus 0.2% for both shares), plus a bid-ask spread for each share (long and short) which we assume to be 0.05% (0.3% in total for both shares). Long-short portfolio can take advantage of the leverage allowed by regulations (two-to-one leverage) by engaging in about twice as much trading activity as a comparable unlevered long-only strategy. The differential is largely a function of the portfolio’s leverage. For example, given a capital of $10 million the investor can choose to invest $5 million long and sell $5 million short. Trading activity for the resulting long-short portfolio will be roughly equivalent to that for a $10 million long-only portfolio. If one considers management fees per dollar of securities positions, rather than per dollar of capital, there should not be much difference between long-short and long-only portfolio. In general, investors should consider the amount of active management provided per dollar of fees. Long-only portfolios have a sizable hidden passive component as only their overweights and underweights relative to the benchmark are truly active. On the other hand, long-short portfolio is entierly active such that in terms of management fees per active dollars, long-short may be substantially less costly than long-only portfolio. Moreover, long-short management is almost always offered on a performance-fee basis. Long-short is viewed as riskier than long-only portfolio due to potentially unlimited losses on short positions. In practice, long-short will incur more risk than long-only portfolio to the extent that it engages in leverage, and/or takes more active positions. Taking full advantage of the leverage available will have at risk roughly double the amount of assets invested in a comparable unlevered long-only strategy. Note, both the portfolio’s degree of leverage and its activeness are within the explicit control of the investor. 7.3 7.3.1 Enhanced active strategies Definition Enhanced active equity portfolios (EAEP) seek to improve upon the performance of actively managed long-only portfolios by allowing for short-selling and reinvestment of the entire short sales proceeds in incremental long positions. This style advances the pursuit of active equity returns by relaxing the long-only constraint while maintaining full portfolio exposure to market return and risk. Enhanced active equity strategy has short positions equal to some percentage X% of capital (generally 20% or 30% and possibly 100% or more) and an equal percentage of leveraged long positions (100 + X)%. On a net basis, the portfolio has a 100% exposure to the market and it often has a target beta of one. For example, in a 130-30 portfolio with initial capital of $100, an investor can sell short $30 of securities and use the $30 proceeds along with $100 of capital to purchase $130 of long positions. This way, the 130-30, or active extension, portfolio structure provides fund managers with exposure to market returns unavailable to market neutral 271 Quantitative Analytics long-short portfolios. A 130/30 strategy has two basic components: forecasts of expected returns, or alphas, for each stock in the portfolio universe, and an estimate of the covariance matrix used to construct an efficient portfolio. With modern prime brokerage structures (called enhanced prime brokerage), the additional long purchases can be accomplished without borrowing on margin, allowing for the management style called enhanced active equity. As a result, the 130-30 products were expected to reach $2 trillion by 2010 (see Tabb et al. [2007]). 7.3.2 Some misconceptions Since enhanced active strategies differ in some fundamental ways from other active equity strategies, both long-only and long-short, some misconceptions about these strategies formed, which Jacobs et al. [2007a] showed not to survive objective scrutiny. For instance, a portfolio that can sell short can underweight in larger amounts, so that meaningful underweights of most securities can only be achieved if short selling is allowed. Hence, a 120-20 portfolio can take more and/or larger active overweight positions than a long-only portfolio with the same amount of capital. Further, it is not optimum to split a 120-20 equity portfolio into a long-only 100-0 portfolio and a 20-20 long-short portfolio because the real benefits of any long-short portfolio emerge only with an integrated optimisation that considers all long and short positions simultaneously. In that setting, Jacobs et al. [2005] developed a theoretical framework and algorithms for integrated portfolio optimisation and showed that it must satisfies two constraints 1. the sum of the long position weights is (100 + X)%. 2. the sum of the short position weights is X%. Short-selling, even in limited amounts, can extend portfolio underweights substantially. Opportunities for shorting are not necessarily mirror images of the ones for buying long. It is assumed that overvaluation is more common and larger in magnitude than undervaluation (non-linear relation). Also, price reactions to good and bad news may not be symmetrical. An enhanced active portfolio can take short positions as large as the prime’s broker policies on leverage allow. For example, the portfolio could short securities equal to 100% of capital and use the proceeds plus the capital to purchase long positions, resulting in a 200-100 portfolio. Comparing an enhanced active 200-100 portfolio with an equitized market-neutral long-short portfolio with 100% of capital in short positions, 100% in long positions, and 100% in an equity market overlay (stock index futures, swaps, exchange traded funds (ETFs)), we see that they are equivalent with identical active weights and identical market exposures. However, the equity overlay is passive, whereas with an enhanced active equity portfolio, market exposure is established with individual security positions. For each $100 of capital, the investor has $300 in stock positions to use in pursuing return and controlling risk. Further, the cost of both strategies is about the same. While all enhanced portfolios are in a risky position in terms of potential value added or lost relative to the benchmark index return, losses on unleveraged long positions are limited because a stock price can not drop below zero, but losses on short positions are theoretically unlimited as stock price can rise to infinity. However, this risk can be minimised by diversification and rebalancing so that losses in some positions can be mitigated by gains in others. A 120-20 portfolio is leveraged, in that it has $140 at risk for every $100 of capital invested. The market exposure created by the 20% in leveraged long positions is offset, however, by the 20% sold short. The portfolio has a 100% net exposure to the market, and with appropriate risk control, a marketlike level of systematic risk (a beta of 1). The leverage and added flexibility can be expected to increase excess return and residual risk relative to the benchmark. If the manager is skilled at security selection and portfolio construction, any incremental risk borne by the investor should be compensated for by incremental excess return. Since EAEP have a net market exposure of 100%, any pressures put on individual security prices should net out at the aggregate market level. Turnover in an enhanced active equity portfolio should be roughly proportional to the leverage in the portfolio. With $140 in positions in a 120-20 portfolio, versus $100 in a long-only portfolio, turnover can be expected to be about 40% higher in the 120-20 portfolio. The portfolio optimisation process should account for expected trading costs so that a trade does not occur unless the expected benefit in terms of risk-adjusted return outweighs the expected cost of trading. 272 Quantitative Analytics Michaud [1993] argued that costs related to short sales are an impediment to efficiency. No investment strategy provides a free lunch. An enhanced active equity strategy has an explicit cost, namely a stock loan fee paid to the prime broker. The prime broker arranges for the investor to borrow the securities that are sold short and handles the collateral for the securities’ lenders. The stock loan fee amounts to about 0.5% annually of the market value of the shares shorted (about 10 bps of capital for a 120-20 portfolio). It will usually incur a higher management fee than a long-only portfolio and higher transaction costs, but it offers a more efficient way of managing equities than a long-only strategy allows. The incremental underweights and overweights can lead to better diversification than in a long-only portfolio. Moreover, the enhanced active portfolio may incur more trading costs than a long-only portfolio because, as security prices change, it needs to trade to maintain the balance between its short and long positions relative to the benchmark. For example, assume that a 120-20 portfolio experiences adverse stock price moves so that its long positions lose $2 (prices drops) and its short positions loose $3 (prices raise), causing capital to decline from $100 to $95. The portfolio now has long positions of $118 and short positions of $23, not the desired portfolio proportions (120% of $95 is $114 and 20% is $19). To reestablish portfolio exposures of 120% of capital as long positions and 20% of capital as short positions, the manager needs to rebalance by selling $4 of long positions and using the proceeds to cover $4 of short positions. The resulting portfolio restores the 120-20 proportions because the $114 long and $19 short are respectively 120% and 20% of the $95 capital. If an EAEP is properly constructed with the use of integrated optimisation, the performance of the long and short positions can not be meaningfully separated. The unique characteristics of 130-30 portfolio strategy suggest that the existing indexes such as the S&P 500 are inappropriate benchmarks for leveraged dynamic portfolios. Lo et al. [2008] provided a new benchmark incorporating the same leverage constraints and the same portfolio construction, but which is otherwise transparent, investable, and passive. They used only information available prior to each rebalancing date to formulate the portfolio weights and obtained a dynamic trading portfolio requiring monthly rebalancing. The introduction of short sales and leverage into the investment process led to dynamic indexes capable of capturing time-varying characteristics. 7.3.3 Some benefits Recently, the centre stage of the long-short debate focused on whether efficiency gains result from relaxing the longonly constraint. Brush [1997] showed that adding a long-short strategy to a long strategy expands the mean-variance efficient frontier, provided that long-short strategies have positive expected alphas. Grinold et al. [2000b] showed that information ratios (IR) decline when one moves from a long-short to a long-only strategy. Jacobs et al. [1998] [1999] further elaborated on the loss in efficiency occurring as a result of the long-only constraint. Martielli [2005] and Jacobs and Levy [2006] provided an excellent practical perspective on the mechanics of enhanced active equity portfolio construction and a number of operational considerations. They compared the enhanced active equity portfolio (EAEP) with traditional long-only passive and active approaches to portfolio management as well as other long-short approaches including market-neutral and equitized long-short. EAEPs are expected to outperform long-only portfolios based on comparable insights. They afford managers greater flexibility in portfolio construction, allowing for fuller exploitation of investment insights. They also provide managers and investors with a wider choice of risk-return tradeoffs. The advantages of enhanced active equity over equitized long-short strategies are summarised in Jacobs et al. [2007b]. Clarke et al. [2002] developed a framework for measuring the impact of constraints on the value added by and the performance analysis of constrained portfolios. Further, Clarke et al. [2004] found that short sale constraints in a long-only portfolio cause the most significant reduction in portfolio efficiency. They showed that lifting this constraint is critical for improving the information transferred from stock selection models to active portfolio weights. Sorensen et al. [2007] used numerical simulations of long-short portfolios to demonstrate the net benefits of shorting and to compute the optimal degree of shorting as a function of alpha (manager skill), desired tracking error (risk target), turnover, leverage, and trading costs. They also found that there was no universal optimal level of short selling in an active extension portfolio, but that level varied according to different factors and market conditions. Johnson et al. [2007] further emphasised the loss in efficiency from the long-only constraint as well as the importance of 273 Quantitative Analytics the concerted selection of gearing and risk in the execution of long-short portfolios. Adopting several simplifying assumptions regarding the security covariance matrix and the concentration profile of the benchmark, Clarke et al. [2008] derived an equation that shows how the expected short weight for a security depends on the relative size of the security’s benchmark weight and its assigned active weight in the absence of constraints. They argue that to maintain a constant level of active risk, the long-short ratio should be allowed to vary over time to accommodate changes in individual security risk, security correlation, and benchmark weight concentration. 7.3.4 The enhanced prime brokerage structures As explained by Jacobs et al. [2006], with a traditional margin account, the lenders of any securities sold short must be provided with collateral at least equal to the current value of the securities (see details in Section 7.2.7). When the securities are first borrowed, the proceeds from the short sale usually serve as this collateral. As the short positions subsequently rise or fall in value, the investor’s account provides to or receives from the securities’ lenders cash equal to the change in value. To avoid the need to borrow money from the broker to meet these collateral demands, the account usually maintains a cash buffer. Market-neutral long-short portfolios have traditionally been managed in a margin account, with a cash buffer of 10% typically maintained to meet the daily marks on the short positions. Long positions may sometimes need to be sold to replenish the cash buffer (without earning investment profits). With the enhanced brokerage structures available today, the investor’s account must have sufficient equity to meet the broker’s maintenance margin requirements, generally 100% of the value of the shares sold short plus some additional percentage determined by the broker. This collateral requierment is usually covered by the long positions. The investor does not have to meet cash marks to market on the short positions. The broker cover those needs and is compensated by the stock loan fee. Also, dividends received on long positions can be expected to more than offset the amount the account has to pay to reimburse the securities’ lenders for dividends on the short positions. The investor thus has little need for a cash buffer in the account. An enhanced active portfolio will generally retain only a small amount of cash, similar to the frictional cash retained in a long-only portfolio. More formally, the enhanced prime brokerage structures allow investors to establish a stock loan account with a broker where the investor is not a customer of the prime broker, as would be the case with a regular margin account, but rather a counterparty in the stock loan transaction 3 . This is an important distinction for at least four reasons: 1. Investors can use the stock loan account to borrow directly the shares they want to sell short. The shares the investor holds long serve as collateral for the shares borrowed. The broker arranges the collateral for the securities’ lenders, providing cash, cash equivalents, securities, or letters of credit. Hence, the proceeds from the short sales are available to the investor to purchase securities long. 2. The shares borrowed are collateralized by securities the investor holds long, rather than by the short sale proceeds, eliminating the need for a cash buffer. All the proceeds of short sale and any other available cash can thus be redirected toward long purchases. 3. A stock loan account in contrast to a margin account provides critical benefits for a tax-exempt investor. The long positions established in excess of the investor’s capital are financed by the proceeds from the investor’s sale of short positions. The longs are not purchased with borrowed funds. 4. The investor being a counterparty in a stock loan account, the investor’s borrowing of shares to sell short is not subject to Federal Reserve Board Regulation T (limits on leverage). Instead, the investor’s leverage is limited by the broker’s own internal lending policies. 3 To establish a stock loan account with a prime broker, the manager must meet the criteria for a Qualified Professional Asset Manager. For a registered investment advisor, it means more than $85 million of client assets under management and $1 million of shareholders’ equity. 274 Quantitative Analytics In exchange for its lending services (arranging for the shares to borrow and handling the collateral), the prime broker charges an annual fee equal to about 0.50% of the market value of the shares shorted (fees may be higher for harderto-borrow shares or smaller accounts). For a 120-20 portfolio with 20% of capital shorted, the fee as a percentage of capital is thus about 0.10%. Generally, the broker also obtains access to the shares the investor holds long, up to the dollar amount the investor has sold short, without paying a lending fee to the investor. Hence, the broker can lend these shares to other investors to sell short, and in turn, the investor can borrow the shares the broker can hypothecate from other investors, as well as the shares the broker holds in its own accounts and the share it can borrow from other lenders. 7.4 7.4.1 Measuring the efficiency of portfolio implementation Measures of efficiency There are a number of studies measuring the efficiency of portfolio implementation, such as Grinold [1989], who introduced the Fundamental Law (FL) of active management, given by the equation √ IR = IC. N where IR is the observed information ratio given in Equation (7.2.1), IC is the information coefficient (a measure of manager skill) given by the correlation of forecast security returns with the subsequent realised security returns, and N is the number of securities in the investment universe. Even though the FL is an approximation, the main intuition is that returns are a function of information level, breadth of investment universe and portfolio risk. The law was extended by Clarke et al. [2002] who introduced the idea of transfer coefficient (TC) to measure the efficiency of portfolio implementation. It is a measure of how effectively manager information is transferred into portfolio weights. The transfer coefficient is defined as the cross-sectional correlation of the risk-adjusted forecasts across assets and the risk-adjusted active portfolio weights in the same assets α ) σe where wa σe is a vector of risk adjusted active weights, σe,i is the residual risk for each asset (the risk of each asset not explained by the benchmark portfolio), and α is a vector of forecast active returns (forecast returns in excess of benchmark related return). Hence, the TC measures the manager’s ability to invest in a way consistent with their relative views on the assets in their investment universe. While a perfectly consistent investment portfolio has a TC of one, any inconsistency in implementation will reduce the TC below one. Assuming that managers have no restrictions on the construction of a portfolio from the information set they possess, the equation becomes T C = ρ(wa σe , √ IR = T C.IC. N where T C acts as a scaling factor on the level of information. In absence of any constraints T C = 1, otherwise it is below 1 since the constraints place limits on how efficiently managers can construct portfolios reflecting their forecasts. This result infers that portfolio outperformance is not only driven by the the ability to forecast security returns, but also by the ability to frame those security returns in the form of an efficient portfolio. Note, we need to know the forecasts and model estimates of residual risk σe,i for every asset i to accurately measure the TC of a fund at a particular time. However, only the portfolio managers themselves should have access to this kind of information. Raubenheimer [2011] proposed a simple metrics, called implied transfer coefficient (ITC), requiring only the weights of the benchmark assets and the investment weight constraints. Nonetheless, we need an understanding of the distribution of likely security weightings in the portfolio. Grinold [1994] proposed the alpha generation formula which was generalised by Clarke er al. [2006] 1 α = ICσ 2 SN 275 Quantitative Analytics where σ is an N × N estimated covariance matrix of the returns of the securities, and SN is an N × 1 vector of randomised standard normal scores. This equation presents forecasted excess returns as generated by a random normal process, scaled by skill and risk. Clarke et al. [2008] and Sorensen et al. [2007] argued that, if forecast excess returns follow a random process, the distribution of optimal active weights resulting from these forecasts could be derived accordingly. These simulated distributions of asset weights can provide sound justification for various weight constraints which are appropriate for each asset and across changing investment views. They considered a simplified two-parameter variance-covariance matrix to simulated the active weight distributions by setting all individual asset variances to a single value σ, and all pairwise correlations to the same value ρ. Under these assumptions, they showed that the unconstrained optimal active weights are normally distributed with a mean of zero and a variance proportional to the active risk 1 σA √ wa ∼ N 0, √ N σ 1−ρ where σA is the target active risk of the portfolio. Increasing volatility and decreasing correlation (increasing crosssectional variation) result in a narrower distribution of active weights and a lower probability of needing short positions to optimally achieving a particular active risk target. All things being equal, a wider distribution of active weights in each security is required with greater active targets. This increase in active weight spread is exponentially increased by a reduced investment universe (smaller N). Hence, given the same active risk targets, funds managed on a smaller asset universe universe or benchmark will likely be more aggressive in their individual active weights per asset than funds managed in a more diverse universe. Further, the wider the distribution of active weights, the more likely short positions in the smaller stocks will be required in the optimal portfolio construction. 7.4.2 Factors affecting performances Following Segara et al. [2012] we present some hypotheses relating the performance of active extension portfolios to unique factors: • Skill levels: Managers with higher skill levels have a greater increase in performance from relaxing the longonly constraint. In the case where a manager has some predictive skill (IC > 0), then he will be able to transform larger active weights into greater outperformance, leading to higher level of performance from active extension strategies. However, short selling can only increase up to the point where the additional transaction and financing costs outweigh the marginal benefits. • Skew in predictive ability: Managers with a higher skew towards picking underperforming stocks can construct active extension portfolios with higher levels of performance (see Gastineau [2008]). • Risk constraints: Portfolios with higher tracking error targets experience greater performance increase from relaxing the long-only constraint. Portfolio managers must face limits to the size of a tracking error which is a function of portfolio active weights and the variance-covariance matrix. Clarke et al. [2004] found a trade-off between the maximum TC, the target tracking error, and the level of shorting. • Costs: An increase in costs relative to the skill the manager possesses will at some point lower the performance of active extensions strategies. Transaction, financing and stock borrowing costs increase proportionally to the gross exposure of the fund, which is driven by the level of short selling in the portfolio. • Volatility: Higher market volatility will increase the performance of active extension strategies. In volatile markets, as greater portfolio concentration may expose a portfolio to higher risk due to lower diversification, an active extension strategy allows for a lower risk target for the same return by using short-side information in a portfolio with added diversification. • Cross-sectional spread of returns: Active extension portfolios perform better in comparison to long-only portfolios in periods where individual stock returns are more highly correlated. According to Clarke et al. [2008], 276 Quantitative Analytics in environments of higher correlation between individual security returns, larger active positions are needed to achieve the same target level of outperformance. Hence, a higher level of short selling will allow managers to distribute more efficiently their higher active weights over both long and short positions in the portfolio. • Market Conditions: The level of outperformance or underperformance of active extension portfolios is equivalent across periods or negative market returns. Having a constant 100% net market exposure and a beta of about 1 when well diversified, an active extension portfolio on average will perform in line with the broader market. 277 Chapter 8 Describing quantitative strategies 8.1 Time series momentum strategies Trend-following or momentum investing is about buying assets whose price is rising and selling assets whose price is falling. Cross-sectional momentum strategies in three dimensions (time-series, cross-section, trading frequency), which are the main driver of commodity trading advisors (CTAs) (see Hurst et al. [2010]), were extensively studied and reported to present strong return continuation patterns across different portfolio rebalancing frequencies with high Sharpe ratio (see Jegadeesh et al. [2001], Moskowitz et al. [2012], Baltas et al. [2012a]). Time-series momentum refers to the trading strategy that results from the aggregation of a number of univariate momentum strategies on a volatility-adjusted basis. As opposed to the cross-sectioal momentum strategy which is constructed as a long-short zero-cost portfolio of securities with the best and worst relative performance during the lookback period, the univariate time-series momentum strategy (UTMS) relies heavily on the serial correlation/predictability of the asset’s return series. Moskowitz et al. [2012] found strong positive predictability from a security’s own past returns across the nearly five dozen futures contracts and several major asset classes studied over the last 25 years. They found that the past 12-month excess return of each instrument is a positive predictor of its future return. This time series momentum effect persists for about a year before partially reversing. Baltas et al. [2012a] showed that time-series momentum strategies have high explanatory power in the time-series of CTA returns. They further documented the existence of strong time-series momentum effects across monthly, weekly and daily frequencies, and confirmed that strategies at different frequencies have low correlation between each other, capturing distinct patterns. This dependence on strong autocorrelation in the individual return series of the contracts poses a substantial challenge to the random walk hypothesis and the market efficiency which was explained by rational and behavioural finance. Using intraday data, Baltas et al. [2012b] explored the profitability of time-series momentum strategies focusing on the momentum trading signals and on the volatility estimation. Results showed that the information content of the price path throughout the lookback period can be used to provide more descriptive indicators of the intertemporal price trends and avoid eminent price reversals. They showed empirically that the volatility adjustment of the constituents of the time-series momentum is critical for the resulting portfolio turnover. 8.1.1 The univariate time-series strategy Assuming predictability of some market time-series, the univariate time-series momentum strategy (UTMS) is defined as the trading strategy that takes a long/short position on a single asset based on the trading signal ψi (., .) of the recent asset return over a particular lookback period. We let J denote the lookback period over which the asset’s past performance is measured and K denote the holding period. In general, both J and K are measured in months, weeks or days depending on the rebalancing frequency of interest. We use the notation MJK to denote monthly strategies with a lookback and holding period of J and K months respectively. The notations WJK and DJK follow similarly for 278 Quantitative Analytics i weekly and daily strategies. Following Moskowitz et al. [2012] (MOP), we construct the return YJ,K (t) at time t for the series of the ith available individual strategy as i YJ,K (t) = ψi (t − J, t)Ri (t, t + K) (8.1.1) where ψi (t − J, t) is the particular trading signal for the ith asset which is determined during the lookback period and in general takes values in the set {−1, 0, 1} which in turn translates to {short, inactive, long}. Note, to evaluate the abnormal performance of these strategies, we can compute their alphas from a linear regression of returns (see Equation (8.1.3)) where we control for passive exposures to the three major asset classes on stocks, commodities and bonds. 8.1.2 The momentum signals i Given the return YJ,K (t) at time t for the series of the ith available individual strategy in Equation (8.1.1), we consider five different methodologies in order to generate momentum trading signals, all focusing on the asset performance during the lookback period [t − J, t] (see Moskowitz et al. [2012], Baltas et al. [2012b]). 8.1.2.1 Return sign In that setting, the time-series momentum strategy is defined as the trading strategy that takes a long/short position on a single asset based on the sign of the recent asset return over a particular lookback period. The trading signal is given by ψi (t − J, t) = signi (t − J, t) where signi (t − J, t) is the sign of the J-period past return of the ith asset. That is, a positive (negative) past return dictates a long (short) position. The return of the time-series momentum strategy becomes i YJ,K (t) = signi (t − J, t)Ri (t, t + K) = sign(Ri (t − J, t))Ri (t, t + K) 8.1.2.2 (8.1.2) Moving Average A long (short) position is determined when the J-(month/week) lagging moving average of the price series lies below (above) a past (month/week)’s leading moving average of the price series. Given the price level S i (t) of an instrument at time t, we let NJ (t) be the number of trading days in the period [t − J, t] and define AJ (t) the average price level during the same time period as NJ (t) X 1 S i (t − NJ (t) + j) AJ (t) = NJ (t) j=1 The trading signal at time t is determined as M A(t − J, t) = 1 if AJ (t) < A1 (t) −1 otherwise Hence, the trading strategy that takes a long/short position on a single asset based on the moving average of the price series over a particular lookback period is i YJ,K (t) = M Ai (t − J, t)Ri (t, t + K) The idea behind the MA methodology is that when a short-term moving average of the price process lies above a longer-term average then the asset price exhibits an upward trend and therefore a momentum investor should take a 279 Quantitative Analytics long position. The reverse holds when the relationship between the averages changes. The comparison of the longterm lagging MA with a short-term leading MA gives the MA methodology a market timing feature. The choice of the past month for the short-term horizon is justified, because it captures the most recent trend breaks. 8.1.2.3 EEMD Trend Extraction This trading signal relies on some extraction of the price trend during the lookback period. We choose to use a recent data-driven signal processing technique, known as the Ensemble Empirical Mode Decomposition (EEMD), which is introduced by Wu et al. [2009] and constitutes an extension of the Empirical Mode Decomposition. The EEMD methodology decomposes a time-series of observations into a finite number of oscillating components and a residual non-cyclical long-term trend of the original series, without virtually imposing any restrictions of stationarity or linearity upon application. That is, the stock price process can be written as the complete summation of an arbitrary number, n of oscillating components ck (t) for k = 1, .., n and a residual long-term trend p(t) S(t) = n X ck (t) + p(t) k=1 The focus is on the extracted trend p(t) and therefore an upward (downward) trend during the lookback period determines a long (short) position 1 if p(t) > p(t − J) EEM D(t − J, t) = −1 otherwise 8.1.2.4 Time-Trend t-statistic Another way of capturing the trend of a price series is through fitting a linear trend on the J-month price series using least-square. The momentum signal can them be determined based on the significance of the slope coefficient of the fit S(j) = α + βj + (j) , j = 1, 2, .., NJ (t) S(t − NJ (t)) Estimating this model for the asset using all NJ (t) trading days of the lookback period yields an estimate of the timetrend, given by the slope coefficient β. The significance of the trend is determined by the t-statistic of β, denoted as t(β), and the cutoff points for the long/short position of the trading signal are chosen to be +2/ − 2 respectively 1 if t(β) > 2 −1 if t(β) < −2 T REN D(t − J, t) = 0 otherwise In order to account for potential autocorrelation and heteroskedasticity in the price process, Newey et al. [1987] tstatistics are used. Note, the normalisation of the regressand in above equation is done for convenience, since it allows for cross-sectional comparison of the slope coefficient, when necessary. The t-statistic of β is of course unaffected by such scalings. 8.1.2.5 Statistically Meaningful Trend Bryhn et al. [2011] study the statistical significance of a linear trend and claim that if the number of data points is large, then a trend may be statistically significant even if the data points are very erratically scattered around the trend line. They introduced the term of statistical meaningfulness in order to describe a trend that not only exhibits statistical significance, but also describes the behaviour of the data to a certain degree. They showed that a trend is informative and strong if, except for a significant t-statistic (or equivalently a small p-value where p is the p-value of 280 Quantitative Analytics the slope coefficient), the R2 of the linear regression exceeds 65%. Further, they consider a method providing some sort of pre-smoothing in the data before the extraction of the trend. Hence, we split the lookback period in 4 to 10 intervals (i.e. 7 regressions per lookback period per asset) and decide upon a long/short position only if at least one of the regressions satisfies the above criteria 1 if tk (β) > 2 and Rk2 ≥ 65% for some k −1 if tk (β) < −2 and Rk2 ≥ 65% for some k SM T (t − J, t) = 0 otherwise where k denotes the kth regression with k = 1, 2, ..., 7. Clearly, SMT is a stricter signal than TREND and therefore would lead to more periods of inactivity. 8.1.3 The signal speed Since the sparse activity could potentially limit the ex-post portfolio mean return, Baltas et al. [2012b] chose to estimate for each contract and for each signal an activity-to-turnover ratio, which is called Signal Speed. It is computed as the square root of the ratio between the time series average of the squared signal value and the time-series average of the squared first-order difference in the signal value E[ψ 2 ] = (Speed(ψ)) = E[(∆ψ)2 ] 1 T −J 2 1 T −J−1 PT t=1 PT t=1 ψ 2 (t − J, t) ψ(t − J, t) − ψ(t − 1 − J, t − 1) 2 Clearly, the larger the signal activity and the smaller the average difference between consecutive signal values (in other words the smoother the transition between long and short positions), the larger the signal speed. When the signals constantly jump between long (+1) to short (−1) positions the numerator is always equal to 1. Inactive trading allows for smoother transition between long and short positions. 8.1.4 The relative strength index The relative strength index (RSI) is a technical indicator intended to chart the current and historical strength or weakness of a stock or market based on the closing prices of a recent trading period. The RSI is classified as a momentum oscillator, measuring the velocity and magnitude of directional price movements. Momentum is the rate of the rise or fall in price. The RSI computes momentum as the ratio of higher closes to lower closes: stocks which have had more or stronger positive changes have a higher RSI than stocks which have had more or stronger negative changes. The RSI is most typically used on a 14 day time frame, measured on a scale from 0 to 100, with high and low levels marked at 70 and 30, respectively. For each trading period an upward change U is defined by the close being higher than the previous close SC (jδ) − SC ((j − 1)δ) if SC (jδ) > SC ((j − 1)δ) U (jδ) = 0 otherwise Similarly, a downward change D si given by SC ((j − 1)δ) − SC (jδ) if SC ((j − 1)δ) > SC (jδ) D(jδ) = 0 otherwise The average of U and D are calculated by using an n-period Exponential Moving Average (EMA) in the AIQ version but with an equal-weighted moving average in Wilder’s original version. The ratio of these averages is the Relative Strength Factor RS = EM A(U, n) EM A(D, n) 281 Quantitative Analytics The EMA should be appropriately initialised with a simple average using the first n-values in the price series. When the average of D values is zero, the RS value is defined ad 100. The RSF is then converted to a Relative Strength Index in the range [0, 100] as 100 1 + RS so that when RS = 100 then RSI is close to 100 and when RS = 0 then RSI = 0. The RSI is presented on a graph above or below the price chart. The indicator has an upper line, typically at 70, a lower line at 30 and a dashed mid-line at 50. The inbetween level is considered neutral with the 50 level being a sign of no trend. Wilder posited that when price moves up very rapidly, at some point it is considered overbought, while when price falls very rapidly, at some point it is considered oversold. Failure swings above 70 and below 30 on the RSI are strong indications of market reversals. The slope of the RSI is directly proportional to the velocity of a change in the trend. Cardwell noticed that uptrends generally traded between RSI of 40 and 80 while downtrends traded with an RSI between 60 and 20. When securities change from uptrend to downtrend and vice versa, the RSI will undergo a range shift. Bearish divergence (between stock price and RSI) is a sign confirming an uptrend while bullish divergence is a sign confirming a downtrend. Further, he noted that reversals are the opposite of divergence. RSI = 100 − A variation called Cutler’s RSI is based on a simple moving average (SMA) of U and D RS = SM A(U, n) SM A(D, n) When the EMA is used, the RSI value depends upon where in the data file his calculation is started which called the Data Length Dependency. Hence Cutler’s RSI is not data length dependent, and it returns consistent results regardless of the length of, or the starting point within a data file. The two measures are similar since SMA and EMA are also similar. 8.1.5 Regression analysis Before constructing momentum strategies, following Moskowitz et al. [2012], we first assess the amount of return predictability that is inherent in a series of predictors by running a pooled time-series cross-sectional regression of the contemporaneous standardised return on a lagged return predictor. We regress the excess return rti for instrument i in month t on its return lagged h months/weeks/days, where both returns are scaled by their ex-ante volatilities σti rti = α + βh Z(t − h) + it i σt−1 (8.1.3) where the regressor Z(t−h) is chosen from a broad collection of momentum-related quantities. Note that all regressor choices are normalised, in order to allow for the pooling across the instruments. For example, we can consider the regression i rt−h rti = α + β + it h i i σt−1 σt−h−1 Given the vast differences in volatilities we divide all returns by their volatility to put them on the same scale. This is similar to using Generalized Least Squares instead of Ordinary Least Squares (OLS). The regressions are run using lags of h = 1, 2, .., 60 months/weeks/days. Another way of looking at time series predictability is to simply focus only on the sign of the past excess return underlying our trading strategies. In a regression setting, this strategy can be captured using the following specification: rti i = α + βh sign(rt−h ) + it i σt−1 282 (8.1.4) Quantitative Analytics where sign(a) = 1 if a ≥ 0 −1 otherwise All possible choices are comparable across the various contracts, and refer to a single period (J = 1) to avoid serial autocorrelation in the error term it . Equation (8.1.4) is estimated for each lag h and regressor Z by pooling all the underlyings together. To allow for the pooling across instruments, all regressor choices are normalised, and the asset returns are normalised. The quantity of interest in these regressions is the t-statistic of the coefficient βh for each lag h. Large and significant t-statistics essentially support the hypothesis of time-series return predictability. The results are similar across the two regression specifications: strong return continuation for the first year and weaker reversals for the next 4 years (see Moskowitz et al. [2012], Baltas et al. [2012b]). 8.1.6 The momentum profitability Subsequently, we construct the return series of the aggregate time-series momentum strategy over the investment horizon as the inverse-volatility weighted average return of all available individual momentum strategies RJK (t) Mt Csf 1 X Y i (t) = Mt i=1 σi (t, D) J,K (8.1.5) where Mt is the number of available assets at time t, and where Csf is a scaling factor and σi (t, D) is an estimate at time t of the realised volatility of the ith asset computed using a window of the past D trading days. See Section (3.4) for the description of a family of volatility estimators. This risk-adjustment (use of standardised returns) across instruments allows for a direct comparison and combination of various asset classes with very different return distributions in a single portfolio. Assuming that the individual time series strategies are mutually independent and that the volatility process is persistent, then the conditional variance of the return can be approximated by i V art (YJ,K (t)) ≈ σi2 (t, D) since ψi2 (t − J, t) = 1 if we further assume that the frequency of the trading periods when ψi (t − J, t) = 0 is relatively small. As a result, the conditional variance of the portfolio is approximated by V art (RJK (t)) ≈ Mt 1 X C2 Mt2 i=1 sf This approximation ignores any covariation among the individual momentum strategies as well as any potential changes in the individual volatility processes but it can be used to define the scaling factor Csf . For example, we can consider D = 60 trading days. The scaling factor Csf = 40% is used by MOP in order to achieve an ex-ante volatility equal to 40% for each individual strategy. This is because it results in an ex-post annualised volatility of 12% 1 strategy roughly matching the level of volatility of several risk factors in their √ sample period. Baltas et al. for their M12 [2012b] considered a rolling window of D = 30 days and a scaling factor Csf = 10% × Mt to achieve an ex-ante volatility equal to 10%. Regarding the ex-ante volatility adjustment (risk-adjustment), it must be noted that it is compulsory in order to allow us to combine in a single portfolio various contracts of different asset classes with different volatility profiles. Recently, Barroso and Santa-Clara [2012] revised the equity cross-sectional momentum strategy and scaled similarly the winners-minus-losers portfolio in order to form what they call a risk-managed momentum strategy. Instead of forming a new momentum portfolio every K periods, when the previous portfolio is unwound, we can follow the overlapping methodology of Jegadeesh et al. [2001], and perform portfolio rebalancing at the end of each 283 Quantitative Analytics month/week/day. The respective monthly/weekly/daily return is then computed as the equally-weighted average across 1 -th of the portfolio is only rebalanced the K active portfolios during the period of interest. Based on this technique, K every month/week/day. In order to assess the profitability of the portfolio, we consider different momentum trading signal, various out-of-sample performance statistics for the (J, K) time-series momentum strategy. The statistics are all annualised and include the mean portfolio return along with the respective Newey et al. [1987] t-statistic, the portfolio volatility, the dollar growth, the Sharpe ratio and the downside risk Sharpe ratio (see Ziemba [2005]). To analyse the performance of the strategies, we can then plot the annualised Sharpe ratios of these strategies for each stock/futures contract. In most studies, they showed that every single stock/futures contract exhibits positive predictability from past one-year returns. These studies also regressed the strategy for each security on the strategy of always being long, and they got a positive alpha in 90% of the cases. Thus, a time series strategy provides additional returns over and above a passive long position for most instruments. 8.2 Factors analysis Some theoretical models have been proposed as a framework for researching connections between asset returns and macroeconomic factors. The Arbitrage Pricing Theory (APT) developed by Ross [1976] is one of the theories that relate stock returns to macroeconomic state variables. It argues that the expected future return of a stock can be modelled as a linear function of a variety of economic state variables or some theoretical market indices, where sensitivity of stock returns to changes in every variable is indicated by an economic state variable-specific coefficient. The rate of return provided by the model can then be used for correcting stock pricing. Thus, the current price of a stock should be equal to the expected price at the end of the period discounted by the discount rate that is suggested by the model. The theory suggests that if the current price of a stock diverges from the theoretical price then arbitrage should bring it back into equilibrium. Roll and Ross [1980] argued that the Arbitrage Pricing Theory is an attractive pricing model to researchers because of its modest assumptions and pleasing implications in comparison with the Capital Asset Pricing Model. The vast majority of papers that used APT as a framework attempted to model a shortrun relation between the prices of equities and financial and economic variables. They used differenced variables and presumed that the variables were stationary. However, evidence suggests that in the short-run equity prices deviate from their fundamental values and are also driven by non-fundamentals. In this section, we are going to model these non-fundamentals values by assuming they are mean-reverting. For simplicity, we assume the market is composed of two types of agents, namely, the indexers (mutual fund managers and long-only managers) and the market-neutral agents. The former seek exposure to the entire market or to specific industry sectors with the goal of being generally long the market or sector with appropriate weightings in each stock, whereas the latter seek uncorrelated returns with the market (alpha). In this market, we are going to present a systematic approach to statistical arbitrage defined in Section (7.2.4), and construct market-neutral portfolio strategies based on mean-reversion. This is done by decomposing stock returns into systematic and idiosyncratic components using different definitions of risk factors. 8.2.1 Presenting the factor model One of the main difficulties in multivariate analysis is the problem of dimensionality, forcing practitioners to use simplifying methods. From an empirical viewpoint, multivariate data often exhibit similar patterns indicating the existence of common structure hidden in the data. Factor analysis is one of those simplifying methods available to the portfolio manager. It aims at identifying a few factors that can account for most of the variations in the covariance or correlation of the data. Traditional factor analysis assumes that the data have no serial correlations. While this assumption is often violated by financial data taken with frequency less than or equal to a week, it becomes more reasonable for asset returns with lower frequencies (monthly returns of stocks or market indexes). If the assumption is violated, one can use parametric models introduced in Section (5.5.2) to remove the linear dynamic dependence of the data and apply factor analysis to the residual series. 284 Quantitative Analytics Considering factor analysis based on orthogonal factor model, we let r = (r1 , ..., rN )> be the N-dimensional log returns, and assume that the mean and covariance matrix of r are µ and Σ. For a return series, it is equivalent to requiring that r is weakly stationary. The factor model postulates that r is linearly dependent on a few unobservable random variables F = (f1 , f2 , ..., fm )> and N additional noises = (1 , .., N )> where m < N , fi are the common factors, and i are the errors. The factor model is given by r1 − µ1 = l11 f1 + ... + l1m fm + 1 r2 − µ2 = l21 f1 + ... + l2m fm + 2 ... = ... rN − µN = lN 1 f1 + ... + lN m fm + N where ri − µi is the ith mean-corrected value. Equivalently in matrix notation, we get r − µ = LF + (8.2.6) where L = [lij ]N ×m is the matrix of factor loadings, lij is the loading of the ith variable on the jth factor, and i is the specific error of ri . The above equation is not a multivariate linear regression model as in Section (5.5.2), even though it has a similar appearance, since the m factors fi and the N errors i are unobservable. The factor model is an orthogonal factor model if it satisfies the following assumptions 1. E[F ] = 0 and Cov(F ) = Im , the m × m identity matrix 2. E[] = 0 and Cov() = Ψ = diag{ψ1 , .., ψN } that is, Ψ is a N × N diagonal matrix 3. F and are independent so that Cov(F, ) = E[F > ] = 0m×N Under these assumptions, we get Σ = Cov(r) = E[(r − µ)(r − µ)> ] = E[(LF + )(LF + )> ] = LE[F F > ]L> + E[F > ]L> + LE[F > ] + E[> ] = LL> + Ψ and Cov(r, F ) = E[(r − µ)F > ] = LE[F F > ] + E[F > ] = L Using these two equations, we get V ar(ri ) 2 2 = li1 + ... + lim + ψi Cov(ri , rj ) = li1 lj1 + ... + lim ljm Cov(ri , fj ) = lij 2 2 The quantity li1 + ... + lim , called the communality, is the portion of the variance of ri contributed by the m common factors, while the remaining portion ψi of the variance of ri is called the uniqueness or specific variance. The orthogonal factor representation of a random variable r is not unique, and in some cases does not exist. For any m × m orthogonal matrix P satisfying P P > = P > P = I, we let L∗ = LP and F ∗ = P > F and get r − µ = LF + = LP P > F + = L∗ F ∗ + 285 (8.2.7) Quantitative Analytics with E[F ∗ ] = 0 and Cov(F ∗ ) = P > Cov(F )P = P > P = I. Thus, L∗ and F ∗ form another orthogonal factor model for r. As a result, the meaning of factor loading is arbitrary, but one can perform rotations to find common factors with nice interpretations. Since P is an orthogonal matrix, the transformation F ∗ = P > F is a rotation in the m-dimensional space. One can estimate the orthogonal factor model with maximum likelihood methods under the assumption of normal density and prespecified number of common factors. If the common factors F and the specific factors are jointly normal and the number of common factors are given a priori, then r is multivariate normal with mean µ and covariance matrix Σr = LL> + Ψ. One can then use the MLM to get estimates of L and Ψ under the constraint L> Ψ−1 L = ∆, which is a diagonal matrix. Alternatively, one can use PCA without requiring the normality of assumption of the data nor the prespecification of the number of common factors, but the solution is often an approximation. Following the description of PCA in Section (5.5.3), we let (λ̂1 , ê1 ), .., (λ̂N , êN ) be pairs of the eigenvalues and eigenvectors of the sample covariance matrix Σ̂r , where λ̂1 ≥ λ̂2 ≥ ... ≥ λ̂N . Letting m < N be the number of common factor, the matrix of factor loadings is given by L̂ = [ˆlij ] = λ̂1 ê1 |λ̂2 ê2 |...|λ̂m êm The estimated specific variances are the diagonal elements of the matrix Σ̂r − L̂L̂> , that is Ψ̂ = diag{ψ̂1 , .., ψ̂N }, Pm 2 where ψ̂i = σ̂ii,r − j=1 ˆlij , and σ̂ii,r is the (i, i)th element of Σ̂r . The communalities are estimated by 2 2 ĉ2i = ˆli1 + ... + ˆlim and the error matrix due to approximation is Σ̂r − (L̂L̂> + Ψ̂) which we would like close to zero. One can show that the sum of squared elements of the above error matrix is less than or equal to λ̂2m+1 + ... + λ̂2N so that the approximation error is bounded by the sum of squares of the neglected eigenvalues. Further, the estimated factor loadings based on PCA do not change as the number of common factors m is increased. For any m × m orthogonal matrix P , the random variable r can be represented with Equation (8.2.7) and we get LL> + Ψ = LP P > L> + Ψ = L∗ (L∗ )> + Ψ so that the communalities and specific variances remain unchanged under an orthogonal transformation. One would like to find an orthogonal matrix P to transform the factor model so that the common factors have some interpretations. There are infinite possible factor rotations available and some authors proposed criterions to select the best possible rotation (see Kaiser [1958]). Factor analysis searches common factors to explain the variabilities of the the returns. One must make sure that the assumption of no serial correlations in the data is satisfied which can be done with the multivariate Portmanteau statistics. If serial correlations are found, one can build a VARMA model to remove the dynamic dependence in the data and apply the factor analysis to the residual series. 286 Quantitative Analytics 8.2.2 Some trading applications 8.2.2.1 Pairs-trading Following the description of pairs trading in Section (7.2.3) we let stocks P and Q be in the same industry or have similar characteristics, and expect the returns of the two stocks to track each other after controlling for beta. Accordingly, if Pt and Qt denote the corresponding price time series, then we can model the system as ln Pt Qt = α(t − t0 ) + β ln + Xt Pt 0 Qt0 or, in its differential version dPt dQt = αdt + β + dXt Pt Qt (8.2.8) where Xt is a stationary, or mean-reverting process called the cointegration residual, or simply the residual (see Pole [2007]). In many cases of interest, the drift α is small compared to the fluctuations of Xt and can therefore be neglected. This means that, after controlling for beta, the long-short portfolio oscillates near some statistical equilibrium (see Avellaneda et al. [2008]). The model in Equation (8.2.8) suggests a contrarian investment strategy in which we go long 1 dollar of stock P and short β dollars of stock Q if Xt is small and, conversely, go short P and long Q if Xt is large. The portfolio is expected to produce a positive return as valuations converge. The mean-reversion paradigm is typically associated with market over-reaction: assets are temporarily under or over-priced with respect to one or several reference securities (see Lo et al. [1990]). Generalised pairs-trading, or trading groups of stocks against other groups of stocks, is a natural extension of pairs-trading. The role of the stock Q would be played by an index or exchange-traded fund (ETF) and P would be an arbitrary stock in the portfolio or sector of activity. The analysis of the residuals, based of the magnitude of Xt , suggests typically that some stocks are cheap with respect to the index or sector, others expensive and others fairly priced. A generalised pairs trading book, or statistical arbitrage book, consists of a collection of pair trades of stocks relative to the ETF (or, more generally, factors that explain the systematic stock returns). In some cases, an individual stock may be held long against a short position in ETF, and in others we would short the stock and go long the ETF. Remark 8.2.1 Due to netting of long and short positions, we expect that the net position in ETFs will represent a small fraction of the total holdings. The trading book will look therefore like a long-short portfolio of single stocks. That is, given a set of stocks S = {S1 , S2 , .., SN } we can go long a subset of stocks Lo with hi dollars invested per ith stock for i ∈ Lo and short the subset So with hi βi dollars of index or ETF for each stock. Conversely, we can go short a subset of stocks So with hj dollars invested per jth stock for j ∈ So and long the subset Lo with hj βj dollars of index or ETF for each stock. We can construct the portfolios PN such that the net position in ETFs will represent a small fraction of the total holdings or even zero by setting k=1 hk βk = 0. 8.2.2.2 Decomposing stock returns Following the concept of pairs-trading in Section (8.2.2.1), the analysis of residuals will be our starting point. Signals will be based on relative-value pricing within a sector or a group of peers, by decomposing stock returns into systematic and idiosyncratic components and statistically modelling the idiosyncratic part. Here, the emphasis is on the residual that remains after the decomposition is done and not the choice of a set of risk-factors. Given the d-day period discrete d St return Rt−d,t = ∇ St−d of the underlying process where ∇d St = St − St−d with period d, we want to explain or predict stock returns. We saw in Section (8.2.1) that one approach is to explain the returns/prices based on some statistical factors 287 Quantitative Analytics R= m X βj Fj + , Corr(Fj , ) = 0 , j = 1, .., m j=1 Pm where Fj is the explanatory factor, βj is the factor loading such that j=1 βj Fj is the explained or systematic portion and is the residual, or idiosyncratic portion. For example, the CAPM described in Section (2.3.1.2) consider a single explanatory factor called the market portfolio R = βF + , Cov(R, ) = 0 , < >= 0 where F is the returns of a broad-market index (market portfolio). The model implies that if the market is efficient, or in equilibrium, investors will not make money (systematically) by picking individual stocks and shorting the index or vice-versa (assuming uncorrelated residuals) (Sharpe [1964], Lintner [1965]). However, markets may not be efficient, and the residuals may be correlated. In that case, we need additional explanatory factors F to model stock returns (see Ross [1976]). In the multi-factor models above (APT), the factors represent industry returns so that < R >= m X βj < Fj > j=1 where brackets denote averaging over different stocks. Thus, the problem of correlations of residuals (idiosyncratic risks) will closely depend on the number of explanatory factors in the model. 8.2.3 A systematic approach 8.2.3.1 Modelling returns A systematic approach in equity when looking at mean-reversion is to look for stock returns devoid of explanatory factors (see Section (1.5.3)), and analyse the corresponding residuals as stochastic processes. Avellaneda et al. [2008] proposed a quantitative approach to stock pricing based on relative performance within industry sectors or PCA factors. They studied how different sets of risk-factors lead to different residuals producing different profit and loss (PnL) for statistical arbitrage strategies. Following their settings, we let {Ri }N i=1 be the returns of the different stocks in the trading universe over an arbitrary one-day period (from close to close). Considering the econometric factor model in Equation (8.2.1) with the continuous-time model for the evolution of stock prices defined in Equation (1.5.20), we let k (t) the return of the kth risky factor be Fkt = dP Pk (t) m X dSi (t) dPk (t) = αi dt + βik + dXi (t) Si (t) Pk (t) k=1 where we let the systematic component of returns ETFs. Therefore, the factors are either Pm k=1 k (t) βik dP Pk (t) be driven by the returns of the eigenportfolios or • eigenportfolios corresponding to significant eigenvalues of the market • industry ETF, or portfolios of ETFs The term dXi (t) is assumed to be the increment of a stationary stochastic process which models price fluctuations corresponding to over-reactions or other idiosyncratic fluctuations in the stock price which are not reflected in the industry sector. Therefore, the approach followed by Avellaneda et al. [2008] was to let the model assumes • a drift which measures systematic deviations from the sector • a price fluctuation that is mean-reverting to the overall industry level 288 Quantitative Analytics Focusing on the residual, they studied how different sets of risk-factors lead to different residuals, and hence, different profit and loss. Market neutrality is achieved via two different approaches, either by extracting risk factors using Principal Component Analysis, or by using industry-sector ETFs as proxies for risk factors. 8.2.3.2 The market neutral portfolio Following the notation in Section (1.5.2), we consider h1 , h2 , .., hN to be the dollars invested in different stocks (long or short) and let S1 , S2 , .., SN be the dividend-adjusted prices. Neglecting transaction costs, we consider the trading portfolio returns given by N X hi,t Ri,t i=1 where Ri,t is the expected return on the ith risky security over one period of time. Assuming the stock returns to follow the factor model in Equation (8.2.1) with αi,t = 0, the portfolio returns become N X hi,t m X N X βik Fkt + hi,t Xi,t i=1 k=1 N m X X N X hi,t Xi,t hi,t βik Fkt + i=1 which becomes i=1 k=1 i=1 where PN i=1 hi,t βik is net dollar-beta exposure along factor k and PN i=1 hi,t is the net dollar exposure of the portfolio. Definition 8.2.1 A trading portfolio is said to be market-neutral if the dollar amounts {hi }N i=1 invested in each of the stocks are such that βk = N X hi βik = 0 , k = 1, 2, .., m i=1 The coefficients β k correspond to the portfolio betas, or projections of the portfolio returns on the different factors. A market-neutral portfolio has vanishing portfolio betas; it is uncorrelated PNwith the market portfolio or factors driving the market returns. As a result, cancelling the net dollar-beta exposure i=1 hi βik for each factor, the portfolio returns become N X hi Xi i=1 Thus, a market-neutral portfolio is affected only by idiosyncratic returns (residuals). In G8 economies, stock returns are explained by approximately m = 15 factors (or between 10 and 20 factors), and the systematic component of stock returns explains approximately 50% of the variance (see Plerou et al. [2002] and Laloux et al. [2000]). Further, in this setting, we define the Leverage Ratio as PN Λ= i=1 |hi,t | Vt which is also written 289 (8.2.9) Quantitative Analytics Λ= Long market value + | Short market value | Equity Some examples of leverage are • long-only: Λ = L V • long-only, Reg T: L ≤ 2E therefore Λ ≤ 2 • 130-30 investment fund: L = 1.3V , |S| = 0.3V therefore Λ = 1.6 • long-short $-neutral, Reg T: L + |S| ≤ 2V therefore Λ ≤ 2 • long-short equal target position in each stock: hi ≤ 8.2.4 Estimating the factor model 8.2.4.1 The PCA approach Λmax V N therefore P i |hi | ≤ Λmax V Although this is very simplistic, the model can be tested on cross-sectional data. Using statistical testing, we can accept or reject the model for each stock in a given list and then construct a trading strategy for those stocks that appear to follow the model and yet for which significant deviations from equilibrium are observed. One of the problem is to find out if the residuals can be fitted to (increments of) OU processes or some other mean-reversion processes? If it is the case, we need to estimate the typical correlation time-scale. In risk-management, factor analysis is used to measure exposure of a portfolio to a particular industry of market feature. One relies on dimension-reduction technique for the study systems with a large number of degrees of freedom, making the portfolio theory viable in practice. Hence, one can consider PCA for extracting factors from data by using historical stock price data on a cross-section of N stocks going back M days in the past. Considering the time window 1 t = 0, 1, 2, .., T (days) where ∆t = 252 and a universe of N stocks, we let {Ri }N i=1 be the returns of the different stocks in the trading universe over an arbitrary one-day period (from close to close). The returns data is represented by a T × N matrix R(i, t) for i = 1, .., N with covariance matrix ΣR and elements σi2 = T T 1 X 1X (R(i, t) − Ri )2 , Ri = R(i, t) T − 1 t=1 T t=1 Data centring being an important element of PCA analysis as it helps minimizing the error of mean squared deviation, the standardised returns are given by Y (i, t) = R(i, t) R(i, t) − Ri or Y (i, t) = σi σi such that the empirical correlation matrix of the data is defined by T Γ(i, j) = 1 X Y (i, t)Y (j, t) T − 1 t=1 where Rank(Γ) ≤ min (N, T ). So one can consider T Γ(i, j) = 1 X Y (i, t)Y (j, t) T − 1 t=1 such that for any index i we get 290 Quantitative Analytics T Γ(i, i) = 1 X (Y (i, t))2 = 1 T − 1 t=1 One can regularise the correlation matrix as follow T C(i, j) = 1 X (R(i, t) − Ri )(R(j, t) − Rj ) + γδ(i, j) , γ = (10)−9 T − 1 t=1 where δij is the Kronecker delta, and C(i, i) ≈ σi2 . We can obtain the matrix as Γreg (i, j) = p C(i, j) C(i, i)C(j, j) This is a positive definite correlation matrix. It is equivalent for all practical purposes to the original one but is numerically stable for inversion and eigenvector analysis. this is especially useful when T << N . If we consider daily returns, we are faced with the problem that very long estimation windows T >> N do not make sense because they take into account the distant past which is economically irrelevant. On the other hand, if we just consider the behaviour of the market over the past year, for example, then we are faced with the fact that there are considerably more entries in the correlation matrix than data points. The commonly used solution to extract meaningful information from the data is Principal Components Analysis. 8.2.4.2 The selection of the eigenportfolios Following Section (5.5.3), we can now let λ1 > λ2 ≥ .. ≥ λN ≥ 0 be the eigenvalues ranked the in decreasing order (j) (j) (j) and V (j) = (V1 , V2 , .., VN ) jor j = 1, 2, .., N be the corresponding eigenvectors. We now need to estimate the significant eigenportfolios which can be used as factors. Analysing the density of states of the eigenvalues, we let m to be a fixed number of eigenvalues to extract the factors close to the number of industry sector. In that setting, the eigenportfolio for each index j is Fjt = N X (j) Vi Y (i, t) = i=1 (j) V N (j) X V i i=1 σi R(i, t) , j = 1, 2, .., m (j) where Qi = σi i is the respective amounts invested in each of the stock. We use the coefficients of the eigenvectors and the volatilities of the stocks to build portfolio weights. It corresponds to the returns of the eigenportfolios which 0 are uncorrelated in the sense that the empirical correlation of Fj and Fj 0 vanishes for j 6= j . These random variables span the same linear space as the original returns. As each stock return in the investment universe can be decomposed into its projection on the m factors and a residual, thus the PCA approach delivers a natural set of risk-factors that can be used to decompose our returns. Assuming that the correlation matrix is invertible, we get < Ri , Rj >= C(i, j) = m X (k) λk Vi (k) Vj k=1 with the factors Fk = N (k) X V N (k) 1 X Vi R(i) , F̃k = √ R(i) σi λk i=1 σi i i=1 and the norms < Fk2 >= λk , < F̃k2 >= 1 , < F̃k F̃k0 >= δkk0 291 Quantitative Analytics so that given the return Ri = Pm k=1 βik Fk we get the coefficient p (k) βik = σi λk Vi It is not difficult to verify that this approach corresponds to modelling the correlation matrix of stock returns as a sum of a rank-m matrix corresponding to the significant spectrum and a diagonal matrix of full rank C(i, j) = m X (k) λk Vi (k) Vj + 2ii δij k=1 where δij is the Kronecker delta and 2ii is given by 2ii = 1 − m X (k) λk Vi (k) Vi k=1 so that C(i, i) = 1. This means that we keep only the significant eigenvalues/eigenvectors of the correlation matrix and add a diagonal noise matrix for the purposes of conserving the total variance of the system. Laloux et al. [2000] pointed out that the dominant eigenvector is associated with the market portfolio, in the sense (1) (1) V (1) that all the coefficients Vi for i = 1, .., N are positive. Thus, the eigenportfolio has positive weights Qi = σi i which are inversely proportional to the stock’s volatility. It is consistent with the capitalisation-weighting, since larger capitalisation companies tend to have smaller volatilities. Note, the remaining eigenvectors must have components that are negative, in order to be orthogonal to V (i) . However, contrary to the interest-rate curve analysis, one can not apply the shape analysis to interpret the PCA. Another method consists in using the returns of sector ETFs as factors. In this approach, we select a sufficiently diverse set of ETFs and perform multiple regression analysis of stock returns on these factors. Unlike the case of eigenportfolios, ETF returns are not uncorrelated, so there can be redundancies: strongly correlated ETFs may lead to large factor loadings with opposing signs for stocks that belong to or are strongly correlated to different ETFs. To remedy this, we can perform a robust version of multiple regression analysis to obtain the coefficients βij such as the matching pursuit algorithm or the ridge regression. Avellaneda et al. [2008] associated to each stock a sector ETF and performed a regression of the stock returns on the corresponding ETF returns. Letting I1 , I2 , .., Im be the class of ETFs spanning the main sectors in the economy, and RIj be the corresponding returns, they decomposed the ETF as Ri = m X βij RIj + i j=1 While we need some prior knowledge of the economy to identify the right ETFs to explain returns, the interpretation of the factor loadings is more intuitive than for PCA. Note, ETF holdings give more weight to large capitalisation companies, whereas PCA has no apriori capitalisation bias. 8.2.5 Strategies based on mean-reversion 8.2.5.1 The mean-reverting model We consider the evolution of stock prices in Equation (1.5.20) and test the model on cross-sectional data. For instance, in the ETF framework, Pk (t) represents the mid-market price of the k-th ETF used to span the market. In practice, only ETFs that are in the same industry as the stock in question will have significant loadings, so we could also work with the simplified model ( Cov(Ri ,RPk ) V ar(RPk ) if stock i is in industry k βik = 0 otherwise 292 Quantitative Analytics where each stock is regressed to a single ETF representing its peers. In order to get a market-neutral portfolio, we we introduce a parametric model for Xi (t), namely, the Ornstein-Uhlembeck (OU) process with SDE dXi (t) = ki (mi − Xi (t))dt + σi dWi , ki > 0 where ki > 0 and {dWi }N i=1 are uncorrelated. This process is stationary and auto-regressive with lag 1 (AR(1) model). See Appendix (C.6.3) for properties of the OU process, details on its discretisation, and the calibration of the AR(1) model. In particular, the increment dXi (t) has unconditional mean zero and conditional mean equal to E[dXi (t)|Xi (s), s ≤ t] = ki (mi − Xi (t))dt The conditional mean, or forecast of expected daily returns, is positive or negative according to the sign of (mi − Xi (t)). In general, assuming that the model parameters vary slowly with respect to the Brownian motion, we estimate the statistics for the residual process on a window of length 60 days, letting the model parameters be constant over the window. This hypothesis is tested for each stock in the universe, by goodness-of-fit of the model and, in particular, by analysing the speed of mean-reversion. As described in Appendix (C.6.3), if we assume that the parameters of the model are constant, we get the solution Xi (t0 + ∆t) = e−ki ∆t Xi (t0 ) + (1 − e−ki ∆t )mi + σi Z t0 +∆t e−ki (t0 +∆t−s) dWi (s) t0 which is the linear regression Xn+1 = aXn + b + νn+1 , {νn } iid N 0, σ 2 ( 1 − e2ki ∆t ) 2ki where a = e−ki ∆t is the slope and b = (1 − e−ki ∆t )mi is the intercept. Letting ∆t tend to infinity, we see that equilibrium probability distribution for the process Xi (t) is normal with E[Xi (t)] = mi and V ar(Xi (t)) = σi2 2ki (8.2.10) According to Equation (1.5.20), investment in a market-neutral long-short portfolio in which the agent is long $1 in the stock and short βik dollars in the kth ETF has an expected 1-day return αi dt + ki (mi − Xi (t))dt The second term corresponds to the model’s prediction for the return based on the position of the stationary process Xi (t). It forecasts a negative return if Xi (t) is sufficiently high and a positive return if Xi (t) is sufficiently low. The parameter ki is called the speed of mean-reversion and τi = 1 ki represents the characteristic time-scale for mean reversion. If k >> 1 the stock reverts quickly to its mean and the effect of the drift is negligible. Hence, we are interested in stocks with fast mean-reversion such that τi << T1 where T1 is the estimation window. Based on this simple model, Avellaneda et al. [2008] defined several trading signals. First they considered an 60 = 0.24) incorporating at least one earnings cycle for the company estimation window of 60 business days (T1 = 252 1 and they selected stocks with mean-reversion times less than 12 period (k > 252 30 = 8.4) with τ = 0.12. That is, 2 30 period is τ = T21 = 252 and k = τ1 = 252 30 . To calibrate the model we consider the linear regression above, and deduce that 293 Quantitative Analytics mi = b 1 2ki V ar(ν) , ki = − log a , σi2 = 1−a ∆t 1 − a2 A fast mean-reversion (compared to the 60-days estimation window) requires that k > reversion of the order of 1.5 months at most. 8.2.5.2 252 30 , corresponding to a mean- Pure mean-reversion In this section we focus only on the process Xi (t), neglecting the drift αi . Given Equation (8.2.10) we know that the equilibrium volatility is r σi τi σeq,i = √ = σi 2 2ki We can then define the dimensionless variable si = Xi (t) − mi σeq,i called the s-score. The s-score measures the distance to equilibrium of the cointegrated residual in units standard deviations, that is, how far away a given stock is from the theoretical equilibrium value associated with our model. As a result, one can define a basic trading signal based on mean-reversion as • buy to open if si < −sbo • sell to open if si > +sso • close short position if si < +sbc • close long position if si > −ssc where the cutoff values sl for l = bo, so, bc, sc are determined empirically. Entering a trade, that is buy to open, means buying $1 of the corresponding stock and selling βi dollars of its sector ETF (pair trading). Similarly, in the case of using multiple factors, we buy βi1 dollars of ETF #1, βi2 dollars of ETF #2 up to βim dollars of ETF #m. The opposite trade consisting in closing a long position means selling stock and buying ETFs. Since we expressed all quantities in dimensionless variables, we expect the cutoffs sl to be valid across the different stocks. Based on simulating strategies from 2000 to 2004 in the case of ETF factors, Avellaneda et al. [2008] found that a good choice of cutoffs was sbo = sso = 1.25, sbc = 0.75, and ssc = 0.5. The rationale for opening trades only when the s-score si is far from equilibrium is to trade only when we think that we detected an anomalous excursion of the co-integration residual. Closing trades when the s-score is near zero also makes sense, since we expect most stocks to be near equilibrium most of the time. The trading rule detects stocks with large excursions and trades assuming these excursions will revert to the mean in a period of the order of the mean-reversion time τi . 8.2.5.3 Mean-reversion with drift When ignoring the presence of the drift, we implicitly assume that the effect of the drift is irrelevant in comparison with mean-reversion. Incorporating the drift, the conditional expectation of the residual return over a period of time ∆t becomes αi dt + ki (mi − Xi )dt = ki αi αi + mi − Xi dt = ki − σeq,i si dt ki ki This suggests that the dimensionless decision variable is the modified s-score 294 Quantitative Analytics smod,i = si − αi αi τi = si − ki σeq,i σeq,i In the previous framework, we short stock if the s-score is large enough. The modified s-score is larger if αi is negative, and smaller if αi is positive. Therefore, it will be harder to generate a short signal if we think that the residual has an upward drift and easier to short if we think that the residual has a downward drift. Since the drift can be interpreted as the slope of a 60-day moving average, we have therefore a built-in momentum strategy in this second signal. A calibration exercise using the training period 2000-2004 showed that the cutoffs defined in the previous strategy are also acceptable for this one. However, Avellaneda et al. [2008] found that the drift parameter had values of the order of 15 basis points and the average expected reversion time was 7 days, whereas the equilibrium volatility of residuals 7 ≈ 0.3. was on the order of 300 bps. The expected average shift for the modified s-score was of the order of 0.15 300 Hence, in practice, the effect of incorporating a drift in these time-scales was minor. 8.2.6 Portfolio optimisation Following the general portfolio valuation in Section (1.5.2), we consider h0 , h1 , .., hN to be the dollars invested in different stocks (long or short) and S0 , S1 , .., SN to be the dividend-adjusted prices. Neglecting transaction costs, the change in portfolio returns becomes dVt = N X hi i=1 N X dSi (t) −( hi )rdt + Vt rdt Si (t) i=1 dSi (t) Si (t) where Ri (t) = is the expected return on the ith risky security. Then, given the evolution of stock prices in Equation (1.5.20), the change in portfolio becomes dVt = N X i=1 hi m X βik k=1 N X dPk hi )rdt + Vt rdt + dXi − ( Pk i=1 which becomes dVt = N X hi dXi + N m X X hi βik k=1 i=1 i=1 N X dPk hi )rdt + Vt rdt −( Pk i=1 PN PN where i=1 hi βik is net dollar-beta exposure along factor k and i=1 hi the net dollar exposure of the portfolio. PN Cancelling the net dollar-beta exposure i=1 hi βik for each factor, the change in portfolio becomes dVt = N X i=1 N X hi dXi − ( hi )rdt + Vt rdt i=1 Thus, a market-neutral portfolio is affected only by idiosyncratic returns. Replacing with the residual process, we get dVt = N X hi ki (m − Xi )dt + σi dWi N X −( hi )rdt + Vt rdt i=1 i=1 which gives dVt = N X N X hi ki (m − Xi ) − r dt + hi σi dWi + Vt rdt i=1 i=1 Ignoring the term Vt rdt, and taking the conditional expectation, we get 295 Quantitative Analytics E[dVt |X] = N X N X hi ki (m − Xi ) − r dt = hi µi dt i=1 i=1 where µi = ki (m − Xi ) − r, and the conditional variance N X V ar(dVt |X) = h2i σi2 dt i=1 Following the mean-variance approach detailed in Section (??), we can therefore build the Mean-Variance optimal portfolio. We considerPthe mean-variance utility function given in Equation () where the expected return of Pwhere N N the portfolio is rP = i=1 hi µi and the variance of the portfolio’s return is σP2 = i=1 h2i σi2 . In that setting, the optimisation problem is given by N X max h N 1 X 2 2 h σ 2τ i=1 i i hi µi − i=1 where τ is the investor’s risk tolerance. The optimal risky portfolio must satisfy Equation (9.2.4). However, in the case of a beta-neutral portfolio, the constraint in Equation (9.2.1) must be satisfied. In our setting, the optimal weight becomes µi σi2 hi = τ Replacing the optimal weight hi in the change of portfolio, we get dVt = τ Setting ξi = (m−Xi ) √ 2ki σi N N X X 2 1 (ki (m − Xi ) − r) k (m − X ) − r dt + λ dWi i i 2 σ σi i=1 i i=1 and r = 0 we get dVt = λ N X ki i=1 2 ξi2 dt +τ N X i=1 r ki ξi dWi 2 As a result, we get the norms τN 2 < dVt >= PN i=1 ki N dt < (dVt )2 > − < dVt >2 = τ 2N 2 PN i=1 ki N dt and the annualised sharpe ratio becomes τN 2 M=q τ 2N 2 since √a a = √ PN i=1 ki N PN = i=1 ki r s N 2 N a. 296 PN i=1 ki = N s Nk 2 Quantitative Analytics 8.2.7 Back-testing The back-testing experiments consisted in running the signals through historical data, with the estimation of parameters (betas, residuals), signal evaluations and portfolio re-balancing performed daily. That is, we assumed that all trades are done at the closing price of that day. Further, we assume a round-trip transaction cost per trade of 10 basis points, to incorporate an estimate of price slippage and other costs as a single friction coefficient. Given the portfolio dynamics in Equation (1.5.17) where Vt is the portfolio equity at time t, the basic PnL equation for the strategy has the following form Vt+∆t = Vt + r∆tVt + N X hi,t Ri,t − r∆t( i=1 hi,t N X hi,t ) + i=1 N X i=1 hi,t N X Di,t − |hi,t+∆t − hi,t | Si,t i=1 = Vt Λt where Ri,t is the stock return on the period (t, t + ∆t), r represents the interest rate (assuming, for simplicity, no 1 spread between long and short rates), ∆t = 252 , Di,t is the dividend payable to holders of stock i over the period (t, t + ∆t), Si,t is the price of stock i at time t, and = 0.0005 is the slippage term alluded to above. At last, hi,t is the dollar investment in stock i at time t which is proportional to the total equity in the portfolio. The proportionality factor Λt is stock-independent and chosen so that the portfolio has a desired level of leverage on average. As a result, N X |hi,t | = N Et Λt i=1 Given the definition of the leverage ratio in Equation (8.2.9) we get Λt = N Λt so that Λt = ΛNt . That is, the weights Λt are uniformly distributed. For example, given N = 200, if we have 100 stocks 2 long and 100 short and we wish to have a (2 + 2) leverage ($2 long and $2 short for $1 of capital), then Λt = 100 and PN 2 we get i=1 |Qi,t | = Et 100 200 = 4Et . Remark 8.2.2 In practice this number is adjusted only for new positions, so as not to incur transaction costs for stock which are already held in the portfolio. Hence, it controls the maximum fraction of the equity that can be invested in any stock, and we take this bound to be equal for all stocks. Given the discrete nature of the signals, the strategy is such that there is no continuous trading. Instead, the full amount is invested on the stock once the signal is active (buy-to-open, short-to-open) and the position is unwound when the s-score indicates a closing signal. This all-or-nothing strategy, which might seem inefficient at first glance, turns out to outperform making continuous portfolio adjustments. 8.3 The meta strategies 8.3.1 Presentation 8.3.1.1 The trading signal i Given the time-series momentum strategy described in Section (8.1), we consider the return YJ,K (t) at time t for the series of the ith available individual strategy which is given by Equation (8.1.1). We are now going to consider several possible trading signal ψi (., .) defined in Section (8.1) and characterising the strategies based on the returns of the 297 Quantitative Analytics underlying process for the period [t − J, t]. Contrary to the time-series momentum strategy described in Section (8.1), we do not let the Return Sign or Moving Average be the trading signal ψi (., t) and do not directly follow the strategy characterised with the above return. Instead, we first perform some risk analysis of that strategy based on different risk measures. That is, we no-longer consider the time-series of the stock returns, but instead, we consider the time-series of some associated risk measures and use it to infer some trading signals. 8.3.1.2 The strategies Return sign Following the return sign strategy discussed in Section (8.1.2.1), we consider the random vector Y0i characterising the benchmark strategy of the ith asset where we always follow the previous move of the underlying price returns. For risk management purposes, we set J = 1 and K = 1 in Equation (8.1.1) getting the return i Y1,1 (jδ) = signi ((j − 1)δ, jδ)Ri (jδ, (j + 1)δ) = sign(Ri ((j − 1)δ, jδ))Ri (jδ, (j + 1)δ) = Y0i (jδ) where the random variables Y0i (jδ) take values in R. Moving average Following the moving average strategy discussed in Section (8.1.2.2), we consider the random vector Y0i characterising the strategy of the ith asset where a long (short) position is determined by a lagging moving average of a price series lying below (above) a past leading moving average. For J lookback periods and K holding periods, the return in Equation (8.1.1) becomes i YJ,K (jδ) = M Ai ((j − J)δ, jδ)Ri (jδ, (j + K)δ) = Y0i (jδ) where the random variables Y0i (jδ) take values in R. 8.3.2 The risk measures 8.3.2.1 Conditional expectations Focusing on the ith asset, we then let X i (jδ) for i = 1, .., N be a random variable taking on only countably many values and possibly correlated with the random variable Y0i (jδ) defined in Section (14.3.5). One of the main advantage of the theory of conditional expectation (described in Appendix (B.5.1)) is that if we already know the value of X i (jδ) we can use this information to calculate the expected value of Y0i (jδ) taking into account the knowledge of X i (jδ). That is, suppose we know that the event {X i (jδ) = k} for some value k has occurred, then the expectation of Y0i (jδ) may change given this knowledge. As a result, the conditional expectation of Y0i (jδ) given the event {X i (jδ) = k} is defined to be E[Y0i (jδ)|X i (jδ) = k] = E Q [Y0i (jδ)] where Q is the probability given by Q(Λ) = P (Λ|X i (jδ) = k). Further, if the r.v. Y0i (jδ) is countably valued then the conditional expectation becomes E[Y0i (jδ)|X i (jδ) = k] = ∞ X y0i (l)P Y0i (jδ) = y0i (l)|X i (jδ) = k l=1 i Note, if we denote Bk the event {X (jδ) = k}, we make sure that the family B1 , B2 , .., Bn is a partition of the sample space Ω (see Appendix (B.5.1)). As a result, we can express the conditional expectation as E[Y0i (jδ)|Bk ] = E[Y0i (jδ)IBk ] P (Bk ) For practicality we define the random variable 298 Quantitative Analytics Yki (jδ) = Y0i (jδ)I{Bk } , k = 1, 2, ..., n (8.3.11) Using Equation (B.5.2) we can express the expectation of the random variable Y0 (jδ) characterising the original strategy as a weighted sum of conditional expectation E[Y0i (jδ)] = n X E[Y0i (jδ)|Bk ]P (Bk ) = k=1 8.3.2.2 n X E[Y0i (jδ)IBk ] = k=1 n X E[Yki (jδ)] k=1 Some examples Example 1 For instance, we can define the random variable X i (jδ) to characterise the strategy consisting in following the previous move of returns only when that return is either positive or equal to zero, or when that return is negative. That is, the random variable X i (jδ) = sign(Ri ((j − 1)δ, jδ)) has only two events (or two points), and the state space is given by Ω = {Ri ((j − 1)δ, jδ) ≥ 0, Ri ((j − 1)δ, jδ) < 0} with B1 = Ri ((j − 1)δ, jδ) ≥ 0 and B2 = Ri ((j − 1)δ, jδ) < 0, so that Y1i (jδ) + Y2i (jδ) = Rti I{Ri ((j−1)δ,jδ)≥0} − I{Ri ((j−1)δ,jδ)<0} = Y0i (jδ) Since I{Ri ((j−1)δ,jδ)≥0} + I{Ri ((j−1)δ,jδ)<0} = 1, we get Y1i (jδ) + Y2i (jδ) = Ri (jδ) 2I{Ri ((j−1)δ,jδ)≥0} − 1 = Y0i (jδ) Example 2 Similarly to the previous example, we can define the random variable X i (jδ) to characterise the strategy consisting in following the product of the two previous move of returns only when that product is either positive or equal to zero, or either when that product is negative. That is, the random variable X i (jδ) = sign(Ri ((j − 2)δ, (j − 1)δ)Ri ((j − 1)δ, jδ)) has only two events (or two points), and the state space is given by Ω = {Ri ((j − 2)δ, (j − 1)δ)Ri ((j − 1)δ, jδ) ≥ 0, Ri ((j − 2)δ, (j − 1)δ)Ri ((j − 1)δ, jδ)δ) < 0} with B1 = Ri ((j − 2)δ, (j − 1)δ)Ri ((j − 1)δ, jδ) ≥ 0 and B2 = Ri ((j − 2)δ, (j − 1)δ)Ri ((j − 1)δ, jδ) < 0, so that Y1i (jδ) + Y2i (jδ) = Rti I{Ri ((j−2)δ,(j−1)δ)Ri ((j−1)δ,jδ)≥0} − I{Ri ((j−2)δ,(j−1)δ)Ri ((j−1)δ,jδ)<0} = Y0i (jδ) Example 3 In this example, we define the random variable X i (jδ) to characterise the strategy consisting in following the previous move of returns only when that return is either big, or when that return is small. That is, the random variable X i (jδ) = |Ri ((j − 1)δ, jδ)| ≥ cB has only two events (or two points), and the state space is given by Ω = {|Ri ((j − 1)δ, jδ)| ≥ cB , |Ri ((j − 1)δ, jδ)| < cB } with B1 = |Ri ((j − 1)δ, jδ)| ≥ cB and B2 = |Ri ((j − 1)δ, jδ)| < cB , so that Y1i (jδ) + Y2i (jδ) = Rti I{|Ri ((j−1)δ,jδ)|≥cB } − I{|Ri ((j−1)δ,jδ)| V ar(Yi (t)) for i = 1, 2, when E[Yi (t)] > 0 for i = 1, 2 we get E[Y1 (t)] E[Y2 (t)] M (Y0 (t)) < p +p = M (Y1 ) + M (Y2 ) V ar(Y1 (t)) V ar(Y2 (t)) and when E[Yi (t)] < 0 for i = 1, 2 we get E[Y2 (t)] E[Y1 (t)] +p = M (Y1 ) + M (Y2 ) M (Y0 (t)) > p V ar(Y1 (t)) V ar(Y2 (t)) while for E[Yi (t)] > 0 and E[Yj (t)] < 0 for i = 1, 2 and for j = 1, 2 with i 6= j, if |E[Yi (t)]| > |E[Yj (t)]| we get E[Yi (t)] E[Yj (t)] M (Y0 (t)) < p +p = M (Yi ) + M (Yj ) V ar(Yj (t)) V ar(Yi (t)) Given the definition of the conditional expectation and conditional variance in Appendix (B.5.1), we can consider the Information ratio or conditional Sharpe ratio M (Y0 (t)|Bk ) = E[Y0 (t)I{Bk } ]/P (Bk ) E[Y0 (t)|Bk ] = σY0 |Bk σY0 |Bk (8.3.12) p where σY0 |Bk = V ar(Y0 (t)|Bk ). Further, given the Definition (B.5.2) of the conditional expectation, we can rewrite the conditional Sharpe ratio as k M (Y0 (t)|Bk ) = where Qk is the probability given by Qk (Λ) = P (Λ|X = k). 300 E Q [Y0 (t)] σY0 |Bk Quantitative Analytics In order to select the appropriate strategy at time t, we need to consider the measure for which the event Bk (t) for k = 1, 2, .. is satisfied. Calling this event Bk∗ (t) and its associated measure M ∗ (Y0 |Bk ), if M ∗ (Y0 |Bk ) > αk we follow the strategy Yk (t) while if M ∗ (X0 |Bk ) < βk we follow the strategy −Yk (t) where αk is a positive constant and βk is a negative constant. 8.4 Random sampling measures of risk We assume that the population is of size N and that associated with each member of the population is a numerical value of interest denoted by x1 , x2 , .., xN . We take a sample with replacement of n values X1 , ..., Xn from the population, where n < N and such that Xi is a random variable. That is, Xi is the value of the ith member of the sample, and xi is that of the ith member of the population. The population moments and the sample moments are given in Appendix (B.9.1). 8.4.1 The sample Sharpe ratio From an investor’s perspective, volatility per se is not a bad feature of a trading strategy. In fact, increases in volatility generated by positive returns are desired. Instead, it is only the part of volatility that is generated by negative returns that is clearly unwanted. There exists different methodologies in describing what is called the downside risk of an investment. Sortino and Van Der Meer [1991] suggested the use of Sortino ratio as a performance evaluation metric in place of the ordinary Sharpe ratio. The Sharpe ratio treats equally positive and negative returns M= µ − Rf σ where the mean µ is estimated with the sample mean X, and the variance σ 2 is estimated with the sample variance n S2 = 1 X (Xi − X)2 n − 1 i=1 Whereas the former normalises the average excess returns with the square root of the semi-variance of returns (variance generated by negative returns) MS = µ − Rf σ− where the semi-variance (σ − )2 is estimated with the sample semi-variance n (S − )2 = X 1 (Xi I{Xi <0} )2 n− − 1 i=1 with n− being the number of periods with a negative return. It is therefore expected that the Sortino ratio will be relatively larger than the ordinary Sharpe ratio for positively skewed distributions 8.4.2 The sample conditional Sharpe ratio Given the definition of the conditional Sharpe ratio in Equation (8.3.12), we let the probability of the event be P (Bk ) = nk n where nk is the number of count in the partition Bk and define the conditional sample mean as X Bk = n n n 1X 1 X Xi I{Bk } = Xi I{Bk } nk n i=1 nk i=1 301 Quantitative Analytics which corresponds to the sample mean of the strata k. Given the definition of the local averaging estimates in Equation (9.3.19) we get ω n,i = I{Bk } with norm = nk and we recover the partitioning estimate in Equation (9.3.20) n X Bk = 1 X ω n,i Xi norm i=1 Given the definition of the conditional variance in Equation (B.5.3) we get the conditional sample variance as 2 SB = k n n n 1X 2 1 X 2 Xi I{Bk } − (X Bk )2 = X I{Bk } − (X Bk )2 nk n i=1 nk i=1 i Putting terms together, the sample conditional Sharpe ratio is M (Y0 (t)|Bk ) = 302 X Bk SBk Chapter 9 Portfolio management under constraints 9.1 Introduction We discussed in Section (1.7.6) the existence of excess returns and showed that the market is inefficient, that is, substantial gain is achievable by rebalancing and predicting market returns based on market’s history. As a consequence, we showed in Section (2.1.1) that market inefficiency leads to active equity management where enhanced indexed portfolios were designed to generate attractive risk-adjusted returns through active weights giving rise to active returns. Earlier results in the non-parametric statistics, information theory and economics literature (such as Kelly [1956], Markowitz [1952]) established optimality criterion for long-only, non-leveraged investment. We saw in Section (2.3) that in view of solving the problem of portfolio selection Markowitz [1952] introduced the mean-variance approach which is a simple trade-off between return and uncertainty, where one is left with the choice of one free parameter, the amount of variance acceptable to the individual investor. Similarly, Kelly [1956] introduced an investment theory based on growth by using the role of time in multiplicative processes to solve the problem of portfolio selection. We presented in Section (2.3.1.2) the capital asset pricing model (CAPM) and described in Appendix (9.3.16) the growth optimum theory (GOT) as an alternative to the expected utility theory and the mean-variance approaches to asset pricing. As an example, we presented in Section (2.3.2) the growth optimal portfolio (POP) as a portfolio having maximal expected growth rate over any time horizon. We saw in Section (7) that in view of taking advantage of market excess returns, a large number of hedge funds flourished, using complex valuation models to predict market returns. Specialised quantitative strategies developed along with specific prime brokerage structures. We defined leverage in Section (7.1.2) as any means of increasing expected return or value without increasing out-of-pocket investment. We are now going to introduce portfolio construction in presence of financial leverage and construction leverage such as short selling which is the process of borrowing assets and selling them immediately, with the obligation to rebuy them later. Portfolio optimisation in the long-short context does not differ much from optimisation in the long-only context. Jacobs et al. [1999] showed how short positions could be added to a long portfolio, by removing the greater than zero constraint from the model. In order to optimise a true long-short portfolio, constraints should be added to the model in order to ensure equal (in terms of total exposure) long and short legs. It was shown in Section (2.3.2) that the optimal asymptotic growth rate on non-leveraged, long-only memoryless market (independent identically distributed, i.i.d.) coincides with that of the best constantly rebalanced portfolio (BCRP). In the special case of memoryless assumption on returns, adding leverage through margin buying and short selling, Horvath et al. [2011] derived optimality conditions and generalised the BCRP by establishing no-ruin conditions. 303 Quantitative Analytics 9.2 Robust portfolio allocation There are some different methods of portfolio optimisation available. We described in Section (2.2.1) the classic MeanVariance portfolio based on algorithms working with point-estimates of expected returns, variances and covariances. 9.2.1 Long-short mean-variance approach under constraints Considering proper portfolio optimisation, Jacobs et al. [1999] had a rigorous look at long-short optimality and called into question the goals of dollar, and beta neutrality which is common practice in traditional long-short management. Following their approach we consider the mean-variance 1 utility function (see details in Appendix (A.7.2)) 1 σP2 2 τ U = rP − (9.2.1) where rP is the expected return of the portfolio during the investor’s horizon, σP2 is the variance of the portfolio’s return, and τ is the investor’s risk tolerance. We need to choose how to allocate the investor’s wealth between a riskfree security and a set of N securities, and we need to choose how to distribute wealth among the N risky securities. We let hR be the fraction of wealth allocated to the risky portfolio (total wealth is 1), and we let hi be the fraction of wealth invested in the ith risky security. The three components of capital earning interest at the risk-free rate are • the wealth allocated to the risk-free security with magnitude of 1 − hR • the balance P of the deposit made with the broker after paying for the purchase of shares long with magnitude hR − i∈L hi where L is the set of securities held long P P • the proceeds of the short sales with magnitude of i∈S |hi | = − i∈S hi where S is the set of securities sold short Since |x| = x for a positive x and |x| = −x for a negative x then hi is negative for i ∈ S. Summing these three components gives the total amount of capital hF earning interest at the risk-free rate hF = 1 − N X hi (9.2.2) i=1 which is independent of hR . We can then make the following observations: PN • In case of long-only management where everything is invested in risky assets, the portfolio satisfies i=1 hi = 1 and we get hF = 0, PN • while in case of short-only management in which i=1 hi = −1, the quantity hF is equal to 2 and the investor earns the risk-free rate twice. PN • In the case of a dollar-balanced long-short management in which i=1 hi = 0, the investor earns the risk-free rate only once. Note, if we do not allocate wealth to the risk-free security, the fraction of wealth allocated to the risky portfolio is hR = 1, and the total amount of capital hF earning interest at the risk-free rate becomes hF = hR − N X hi i=1 1 It is only a single-period formulation which is not sensitive to investor wealth. 304 Quantitative Analytics We now let rF be the return on the risk-free security, and Ri be the expected return on the ith risky security. As explained in Section (9.2.2.2), in the case of short-selling, when the price of an asset drops, the returns becomes −Ri . Since hi < 0, when asset price rises we get Ri > 0 and we loose money, and when asset price drops we get Ri < 0 and we make money. Putting long and short returns together, the expected return on the investor’s total portfolio is rP = hF rF + N X hi Ri i=1 We substitute hF into this equation, the total portfolio return is the sum of a risk-free return and a risky return component rP = (1 − N X hi )rF + N X i=1 hi Ri = rF + rR (9.2.3) i=1 where the risky return component is rR = N X hi ri i=1 where ri = Ri − rF is the expected return on the ith risky security in excess of the risk-free rate. It can be expressed in matrix notation as rR = h> r where h = [h1 , .., hN ]> and r = [r1 , .., rN ]> . Similarly to the long-only portfolio in Section (2.2.1), given rR , the variance of the risky component is 2 σR = h> Qh 2 where Q is the covariance matrix of the risky securities’ returns. It is also the variance of the entire portfolio σP2 = σR . Using these expressions, the utility function in Equation (9.2.1) can be rewritten in terms of controllable variables. We determine the optimal portfolio by maximising the utility function through appropriate choice of these variables under constraints. For instance, the requirement that all the wealth allocated to the risky securities is fully utilised. Some of the most common portfolio constraints are PN • beta-neutrality constraint i=1 hi βi = 0 PN PN • portfolio constraint i=1 hi = 1 for long-only portfolio and i=1 hi = −1 for short-only portfolio PN P P • leverage constraint i=1 |hi | = l where l is the leverage or we can set i∈L |hi | = lL and i∈S |hi | = lS with l = lL + lS Most strategies will be dollar and beta neutral, but fewer will be sector/industry, capitalisation and factor neutral. Arguably, the more neutral a long-short portfolio the better, as systematic risk diminishes (as does the residual return correlation of the long and short portfolios) and stock specific risk which is the object of long-short, increases. The solution (provided Q is non-singular) gives the optimal risky portfolio h = τ Q−1 r (9.2.4) corresponding to the minimally constrained portfolio. The expected returns and their covariances must be quantities that the investor expect to be realised over the portfolio’s holding period. 305 Quantitative Analytics Remark 9.2.1 The true statistical distribution of returns being unknown, it leads to different results based on different assumptions. Optimal portfolio holdings will thus differ for each investor, even though investors use the same utility function. The optimal holdings in Equation (9.2.4) define a portfolio allowing for short positions because no non-negativity constraints are imposed. The single portfolio exploits the characteristics of individual securities in a single integrated optimisation even though the portfolio can be partitioned artificially into one sub-portfolio of long stocks and the other one of stocks sold short (there is no benefit in doing so). Further, the holdings need not satisfy any arbitrary balance conditions, that is dollar or beta neutrality is not required. The portfolio has no inherent benchmark so that there is no residual risk. The portfolio will exhibit an absolute return and an absolute variance of return. This return is calculated as the weighted spread between the returns to the securities held long and the ones sold short. Performance attribution can not distinguish between the contribution of the stocks held long and those sold short. Remark 9.2.2 Separate long and short alpha (and their correlation) are meaningless. Long-short portfolio allows investors to be insensitive to chosen exogenous factors such as the return of the equity market. This is done by constructing a portfolio so that the beta of the short positions equals and offsets the beta of the long position, or (more problematically) the dollar amount of securities sold short equals the dollar amount of securities held long. However, market neutrality may exact costs in terms of forgone utility. This is the case if more opportunities exist on the short side than on the long side of the market. One might expect some return sacrifice from a portfolio that is required to hold equal-dollar or equal-beta positions long and shorts. Market neutrality can be achieved by using the appropriate amount of stock index futures, without requiring that long and short security positions be balanced. Nevertheless, investors may prefer long-short balances for mental accounting reasons. Making the portfolio insensitive to equity market return (or to any other factor) constitutes an additional constraint on the portfolio. The optimal neutral portfolio maximise the investor’s utility subject to all constraints, including neutrality. However, the optimal solution is no-longer given by Equation (9.2.4). Definition 9.2.1 By definition, the risky portfolio is dollar-neutral if the net holding H of risky securities is zero, meaning that H= N X hi = 0 (9.2.5) i=1 This condition is independent of hR . Applying the condition in Equation (9.2.5) to the optimal weights in Equation (9.2.4) it can be shown that the dollar-neutral portfolio is equal to the minimally constrained optimal portfolio when H∼ N X ri (ξi − ξ) = 0 σi i=1 where ξi = σ1i is a measure of stability of the return of the stock i and ξ is the average return stability of all stocks in the investor’s universe. The term σrii is a risk adjusted return, and (ξi − ξ) can be seen as an excess stability. Highly volatile stocks will have low stabilities and their excess stability will be negative. If the above quantity is positive, the net holding should be long, and if it is negative it should be short. Once the investor has chosen a benchmark, each security can be modelled in terms of its expected excess return αi and its beta βi with respect to that benchmark. If rB is the expected return of the benchmark, then the expected return of the ith security is ri = αi + βi rB 306 Quantitative Analytics Similarly, the expected return of the portfolio can be modelled in terms of its expected excess return αP and beta βP with respect to the benchmark rP = αP + βP rB (9.2.6) where the beta of the portfolio is expressed as a linear combination of the betas of the individual securities βP = N X hi βi i=1 This is obtained by replacing the expected return ri of the ith security in the portfolio return rP given in Equation (9.2.3). From Equation (9.2.6) it is clear that any portfolio that is insensitive to changes in the expected benchmark return must satisfy the condition βP = 0 Applying this condition to the optimal weights in Equation (9.2.4), together with the model for the expected return of the ith security above, it can be shown that the beta-neutral portfolio is equal to the optimal minimally constrained portfolio when N X βi φ i = 0 i=1 with weights φi = ri 2 σe,i (9.2.7) 2 where ri is the excess return and σe,i is the variance of the excess return of the ith security. It is the portfolio net beta-weighted risk-adjusted expected return. When this condition is satisfied the constructed portfolio is unaffected by the return of the chosen benchmark (it is beta-neutral). 9.2.2 Portfolio selection As an example of long-only, non-leveraged active equity management, the Constantly Rebalanced Portfolio (CRP) is a self-financing portfolio strategy, rebalancing to the same proportional portfolio in each investment period. This means that the investor neither consumes from, nor deposits new cash into his account, but reinvests his capital in each trading period. Using this strategy the investor chooses a proportional portfolio vector πv = (πv1 , ..., πvN ), where πvi is defined in Equation (1.5.18), and rebalances his portfolio after each period to correct the price shifts in the market. The idea being that on a frictionless market the investor can rebalance his portfolio for free at each trading period. Hence, asymptotic optimisation on a memoryless market means that the growth optimal (GO) strategy will pick the same portfolio vector at each trading period, leading to CRP strategies. Thus, the one with the highest asymptotic average growth rate is referred to as Best Constantly Rebalanced portfolio (BCRP). In a memoryless market, leverage is anticipated to have substantial merit in terms of growth rate, while short selling is not expected to yield much better results since companies worth to short in a testing period might already have defaulted. That is, in case of margin buying (the act of borrowing money and increasing market exposure) and short selling, it is easy to default on total initial investment. In this case the asymptotic growth rate becomes minus infinity. Horvath et al. [2011] showed that using leverage through margin buying yields substantially higher growth rate in the case of memoryless assumption on returns. They also established mathematical basis for short selling, that is, creating negative exposure to asset prices. Adding leverage and short selling to the framework, Horvath et al. derived optimality conditions and generalised the BCRP by establishing no-ruin conditions. They further showed that short selling might yield increased profits in case of markets with memory since market is inefficient. 307 Quantitative Analytics 9.2.2.1 Long only investment: non-leveraged We consider a market consisting of N assets and let the evolution of prices to be represented by a sequence of price vectors S1 , S2 , .. ∈ RN + where Sn = (Sn1 , Sn2 , ..., SnN ) Sni denotes the price of the ith asset at the end of the nth trading period. We transform the sequence of price vectors {Sn } into return vectors xn = (x1n , x2n , ..., xN n) where xin = Sni i Sn−1 (9.2.8) Note, we usually denotes return as Rni = xin − 1 Note also that expected excess return is the expected absolute return minus the expected risk free rate. A representative example of the dynamic portfolio selection in the long-only case is the constantly rebalanced portfolio (CRP), introduced and studied by Kelly [1956], Latane [1959], and presented in Section (2.3.2). As defined in Equation i i (n) (1.5.18), we let πvi (n) = δ (n)S be the ith component of the vector πv representing the proportion of the investor’s V (n) capital invested in the ith asset in the nth trading period. Remark 9.2.3 In that setting, the proportion of the investor’s wealth invested in each asset at the beginning of trading periods is constant. The portfolio vector has non-negative components that sum up to 1, and the set of portfolio vectors is denoted by N X πvi = 1 ∆N = πv = (πv1 , ..., πvN ) , πvi ≥ 0 , i=1 Note, in this example nothing is invested into cash (risk-free rate). Let V (0) denote the investor’s initial capital. At the beginning of the first trading period, n = 1, V (0)πvi is invested into asset i, and it results in position size V (1) = V (0)πvi + V (0)πvi S1i − S0i = V (0)πvi xi1 S0i after changes in market prices, or equivalently V (1) = V (0)πvi (1 + R1i ). That is, we hold V (0)πvi of asset i and we earn V (0)πvi R1i of interest. Therefore, at the end of the first trading period the investor’s wealth becomes V (1) = V (0) N X πvi xi1 = V (0) < πv , x1 > i=1 where < ., . > is the inner product. Equivalently, we get V (1) = V (0) N X πvi (1 + R1i ) = V (0) < πv , (1 + R1 ) > i=1 For the second trading period, n = 2, V (1) is the new initial capital, and we get 308 Quantitative Analytics V (2) = V (1) < πv , x2 >= V (0) < πv , x1 >< πv , x2 > Note, taking the difference between period n = 2 and period n = 1 and setting dS1i = S2i − S1i , we get V (2) − V (1) = V (1) N X πvi R2i = V (1) i=1 PN since i=1 πvi = 1. For πvi (1) = the investor’s wealth becomes δ i S1i V (1) N X πi v i=1 S1i dS1i we recover the dynamics of the portfolio. By induction, after n trading periods, V (n) = V (n − 1) < πv , xn >= V (0) n Y < πv , xj > j=1 Including cash account into the framework is straight forward by assuming xin = 1 (or Rni = 0) for some i and for all n. The asymptotic average growth rate of the portfolio satisfies n 1X 1 ln V (n) = lim ln < πv , Xj > n→∞ n n→∞ n j=1 W (πv ) = lim if the limit exists. If the market process {Xi } is memoryless, (it is a sequence of independent and identically distributed (i.i.d.) random return vectors) then the asymptotic rate of growth exists almost surely (a.s.), where, with random vector X being distributed as Xi we get n 1X ln < πv , Xj >= E[ln < πv , X >] = E[ln < πv , (1 + R) >] n→∞ n j=1 W (πv ) = lim (9.2.9) given that E[ln < πv , X >] is finite, due to strong law of large numbers. We can ensure this property by assuming finiteness of E[ln X i ], that is, E[| ln X i |] < ∞ for each i = {1, 2, .., N }. Because of πvi > 0 for some i, we have E[ln < πv , X >] ≥ E[ln(πvi X j )] = ln πvi + E[ln X j ] > −∞ and because of πvi ≤ 1 for all i, we have E[ln < πv , X >] ≤ ln N + X E[ln |X j |] < ∞ j From Equation (9.2.9), it follows that rebalancing according to the best log-optimal strategy πv∗ ∈ arg max E[ln < πv , X >] πv ∈∆N is also an asymptotically optimal trading strategy, that is, a strategy with a.s. optimum asymptotic growth W (πv∗ ) ≥ W (πv ) for any πv ∈ ∆N . The strategy of rebalancing according to πv∗ at the beginning of each trading period, is called best constantly rebalanced portfolio (BCRP). For details on the maximisation of the asymptotic average rate of growth see Bell et al. [1980]. 309 Quantitative Analytics 9.2.2.2 Short selling: No ruin constraints Short selling an asset is usually done by borrowing the asset under consideration and selling it. As collateral the investor has to provide securities of the same value to the lender of the shorted asset. This ensures that if anything goes wrong, the lender still has high recovery rate. While the investor has to provide collateral, after selling the assets having been borrowed, he obtains the price of the shorted asset again. This means that short selling is virtually for free 0 V =V −C +P 0 where V is wealth after opening the short position, V is wealth before, C is collateral for borrowing and P is price income of selling the asset being shorted. For simplicity we assume C=P (9.2.10) 0 so that V = V and short selling is free. Note, in the case of naked short transaction, selling an asset short yields immediate cash (see Cover et al. [1998]). For example, assume an investor wants to short sell 10 shares of IBM at $100, and he has $1000 in cash. First he has to find a lender, the short provider, who is willing to lend the shares. After exchanging the shares and the $1000 collateral, the investor sells the borrowed shares. After selling the investor has $1000 in cash again, and the obligation to cover the shorted assets later. If the price drops $10, he has to cover the short position at $90, thus he gains 10 × $10 (weight is 10 and return is $10). If the price rises $10, he has to cover at $110, loosing 10 × $10. In this example we assume that our only investment is in asset i and our initial wealth is V (0). We invest a proportion of πvi ∈ (−1, 1) of our wealth in the ith risky asset and πv0 = 1 − πvi is invested in cash. If the position is long (πvi > 0), it results in the wealth in period n = 1 as V (1) = V (0)(1 − πvi ) + V (0)πvi xi1 = V (0) + V (0)πvi (X1i − 1) = V (0) + δ i (S1i − S0i ) where V (0)πv0 is invested in cash. Equivalently, we get V (1) = V (0)(1 − πvi ) + V (0)πvi (1 + R1i ) = V (0) + V (0)πvi R1i Again, we hold V (0)πvi of asset i and we earn V (0)πvi R1i of interest. While if the position is short (πvi < 0), we win as much money as price drop of the asset. Remark 9.2.4 As we are short selling a stock, we do not hold the asset and we do not earn interest out of it. From Equation (9.2.10), we only make a profit when the value of the asset drops. Given the return in Equation (9.2.8), when price of asset drops, the return becomes 1 − Xni = i Sn−1 − Sni = −Rni ≥ 0 i Sn−1 and the wealth becomes V (1) = V (0) + V (0)|πvi |(1 − X1i ) = V (0) − V (0)πvi (1 − X1i ) = V (0) + V (0)πvi (X1i − 1) since from Equation (9.2.10) short selling is free. That is, V is used as collateral to borrow stocks, and once sold we receive income (cash) from them. Equivalently, we get V (1) = V (0) + V (0)|πvi |(−R1i ) = V (0) + V (0)πvi R1i Remark 9.2.5 Since πvi < 0, when price rises we get positive return R1i > 0 and we loose money, and when price drops we get negative return R1i < 0 and we make money. 310 Quantitative Analytics Let’s consider the general case where πv = (πv0 , πv1 , ..., πvN ) is the portfolio vector such that the 0th component corresponds to cash. From Remark (9.2.4), we can conclude that at the end of the first trading period, n = 1, the investor’s wealth becomes N X i+ i + − V (1) = V (0) πv0 + πv X1 + πvi (X1i − 1) i=1 − where (.) denotes the negative part operation. Equivalently, we get N X i+ + − V (1) = V (0) πv0 + πv (1 + R1i ) + πvi R1i i=1 In case of the investor’s net wealth falling to zero or below he defaults. However, negative wealth is not allowed in our framework, thus the outer positive part operation. Since only long positions cost money in this setup, we will constrain to portfolios such that N X + πvi = 1 i=0 PN + leading to πv0 = 1 − i=1 πvi . Hence, if the portfolio has no long position, that is, only short position, then from Equation (9.2.10) all the capital is in cash πv0 = 1 since short selling is free. Considering this, we can rewrite the portfolio in period n = 1 as V (1) N N X X i+ i + + − πvi + πv (X1 − 1) + πvi (X1i − 1) = V (0) i=0 i=1 N X i i + πv (X1 − 1) = V (0) 1 + i=1 Equivalently, we get N + X πvi R1i V (1) = V (0) 1 + i=1 This shows that we gain as much as long positions raise and short positions fall (see Remark (9.2.5)). Hence, we can see that short selling is a risky investment, because it is possible to default on total initial wealth without the default of any of the assets in the portfolio. The possibility of this would lead to a growth rate of minus infinity, thus we restrict our market according to 1 − B + δ < Xni < 1 + B − δ , i = 1, ..., N (9.2.11) or equivalently −B + δ < Rni < B − δ , i = 1, ..., N Besides aiming at no-ruin, the role of δ > 0 is ensuring that rate of growth is finite for any portfolio vector. For the usual stock market daily data, there exist 0 < a1 < 1 < a2 < ∞ such that a1 ≤ xin ≤ a2 or a1 − 1 ≤ Rni ≤ a2 − 1 311 Quantitative Analytics for all i = 1, ..., N and for example a1 = 0.7 and with a2 = 1.2. Thus, we can choose B = 0.3. As a result, the maximal loss that we could suffer is B N X |πvi | i=1 This value has to be constrained to ensure no-ruin. We denote the set of possible portfolio vectors by N N X X + 0 1 N 0 ∆−B πvi = 1 , B |πvi | ≤ 1 N = πv = (πv , πv , ..., πv ) , πv ≥ 0 , i=0 + where i=0 πvi = 1 means that we invest all of our initial PN B i=1 |πvi | ≤ 1 maximal exposure is limited such that ruin PN i=1 wealth into some assets - buying long - or cash. By is not possible, and rate of growth it is finite. This is equivalent to N X − πvi ≤ i=1 1−B = 2.33 B ∆−B N Since the set of possible portfolio vectors is not convex we can not apply the Kuhn-Tucker theorem to get the maximum asymptotic average rate of growth. Horvath et al. [2011] proposed to transform the non-convex set ∆−B N ˜ −B and showed that in that setting π̃v∗ had the same market exposure as with πv∗ . to a convex region ∆ N 9.2.2.3 Long only investment: leveraged Assuming condition in Equation (9.2.11) then market exposure can be increased over one without the possibility of ruin. Given the portfolio vector πv = (πv0 , πv1 , ..., πvN ) where πv0 is the cash component, the no short selling condition implies that πvi > 0 for i = 1, ..., N . We assume the investor can borrow money and invest it on the same rate r, and that the maximal investable amount of cash LB,r (relative to initial wealth V (0)) is always available for the investor. That is, LB,r ≥ 1 sometimes called the buying power, is chosen to be the maximal amount, investing of which ruin is not possible given Equation (9.2.11). Because our investor decides over the distribution of his buying power, we get the constraint N X πvi = LB,r i=0 πv0 so that = LB,r − defined as PN i i=1 πv . Unspent cash earns the same interest r, as the rate of lending. The market vector is Xr = (X 0 , X 1 , ..., X N ) = (1 + r, X 1 , ..., X N ) where X 0 = 1 + r. The feasible set of portfolio vectors is N X +N +1 0 1 N ∆+B,r = π = (π , π , ..., π ) ∈ R , πvi = LB,r v v v v 0 N i=0 where πv0 denotes unspent buying power. Hence, the investor’s wealth evolves according to + V (1) = V (0) < πv , Xr > −(LB,r − 1)(1 + r) where V (0)r(LB,r − 1) is interest on borrowing (LB,r − 1) times the initial wealth V (0). Equivalently, we get 312 Quantitative Analytics V (1) = V (0) N X πvi (1 + Ri ) − (LB,r − 1)(1 + r) + i=0 πv0 X 0 πv0 (1 0 where = + r) so that R = r. Given the maximal investable amount of cash LB,r ≥ 1 relative to initial wealth V (0), we borrow the quantity (LB,r − 1) which is invested in the long-only portfolio. However, we do not keep borrowing that quantity on the rolling portfolio and we must subtract it from our rolling portfolio. We can visualise that phenomenon by expending the previous equation V (1) = V (0) LB,r + N X N X + + πvi Ri − (LB,r − 1)(1 + r) = V (0) 1 + πvi Ri − r(LB,r − 1) i=0 i=0 Further, as we borrow the amount V (0)(LB,r − 1) from the broker, we must subtract the interest rV (0)(LB,r − 1) from our portfolio. To ensure no-ruin and finiteness of growth rate choose LB,r = 1+r B+r This ensures that ruin is not possible: < πv , Xr > −(LB,r − 1)(1 + r) = N X πvi X i − (LB,r − 1)(1 + r) i=0 = πv0 (1 + r) + N X πvi X i − (LB,r − 1)(1 + r) > πv0 (1 + r) + i=1 N X πvi (1 − B + δ) − (LB,r − 1)(1 + r) i=1 and after simplification 1+r B+r For details on maximising the asymptotic average rate of growth see Horvath et al. [2011]. < πv , Xr > −(LB,r − 1)(1 + r) > δ 9.2.2.4 Short selling and leverage Assuming short selling and leverage, we combine the results of the previous two sections, so that the investor’s wealth evolves according to N + X i+ i − V (1) = V (0) πv0 (1 + r) + πv X1 + πvi (X1i − 1 − r) − (LB,r − 1)(1 + r) i=1 − where (.) denotes the negative part operation. Equivalently, we get N + X i+ − V (1) = V (0) πv0 (1 + r) + πv (1 + r1i ) + πvi r1i − (LB,r − 1)(1 + r) i=1 and expending the equation, the investor’s wealth becomes N N + X X i+ i + − V (1) = V (0) πv0 (1 + r) + πvi + πv r1 + πvi r1i − (LB,r − 1)(1 + r) i=1 i=1 with the buyer power constraint 313 (9.2.12) Quantitative Analytics N X + πvi = LB,r i=0 so that πv0 = LB,r − PN i=1 + πvi . Expending the previous equation, and putting terms together, we get N N + + X X V (1) = V (0) rπv0 + 1 + πvi r1i − r(LB,r − 1) = V (0) 1 + πvi r1i − r(LB,r − 1) i=1 with r10 i=0 = r. The feasible set corresponding to the non-convex region is N N X X 0 1 N i+ ∆±B,r = π = (π , π , ..., π ) , π = L , B |πvi | ≤ 1 v B,r v v v v N i=0 (9.2.13) i=0 Again, using the transformation for short selling, Horvath et al. [2011] showed that in that setting π̃v∗ had the same market exposure as with πv∗ . 9.3 Empirical log-optimal portfolio selections We presented in Section (2.3.2) the growth optimal portfolio (POP) as a portfolio having maximal expected growth rate over any time horizon. Following Gyorfi et al. [2011], we are now going to introduce the growth optimum theory (GOT) as an alternative to the expected utility theory and the mean-variance approaches to asset pricing. Investment strategies are allowed to use information collected from the past of the market, and determine a portfolio at the beginning of a trading period, that is, a way of distributing their current capital among the available assets. The goal of the investor is to maximise his wealth in the long run without knowing the underlying distribution generating the stock prices. Under this assumption the asymptotic rate of growth has a well-defined maximum which can be achieved in full knowledge of the underlying distribution generated by the stock prices. In this section, both static (buy and hold) and dynamic (daily rebalancing) portfolio selections are considered under various assumptions on the behaviour of the market process. While every static portfolio asymptotically approximates the growth rate of the best asset in the study, one can achieve larger growth rate with daily rebalancing. Under memoryless assumption on the underlying process generating the asset prices, the best rebalancing is the log-optimal portfolio, which achieves the maximal asymptotic average growth rate. After presenting the log-optimal portfolio, we will then briefly present the semi-log optimal portfolio selection as an alternative to the log-optimal portfolio. 9.3.1 Static portfolio selection Keeping the same notation as in Section (2.3.2), the market consists of N assets, represented by an N -dimensional vector process S where Sn = (Sn0 , Sn1 , .., SnN ) with Sn0 = 1, and such that the ith component S i of Sn denotes the price of the ith asset on the n-th trading period. Further, we put S0i = 1. We assume that {Sn } has exponential trend: i Sni = enWn ≈ enW with average growth rate (average yield) Wni = 1 ln Sni n and with asymptotic average growth rate 314 i Quantitative Analytics W i = lim n→∞ 1 ln Sni n A static portfolio selection is a single period investment strategy. A portfolio vector is denoted by πv = (πv1 , .., πvN ) where the ith component πvi of πv denotes the proportion of the investor’s capital invested in asset i. We assume that the portfolio vector b has non-negative components which sum up to 1, meaning that short selling is not permitted. The set of portfolio vectors is denoted by N X ∆N = πv = (πv1 , ..., πvN ) , πvi ≥ 0 , πvi = 1 i=1 i The aim of static portfolio selection is to achieve max1≤i≤N W . The static portfolio is an index, for example, the S&P 500 such that at time n = 0 we distribute the initial capital V (0) according to a fix portfolio vector πv , that is, if V (n) denotes the wealth at the trading period n, then V (n) = V (0) N X πvi Sni i=1 We apply the following simple bounds V (0) max πvi Sni ≤ V (n) ≤ N V (0) max πvi Sni i If πvi i > 0 for all i = 1, .., N then these bounds imply that W = lim n→∞ 1 1 ln V (n) = lim max ln Sni = max W i n→∞ i i n n Thus, any static portfolio selection achieves the growth rate of the best asset in the study, maxi W i , and so the limit does not depend on the portfolio πv . In case of uniform portfolio (uniform index) πvi = N1 , and the convergence above is from below: V (0) max i 9.3.2 1 i S ≤ V (n) ≤ V (0) max Sni i N n Constantly rebalanced portfolio selection In order to apply the usual prediction techniques for time series analysis one has to transform the sequence price vectors {Sn } into a more or less stationary sequence of return vectors (price relatives) {Xn } Xn = (Xn1 , .., XnN ) Si such that Xni = S i n = Rni + 1. With respect to the static portfolio, one can achieve even higher growth rate for long n−1 run investments, if we make rebalancing, that is, if the tuning of the portfolio is allowed dynamically after each trading period. The dynamic portfolio selection is a multi-period investment strategy, where at the beginning of each trading period we can rearrange the wealth among the assets. A representative example of the dynamic portfolio selection is the constantly rebalanced portfolio (CRP), which was introduced and studied by Kelly [1956], Latane [1959], Breiman [1961], Markowitz [1976]. In case of CRP we fix a portfolio vector b ∈ ∆N , that is, we are concerned with a hypothetical investor who neither consumes nor deposits new cash into his portfolio, but reinvests his portfolio at each trading period. In fact, neither short selling, nor leverage is allowed. The investor has to rebalance his portfolio after each trading day to corrigate the daily price shifts of the invested stocks. 315 Quantitative Analytics Let V (0) denote the investor’s initial capital. Then at the beginning of the first trading period V (0)πvi is invested into asset i, and it results in return V (0)πvi X1i = V (0)bi (1 + R1i ). Therefore at the end of the first trading period the investor’s wealth becomes V (1) = V (0) N X πvi X1i = V (0) i=1 N X πvi (1 + R1i ) = V (0) < πv , X1 > i=1 where < ., . > denotes inner product. For the second trading period, V (1) is the new initial capital V (2) = V (1) < πv , X2 >= V (0) < πv , X1 >< πv , X2 > By induction, for the trading period n the initial capital is V (n − 1), therefore n Y V (n) = V (n − 1) < πv , Xn >= V (0) < πv , Xj > j=1 The asymptotic average growth rate of this portfolio selection is n n 1 1X 1X 1 ln V (n) = lim ln V (0) + ln < πv , Xj > = lim ln < πv , Xj > n→∞ n n→∞ n n→∞ n n j=1 j=1 W = lim therefore without loss of generality one can assume in the sequel that the initial capital V (0) = 1. 9.3.2.1 Log-optimal portfolio for memoryless market process If the market process {Xi } is memoryless, that is, it is a sequence of independent and identically distributed (i.i.d.) random return vectors, then one can show that the best constantly rebalanced portfolio (BCRP) is the log-optimal portfolio: πv∗ = arg max E[ln < πv , X1 >] πv ∈∆N (9.3.14) This optimality means that if V ∗ (n) = V (n)(πv∗ ) denotes the capital after day n achieved by a log-optimal portfolio strategy πv∗ , then for any portfolio strategy πv with finite E[(ln < πv , X1 >)2 ] and with capital V (n) = V (n)(πv ) and for any memoryless market process {Xn }∞ −∞ 1 1 ln V (n) ≤ lim ln V ∗ (n) almost surely n→∞ n n→∞ n and maximal asymptotic average growth rate is W = lim 1 ln V ∗ (n) = W ∗ = E[ln < πv∗ , X1 >] almost surely n For the proof, set W (πv ) = E[ln < πv , X1 >] and use the strong law of large numbers (see Gyorfi et al. [2011]). For memoryless or Markovian market process, optimal strategies have been introduced if the distributions of the market process are known. lim n→∞ The principle of log-optimality has the important consequence that V πv (n) is not close to E[V πv (n)] The optimality property discribed above means that, for any δ > 0 the event {−δ < 1 ln V πv (n) − E[ln < πv , X1 >] < δ} n 316 Quantitative Analytics has probability close to 1 if n is large enough. On the one hand, we have that {−δ < 1 ln V πv (n) − E[ln < πv , X1 >] < δ} = {en(−δ+E[ln <πv ,X1 >]) < ln V πv (n) < en(δ+E[ln <πv ,X1 >]) } n so that V πv (n) is close to enE[ln <πv ,X1 >] On the other hand E[V πv (n)] = E[ n Y < πv , Xj >] = j=1 n Y < πv , E[Xj ] >= en ln <πv ,E[X1 ]> j=1 By Jensen inequality, we get ln < πv , E[X1 ] > > E[ln < πv , X1 >] and therefore V πv (n) is much less than E[V πv (n)] Not knowing this fact, one can apply a naive approach arg max E[V πv (n)] πv Because of E[V πv (n)] =< πv , E[X1 ] >n this naive approach has the equivalent form arg max E[V πv (n)] = arg max < πv , E[X1 ] > πv πv which is called the Mean approach. In that setting arg maxπv < πv , E[X1 ] > is a portfolio vector having 1 at the position, where the vector E[X1 ] has the largest component. In his seminal paper, Markowitz [1952] realised that the mean approach was inadequate, that is, it is a dangerous portfolio. In order to avoid this difficulty he suggested a diversification, which is called Mean-Variance portfolio such that π̃v = arg max πv :V ar(<πv ,X1 >)≤λ < πv , E[X1 ] > (9.3.15) where λ > 0 is the investor’s risk aversion parameter. For appropriate choice of λ the performance (average growth rate) of π̃v can be close to the performance of the optimal πv∗ , however, the good choice of λ depends on the (unknown) distribution of the return vector X. The calculation of π̃v is a quadratic programming (QP) problem, where a linear function is maximised under quadratic constraints. In order to calculate the log-optimal portfolio πv∗ , one has to know the distribution of X1 . If this distribution is unknown then the empirical log-optimal portfolio can be defined by n πv∗ (n) 1X = arg max ln < πv , Xj > πv n j=1 (9.3.16) with linear constraints N X πvi = 1 and 0 ≤ πvi ≤ 1 for i = 1, .., N i=1 The behaviour of this empirical portfolio was studied by Mori [1984] [1986]. The calculation of πv∗ (n) is a nonlinear programming (NLP) problem (see Cover [1984]). 317 Quantitative Analytics 9.3.2.2 Semi-log-optimal portfolio Roll [1973], Pulley [1994] and Vajda [2006] suggested an approximation of πv∗ and πv∗ (n) using 1 h(z) = z − 1 − (z − 1)2 2 which is the second order Taylor expansion of the function ln z at z = 1. Then, the semi-log-optimal portfolio selection is π v = arg max E[h(< πv , X1 >)] πv and the empirical semi-log-optimal portfolio is n 1X π v (n) = arg max h(< πv , Xj >) πv n j=1 In order to compute πv∗ (n), one has to make an optimisation over πv . In each optimisation step the computational complexity is proportional to n. For π v (n), this complexity can be reduced so that the running time can be much smaller (see Gyorfi et al. [2011]). The other advantage of the semi-log-optimal portfolio is that it can be calculated via quadratic programming. 9.3.3 Time varying portfolio selection For a general dynamic portfolio selection, the portfolio vector may depend on the past data. As before Xj = (Xj1 , .., XjN ) denotes the return vector on trading period j. Let πv = πv (1) be the portfolio vector for the first trading period. For initial capital V (0), we get that V (1) = V (0) < πv (1), X1 >= V (0) < πv (1), 1 + R1 > For the second trading period, n = 2, V (1) is new initial capital, the portfolio vector is πv (2) = πv (X1 ), and V (2) = V (0) < πv (1), X1 >< πv (X1 ), X2 > For the nth trading period, a portfolio vector is πv (n) = πv (X1 , .., Xn−1 ) = πv (X1n−1 ) and V (n) = V (0) n Y < πv (X1j−1 ), Xj >= V (0)enWn (B) j=1 with the average growth rate n Wn (B) = 9.3.3.1 1X ln < πv (X1j−1 ), Xj > n j=1 Log-optimal portfolio for stationary market process The fundamental limits, determined in Mori [1982], in Algoet et al. [1988], and in Algoet [1992] [1992], reveal that the so-called (conditionally) log-optimal portfolio B ∗ = {πv∗ (.)} is the best possible choice. More precisely, on trading period n, let πv∗ (.) be such that E[ln < πv∗ (X1n−1 ), Xn >|X1n−1 ] = max E[ln < πv (X1n−1 ), Xn >|X1n−1 ] πv (.) 318 (9.3.17) Quantitative Analytics ∗ If V ∗ (n) = V B (n) denotes the capital achieved by a log-optimal portfolio strategy B ∗ after n trading periods, then for any other investment strategy B with capital V (n) = V B (n) and with sup E[(ln < πv (X1n−1 ), Xn >)2 ] < ∞ n and for any stationary and ergodic process {Xn }∞ −∞ lim sup n→∞ 1 1 ln V (n) − ln V ∗ (n) ≤ 0 almost surely n n and lim n→∞ 1 ln V ∗ (n) = W ∗ almost surely n where −1 −1 W ∗ = E max E[ln < πv (X−∞ ), X0 >|X−∞ ] b(.) is the maximal possible growth rate of any investment strategy. Remark 9.3.1 Note that for memoryless markets W ∗ = maxb E[ln < πv , X0 >] which shows that in this case the log-optimal portfolio is the best constantly rebalanced portfolio. 9.3.3.2 Empirical portfolio selection The optimality relations proved above give rise to the following definition: Definition 9.3.1 An empirical (data driven) portfolio strategy B is called universally consistent with respect to a class C of stationary and ergodic processes {Xn }∞ −∞ if for each process in the class lim n→∞ 1 ln V B (n) = W ∗ almost surely n It is not at all obvious that such universally consistent portfolio strategy exists. The surprising fact that there exists a strategy, universal with respect to a class of stationary and ergodic processes was proved by Algoet [1992]. Most of the papers dealing with portfolio selections assume that the distributions of the market process are known. If the distributions are unknown then one can apply a two stage splitting scheme. 1. In the first time period the investor collects data, and estimates the corresponding distributions. In this period there is no investment. 2. In the second time period the investor derives strategies from the distribution estimates and performs the investments. Gyorfi et al. [2011] showed that there is no need to make any splitting, one can construct sequential algorithms such that the investor can make trading during the whole time period, that is, the estimation and the portfolio selection is made on the whole time period. Given the definition of the conditionally log-optimal portfolio in Equation (9.3.17) for a fixed integer k > 0 large enough, we expect that n−1 n−1 E[ln < πv (X1n−1 ), Xn >|X1n−1 ] ≈ E[ln < πv (Xn−k ), Xn >|Xn−k ] and 319 Quantitative Analytics n−1 n−1 n−1 πv∗ (X1n−1 ) ≈ bk (Xn−k ) = arg max E[ln < πv (Xn−k ), Xn >|Xn−k ] πv (.) Because of stationarity bk (xk1 ) = arg max E[ln < πv , Xk+1 >|X1k = xk1 ] πb which is the maximisation of the regression function mb (xk1 ) = E[ln < b, Xk+1 >|X1k = xk1 ] Thus, a possible way for asymptotically optimal empirical portfolio selection is that, based on the past data, sequentially estimate the regression function mb (xk1 ) and choose the portfolio vector, which maximises the regression function estimate. 9.3.4 Regression function estimation: The local averaging estimates We first consider the basics of nonparametric regression function estimation. Let Y be a real valued random variable, and let X denote an observation vector taking values in Rd . The regression function is the conditional expectation of Y given X: m(x) = E[Y |X = x] If the distribution of (X, Y ) is unknown, then one has to estimate the regression function from data. The data is a sequence of i.i.d. copies of (X, Y ): Dn = {(X1 , Y1 ), ..., (Xn , Yn )} The regression function estimate is of form mn (x) = mn (x, Dn ) An important class of estimates is the local averaging estimates mn (x) = n X ωn,j (x; X1 , .., Xn )Yj (9.3.18) j=1 where usually the weights ωn,j (x; X1 , .., Xn ) for j = 1, .., n are non-negative and sum up to 1. Moreover, the weight ωn,j (x; X1 , .., Xn ) is relatively large if x is close to Xj , otherwise it is zero. Note, we can always rewrite the local averaging estimates as n mn (x) = norm = Pn 9.3.4.1 The partitioning estimate j=1 1 X ω n,j (x; X1 , .., Xn )Yj norm j=1 (9.3.19) ω n,j (x; X1 , .., Xn ). An example of such an estimate is the partitioning estimate. Here one chooses a finite or countably infinite partition Pn = {An,1 , An,2 , ...} of Rd consisting of cells An,l ⊂ Rd and defines, for x ∈ An,l the estimate by averaging the Yj with the corresponding Xj in An,j . That is 320 Quantitative Analytics Pn j=1 mn (x) = Pn I{Xj ∈An,l } Yj j=1 I{Xj ∈An,l } n = 1 X I{Xj ∈An,l } Yj for x ∈ An,l norm j=1 (9.3.20) Pn where ω j = I{Xj ∈An,l } and norm = j=1 ω j . For notational purpose we use the convention 00 = 0. In order to have consistency, on the one hand we need that the cells An,l should be small, and on the other hand the number of non-zero terms in the denominator of the above ratio should be large. These requirements can be satisfied if the sequences of partition Pn is asymptotically fine, that is, if diam(A) = sup ||x − y|| x,y∈A denotes the diameter of a set such that ||.|| is the Euclidean norm, then for each sphere S centred at the origin lim max n→∞ l:An,l ∩S6=0 diam(An,l ) = 0 and lim n→∞ |{l : An,l ∩ S 6= 0}| =0 n For the partition Pn the most important example is when the cells An,l are cubes of volume hdn . For cubic partition, the consistency conditions above mean that lim hn = 0 and lim nhdn = ∞ n→∞ 9.3.4.2 n→∞ (9.3.21) The Nadaraya-Watson kernel estimate The second example of a local averaging estimate is the Nadaraya-Watson kernel estimate. Let K : Rd → R+ be a function called the kernel function, and let h > 0 be a bandwidth. The kernel estimate is defined by Pn x−Xj h )Yj x−Xj j=1 K( h ) j=1 mn (x) = Pn K( n = 1 X x − Xj K( )Yj norm j=1 h The kernel estimate is a weighted average of the Yj , where the weight of Yj (i.e., the influence of Yj on the value of the estimate at x) depends on the distance between Xj and x. For the bandwidth h = hn , the consistency conditions are given in Equation (9.3.21). If one uses the so-called naive kernel (or window kernel) K(x) = I{||x||≤1} then we get Pn j=1 mn (x) = Pn I{||x−Xj ||≤h} Yj j=1 I{||x−Xj ||≤h} n = 1 X I{||x−Xj ||≤h} Yj norm j=1 Pn where ω j = I{||x−Xj ||≤h} and norm = j=1 ω j . That is, one estimates m(x) by averaging the Yj ’s such that the distance between Xj and x is not greater than h. 321 Quantitative Analytics 9.3.4.3 The k-nearest neighbour estimate Another example of local averaging estimates is the k-nearest neighbour (k-NN) estimate. Here one determines the k nearest Xj ’s to x in terms of the distance ||x − Xj || and estimates m(x) by the average of the corresponding Yj ’s. That is, for x ∈ Rd , let (X(1) (x), Y(1) (x)), .., (X(n) (x), Y(n) (x)) be a permutation of (X1 , Y1 ), .., (Xn , Yn ) such that ||x − X(1) (x)|| ≤ ... ≤ ||x − X(n) (x)|| Then, the k-NN estimate is defined by mn (x) = If k = kn → ∞ such that 9.3.4.4 kn n k 1X Y(j) (x) k j=1 → 0 then the k-nearest-neighbour regression estimate is consistent. The correspondence We use the following correspondence between the general regression estimation and portfolio selection: X ∼ X1k Y ∼ ln < b, Xk+1 > and m(x) = E[Y |X = x] ∼ mb (xk1 ) = E[ln < b, Xk+1 >|X1k = xk1 ] Note, the theoretical results above hold under the condition of stationarity. Obviously, the real data of returns (relative prices) are not stationary. 9.4 9.4.1 A simple example A self-financed long-short portfolio We generally assign weights δ i to the ith instrument in the portfolio together with a condition of no short sales to guarantee that the sum of the weights equal one. However, as seen in Section (9.2.1), this is no-longer the case when we assume short selling. To overcome this problem, we assume that the index is made of N stocks, and given n periods of time such that ∆t = Tn , we want to build at period j two synthetic portfolios, one made of long stocks and the other one made of short stocks. For each stock Si (j) with i = 1, .., N we compute the measure Mi (j) observed at time j∆ and use it to decide weather to buy or sell the stock. We let the Decision Variable i (j) at time j∆ takes values in the set {1, 0, −1}. We let Ri (j) be the return of the ith stock in the jth period, and assume that if Mi (j) > γU we set the Decision Variable to i (j) = 1 and we buy the stock, and if Mi (j) < γD we set i (j, k) = −1 and we sell the stock. In the case where γD < Mi (j) < γU we choose to do nothing and set i (j) = 0. 322 Quantitative Analytics We let δ = (δ0 , δ1 , ..., δN ) be the portfolio vector such that the 0th component corresponds to cash, and we let hR be the fraction of wealth allocated to the risky portfolio where 1 − hR is allocated to the risk-free security. We then create a weighted portfolio at period j as V δ (j) = N X δi (j)i (j)Si (j) i=1 with N ≥ Nb + Ns , where Nb is the number of elements in the long portfolio and Ns is the number of elements in the short portfolio, and where the weights δi (j) are used to allocate the capital CA . Given the capital CA , we want to choose the weights δib (•) ≥ 0 such that their sum in the long portfolio equal the percentage ξb of capital Nb X δib (jδ) = ξb i=0 where ξb ∈ [1, 2]. Note, we let the cash weight δ0 be part of the long portfolio. Similarly, we want to choose the weights δis (•) < 0 such that their sum in the short portfolio is a percentage of the capital CA Ns X |δis (jδ)| = ξs i=1 where ξs ∈ [0, 1]. Note, it satisfies the short selling leverage constraint in Equation (9.2.13) as N X |δi (jδ)| = ξb + ξs = LB,r i=0 For example, a 150-50 portfolio has ξb = 1.5 and ξs = 0.5 where we sell short 50% of the capital CA . The daily PnL in the range [j∆, (j + 1)∆] is computed by investing in the portfolio at period j and unwinding it at period (j + 1). That is, we let V δ (j) be the value of the portfolio at period (j), and V δ (j + 1) be the price of the portfolio after one period. Then, by using discrete compounding, accounting for fixed costs, and allowing for leverage, we derive (see Section (9.2.2)) the usual expression for a portfolio return as V δ (j + 1) = N n X V δ (j) δ0b (j)(1 + r) + δib (j) 1 + bi (j)Ri (j, j + 1) − cbF + δis (j) i=1 o s i (j)Ri (j, j + 1) − csF − (ξb − 1) where V δ (0) = CA and cF is a fixed cost. Note, the 0th component δ0b (j) is a fraction of wealth invested in cash corresponding to δ0b (j) = 1 − Nb X δib (j) i=1 Using the constraint on the long portfolio, we can re-express the long-short portfolio as N X V δ (j + 1) = V δ (j) 1 + δi (j) i (j)Ri (j, j + 1) − ξb cbF − ξs csF i=0 where R0 (., .) = r. We let Rp (j, j + 1) = V δ (j + 1) − V δ (j) V δ (j) 323 Quantitative Analytics be the return of the portfolio for the period (j + 1) and replace V δ (j + 1) with its value to get Rp (j, j + 1) = N X δi (j)i (j)Ri (j, j + 1) − ξb cbF − ξs csF i=0 so that the portfolio at period (j + 1) can be expressed in terms of the portfolio return as V δ (j + 1) = V δ (j) 1 + Rp (j, j + 1) (9.4.22) Hence, the profit and loss over one period of time becomes P nL(j, j + 1) = V δ (j + 1) − V δ (j) = V δ (j)Rp (j, j + 1) = V δ (j) N X δi (j)i (j)Ri (j, j + 1) − cbF V δ (j) − csF ξs V δ (j) i=0 Given the maturity T = n∆, the cummulated PnL in the range [0, T ] is given by CP nL(0, n) = n−1 X P nL(j, j + 1) = j=0 n−1 X V δ (j)Rp (j, j + 1) j=0 That is, the cummulated PnL can be expressed as a weighted sum of portfolio returns CP nL(0, n) = n−1 X W (j)Rp (j, j + 1) (9.4.23) j=0 with weights W (j) = V δ (j) for j = 0, .., n − 1. Affecting an initial investment of CA , and assuming no capital inflows and outflows after the initial investment (see Section (9.2.2)), the expression for the portfolio return at time T = n∆ is δ δ V (n) = V (0) n−1 Y 1 + Rp (j, j + 1) j=0 We can write V δ (j + 1) = V δ (0) j Y 1 + Rp (k, k + 1) = V δ (j) 1 + Rp (j, j + 1) k=0 and the profit and loss becomes P nL(j, j + 1) = V δ (j + 1) − V (j) = V (j)Rp (j, j + 1) and the cummulated PnL is CP nL(0, n) = n−1 X P nL(j, j + 1) = V δ (n) − V δ (0) j=0 = hn−1 i Y V δ (0) 1 + Rp (j, j + 1) − 1 j=0 324 (9.4.24) Quantitative Analytics Expending the product term, we get n−1 Y n−1 n−1 X X 1 + Rp (j, j + 1) = 1 + Rp (j, j + 1) + Rp (0, 1) Rp (j, j + 1) j=0 j=0 + Rp (1, 2) n−1 X j=1 Rp (j, j + 1) + ... + Rp (n − 2, n − 1)Rp (n − 1, n) + j=2 n−1 Y Rp (j, j + 1) j=0 so that the cummulated PnL can be written as n−1 n−1 hn−1 X X X CP nL(0, n) = V δ (0) Rp (j, j + 1) + Rp (0, 1) Rp (j, j + 1) + Rp (1, 2) Rp (j, j + 1) j=0 + j=1 ... + Rp (n − 2, n − 1)Rp (n − 1, n) + n−1 Y Rp (j, j + 1) j=2 i j=0 9.4.2 Allowing for capital inflows and outflows As explained in Section (9.2.2.1), a constantly rebalanced portfolio (CRP) is a self-financing portfolio strategy, rebalancing to the same proportional portfolio in each investment period. That is the investor neither consumes from, nor deposits new cash into his account, but reinvests his capital in each trading period. In the previous Section, given the initial investment CA , we assumed no capital inflows and outflows after the initial investment and built a long-short portfolio. In the special case where we discretely invest the fixed quantity CA at each period by locking each daily profit at the risk-free rate in a separate account and borrowing cash from the broker when needed, the portfolio in Equation (9.4.22) simplifies to V δ (j + 1) = V δ (0) 1 + Rp (j, j + 1) At maturity T = n∆t the portfolio becomes V δ (n) = V δ (0) 1 + Rp (n − 1, n) which is to compare with Equation (9.4.24). Each investment being independent from one another, the profit and loss realised in the period [j, j + 1] becomes P nL(j, j + 1) = V δ (j + 1) − V δ (0) = V δ (0)Rp (j, j + 1) so that the amount of cash deposited at period (j + 1) in a separate account at the risk-free rate is the profit and loss P nL(j, j + 1). Hence, the cummulated PnL generated in the range [0, T ] is CP nL(0, n) = n−1 X P nL(j, j + 1) = V δ (0) j=0 n−1 X Rp (j, j + 1) j=0 In that setting, the weights of the cummulated PnL given in Equation (9.4.23) simplifies to W (j) = CA and are time-independent. Comparing the two cummulated PnL, their difference is 325 Quantitative Analytics n−1 n−1 h X X CP nL(0, n) − CP nL(0, n) = V δ (0) Rp (0, 1) Rp (j, j + 1) + Rp (1, 2) Rp (j, j + 1) j=1 + ... + Rp (n − 2, n − 1)Rp (n − 1, n) + n−1 Y j=2 Rp (j, j + 1) i j=0 9.4.3 Allocating the weights As only long positions cost money in the setup, we consider only the portfolio for the buy stocks with Nb stocks and follow the approach described in Section (9.4.4). Note, the 0th component ω0 (jδ) is a fraction of wealth invested in cash. In our setting, we need to specify a modified weight wi and then define the quantity norm as norm = Nb X |wi (jδ)| i=0 i (jδ) for i = 1, .., Nb with a sum equal to ξb . In the case of the short such that the weights becomes wi (jδ) = ξb wnorm portfolio we get norm = Ns X |wi (jδ)| i=1 i (jδ) with weights wi (jδ) = ξs wnorm for i = 1, .., Ns . The choice of the modified weight wi (jδ) is crucial in obtaining the best allocation to the market data. 9.4.3.1 Choosing uniform weights We assume that all the weights are uniformaly distributed and set ω i (jδ) = 1 for i = 1, .., Nb . 9.4.3.2 Choosing Beta for the weight We let βia (jδ), taking values in R, be the statistical Beta for the stock Si (jδ). We want to define a mapping allocating maximum weight to stocks with β = 0, and decreasing weight as the β increases. One possibility is to set βi (jδ) = a + bβia (jδ) , i = 1, .., Nb with a = 1 3 and b = 23 . Then, we define the modified weight as ω i (jδ) = 1 βi (jδ) An alternative approach is to consider a bell shape for the distribution of the Beta and define the modified weight as a ω i (jδ) = ae−b(βi (jδ)) 2 with a = 3 and b = 0.25. In that setting ω i (jδ) ∈ [0, a] with the property that when β = 0 we get the maximum value a. 326 Quantitative Analytics 9.4.3.3 Choosing Alpha for the weight We let αia (jδ), taking values in R, be the statistical Alpha for the stock Si (jδ). We want to define a mapping allocating minimum weight to stocks with β = 0, and increasing weight as the α increases. One possibility is to define the modified weight as ω i (jδ) = a 1 − e −cαa i (jδ)I{αa (jδ)≥0} i with a = 3 and c = 0.3. In that setting ω i (jδ) ∈ [0, a] with the property that when αa = 0 we get the minimum value 0. 9.4.3.4 Combining Alpha and Beta for the weight We let αia (jδ) and βia (jδ) taking values in R be respectively the statistical Alpha and Beta for the stock Si (jδ). We let the blending parameter p ∈ [0, 1] be the weight representing the quantity of Beta, and define the combined quantity as β ω i (jδ) = (1 − p)ω α i (jδ) + pω i (jδ) As an example we set p = 23 . 9.4.4 Building a beta neutral portfolio 9.4.4.1 A quasi-beta neutral portfolio One possibility to satisfy the leverage constraint and to get a quasi-beta-neutral portfolio is to set hi = β1i . Further, P P due to the linearity of the leverage constraint, we get i∈L |hi | = lL and i∈S |hi | = lS . Hence, we need to specify 1 a modified weight hL i = βi for i ∈ L and then define the quantity normL as X normL = |hL i | i∈L hL i such that the weights becomes hi = lL normL for i ∈ L with the sum of |hi | equal to lL . Similarly, in the case of the short subset, given the modified weight hSi = β1i for i ∈ S we get X normS = |hSi | i∈S hS i with weights hi = lS normS for i ∈ S. As the constraint for the beta-neutral portfolio is linear, we need to satisfy X X hi βi = − hi βi i∈L i∈S where hi > 0 for i ∈ L. Replacing the weights hi with their values in the above equation, we get lL lL X 1 βi = NL normL βi normL i∈L i∈L X lS X 1 lS h i βi = βi = NS normS βi normS X i∈S hi βi = i∈S with NL elements in the set L and NS elements in the set S. In a 100-100 long-short porfolio lL = lS = 1 so that we are comparing 327 Quantitative Analytics NS NL NL NS with =P =P 1 1 normL normS i∈L | βi | i∈S | βi | 9.4.4.2 An exact beta-neutral portfolio L One can get an exact beta-neutral portfolio by choosing freely the set of modified weights (hL 2 , .., hNL ) within the set L of long stocks, and by constraining the first weight as hL 1 =− NL 1 X hL βi β1 i=2 i Again, for i ∈ L we define the quantity normL as normL = X |hL i | i∈L hL i lL norm L such that the weights becomes hi = for i ∈ L with the sum of |hi | equal to lL . The same technique is used S to compute the modified weights hi for i ∈ S. Replacing the weights hi with their values in the beta-neutral portfolio constraint, we get lL X L hi βi = 0 normL i∈L i∈L X lS X S hi βi = 0 hi βi = normS X hi βi = i∈S i∈S Thus, with one modified weight fixed and the rest chosen to satisfy a particular allocation we can obtain a beta-neutral portfolio independently from the leverage chosen. For instance, the modified weights can be chosen to match the information ratio σri2 . i 9.5 9.5.1 Value at Risk Defining value at risk We will see in Chapter (10) that extreme price movements in the financial markets are not so rare, and do not necessarily correspond to big financial crises. Nonetheless, these large price fluctuations have been associated to risky events and numerous measures of market risk developed such as the value at risk (VaR). Various methods for calculating VaR were proposed based on different statistical theories, among which are RiskMetrics. Duffie et al. [1997] described VaR as a single estimate of the amount by which an institution’s position in a risk category could decline due to general market movements during a given holding period. Being defined as the maximal loss of a financial position during a given time period for a given probability, VaR is generally used to ensure that a financial institution can still be in business after a catastrophic event. Alternatively, a regulatory committee can define VaR as the minimal loss under extraordinary market circumstances, leading to the same measure. We let ∆V (d) be the change in value of the assets in a portfolio V from time t to t + d measured in dollars. We let Fd (x) be the cumulative distribution function (CDF) of ∆V (d) and define the VaR of a long position (loss when ∆V (d) < 0) over the time horizon d with probability p as p = P (∆V (d) ≤ V ar) = Fd (V ar) (9.5.25) assuming a negative value when p is small. That is, the negative sign means a loss. Hence, the probability that the holder would encounter a loss greater than or equal to VaR over the time horizon d is p. Equivalently, with probability 328 Quantitative Analytics (1 − p), the potential loss encountered by the holder of the portfolio over the time period d is less than or equal to VaR. In the case of a short position (loss when ∆V (d) > 0) the Var becomes p = P (∆V (d) ≥ V ar) = 1 − P (∆V (d) ≤ V ar) = 1 − Fd (V ar) assuming a positive value when p is small. That is, the positive sign means a loss. This definition of the VaR shows that it is concerned with the tail behaviour of the CDF Fd (x) where the left tail is important for a long position, and the right tail for a short one. For any univariate CDF Fd (x) and probability p, such that 0 < p < 1, the quantity xp = inf {x|Fd (x) ≥ p} is called the pth quantile of Fd (x), where inf denotes the smallest real number satisfying Fd (x) ≥ p. Therefore, for known CDF Fd (x), the VaR is simply its pth quantile, that is, V aR = xp . Since the CDF is unknown in practice, VaR is essentially concerned with the estimation of the CDF, or its quantile, especially the tail behaviour of the CDF. Consquently, econometric modelling was used to forecast the CDF, where different methods for estimating the CDF gave rise to different approaches for calculating the VaR. Note, given log returns {rt }, the VaR calculated from the quantile of the distribution of rt+1 given time t is in percentage so that the dollar amount of VaR is the cash value of the portfolio times the VaR of the log return series. While VaR is a prediction concerning possible loss of a portfolio in a given time period, it should be computed by using the predictive distribution of future returns. But, in statistics, predictive distribution takes into account the parameter uncertainty in a properly specified model, which is largely ignored in the available methods for VaR calculation. 9.5.2 Computing value at risk 9.5.2.1 RiskMetrics RiskMetrics, developed by Longerstaey et al. [1995b], assumes that the continuously compounded daily return of a portfolio follows a conditional normal distribution rt |Ft−1 ∼ N (µt , σt2 ) where µt is the conditional mean and σt2 is the conditional variance of rt . Further, the method assumes that the two quantities evolve over time as 2 2 µt = 0 , σt2 = ασt−1 + (1 − α)rt−1 ,1>α>0 (9.5.26) The method assumes that the logarithm of the daily price, p = ln (Pt ), of the portfolio satisfies the difference equation pt − pt−1 = at , where at = σt t is an IGARCH(1, 1) process without drift. The value of α is usually taken in the range [0.9, 1]. For a k-period horizon, the log return from time t + 1 to time t + k (inclusive) is rt (k) = rt+1 + ... + rt+k−1 + rt+k . In this model the conditional distribution rt (k)Ft is normal with mean zero and variance σt2 (k) which can be computed by using the forecasting method presented in Section (??). Given the assumption of independence of t , we have σt2 = V ar(rt (k)|Ft ) = k X V ar(at+i |Ft ) i=1 2 where V ar(at+i |Ft ) = E[σt+i |Ft ] can be obtained recursively. Using rt−1 = at−1 = σt−1 t−1 , we can rewrite the volatility equation of the IGARCH(1, 1) model as 2 2 σt2 = σt−1 + (1 − α)σt−1 (t−1 − 1) , ∀t In particular, we have 2 2 2 σt+i = σt+i−1 + (1 − α)σt+i−1 (t+i−1 − 1) for i = 2, .., k Since E[(t+i−1 − 1)|Ft ] = 0 for i ≥ 2, the prior equation shows that 329 Quantitative Analytics E[σt+i |Ft ] = E[σt+i−1 |Ft ] for i = 2, .., k 2 For the 1-step ahead volatility forecast, Equation (9.5.26) shows that σt+1 = ασt2 + (1 − α)rt2 , so that the above 2 2 2 2 equation shows that V ar(rt+i |Ft ) = σt+1 for i ≥ 1 and hence σt (k) = kσt+1 such that rt (k)|Ft ∼ N (0, kσt+1 ). Therefore, in the IGARCH(1, 1) model given in Equation (9.5.26), the conditional variance of √ rt (k) is proportional to the horizon time k, and the conditional standard deviation of a k-period horizon log return is kσt+1 . In the case of a long position with probability set to 5%, the RiskMetrics uses 1.65σt+1 to measure the risk of the portfolio, that is, it uses the one-sided 5% quantile of a normal distribution with mean zero and standard deviation σt+1 . Note, the 5% quantile is actually −1.65σt+1 , but the negative sign is ignored with the understanding that it is a loss. As a result, in the RiskMetrics model, when the standard deviation is measured in percentage, then the daily VaR of the portfolio becomes V aR = W × 1.65σt+1 where W is the amount of the position, and the VaR of a k-day horizon is √ V aR(k) = W × 1.65 kσt+1 Therefore, we can write the VaR as √ V aR(k) = k × V aR which is the square root of time rule in VaR calculation under RiskMetrics. In the case where the investor holds multiple positions, assuming that daily log returns of each position follow a random-walk IGARCH(1, 1) model we need to estimate the cross-correlation coefficients between the returns. In the case of two positions with VaR being V aR1 and V aR2 , respectively, and cross-correlation coefficient being ρ12 = p Cov(r1t , r2t ) V ar(r1t )V ar(r2t ) then the overall VaR of the investor is V aR = q V aR12 + V aR22 + 2ρ12 V aR1 V aR2 In the case of m assets the VaR is generalised to v uX m X um V aRi2 + 2 ρij V aRi V aRj V aR = t i=1 i 2. It says that if q is the pth quantile of a Student-t distribution with v degrees of freedom, then √ q v (v−2) is σt2 the pth quantile of the standardised distribution. Hence, if t of the GARCH model for is a standardised Student-t distribution with v degrees of freedom and the probability is p, the quantile used to calculate the 1-period horizon VaR at time t is tv (p)σ̂t (1) r̂t (1) − q v (v−2) We are now considering the k-period log return at the forecast origin h, that is, rh (k) = rh+1 + ... + rh+k . We can then use the appropriate forecasting methods to obtain the conditional mean and variance of rh (k). The conditional mean E[rh (k)|Fh ] is obtained by using the forecasting method of ARMA models r̂h (k) = rh (1) + .. + rh (k) where rh (l) is the l-step ahead forecast of the return at the forecast origin h, which can be computed recursively. Using the MA representation of the ARMA model, we can rewrite the l-step ahead forecast error at the forecast origin h as 331 Quantitative Analytics eh (l) = rh+l − rh (l) = ah+l + ψ1 ah+l−1 + ... + ψl−1 ah+1 The forecast error of the expected k-period return r̂h (k) is the sum of 1-step to k-step forecast errors of rt at the forecast origin h and can be written as eh (k) = eh (1) + .. + eh (k) = ah+k + (1 + ψ1 )ah+k−1 + ... + k−1 X ψi ah+1 i=0 where ψ0 = 1. The volatility forecast of the k-period return at the forecast origin h is the conditional variance of eh (k) given Fh . Using the independent assumption of t+i for i = 1, .., k where at+i = σt+i t+i , we have V ar(eh (k)|Fh ) = V ar(ah+k |Fh ) + (1 + ψ1 )2 V ar(ah+k−1 |Fh ) + ... + k−1 X 2 ψi V ar(ah+1 |Fh ) i=0 = σh2 (k) + (1 − ψ1 )2 σh2 (k − 1) + ... + k−1 X 2 ψi σh2 (1) i=0 where σh2 (l) is the l-step ahead volatility forecast at the forecast origin h. In the GARCH model these volatility forecasts can be obtained recursively. For instance, in the simple model rt = µ + at , at = σt t 2 σt2 = α0 + α1 a2t−1 + β1 σt−1 we have ψi = 0 for all i > 0. The point forecast of the k-period return at the forecast origin h is r̂h (k) = kµ and the associated forecast error is eh (k) = ah+k + ah+k−1 + ... + ah+1 As a result, the volatility forecast for the k-period return at the forecast origin h is V ar(eh (k)|Fh ) = k X σh2 (l) l=1 Using the forecasting method of GARCH(1, 1) models, we have σh2 (1) = α0 + α1 a2h + β1 σh2 σh2 (l) = α0 + (α1 + β1 )σh2 (l − 1) , l = 2, .., k so that V ar(eh (k)|Fh ) can be obtained by the prior recursion. If t is Gaussian, then the conditional distribution of rh (k) given Fh is normal with mean kµ and variance V ar(eh (k)|Fh ) and one can compute the quantiles needed in VaR calculation. 9.5.2.3 Quantile estimation to VaR calculation While quantile estimation provides a nonparametric approach to VaR calculation by making no specific distributional assumption on the return of a portfolio, it assumes that the distribution continues to hold within the prediction period. Two types of quantile methods exict, the first one directly using empirical quantile, and the second one using quantile regression. We consider the collection of n returns {r1 , .., rn } where the minimum return is r(1) , the smallest order 332 Quantitative Analytics statistic, and the maximum return is r(n) , the maximum order statistic. That is, r(1) = min1≤j≤n {rj } and r(n) = (1) max1≤j≤n {rj }. Since we have r(n) = − min1≤j≤n {−rj } = −rc , where rt,c = −rt with the subscript c denoting (1) sign change, we can concentrate on the minimum return r . We further assume that the returns are i.i.d. random variables having a continuous distribution with probability density function (pdf) f (x) and CDF F (x). Then there exists well known asymptotic result for the order statistic r(l) where l = np with 0 < p < 1 (see Cox et al. [1974]). We let xp be the pth quantile of F (x), that is xp = F −1 (p) and assume that f (x) is not zero at xp . Then the order p(1−p) statistic r(l) is asymptotically normal with mean xp and variance nf 2 (x ) , that is, p r(l) ∼ N (xp , p(1 − p) ) , l = np nf 2 (xp ) and it can be used for estimating the quantile xp . In practice, the probability p may not satisfy np to be a positive integer, and simple interpolation must be used. For noninteger np, we let l1 and l2 be two neighbouring positive integers such that l1 < np < l2 and define pi = lni . Hence, r(li ) is a consistent estimate of the quantile xpi since p1 < p < p2 . As a result, the quantile xp can be estimated by x̂p = p − p1 l2 p2 − p l1 r + r p2 − p1 p2 − p1 Even though this method is simple and use no specific distributional assumption, it assumes stationarity of the distribution. Hence, in the case of tail probability, it implies that the predicted loss can not be greater than the historical one. Further, for extreme quantiles (when p is close to zero or unity), the empirical quantiles are not efficient estimates of the theoretical quantiles. At last, direct quantile estimation fails to take into account the effect of explanatory variables relevant to the portfolio under study. In general, the empirical quantile serves as a lower bound for the actual VaR. In real application, one can rely on explanatory variables having important impacts on the dynamics of asset returns, and should therefore consider the conditional distribution function rt+1 |Ft where the filtration Ft includes the explanatory variables. The associated quantiles of this distribution are refered to regression quantiles (see Koenker et al. [1978]). We can cast the empirical quantile as an estimation problem where for a given probability p, the pth quantile of {rt } is given by x̂p = arg minβ n X wp (ri − β) i=1 where wp (z) is defined by wp (z) = pz if z ≥ 0 (p − 1)z otherwise The regression quantile generalise such an estimate by considering the linear regression rt = β > xt + at where β is a k-dimensional vector of parameters and xt is a vector of predictors that are elements of Ft−1 . Since β > xt is known, then the conditional distribution of rt given Ft−1 becomes a translation of the distribution of at . Koenker et al. [1978] estimated the conditional quantile xp |Ft−1 of rt as x̂p |Ft−1 = inf {β0> x|Rp (β0 ) = min} where Rp (β0 ) = min means that β0 is obtained by solving β0 = arg minβ n X i=1 where wp (z) is defined as before. 333 wp (ri − β > xi ) Quantitative Analytics 9.5.2.4 Extreme value theory to VaR calculation We assume that returns rt are serially independent with a common cumulative distribution function F (x) and that the range of the returns is [l, u], where l = −∞ and u = ∞ for log returns. Then, the CDF of r(1) , denoted by Fn,1 (x), is given by Fn,1 (x) = P (r(1) ≤ x) = 1 − P (r(1) > x) = 1 − P (r1 > x, ..., rn > x) From independence we have Fn,1 (x) = 1 − n Y P (rj > x) = 1 − j=1 n Y 1 − P (rj ≤ x) j=1 and by common distribution we get Fn,1 (x) = 1 − n Y n 1 − F (x) = 1 − 1 − F (x) j=1 Since the CDF F (x) of rt is unknown, then Fn,1 (x) of r(1) is unknown, but as n increases to infinity, Fn,1 (x) becomes degenerated, that is, 0 if x ≤ l Fn,1 (x) → as n → ∞ 1 otherwise Since this degenerated CDF has no practical value, the extreme value theory (EVT) is concerned with finding two sequences {αn } and {βn }, where the former is a series of scaling factors and the latter is a location series with αn > 0 (1) n) converges to a nondegenerated distribution as n goes to infinity. and such that the distribution of r(1∗ ) = (r α−β n Under the independent assumption, the limiting distribution of the normalised minimum r(1∗ ) is given by ( 1 1 − e−(1+kx) k if k 6= 0 F∗ (x) = x 1 − e−e if k = 0 for x < − k1 if k < 0 and for x > − k1 if k > 0, where the subscript ∗ signifies the minimum. The case of k = 0 is taken as the limit when k → 0, the parameter k is called the shape parameter governing the tail behaviour of the limiting distribution, and the parameter α = − k1 is the tail index of the distribution. The limiting distribution of the above equation is the generalised extreme value distribution of Jenkinson [1955] for the minimum encompassing the three types of limiting distribution of Gnedenko [1943] 1. k = 0, the Gumbel family with CDF x F∗ (x) = 1 − e−e , − ∞ < x < ∞ 2. k < 0, the Frechet family with CDF ( 1 − e−(1+kx) k if x < − k1 1 otherwise ( 1 − e−(1+kx) k if x > − k1 0 otherwise F∗ (x) = 1 3. k > 0, the Weibull family with CDF F∗ (x) = 1 334 Quantitative Analytics Gnedenko [1943] gave necessary and sufficient conditions for the CDF F (x) of rt to be associated with one of the three types of limiting distribution. The tail behaviour of F (x) determines the limiting distribution F∗ (x) of the minimum. The (left) tail of the distribution declines exponentially for the Gumbel family, by a power function for the Frechet family, and is finite for the Weibull family. For risk management, we are mainly interested in the Frechet family that includes stable and Student-t distributions. The Gumbel family consists of thin-tailed distributions such as normal and lognormal distributions. The probability density function (pdf) of the generalised limiting distribution in Equation (9.5.27) can be obtained by differentiation ( 1 1 (1 + kx) k −1 e−(1+kx) k if k 6= 0 f∗ (x) = x ex−e if k = 0 where −∞ < x < ∞ for k = 0, x < − k1 for k < 0, and x > − k1 for k > 0. The two important implications of extreme value theory are 1. the tail behaviour of the CDF F (x) of rt , not the specific distribution, determines the limiting distribution F∗ (x) of the (normalised) minimum, making the theory applicable to a wide range of distributions for the return rt . 2. Feller [1971] showed that the tail index k does not depend on the time interval of rt , meaning the tail index (or equivalently the shape parameter) is invariant under time aggregation, being handy in the VaR calculation. The extreme value theory was extended to serially dependent observations {rt }nt=1 provided that the dependence is weak. Berman [1964] showed that the same form of the limiting extreme value distributionPholds for stationary ∞ normal sequences provided that the autocorrelation function of rt is squared summable, that is i=1 ρ2i < ∞, where ρi is the lag-i autocorrelation function of rt . We saw that the extreme value distribution contains three parameters k, αn , and βn called the shape, scale parameter and location, respectively, and can be estimated by using parametric or nonparametric methods. Since for a given sample one only has a single minimum or maximum, we must divide the sample into subsamples and apply the EVT to the subsamples. Assuming T returns {rj }Tj=1 , we divide the sample into g non-overlapping subsamples each with n observations (T=ng) {r1 , .., rn |rn+1 , .., r2n |...|r(g−1)n+1 , .., rng } and write the observed returns as rin+j where 1 ≤ j ≤ n and i = 0, .., g − 1. When n is sufficiently large, we hope that the EVT applies to each subsample. Hence, we let rn,i be the minimum of the ith subsample, so that when n (r −β ) is sufficiently large xn,i = n,iαn n should follow an extreme value distribution, and the collection of subsample minima {rn,i }gi=1 can then be regarded as a sample of g observations from that extreme value distribution. We can define rn,i = min {r(i−1)n+j } , i = 1, .., g 1≤j≤n which clearly depends on the choice of the subperiod length n. Alternatively, we can use a parametric approach such as the maximum likelihood method. Assuming that the pdf of xn,i is given above, the pdf of rn,i is obtained by a simple transformation as 1 kn (rn,i −βn ) ) kn 1 (1 + kn (rn,i −βn ) ) k1n −1 e−(1+ αn if kn 6= 0 αn αn (rn,i −βn ) f (rn,i ) = (rn,i −βn ) 1 αn −e αn if kn = 0 αn e (r −β ) where 1 + kn n,iαn n > 0 if kn 6= 0. The subscript n added to the shape parameter k means that its estimate depends on the choice of n. Under the assumption of independence, the likelihood function of the subperiod minima is 335 Quantitative Analytics l(rn,1 , .., rn,g |kn , αn , βn ) = g Y f (rn,i ) i=1 and nonlinear estimation procedures can be used to obtain maximum likelihood estimates of kn , αn , and βn , These estimates are unbiased, asymptotically normal, and of minimum variance under proper assumptions. 336 Part IV Quantitative trading in multifractal markets 337 Chapter 10 The fractal market hypothesis 10.1 Fractal structure in the markets 10.1.1 Introducing fractal analysis 10.1.1.1 A brief history The Hurst Exponent (H) proposed by Hurst [1951] and tested by Hurst et al. [1965] relates to the autocorrelations of the time series, and the rate at which these decrease as the lag between pairs of values increases. It is used as a measure of long-term memory of time series, classifying the series as a random process, a persistent process, or an anti-persistent process. Hurst measured how a reservoir level (Nile River Dam project) fluctuated around its average level over time, and found that the range of the fluctuation would change, depending on the length of time used for 1 measurement. If the series were random, the range would increase with the square root of time T 2 . To standardise the measure over time, he created a dimensionless ratio by dividing the range by the standard deviation of the observation, obtaining the rescaled range analysis (R/S analysis). He found that most natural phenomena follow a biased random walk, that is, a trend with noise which could be measured by how the rescaled range scales with time, or how high the exponent H is above 12 . In 1975 Mandelbrot (see Mandelbrot [1975] [2004]) introduced the term fractal as a geometric shape that is self-similar and has fractional dimensions, leading to the Mandelbrot set in 1977 and 1979. An object for which its topological dimension is lower or equal to its Hausdorff-Besicovitch (H-B) dimension is a fractal. By doing so, he was able to show how visual complexity can be created from simple rules. A more general definition states that a fractal is a shape made of parts similar to the whole in some way (see Feder [1988]). Two examples of fractal shapes are the Sierpinski Triange (see Figure ( 10.1)) and Koch Curve (see Figure ( 10.2)). The above Figures are bi-dimensional and deterministic fractal. Focusing on financial time series, Figure ( 10.3) illustrates a one-dimensional non-deterministic fractal representing thirty returns from the CAC40 Index at different time scales. Without any labels on the X − Y scales, it is impossible to know which one is daily, weekly, or monthly returns. The fractal dimension D measures the smoothness of a surface, or, in our case, the smoothness of a time series. As discussed by Peters [1994], the importance of the fractal dimension of a time series is that it recognises that a process can be somewhere between deterministic (a line with fractal dimension of 1) and random (a fractal dimension of 1.50). Fractal analysis is done by conducting rescaled adjusted range analysis (R/S analysis) of time series (see Mandelbrot [1975b]), where the Hurst Exponent and the fractal dimension of the series are estimated. A major application of the R/S analysis is the study of price fluctuations in financial markets. There, the value of the Hurst Exponent, H, in a time series may be interpreted as an indicator of the irregularity of the price of a commodity, currency or similar quantity. Interval estimation and hypothesis testing for H are central to comparative quantitative analysis. 338 Quantitative Analytics (a) Initial triangle (b) Second step (c) Third step (d) Few iterations Figure 10.1: Sierpinski Triangle (a) Initial line (b) Second step (c) Third step (d) Few iterations Figure 10.2: Koch Curve 10.1.1.2 Presenting the results Working on the Nile River Dam Project, Hurst was concerned with the storage capacity of a reservoir, based on an estimate of the water inflow and of the need for water outflow. Studying a 847-year record from 622 A.D. to 1469 A.D., he found that the record was not random, as larger than average overflows were more likely to be followed by more large overflows. Further, the process would abruptly change to a lower than average overflow, and be followed by more lower overflows. This is the characteristics of cycles with nonperiodic length. Working on Brownian motion, Einstein [1908] found that the distance R that a random particle covers increases with the square root of time T used to measure it, that is, 1 R=T2 339 (10.1.1) Quantitative Analytics ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● Figure 10.3: Self-similarity in CAC40 Index returns which is called the T to the one-half rule commonly used in statistics. It is used in financial economics to annualise volatility or standard deviation. However, in a sample data with N elements, we can only use this equation if the time series under consideration is independent of increasing values of N . That is, Equation (10.1.1) only applies to Brownian motion time series. Hurst generalised the concept to non-Brownian motion by taking into account systems that are not independent. Hurst et al. [1965] remedied this drawback by dividing the range by the standard deviation S of the original observations. They proposed a more general relation by calculating the Rescaled Range as R = k × TH S where k is a constant depending on the time series (see Peters [1994] [1991-96]). The R S value has a mean of zero, is expressed in terms of local standard deviation S, and scales as we increase the time increment T by a power law value equals to the Hurst Exponent (H). By rescaling the data we can compare diverse phenomena and time periods. The value of the Hurst Exponent varies between 0 and 1, with H = 21 implying a random walk or an independent process (see Figure 10.4). Figure ( 10.5) illustrates the role of the Hurst exponent. For 0 ≤ H < 12 we have anti-persistence (or ergodicity) where the process covers less distance than a random walk. It is often referred as mean reverting, meaning that if the system has been up in the previous period, it is more likely to be down in the next period. The converse being true. Anti-persistent time series exhibit higher noise and more volatility than a random series because it consists of frequent reversals. For 21 < H ≤ 1 we have persistence (or trend-reinforcing) where the process covers more distance than a random walk. A persistent series has long memory effects such that the trend at a particular point in time affects the remainder of the time series. If the series has been up (down) in the last period, then the chances are that it will continue to be positive (negative) in the next period. The fractal dimension D of a time series measures how jagged the time series is. In order to calculate the fractal dimension of a time series we count the number of circles of a given, fixed diameter needed to cover the entire time series. We then increase the diameter and count again the number of circles required to cover the time series. Repeating that process, the number of circles has an exponential relationship with the radius of the circle satisfying N × dD = 1 where N is the number of circles, and d is the diameter. Transforming the above equation 1 , the fractal dimension is given by 1 1 N = ( )D d 340 Quantitative Analytics ● H=0.9 H=0.8 H=0.7 H=0.6 H=0.5 H=0.4 H=0.3 H=0.2 H=0.1 ● 0 500 1000 1500 2000 time 0.0 ● ● −0.6 −1.0 −2 −1 −0.5 −0.4 0 0.0 1 −0.2 2 ● 0.5 Figure 10.4: Range of Hurst exponents between 0.1 and 0.9 ● 0 500 1000 1500 2000 ● 0 ● 500 time 1000 1500 2000 0 500 time (a) H = 0.1 (b) H = 0.5 1000 1500 2000 time (c) H = 0.9 Figure 10.5: Cumulative observations for different values of H D= log (N ) log ( d1 ) (10.1.2) Thus, the fractal dimension of a time series is a function of scaling in time. Mandelbrot showed that the Hurst 341 Quantitative Analytics Exponent, H, is related to the fractal dimension D for a self-similar surface in n-dimensional space by the relation D =n+1−H (10.1.3) where 0 ≤ H ≤ 1. While the fractal dimension of a line is 1.0 and the fractal dimension of a geometric plane is 2.0, the fractal dimension of a random walk is half way between the line and the plane at 1.5. A value of 21 < H ≤ 1 results in a fractal dimension closer to a line, so that a persistent time series would result in a smoother, less jagged line than a random walk. Similarly, for 0 < H < 12 , a time series is more jagged than a random series, or has more reversals. Definition 10.1.1 The Hurst Exponent is the measure of the smoothness of fractal time series based on the asymptotic behaviour of the rescaled range of the process. The Hurst Exponent can be estimated by H= where T is the duration of the sample data, and R S log ( R S) log (T ) is the corresponding value of the rescaled range. Definition 10.1.2 The Rescaled Range is the measure characterising the divergence of time series defined as the range of the mean-centred values for a given duration divided by the standard deviation of that duration. Persistent series are fractional Brownian motion, or biased random walk with the strength of the bias depending on how far H is above 12 . For H 6= 21 each observation carry a long-term memory, theoretically lasting forever. A system exhibiting Hurst statistics is the result of a long stream of interconnected events where time is important as the future depends on the past. As discussed in Feder [1988], the variance of fractionally integrated processes is proportional to t2H , and the impact of the present on the future can be expressed as a correlation C = 2(2H−1) − 1 (10.1.4) 1 2 where C is the correlation measure. For H = we get C = 0, and events are random and uncorrelated. The R/S analysis can classify an independent series, no matter what is the shape of the underlying distribution. Note, the correlation C is not related to the Auto Correlation Function (ACF) of Gaussian random variables which assumes Gaussian, or near-Gaussian, properties in the underlying distribution. 10.1.2 Defining random fractals Mandelbrot et al. [1968] introduced the fractional Brownian motion (fBm) as a generalisation of the ordinary Brownian motion by considering correlations between the increments of the process. The fBm and its corresponding generalised derivative process, the fractional Gaussian noise (fGn), are the benchmark of the Fractal Market Hypothesis (FMH). This is the only family of processes being Gaussian, self-similar, and endowed with stationary increments. 10.1.2.1 The fractional Brownian motion We consider the one dimensional random process X(t) with values X(t1 ), X(t2 ), ... such that the increment X(t2 ) − X(t1 ) has a Gaussian distribution, and the mean square increments have a variance proportional to the time differences, E[|X(t2 ) − X(t1 )|2 ] ∝ |t2 − t1 | We say that the increments of X are statistically self-similar in the sense that 1 X(t0 + t) − X(t0 ) and √ (X(t0 + rt) − X(t0 )) r 342 Quantitative Analytics have the same finite dimensional joint distribution functions for any t0 and time scale r > 0. The integral of uncorrelated white Gaussian noise W satisfies the above equations, and is given by Z t W (s)ds X(t) = −∞ where the random variables W (t) are uncorrelated and have the same normal distribution. The fractional Brownian motion (fBm) is a generalisation satisfying V ar(X(t2 ) − X(t1 )) ∝ |t2 − t1 |2H for 0 < H < 1. In the special case H = 21 we recover the Brownian motion. Again, the increments of X are statistically self-similar with parameter H in the sense that 1 (X(t0 + rt) − X(t0 )) rH have the same finite dimensional joint distribution functions for any t0 and r > 0. Setting t0 = 0, the accelerated fBm X(rt) is properly rescaled by dividing amplitudes by rH . X(t0 + t) − X(t0 ) and More formally, the fractional Brownian motions, {BH (t), t > 0}, is a Gaussian process with zero mean and stationary increments whose variance and covariance are given by 2 E[BH (t)] = σ 2 t2H E[BH (s)BH (t)] = 1 2 2H σ s + t2H − |t − s|2H , t, s > 0 2 where 0 < H < 1, σ > 0. Note, fBm are continuous but non-differentiable (in the classical sense). Note, Mandelbrot et al. [1968] defined the above as self-affinity of increments in distribution and proposed the following definition of self-similarity in distribution Definition 10.1.3 A process (Xt )−∞ ∝ kλkα , α = 2H p with r = (x1 , .., xd ), λ = (λ1 , .., λd ), and kλk = λ21 + ... + λ2d . • a power spectrum SH ∝ kwk−β , β = d + 2H p with w = (w1 , .., wd ) the angular frequency, and kwk = w12 + ... + wd2 . • a number of objects NH of characteristic size needed to cover the fractal NH ∝ −D , D = d + 1 − H where D is the fractal dimension of f (r), In the special case where d = 1, the power spectrum for the fractional Brownian motion becomes SH ∝ 1 |w|β with β = 2H + 1 and 1 < β < 3. Similarly, the power spectrum for the fractional Gaussian noise becomes SH ∝ 1 |w|β with β = 2H − 1 and −1 < β < 1. 10.1.2.3 The fractional Gaussian noise The implications of self-similarity for time series are not based on distributions but on dynamic properties of the time series which are defined by the autocorrelation function γ(k) (see Section ()). We denote by {WH (t), t > 0} the process derived from the increment of fBm, namely WH (t) = BH (t + 1) − BH (t) Beran [1994] and Embrechts et al. [2002] showed that self-similar processes have autocorrelation function defined exactly and asymptotically in the following two propositions. Proposition 1 Let (Xt )Tt=0 be self-similar process with 0 < H < 1 and finite variance σ 2 < ∞. Then the correlations are given by autocorrelation function γ(k) = E[Xt Xt+k ] = (k + 1)2H − 2k 2H + (k − 1)2H 2 for k ≥ 0, where H is the Hurst exponent. Proposition 2 Let (Xt )Tt=0 be self-similar process with 0 < H < 1 and finite variance σ 2 < ∞. Then the correlations are asymptotically given by autocorrelation function γ(k) ∼ H(2H − 1)k 2H−2 for k → ∞, where H is the Hurst exponent. 344 Quantitative Analytics Note, the second Proposition (2) suggests that if H = 12 , we have either an independent process, if the first Proposition (1) holds as well, or a short-term dependent process, if that first proposition is not valid. Thus, an independent process has zero correlations at all non-zero lags, while a short-term dependent process has significantly non-zero correlations at low lags but zero correlations at high lags. For H > 21 , the process has significantly positive correlations at all lags. P∞ It has hyperbolically decaying correlations which are non-summable and k=0 γ(k) = ∞. For H < 21 , the process has significantlyP negative correlations at all lags decaying hyperbolically. However, the correlations are summable, ∞ and we get 0 < k=0 γ(k) < ∞ (see Embrechts et al. [2002]). The spectral density (Fourier transform of γ) is ∞ X λ 1 ∼ CH |λ|1−2H as λ → 0 f (λ) = CH (2 sin ( ))2 2 |λ + 2πk|2H+1 k=−∞ where CH is a constant. 10.1.2.4 The fractal process and its distribution Following Mandelbrot et al. [1997] we now define fractal process with the separation between multi-fractal and monofractal processes of Lux [2003]. Definition 10.1.5 A process (Xt )−∞ 0, there also exists b > 0 such that F( x x x ) × F( ) = F( ) b1 b2 b This is a general characteristic of the class of stable distribution. The characteristic functions of F can be expressed in a similar manner f (b1 t) × f (b2 t) = f (bt) so that f (b1 t), f (b2 t), and f (bt) all have the same shaped distribution, despite their being products of one another which accounts for their stability. Following Mandelbrot [1964], we are now going to define the family of stable distributions, also called fractal because of their self-similar properties. Definition 10.1.6 Stable distributions are determined by characteristic function, natural logarithm of which is defined as φ(t) = ln E[eixt ] = iδt − |ct|α 1 − iβ t πα tan |t| 2 for α 6= 1 and φ(t) = iδt − |ct|α 1 + iβ 345 2 ln |t| π Quantitative Analytics for α = 1, where 0 < α ≤ 2 is a characteristic exponent determining peakedness at δ, β ≤ |1| is a skewness parameter, −∞ < δ < ∞ is a location parameter and 0 ≤ c < ∞ is a scale parameter. t Note, |t| is the the sign of t. We usually represent the parameters of a stable distribution by S(x; α, β, c, δ). For α = 2, β = 0 we recover the Gaussian distribution with variance equal to c = 2σ 2 . Further, if δ = 0, we get the standardise normal distribution with zero mean and unit variance. Setting α = 1, β = 0, we recover the Cauchy distribution which has infinite variance and mean. The parameter α is crucial for an existence of variance. For 1 < α < 2, the distribution has infinite or undefined second moment and thus population variance. Moreover, for 0 < α ≤ 1, the distribution has infinite mean as well. Even though there are a number of different ways of measuring the characteristic exponent α (see Fama [1965]), the R/S analysis and spectral analysis offer the most reliable method. Peters [1991-96], Panas [2001] and others showed that the self-similar process is connected to stable distribution of the process by the following relation between the Hurst exponent and the characteristic exponent α 1 (10.1.7) H While H measures the fractal dimension of the time trace by the fractal dimension 2 − H (see Equation (10.1.3) 1 with n = 1), it is also related to the statistical self-similarity of the process through Equation (10.1.7). However, H measures the fractal dimension of the probability space. α= 10.1.2.5 An application to finance Even though the major problem with the family of stable distributions is that they do not lend themselves to closed-for solutions, apart from the normal and Cauchy distributions, they have a number of desirable characteristics • Stability under addition: the sum of two or more distributions that are fractal with characteristic exponent α keeps the same shape and characteristic exponent α. • Self-similarity: fractal distributions are infinitely divisible. When the time scale changes, α remains the same. • They are characterised by high peaks at the mean and by fat tails matching the empirical characteristics of market distributions. but also some characteristics undesirable from a mathematical point of view, but actually reflecting market behaviour • Infinite variance: second moments do not exist. Variance is unreliable as a measure of dispersion or risk. • Jumps: large price changes can be large and discontinuous. The Brownian motion, the L-stable process (see Mandelbrot [1963]), and the fBm are the main examples of selfaffine processes in finance. Long memory is a characteristic feature of fBm, BH (t), having continuous sample paths, as well as Gaussian increments. Granger et al. [1980] and Hosking [1981] introduced ARFIMA, a discrete-time counterpart of the fBm which was used in economics to introduce long memory (see details in Section (10.1.3.2)). However, neither fBm nor ARFIMA disentangle volatility persistence from long memory in returns. To overcome this problem, Mandelbrot et al. [1997] proposed the multifractal model of asset returns (MMAR) which combines several elements of research on financial time series, such as generating fat tails in the unconditional distribution of returns, generating returns with a finite variance, fluctuations in volatility. Further, the multifractal model has long memory in the absolute value of returns, but the returns themselves have a white spectrum. At last, the multifractal model is built on the concept of trading time. It is constructed by compounding a Brownian motion, B(t), with a random increasing function, θ(t), called the trading or time-deformation process (see details in Section (11.6)). The MMAR model locally varies as (dt)α(t) , where the local scale α(t) can take a continuum of values with relative occurrences summarised in a renormalised probability density called the multifractal spectrum (see details in Section (11.1.2)). 346 Quantitative Analytics 10.1.3 A first approach to generating random fractals As listed by Coeurjolly [2000] and Dieker [2003], there exists a plethora of methods for generating fractional Brownian motion (fBm). Historically, Mandelbrot et al. [1968] first simulated a fBm by using its stochastic representation with respect to an ordinary Brownian motion. Since this approach makes very rough approximations, Choleski proposed a method using a Choleski decomposition of the covariance matrix of the standard fBm which is exact but highly demanding in computational resource (complexity O(n3 )). To circumvent this problem, Davis et al. considered the same approach as Choleski, but used in addition circulant matrix. Later, Wood et al. [1994] generalised the method to end up with an exact simulation of fBm with the complexity O(n log n). There are many more methods such as Hosking-Levinson-Durbin method (see Hosking [1984]), the Random Midpoint Dispacement (see Lau et al. [1995]), Fast Fourier Transform method (see Paxson [1997]), and wavelet-based method (see Abry et al. [1996]), to name a few. While there is a large number of methods for identifying fractional Brownian objects, Meharabi et al. [1997] compared seven of these methods and found that the wavelet decomposition method offers a highly accurate and efficient tool for characterising long-range correlations in complex distributions and profiles. We are now going to briefly present the Fourier filtering method and the ARFIMA models. 10.1.3.1 Approximating fBm by spectral synthesis The spectral synthesis method (or Fourier filtering method) for generating fBm is based on the spectral representation of samples of the process X(t). As the Fourier transform of X is generally undefined, we first restrict X(t) to a finite time interval 0 < t < T , denoted X(t, T ). Then, we get Z ∞ X(t, T ) = F (f, T )e2πitf df ∞ where F (f, T ) is the Fourier transform of X(t, T ) T Z X(t)e−2πitf dt F (f, T ) = 0 Note, |F (f, T )|2 df is the contribution to the total energy of X(t, T ) from those components with frequencies between f and f + df . Thus, the average power of X (power spectra) contained in the interval [0, T ] is given by Z 1 ∞ 1 |F (f, T )|2 df PF (f, T ) = EF (f ) = T T ∞ and the power spectral density (PSD) per unit time of X(t, T ) (see Equation (F.1.1)) is 1 |F (t, t)|2 T The spectral density of X is then obtained in the limit as T → ∞ S(f, T ) = 1 |F (f, T )|2 T →∞ T Note, S(f )df is the average of the contribution to the total power from components in X(t) with frequencies between f and f + df . It is a non-negative and even function. In the spectral analysis, X(t) is decomposed into a sum of infinitely many sine and cosine terms of frequencies f whose powers (and amplitudes) are determined by the spectral density S(f ). S(f ) = lim The main idea behind spectral synthesis is that a prescription of the right kind of spectral density S(f ) will give rise to fBm with exponent 0 < H < 1. For instance, if the random function X(t) contains equal power for all frequencies f , the process is white noise. If S(f ) is proportional to f12 we obtain the Brownian motion. In general, a process X(t) with a spectral density proportional to 1 fβ corresponds to fBm with H = 347 β−1 2 . That is, Quantitative Analytics S(f ) ∝ 1 ∼ fBm with β = 2H + 1 fβ Choosing the spectral exponent β between 1 and 3 will generate a graph of fBm with a fractal dimension of 5−β 2 The relationship between β and H can be derived from the fact that the mean square increments are directly related to the autocorrelation function of X, which in turns defines the spectral density by means of a Fourier transform via the Wiener-Khintchine relation. Df = 2 − H = To obtain a practical algorithm Saupe [1988] translated the above equations into conditions on the coefficients ak of the discrete Fourier transform X(t) = N −1 X ak e2πikt k=0 Since the coefficients ak are in a one-to-one correspondence with the complex values X(tk ) for tk = 0, 1, .., N − 1, the condition to be imposed on the coefficients to satisfy S(f ) ∝ f1β becomes E[|ak |2 ] ∝ k N, k = 1 kβ for 0 < k < N2 since k denotes the frequency in the above equation. For k ≥ N2 we must have ak = aN −k because X is a real function. Thus, the method consists of randomly choosing coefficients subject to the above expectation and then computing the inverse Fourier transform to obtain X in the time domain. As the process X need only have real values, it is sufficient to sample real random variables Ak and Bk under the constraint E[A2k + Bk2 ] ∝ 1 kβ and then set N X(t) = 2 X Ak cos kt + Bk sin kt k=1 One can interpret the addition of more and more random Fourier coefficients ak as a process of adding higher frequencies, thus, increasing the resolution in the frequency domain. However, due to the nature of Fourier transforms, the generated samples are periodic, as one can compute twice or four times as many points as actually needed and then discard a part of the sequence. 10.1.3.2 The ARFIMA models We saw in Appendix (??) that ARIMA models are homogeneous nonstationary systems that can be made stationary by successively differencing the observations. While the differencing parameter, d, was always an integer value, Granger et al. [1980] and Hosking [1981] generalised the ARIM A(p, d, q) value for fractional differencing to yield the autoregressive fractionally integrated moving average (ARFIMA) process where d can be any real value, including fractional value. As a result, these models can generate persistent and antipersistent behaviour where the ARF IM A(0, d, 0) process is the fractional Brownian motion introduced by Mandelbrot. The general ARF IM A(p, d, q) process can include short-memory AR or MA processes over a long-memory process. Hence, the very high-frequency terms can be autoregressive, when superimposed over a long-memory Hurst process. Fractional differencing tries to convert a continuous process, fractional Brownian motion into a discrete one by breaking the differencing process into 348 Quantitative Analytics smaller components. Moreover, there is a direct relationship between the Hurst exponent and the fractional operator given by d=H− 1 2 where 0 < d < 12 corresponds to a persistent black noise process, and − 21 < d < 0 is equivalent to an antipersistent pink noise system. White noise, the increments of a random walk, corresponds to d = 0, and brown noise, the trail of a random walk, corresponds to d = 1. We saw in Section () that the discrete time white noise can be represented in terms of a backward shift operator as B(xt ) = xt−1 so that ∆xt = (1 − B)xt = at where the at are i.i.d. random variables. fractional differenced white noise with parameter d is given by the binomial series ∆ d = ∞ X d (1 − B) = (−B)k k = 1 1 1 − dB − d(1 − d)B 2 − d(1 − d)(2 − d)B 3 − ... 2 6 d k=0 We are now presenting the relevant characteristic of the fractional noise process developed by Hosking. We let {xt } be an ARF IM A(0, d, 0) process where k is the time lag and at is a white noise process with mean zero and variance σa2 . When d < 12 , then {xt } is a stationary process and has infinite moving average representation xt = ψ(B)at = ∞ X ψk at−k k=0 where ψk = (k+d−1)! k!(d−1)! . When d > − 12 , then {xt } is invertible and has the infinite autoregressive representation π(B)xt = ∞ X πk xt−k k=0 where πk = (k−d−1)! k!(d−1)! . The spectral density of {xt } is s(w) = (2 sin w −2d ) 2 for 0 < w ≤ π. The covariance function of {xt } is γk = E[xt xt−k ] = (−1)k (−2d)! (k − d)!(−k − d)! The covariance function of {xt } is ρk ∼ (−d)! 2d−1 k (d − 1)! as k → ∞. The inverse correlations of {xt } are ρinv,k ∼ d! k −1−2d (−d − 1)! The partial correlations of {xt } are 349 Quantitative Analytics φkk = d , k = 1, 2, ... k−d Note, for − 12 < d < 12 , both φk and πk decay hyperbolically (according to a power law) rather than exponentially, as they would with an AR process. For d > 0, the correlation function is also characterised by power law decay. This implies that {xt } is asymptotically self-similar, or it has a statistical fractal structure. Further, the partial and inverse correlations also decay hyperbolically, unlike the standard ARIM A(p, 0, q). All of the hyperbolic decay behaviour in the correlations is also consistent with a long-memory, stationary process for d > 0. In the case where − 21 < d < 0, the ARF IM A(0, d, 0) process is antipersistent. The correlations and partial correlations are all negative, except for ρ0 = 1, and decay to zero according toa power law. The general ARF IM A(p, d, q) process has short-frequency effects superimposed over the low-frequency or longmemory process. Hosking argued that in practice it is likely to be of most interest for small values of p and q. An ARF IM A(1, d, 0) process is defined by (1 − φB)∆d yt = at where at is a white noise process. We must include the fractional differencing process xt = φ(B)at with ∆xt = at so that xt = (1 − φB)yt . The ARIM A(1, d, 0) variable, yt , is a first-order autoregression with ARIM A(0, d, 0) disturbance, that is, an ARF IM A(1, d, 0) process. Hence, yt will have short-term behaviour that depends on the coefficient of autoregression, φt , like a normal AR(1) process, but the long-term behaviour of yt will be similar to xt and will exhibit persistence or antipersistence, depending on the value of d. For stationarity and invertibility, we assume |d| < 21 and |φ| < 1. 10.1.4 From efficient to fractal market hypothesis 10.1.4.1 Some limits of the efficient market hypothesis We saw in Section (1.7.6) that the efficient market hypothesis (EMH) required observed prices to be independent, or at best, to have a short-term memory such that the current change in prices could not be inferred from previous changes. Since efficient markets are priced so that all public information, both fundamental and price history, is already discounted, prices only move when new information is received. That is, only today’s unexpected news can cause today’s price to change. This could only occur if price changes were random walk and if the best estimate of the future price was the current price. The process would be a martingale, or a fair game. However, stock markets were started so that traders could find a buyer if one of them wanted to sell, and a seller if one of them wanted to buy. This process would create liquidity ensuring that 1. the price investors get is close to what the market consider fair 2. investors with different investment horizons can trade efficiently with one another 3. there are no panics or stampedes occurring when supply and demand become imbalanced That is, if short-term investor experiences relatively high loss, it becomes a buying opportunity for a long-term investor and vice versa. Investors being considered as rational, after assessing the risks involved, the collective consciousness of the market finds an equilibrium price. Ignoring liquidity, EMH only consider fair price even though completing the trade at any cost may become vital in some market situations (non-stable or illiquid markets). In general, the frequency distribution of returns is a fat-tailed, high-peaked distribution existing at many different investment horizons. Further, the standard deviation of returns increases at a faster rate than the square root of time. As a result, correlations come and go, and volatility is highly unstable. Taking into consideration these observations, Mandelbrot [1960] [1963a] [1963] described the financial market as a system with fat tails, stable distributions and persistence. Consequently, the evidence of long-range memory in financial data causes several drawbacks in modern finance 350 Quantitative Analytics 1. the optimal consumption and portfolio decisions may become extremely sensitive to the investment horizon. 2. the methods used to price financial derivatives based on martingale models are no-longer useful. 3. since the usual tests on the CAPM and arbitrage pricing theory (APT) do not take into account long-range dependence, they can not be applied to series presenting such behaviour. 4. if long-range persistence is present in the returns of financial assets, the random walk hypothesis is no-longer valid and neither is the market efficiency hypothesis. Hence, long memory effects severely inhibit the validity of econometric models, explaining the poor record economists have had in forecasting. In order to explain discontinuities in the pricing structure, and the fat tails, Shiller [1989] and Miller [1991] proposed that information arrives in a lumpy, discontinuous manner. Investors still react to information homogeneously, preserving the assumption of independence, but the arrival of information is discontinuous. However, investors are not homogeneous, and the importance of information can be considered largely dependent on the investment horizon of the investors. The important information being different at each investment horizons, the source of liquidity can be characterised by investors with different investment horizons, different information sets, and consequently, different concepts of fair price. Further, new information may contribute to increased levels of uncertainty, rather than increased levels of knowledge. We may get increased volatility, or merely a noisy jitter. At last, at longer frequencies, the market reacts to economic and fundamental information in a nonlinear fashion. Studies of macroeconomic indices and simulations showed that the influence of information flow in the formation of economic cycles was highly relevant, and delayed information flow markedly affected economy system evolutions (see Ausloos et al. [2007]) and Miskiewicz et al. [2007]. Hence, while the linear paradigm, built into the rational investor concept, states that investors react to information in a linear fashion, the new paradigms must generalise investor reaction by accepting the possibility of nonlinear reaction to information. Accounting for these new stylised facts, Larrain [1991] and Vaga [1990] proposed two similar models contradicting some assumptions of EMH, homogeneity of investors, independent identically distributed returns and risk-return tradeoff. 10.1.4.2 The Larrain KZ model Even though the Larrain’s KZ model (LKZ) proposed by Larrain [1991] is a model of real interest rate, its main idea is general enough to be an alternative to the EMH. In the LKZ model, a system can be generated from two separate mechanisms, one based on past behaviour and the other one based on interconnection with other fundamental variables. We let (Xt ; t = 1, .., n) be the underlying process, and assume that its dynamics are given by the following two equations Xt+1 = f (Xt−n ) and Xt+1 = g(Z) where Z is another stochastic process. The first equation states that the future values Xt+1 are dependent on present and past values Xt , .., Xt−n , and the second equation states that the future values Xt+1 are dependent on fundamental variables represented by Z. As an example, Larrain specified the function f (•), so that the first equation rewrite Xt+1 = a − cXt (1 − Xt ) where a is an arbitrary constant and c > 0 is a positive constant. Putting together the two equations, we get Xt+1 = a − cXt (1 − Xt ) + g(Z) Testing empirically the model on interest rates with different fundamental variables, Larrain obtained very strong results. The past real rates together with real GNP, nominal money supply, consumer price index, real personal 351 Quantitative Analytics income and real personal consumption all had significant coefficients. Asa result, he concluded that both past prices and fundamental variables are important for describing the dynamical system, so that fundamentalists and technicians can be part of the market and both can influence the behaviour of market prices. Fundamentalists base their estimates on changes of expected cash flows, while technicians base their trading strategy on crowd behaviour, short-term effects or past behaviour of stock prices. This implication strongly contradicts two assumptions of the EMH, namely the homogeneity of the investors and the unusefulness of past prices for future prices prediction. 10.1.4.3 The coherent market hypothesis Vaga [1990] developed the coherent market hypothesis by considering the theory of coherent systems in natural sciences, which is based on a system with an order parameter summing all external forces driving the system. The main idea is based on Ising model of ferromagnetism where molecules behave randomly (with normally distributed movements) up till order parameter (temperature of an iron bar) reaches certain level where the molecules start to cluster and behave chaotically. The theory has been applied to the behaviour of social groups as well as to the behaviour of investors (see Schobel et al. [2006]). Vaga proposed the following probability formula for annualised return f (q) −1 f (q) = c Q(q)e 2 K(y) dy − 1 Q(y) 2 Rq where K(q) = sinh (kq + h) − 2q cosh (kq + h) Q(q) = 1 cosh (kq + h) − 2q sinh (kq + h) n and −1 c Z 1 2 −1 Q = (q)e 2 K(y) dy − 1 Q(y) 2 Rq dq − 21 where n is the number of degrees of freedom (market participants), k is a degree of crowd behaviour, and h is a fundamental bias. Schobel et al. identified five types of markets with respect to varying parameters k and h, namely, • Efficient market (0 ≤ k << kcritical , h = 0) where investors act independently of one another and a random walk is present. • Coherent market (k ≈ kcritical , h << 0h >> 0) where crowd behaviour is in conjunction with strong bullish or bearish fundamentals and creates coherent market where traditional risk-return tradeoff is inverted and investors can earn above-average returns while facing below-average risk. • chaotic market (k ≈ kcritical , h ≈ 0) where crowd behaviour is in conjunction with only weak bearish or bullish fundamentals and creates the situation of low returns with above-average risk. • Repelling market (k < 0, h = 0) where opposite of crowd behaviour is present, investors try to avoid having the same opinion as the majority. • Unstable transitions consist of all market states that can not be assigned to any of the previous states. Similarly to the LKZ model, markets can exhibit various stages of behaviour by combining fundamental and sentiment influences which contradict the assumptions of EMH. 352 Quantitative Analytics 10.1.4.4 Defining the fractal market hypothesis Retaining the most important assumptions from the above models, Peters [1994] proposed the Fractal Market Hypothesis (FMH) to model investor behaviour and market price movements, that is, 1. The market is stable when it consists of investors covering a large number of investment horizons, ensuring liquidity for traders. 2. The information set is more related to market sentiment and technical factors in the short term than in the longer term. As investment horizons increase, longer-term fundamental information dominates. Thus, price changes may reflect information important only to that investment horizon. 3. If an event occurs making the validity of fundamental information questionable, long-term investors either stop participating in the market or begin trading based on the short-term information set. When the overall investment horizon of the market shrinks to a uniform level, the market becomes unstable. In that case, there are no longterm investors to stabilise the market by offering liquidity to short-term investors. 4. Prices reflect a combination of short-term technical trading and long-term fundamental valuation, so that shortterm price changes are likely to be more volatile, or noisier, than long-term trades. The underlying trend in the market is reflective of changes in expected earnings, based on the changing economic environment. Shortterm trends are more likely the result of crowed behaviour. There is no reason to believe that the length of the short-term trends is related to the long-term economic trend. 5. If a security has no tie to the economic cycle, then there will be no long-term trend. Trading, liquidity, and short-term information will dominate. Those hypothesis state that the different investment horizons value information differently, leading to uneven diffusion of information, so that at any one time, prices only reflect the information important to that investment horizon. Investors with short investment horizon focus on technical information and crowd behaviour of other market participants, while long-term investors base their decisions on fundamental information, which emphasise the heterogeneity of investors. This lead Peters to argue that fair value is not a single price, but a range of prices determined partly by fundamental information (earnings, management, new products, etc.) and by what investors feel other investors will be willing to pay (sentiment component). While the former is using fundamental analysis, the latter uses technical analysis setting a range around the fair value. The combination of information and sentiment results in a bias in the assessment of a stock’s value. The range is dynamic as new information about the specific security or the market as a whole can shift the range and cause dramatic reversals in either the market or the single stock. Hence, a single negative information can turn markets into a downward spiral. This is similar with the Coherent Market Hypothesis (CMH) (see Vaga [1990]), and the K-Z model (see Larrain [1991]) where the market assumes different states and can shift between stable and instable regimes. In all cases, the chaotic regime occurs when investors lose faith in long-term fundamental information. EMH works well as long as markets are stable and close to equilibrium, but it cease to work if markets are close to or in turbulence. As opposed to the EMH which restricts the data process to be normal, one important generalisation of the FMH is that it does not restrict the data process to be of any specific distribution. FMH states that the market is stable as long as the returns of different investment horizons are self-similar in their distribution, thus, when it has no characteristic time scale or investment horizon. That is, instability occurs when the market loses its fractal structure and assumes a fairly uniform investment horizon. For fractality measurement, we use the Hurst exponent applied to financial time series. 10.2 The R/S analysis 10.2.1 Defining R/S analysis for financial series As discussed in Section (10.1.1), the Rescaled Range Analysis (R/S) was developed by Hurst [1951] as a statistical method for analysing long records of natural phenomenon. It has been extended to study economic and capital market 353 Quantitative Analytics time series by defining a range that would be comparable to the fluctuations of the reservoir height levels. That is, the Hurst statistic applied to the Nile River discharge record is replaced by the difference between the maximum and minimum levels of the cumulative deviation over N periods of financial series. In that setting, R/S analysis, which is the central tool for fractal data modelling, is made of 1. the difference between the maximum and the minimum cumulative values 2. the standard deviation from the observed values. Given a discrete time series (of order of magnitude the market returns) with values X1 , .., Xn where n is the number of observations, we let µ̂n and σ̂n be respectively the sample mean and sample standard deviation of the time series. The Rescaled Range is calculated by rescaling the time series by subtracting the sample mean, getting the mean-adjusted series Yi = Xi − µ̂n , i = 1, .., n so that the resulting series has zero mean. We let Γn be the cumulative deviate time series over n periods with element given by Γi = Γi−1 + Yi , i = 2, .., n , Γ1 = Y1 with Γn = 0 since Y has a zero mean 2 . The adjusted range is the difference between the maximum value and the minimum value of Γi , that is, Rn = max (Γ1 , .., Γn ) − min (Γ1 , .., Γn ) with the property that Rn ≥ 0. The adjusted range Rn is the distance that the system travels for time n. In discrete time, the distance R a particle covers increases with respect to time T according to the general relation R )n = c × nH as n → ∞ (10.2.8) S where the subscript n refers to the duration of the time series, c is a constant, and H is the Hurst Exponent. Taking the logarithm of the Rescaled Range with basis equal to b, we get ( logb ( R )n = H logb (n) + logb (c) S which indicates the power scaling. Finding the slope of the log/log graph of R S versus n will give us an estimate of H making no assumptions about the shape of the underlying distribution (see Figure (10.6)). Peters noted that real observations with long scale n could be expected to exhibit properties similar to regular Brownian motion, or pure random walk, as the memory effect dissipates. Finding H = 21 does not prove a Gaussian random walk, but only that there is no long memory process. That is, any independent system, Gaussian or otherwise, produces H = 12 . Assuming c = 21 , Hurst gave a formula for estimating the exponent H from a single R/S value H= logb ( R S) logb ( n2 ) where n is the number of observations. For short data sets, where regression is not possible, this empirical law can be used as a reasonable estimate. 2 Γn = Pn i=1 Xi − nµ̂n = 0 354 Quantitative Analytics ● ● 8 ● ● 6 Error Variance ● ● ● 4 ● ● ● 2 ● ● 4 6 8 10 12 14 Window Size Figure 10.6: Log-regression of the Rescale Range on the scale for a simulated fBm with H = 0.62. The slope of the blue line gives the Hurst Exponent The joker effect Hurst assumed that the water inflow and outflow of the reservoir under study was governed by a biased random walk, and devised an elegant method to simulate such a process. Rather than flipping coins to simulate random walks, Hurst constructed a probability pack of cards with 52 cards numbered −1, 1, −3, 3, −5, 5, −7, 7. The numbers were distributed to approximate the normal curve and the random walk was simulated by shuffling, cutting the deck, and noting the cut cards. The process to simulate a biased random walk was more complex, but resulted from randomly cutting the deck. He would first shuffle the deck, cut it once, and note the number, say 3. Replacing the card and reshuffling the deck, he would deal out two hands of 26 cards, obtaining deck A and deck B. He would then take the three highest cards from deck A, place them in deck B, and remove the three lowest cards in deck B. Deck B being biased to a level of 3, a joker is added to deck B which is reshuffled. This biased deck was used as a time series generator, until the joker was cut, in which case a new biased hand was created. Performing 1000 trials of 100 hands, he calculated H = 0.72. Yet, no matter how many times the experiment was done, Hurst found the same result. He found that a combination of random events with generating order creates a structure. 10.2.2 A step-by-step guide to R/S analysis 10.2.2.1 A first approach The R/S analysis being highly data intensive, we must consider a series of executable steps. Given the process Xt,N , the process for estimating the Hurst Exponent by using the R/S analysis consists of three steps 355 Quantitative Analytics 1. The cumulative total at each point in time, for a time series over a total duration N , is given by ΓN,k = k X (Xi − µ̂N ) , 0 < k ≤ N i=1 The range R of Γ is given by R = max (ΓN,k ) − min (ΓN,k ) Given the sample standard deviation σ̂N , the Rescaled Range is given by R S with S = σ̂N . 2. We take N = N2 and calculate the new Rescaled Range R S for each segment, following step 1. The average value of R is then computed. We repeat this process for successively smaller intervals over the data set, dividing S for each segment and computing the average R each segment obtained in each step in two, calculating R S S. 3. The Hurst Exponent is estimated by plotting the values of logb ( R S ) versus logb (N ). Such a graph is called a pox plot. The slope of the best fitting line gives the estimate of the Hurst Exponent. Note, R/S analysis is calculated for all values of n, such that if there is not enough data left for a full value of n, then it leaves that data off. As n increases, more and more of the data is discarded resulting in the jaggedness of the log/log plots at high value of n. An alternative is to use values of n that are even divisors of the total number of observations so that all of the R/S values use all of the data. One must therefore sometimes reduce the initial data set to a number having the most divisors. Further, one can generate least squares regression line using linear regression method. However, this approach is known to produce biased estimates of the power-law exponent. A more principled approach fits the power law in a maximum-likelihood fashion (see Clauset et al. [2009]). 10.2.2.2 A better step-by-step method We observe the stochastic process Xt at time points t ∈ I = {0, .., N }, and we let n be a small integer relative to N N (asymptoticall, as N n → ∞), and let A denotes the integer part of n . Divide the interval I into A consecutive subintervals, each of length n and with overlapping end points. In every subinterval, correct the original datum Xt for location, using the mean slope of the process in the subinterval, obtaining t (Xan − X(a−1)n ) n for all t with (a − 1)n ≤ t ≤ an for all a = 1, .., A. Over the a-th subinterval Xt − Ia = (a − 1)n, (a − 1)n + 1, .., an for 1 ≤ a ≤ A, construct the smallest box (with sides parallel to the cordinate axes) such that the box contains all the fluctuations of Xt − nt (Xan − X(a−1)n ) occurring within Ia . Then, the height of the box equals t t (Xan − X(a−1)n )} − min {Xt − (Xan − X(a−1)n )} n n (a−1)n≤t≤an (a−1)n≤t≤an We let Sa be the sample standard error of the n variables Xt − Xt−1 for (a − 1)n ≤ t ≤ an. If the process X is stationary the Sa varies little with a, otherwise, dividing Ra by Sa corrects for the main effects of scale inhomogeneity in both spatial and temporal domains. The total area of the boxes, corrected for scale, is proportional in n to Ra = max {Xt − ( A X R Ra )n = A−1 S S a=1 a The slope Ĥ of the regression of log ( R S )n on log (n), for k values of n, may be taken as an estimator of the Hurst constant describing long-range dependence of the process X. 356 Quantitative Analytics 10.2.3 Testing the limits of R/S analysis We can question the validity of the Hurst estimate itself, as it is sensitive to the amount of data tested. An estimate of exponent H that is significantly different (greater) from 12 has two possible explanations 1. there is a long memory component in the time series studied 2. the analysis itself is flawed. One way of testing for the validity of the results is to randomly scramble the data so that the order of the observations is completely different from that of the original time series. Repeating the calculation of the Hurst exponent on the scrambled data, if the series is truly independent, the result should remain virtually unchanged because there were no long memory effects. In that case, scrambling the data has no effect on the qualitative aspect of the data. On the other hand, if there was a long memory effect, scrambling the data would destroy the structure of the system. The H estimate would be much lower, and closer to 12 , while the frequency distribution remains unchanged. Since an AR(1) process is an infinite-memory process, some authors suggest to take AR(1) residuals off the data before applying R/S analysis to filter out the short-memory process. In order to assess the significance of R/S analysis, we need some kind of asymptotic theory to define confidence intervals, much like the t-statistics of linear regression. It can be done by first studying the behaviour of R/S analysis when the system is an independent, random one, and compare other processes to the random null hypothesis. Basing his null hypothesis on the binomial distribution and the tossing of coins, Hurst [1951] found the random walk to be a special case of Equation (10.2.8) given by π 1 R )n = (n ) 2 S 2 where n is the number of observations. While Hurst worked on the rescaled range, Feller [1951] considered the 0 adjusted range R which is the cumulative deviations with the sample mean deleted, and developed its expected value and its variance. It would avoid the problem of computing the sample standard deviation for small values of n, and at the limit (n → ∞), it would be equivalent to the rescaled range. He obtained the formulas ( 0 E[R (n)] 0 V ar(E[R (n)]) π 1 (n ) 2 2 π2 π = n( − ) 6 2 = 0 Since the R/S values of a random number should be normally distributed, the variance of R (n) should decrease as we increase samples. Hurst and Feller suggested that the rescaled range also increases with the square root of time and that the variance of the range increases linearly with time. With the power of computers we can directly apply Monte Carlo method of simulation on Equation (10.2.8) to test the Gaussian hypothesis. Peters considered a pseudo-random number series of 5000 values, scrambled twice, and calculated R/S values for all n that are evenly divisible into 5000. This process was repeated 300 times to generate 300 (R/S))n values for each n. For n > 20, results were similar to the formulas by Hurst and Feller, but a consistent deviation was present for smaller values of n. In that setting, the (R/S))n values and their variances were systematically lower. It can be explained because Hurst was calculating an asymptotic relationship holding only for large n. Mandelbrot et al. [1969b] referred to that region of small n as transient because n was not large enough for the proper behaviour to be observed. To circumvent this deviation, Anis et al. [1976] (AL76) developed the following statistic for small n n−1 Γ( 1 (n − 1)) X E[(R/S)n ] = √2 πΓ( 12 n) k=1 357 r n−k k Quantitative Analytics However, this equation is less useful q for large values of n as the gamma values become too large. Yet, approximating the gamma function Γ(•) with n2 , just like the beta function B(•) is used as a substitute of gamma function, Peters approximated the Sterling’s function as Γ( 12 (n − 1)) 2 1 ≈ ( )2 1 n Γ( 2 n) Note that the exact application of the Stirling’s approximation yields Γ( 21 (n − 1)) 1 2 ≈( )2 n−1 Γ( 21 n) Nonetheless, Peters simplified the equation to n−1 π 1X E[(R/S)n ] = (n )− 2 2 k=1 r n−k k which can be used when n > 300. Still, the above equation was missing something for values of n less than 20. Multiplying the above equation with an empirical correction factor, Peters [1994] (P94) obtained n−1 n − 21 π − 1 X (n ) 2 E[(R/S)n ] = n 2 k=1 r n−k k (10.2.9) getting closer to the simulated R/S values. Using this equation, Peters showed that H = 12 for an independent process is an asymptotic limit, and that the Hurst exponent will vary depending on the values of n used to run the regression. We must therefore consider a system under study in relation with the E[R/S] series for the same values of n. Note, Couillard et al. [2005] thoroughly tested the above corrections for finite samples and found that Anis et al. estimates rescaled range for small samples (n < 500) much more accurately and underestimates rescaled range for large samples (n > 500) compared to Peters. But the underestimation is insignificant. They also tested the asymptotic standard deviation of H, denoted σ̂(H), and argued that Peters’ statement that σ̂(H) ≈ √1T is only an asymptotic limit and is significantly biased for finite number of observations. They came up with a new estimate based on simulations 1 . up to T = 10000, getting σ̂(H) ≈ e3 √ T 10.2.4 Improving the R/S analysis 10.2.4.1 Reducing bias A problem with R/S analysis, which is common to many Hurst parameter estimators, is knowing which values of n to consider. In general, since the R/S analysis is based on range statistic R and standard deviation S, the estimates of Hurst exponent can be biased. For instance, for small n short term correlations dominate and the readings are not valid, while for large n there are a few samples and the value of the statistic will not be accurate. Further, at low scales, n, sample standard deviation can strongly bias the final rescaled range, since standard deviation becomes close to zero, implying infinite rescaled range. Hence, we should run the regression over values of n ≥ 10, as small values of n produce unstable estimates when sample sizes are small. In addition, range statistic is very sensitive to outliers and its estimate can strongly bias the final rescaled range at high scales, n, as the outliers are not averaged out as it is the case at low scales. Millen et al. [2003] proposed to use a minimum scale of at least 10 observations and a maximum scale of a half of the time series length. 358 Quantitative Analytics 10.2.4.2 Lo’s modified R/S statistic The R/S analysis is problematic when considering heteroskedastic time series and series with short-term memory. The complicated use for heteroskedastic time series, due to the use of sample standard deviation together with a filtration of a constant trend (computation of accumulated deviations from the arithmetic mean), makes R/S analysis sensitive to non-stationarities in the underlying process. One way forward is to consider detrended fluctuation analysis (DFA), where one filters the series not only from a constant trend, but also from higher polynomials such as linear and quadratic (details are given in Section (10.3.2.1)). To deal with short-term dependence in the time series, the modified rescaled range (M − R/S) introduced by Lo [1991] is the mostly used technique. Differing only slightly from the R/S method in the computation of the standard deviation S, and focusing on the single period n = N , the (M −R/S) analysis deals with both heteroskedasticity and short-term memory. The modified standard deviation is defined with PN the use of auto-covariance γj = i=j+1 (Xi − X N )(Xi−j − X N ) of the selected sub-period, up to the lag λ, as follow Sλ2 = S 2 + 2 λ X γj wj (λ) j=1 where wj (λ) = 1 − j λ+1 , λ < N . Lo’s modified R/S statistic Vλ (N ) is defined by 1 Vλ (N ) = N − 2 ( R )N Sλ Note, for λ = 0 we recover the sample variance S 2 and as a result the R/S method. The weights wj (•) are chosen such that Sλ2 is the sample variance of an aggregated or averaged series. If a series has no long-range dependence, Lo showed that given the right choice of λ, the distribution of Vλ (N ) is asymptotic to that of W1 = max W0 (t) − min W0 (t) 0≤t≤1 0≤t≤1 where W0 is a standard Brownian bridge 3 Since the distribution of the random variable W1 is known P (W1 ≤ x) = 1 − 2 ∞ X (4x2 n2 − 1)e−2x 2 n2 n=1 it follows that P (W1 ∈ [0.809, 1.862]) = 0.95. Hence, Lo used the interval [0.809, 1.862] as the 95% (asymptotic) acceptance region for testing the null hypothesis H0 = { no long-range dependence, H = 1 } 2 against the composite alternative 1 < H < 1} 2 Unlike the graphical R/S method, which provides a rough estimate of the Hurst parameter, Lo’s method only indicates whether long-range dependence is present or not. While Lo’s results are asymptotic since they assume N → ∞ and λ → ∞, in practice the sample size N is finite and the question of the right choice of λ becomes dominant. The most problematic issue of that new standard deviation is the number of lags (λ) used, since for too small lags it omits lags which may be significant and therefore still biased the estimated Hurst exponent by the short-memory in the time series. On the other hand, if the used lag is too high, the finite sample distribution deviates significantly from its asymptotic limit destroying any long-range effect that might be in the data (see Teverovsky et al. [1999]). Even H1 = { there is a long-range dependence, 3 W0 = B(t) − tB(1), where B denotes a standard Brownian motion. 359 Quantitative Analytics though Lo [1991] proposed an estimator of optimal lag based on the first-order autocorrelation coefficient ρ̂(1), given by, 3N 1 2ρ̂(1) 32 )3 λ∗ = ( 2 1 − (ρ̂(1))2 where is the greatest integer function, the optimal log of Lo is only correct if the underlying process is an AR(1) process. Hence, we focus on the optimal lag devised by Chin [2008] which is based on the length of the sub-period, given by n 2 )9 100 which is recalculated for each length of specific sub-period n. λ∗ = 4( 10.2.4.3 Removing short-term memory Since the R/S values are random variables, normally distributed, we would expect that values of H to also be normally distributed. Using Monte Carlo simulation, Peters tested this hypothesis and concluded that E[H] for i.i.d. random variables could be calculated from Equation (10.2.9) with variance T1 where T is the total number of observations in the sample. Unfortunately, the variance for non-normally distributed distributions differs on an individual basis, such that the confidence interval is only valid for i.i.d. random variables. Testing the R/S analysis on different types of time series used to model financial economics, such as ARIMA and ARCH models, Peters [1994] proposed to reduce persistence bias by taking AR(1) residuals on the original (integrated) time series and then follow all the steps of the original procedure with the residuals of the estimated autoregressive process. The AR(1) residuals are calculated as rn = Xn − (c + c1 Xn−1 ) (10.2.10) where rn is the AR(1) residual of X at time n, c is the intercept, and c1 is the slope. Doing so, he has subtracted out the linear dependence of Xn on Xn−1 . He found that none of the ARIMA models exhibited the Hurst effect of persistence, once short-term memory processes were filtered out. Further, even though ARCH and GARCH series could not be filtered, they did not exhibit long-term memory either. As a result, the problem of choosing the correct lag, discussed in Section (10.2.4.2), can be partly overcome by short-memory filtration. However, the problem of setting the right lag appears again, as the AR(1) does not need to be satisfied for short-term memory filtration. In which case one should consider applying the ARIM A(p, 1, q) model, but it can be misleading or inefficient on long time series (T > 10000). Consequently, it seems that both R/S and M − R/S analysis can not perfectly separate short-term memory from the long-term one as even a little bias in estimated coefficients can lead to significant break of long-term memory structure. Note, Cajueiro et al. [2004] filtered the data by means of an AR − GARCH procedure, which was intended to filter at the same time the short-range behaviour present in the time series and the volatility of returns. This is to avoid the long-range dependence that may be due to volatility effects, which are known to be persistent in financial time series. 10.2.5 Detecting periodic and nonperiodic cycles 10.2.5.1 The natural period of a system Some technical analysts assume that there are some regular market cycles, hidden by noise or irregular perturbations, within financial markets. As a result, spectral analysis became a popular tool to break observed financial time series into sine waves. However, if economic cycles are nonperiodic, spectral analysis becomes an inappropriate tool for market cycle analysis, and we need a more robust method that can detect both periodic and nonperiodic cycles. Chaos theory can account for nonperiodic cycles having average duration, but unkown exact duration of a future cycle. Alternatively, R/S analysis can also perform that function. Analysing financial time series, Peters [1991-96] found that when we cross N = 200 (log (200) = 2.3), the R/S observations begin to become erratic and random. This 360 Quantitative Analytics characteristic of the R/S analysis can be used to determine the average cycle length of the system, being the length of time after which knowledge of the initial condition is lost. While long memory processes are supposed to last forever in theory, in practice there is a point in any nonlinear system where memory of initial conditions is lost, corresponding to the end of the natural period of the system. For financial time series with H 6= 21 , the long memory effect can impact the future for very long periods and goes across time scales. Since the impact decays with time, the cycle length measures how long it takes for a single period’s influence to reduce to unmeasurable amounts. Therefore, one should visually inspect the data to see whether such a transition is occurring. One can assume that the long memory process underlying most systems is finite, and that the length of the memory depends on the composition of the nonlinear dynamic system producing the fractal time series. Hence the importance of visually inspecting the data in the log/log plot before measuring the Hurst exponent. It is then necessary to define the meaning of sufficient or adequate data when estimating the Hurst exponent. Peters [1991-96] suggested that we have enough data when the natural period of the system can easily be discerned. Since Chaos theory suggests that the data from 10 cycles are enough, if we can estimate the cycle length, we can use 10 cycles as a guideline. 10.2.5.2 The V statistic As a periodic system corresponds to a limit cycle or a similar type of attractor, its phase space portrait is a bounded set. In the case of a sine wave, the time series is bounded by the amplitude of the wave. Since the range can never grow beyond the amplitude, the R/S values should reach a maximum value after one cycle. Mandelbrot et al. [1969a] performed a series of computer simulations and found that R/S analysis could detect periodic components. Considering sine wave, once it has covered a full cycle, its range stops growing since it has reached its maximum amplitude. Repeating the experiment on an infinite sum of series of sine waves with decreasing amplitude (fractal function due to Weirstrass), Peters showed that R/S analysis could find the primary cycle, as well as the underlying ones, as long as the number of subcycles was a small, finite number. In that case, looking at the log/log plot, the end of each frequency cycle and the beginning of the next can be seen as breaks or flattening in the R/S plot. In order to obtain a clear peak when R/S stops scaling at a faster rate than the square root of time, Hurst proposed a simple statistic called V to test for stability, giving a precise measure of the cycle length even in presence of noise. The ratio 1 Vn = √ (R/S)n n would result in a horizontal line if the R/S statistic was scaling with the square root of time. This ratio is in general symptomatic of the existence of a periodic or non-periodic cycle. That is, a plot of V versus log n is flat for an independent, random process, downward sloping for an antipersistent process, and upward sloping for a persistent one. By plotting V on the y axis and log n on the x axis, the breaks occur when the V chart flattens out, indicating that the long-memory process has dissipated at those points. 10.2.5.3 The Hurst exponent and chaos theory A nonperiodic cycle has no absolute frequency, but an average one, and can have two sources 1. it can be a statistical cycle, exemplified by the Hurst phenomena of persistence and abrupt changes in direction 2. it can be the result of a nonlinear dynamic system, or deterministic chaos We saw that the Hurst process can be described as a biased random walk, where the bias can change abruptly in direction or magnitude. The abrupt changes in bias is characterised by the random arrival of the joker in Hurst pack of cards which is not predictable. Hence, the Hurst cycles have no average length, and the log/log plot continues to scale indefinitely. Alternatively, nonlinear dynamical systems are deterministic systems that can exhibit erratic behaviour. In chaos, maps are systems of iterated difference equations, such as the Logistic equation that can generates statistically random numbers, deterministically. Chaotic flows, which are continuous systems of interdependent differential equations, are used to model large ecosystems. The best known system of that type is the Lorenz attractor. A simpler 361 Quantitative Analytics system of nonlinear equations was derived by Mackey et al. [1977], where over and under production tend to be amplified, resulting in nonperiodic cycles. It is a delay differential equation with an infinite number of degrees of freedom, much like in the markets. It is given by Xt = 0.9Xt−1 + 0.2Xt−n where the degree of irregularity, and as such the fractal dimension, depend on the time lag n. Varying the cycle used, Peters showed that the R/S analysis can detect different cycle length and estimate the average length of a nonperiodic cycle. We consider two types of noise in dynamical systems 1. observational or additive noise where the noise is a measurement problem (the recorded values have noise increment added) 2. dynamical noise when the system interprets the noisy output as an input (the noise invades the system) Adding one standard deviation of additive noise to the system, Peters showed that the V statistic was unaffected and concluded that R/S analysis was robust with respect to noise. 10.2.6 Possible models for FMH 10.2.6.1 A few points about chaos theory Fractional Brownian motion (fBm) has some characteristics conforming with FMH such as statistical self-similarity over time and persistence, creating trends and cycles. However, in fBm, there is no reward for long-term investing as the term structure of volatility, in theory, does not stop growing. Further, fBm are more concerned with explaining crowed behaviour than to understand investor expectations about the economy. We have already discussed measurement noise (or observational noise) and system noise (or dynamical noise). Since, at longer frequencies, the market reacts to economic and fundamental information in a nonlinear fashion, some authors added nonlinear dynamical system to fBm to satisfy all aspects of FMH. These systems called chaotic systems allows for nonperiodic cycles and bounded sets (attractors). Chaotic systems are nonlinear feedback systems subject to erratic behaviour, amplification of events, and discontinuities. At least two requirements must be satisfied for a system to be considered chaotic 1. the existence of a fractal dimension 2. a characteristic called sensitive dependence on initial conditions A chaotic system is analysed in a phase space consisting of one dimension for each factor defining the system. For instance, a pendulum is made of two factors defining its motion, velocity and position. In the theoretical case of no friction, the pendulum would swing back and forth forever, leading to a phase plot being a closed circle. However, in presence of friction, or damping, after each swing the pendulum would slow down with amplitude eventually stopping, and the corresponding phase plot would spiral into the origin, where velocity and position are zero. In the case of the Lorenz attractor, the phase plot never repeats itself, but it is bounded by the owl eyes shape. The lines within the attractor represent a self-similar structure caused by repeated folding of the attractor. As the lines do not intersect, the process will never completely fill the space, and its dimension is fractal. Chaotic systems being characterised by growth and decay factor, the attractor is bounded to a particular region of space. A trip around the attractor is an orbit. In the case of two orbits, as each one of them reaches the outer bound of the attractor, it returns toward the centre and the divergent points will be close together again. This is the property of sensitive dependence on initial conditions. As we can not measure current conditions to an infinite amount of precision, we can not predict where the process will go in the long term. The rate of divergence, or the loss in predictive power, can be characterised by measuring the divergence of nearby orbits in phase space. It is called the Lyapunov exponent. and is measured for each dimension in phase space. While a positive rate means that there are divergent orbits, when combined with a fractal dimension, it means that the system is chaotic. There must also be a negative exponent to measure the folding process, or the return to the attractor. The Lyapunov exponent is given by 362 Quantitative Analytics Li = lim t→∞ 1 pi (t) log2 t pi (0) where Li is the Lyapunov exponent for dimension i, and pi (t) is the position in the ith dimension, at time t. This equation measures how the volume of a sphere grows over time t, by measuring the divergence of the two points p(t) and p(0) in dimension i. There is a certain similarity with the R/S analysis and to the fractal dimension calculation, all being concerned with scaling. However, chaotic attractors have orbits decaying exponentially rather than through power laws. Note, as the phase space includes all of the variables in the system, its dimensionality is dependent on the complexity of the system. The next higher integer to the fractal dimension tells us the minimum number of dynamic variables needed to model the dynamics of the system, placing a lower bound on the number of possible degrees of freedom. We saw that the fractal dimension, D, could be estimated by Equation (10.1.2) for a fractal embedded in two-dimensional space. For a higher-dimensional attractor, we need to use hyperspheres of higher dimensionality. Alternatively, Grassberger et al. [1983] proposed the correlation dimension as an approximation of the fractal dimension which uses the correlation integral Cm (d) where m is the dimension, and d a distance. We let the correlation integral be the probability that any two points are within a certain length, d, apart in phase space. As we increase d, the probability scales according to the fractal dimension of the phase space. It is given by Cm,N (d) = N 1 X H(d − |Xi − Xj |) , i 6= j N 2 i,j=1 where H(x) = 1 if d − |Xi − Xj | > 0 and 0 otherwise, N is the number of observations, d is the distance, and Cm is the correlation integral for dimension m. The function, H(•), counts the number of points within a distance, d, of one another. Further, the Cm should increase at the rate dD , with D the correlation dimension of the phase space, which is closely related to the fractal dimension. 10.2.6.2 Using R/S analysis to detect noisy chaos Studying the attractor by Mackey et al. [1977], Peters showed that R/S analysis was a robust way of detecting noisy chaos. While the continuous, smooth nature of the chaotic flow leads to very high Hurst exponent, gradually adding one standard deviation of white, uniform noise to the system would bring the Hurst exponent down, leading to an index of noise. Note, in markets, system noise is more likely to be a problem than additive noise. Because of the problem of sensitive dependence on initial conditions, system noise increases the problem of prediction. However, the impact of system noise on the Hurst exponent is similar to additive noise. Since the R/S analysis can distinguish cycles, Peters performed R/S analysis on the Mackey-Glass equation with one standard deviation of system noise incorporated and observed a cycle as the log-log plot crossed over to a random walk. This means that 1. the process can be fractional Brownian motion with a long but finite memory, or 2. the system is a noisy chaotic system, and the finite memory length measures the folding of the attractor. In the latter, the diverging of nearby orbits in phase space means that they become uncorrelated after an orbital period, so that the memory process ceases after an orbital cycle. That is, the finite memory length becomes the length of time it takes the system to forget its initial conditions. Since both explanations are possible, a true cycle should not be dependent on sample size, in which case we should be examining noisy chaos and not fractional noise. If we have sufficient data to obtain ten cycles of observations we can estimate the largest Lyapunov exponent. If that exponent is positive, we have strong evidence that the process is chaotic. Confidence level can be increased if the inverse of the largest Lyapunov exponent is approximately equal to the cycle length. Note, this approach is problematic in presence of small data sets. In that case, Peters proposed to consider both the R/S analysis and the BDS test which measures the statistical significance of the correlation dimension calculations (see Brock et al. [1987]). Even though it is a powerful test for distinguishing random systems from deterministic chaos or nonlinear stochastic systems, it can not distinguish between a nonlinear deterministic system and a nonlinear stochastic system. But it finds nonlinear 363 Quantitative Analytics dependence. According to the BDS test, the correlation integrals should be normally distributed if the system under study is independent. Note, in real life we do not know the factors involved in the system, and we do not know how many of them there are, as we only observe stock price changes. However, a theorem from Takens [1981] states that we can reconstruct the phase space by lagging the one time series we have for each dimension we think exists. In the case where the number of embedding dimensions is larger than the fractal dimension, then the correlation dimension stabilises to one value. The correlation integral calculates the probability that two points that are part of two different trajectories in phase space, are d units apart. Assuming the Xi in the time series X (with N observations) are independent, we lag the series into n histories by creating a phase space of dimension n from the time series X. We then calculate the correlation integral Cn,N (d). As N approaches infinity we get Cn,N (d) → C1 (d)n with probability 1. This is the typical feature of random processes. The correlation √ integral simply fills the space of whatever dimension it is placed in. Brock et al. showed that |Cn,N (d) − C1,N (d)n | N is normally distributed with a mean of 0. The BDS statistic, w, given by √ N n wn,N (d) = |Cn,N (d) − C1,N (d) | Sn,,N (d) where Sn,N (d) is the standard deviation of the correlation integrals, is also normally distributed. The BDS statistic, w, has a standard normal probability distribution, so that when it is greater than 2 we can reject, with 95% confidence, the null hypothesis that the system under study is random. However, it will find linear as well as nonlinear dependence in the data, so that it is necessary to take AR(1) residuals for this test. Further, the dependence can be stochastic (such as the Hurst process, or GARCH), or it can be deterministic (such as chaos). We must determine the radius, or distance, d, as well as the embedding dimension m. LeBaron [1990] and Hsieh [1989] did extensive tests on stock prices and currencies using m = 6 and d = 21 standard deviation of the data. Using these settings Peters tested his approach on the Macky-Glass equation with and without noise (both observational noise and system noise) before applying it to the Dow 20-day and 5-day series obtaining significant results. He concluded that the Dow was chaotic in the long term following economic cycle, and that currencies were fractional noise processes, even in the long term. 10.2.6.3 A unified theory Peters found that, except for currencies, noisy chaos was consistent with the long-run, fundamental behaviour of markets, and fractional Brownian motion was more consistent with the short-run, trading characteristic. Both being consistent with the fractal market hypothesis (FMH). To unify both theory, Peters examined the relationship between fractal statistics and noisy chaos. He first looked at the frequency distribution of changes on the Mackey-Glass equation adding observational and system noise respectively, and concluded that there was a striking similarity between the system noise frequency distributions and the capital market distributions. Second, looking at the term structure of volatility, when market returns are normally distributed, the volatility should increase with the square root of time. However, stocks, bonds, and currencies all have a volatility term structure increasing at a faster rate, which is consistent with the properties of infinite variance distributions and fBm. Note, for a pure fBm process, such scaling should increase for ever. However, while currencies appear to have no limit to their scaling, Peters showed that US stocks and bonds were bounded at about four years which is similar to the four-year cycle he obtained with the R/S analysis. The connection being that in a chaotic system the attractor is a bounded set. That is, after the system has completed one cycle, changes stop growing. After testing that chaotic systems (using the Mackey-Glass equation with added noise) have bounded volatility term structures, Peters postulated one could test for the presence of nonperiodic cycles by using volatility term structures. The test was repeated with the Lorenz and Rosseler attractors and similar results were obtained. Note, currencies did not have this bounded characteristic. Third, defining the sequential standard deviation as the standard deviation of the time series as we add one observation at a time, assuming normality, the more observations we have the more the sequential standard deviation would tend to the population standard deviation. Similarly, if the mean is stable and finite, the sample mean would eventually converge to the population mean. Testing the Dow Jones, Peters found evidence of convergence after about 100 years of data, meaning that the process is closer to an infinite variance than to a finite one in shorter periods. He also found that the sequential mean converged more 364 Quantitative Analytics rapidly, and looked more stable. A fractal distribution is a good candidate to reproduce these desired characteristics. Peters repeated the test on chaotic systems and found that, without noise, the Mackey-Glass equation was persistent with unstable mean and variance, while with noise, both observational and system, the system was closer to market series, but not identical. Analysing the Hurst exponent of a chaotic system with noise, Peters obtain H = 0.64 compared with H = 0.72 using R/S analysis which a big discrepancy. At last, Peters checked cycle lengths of dynamical systems and the self-similarity of noisy chaos and found that it had many desirable attributes. Trying to unify GARCH, fBm, and chaos, Peters postulated • In the short term, markets are dominated by trading processes, which are fractional noise processes. They are, locally, members of the ARCH family of processes characterised by conditional variances. • Globally, the process is a stable Levy (fractal) distribution with infinite variance. As the investment horizon increases, it approaches infinite variance behaviour. • In the very long term (periods longer than four years), the market are characterised by deterministic nonlinear systems or deterministic chaos. Nonperiodic cycles arise from the interdependence of the various capital markets among themselves, as well as from the economy. That is, short-term trading is dominated by local ARCH and global fractal, while long-term trading is tied to fundamental information and deterministic nonlinearities. 10.2.7 Revisiting the measures of volatility risk 10.2.7.1 The standard deviation We saw in Section (3.4) that the volatility σt is usually defined by rt = σt t where rt is the rate of return and t are identical independently distributed random variables with vanishing average and unitary variance. In general, the distribution of the t is chosen to be the normal Gaussian, and we also assume the probabilistic independence between σt and t . Hence, the returns series can be considered as the realisation of a random process based on a zero mean Gaussian, with a standard deviation σt changing at each time step. Standard deviation measures the probability that an observation will be a certain distance from the average observation. The larger this number is, the wider the dispersion, meaning that there is a high probability of large swings in returns. In the efficient market hypothesis (EMH), the variance is assumed to be finite, that is, the standard deviation tends to a value that is the population standard deviation. Since the standard deviation is higher if the time series of prices is more jagged, the standard deviation became a measure of the volatility of the stock prices. The scaling feature of the 1 normal distribution being referred to as the T 2 Rule, where T is the increment of time, the investment community √ annualises risk with that rule. For example, the monthly standard deviation is annualised by multiplying it by 12. Turner et al. [1990] found that monthly and quarterly volatility were higher than they should be compared with annual volatility, but that daily volatility was lower. Shiller [1989] found excessive market volatility challenging the idea of rational investors and the concept of market efficiency. Engle [1982] proposed the autoregressive conditional heteroskedastic (ARCH) model where the volatility is conditional upon its previous level. As a result, high volatility levels are followed by more high volatility, and vice versa for low volatility, which is consistent with the observation that the size of price changes (ignoring sign) is correlated. Hence, standard deviation is not a standard measure, at least over the short term. While variance is stable and finite for the normal distribution alone, it is particularly unstable when the capital markets are described by the Stable Paretian family of distributions described in Section (10.1.2.4). In the family of stable distribution, the normal distribution is a special case that exists when α = 2, in which case the population mean and variance do exist. Infinite variance means that there is no population variance that the distribution tends 365 Quantitative Analytics to at the limit. When we take a sample variance, we do so, under the Gaussian assumption, as an estimate of the unknown population variance. For instance, Sharpe calculated betas from five years’ monthly data to get a statistically significant sample variance needed to estimate the population variance. However, five years is statistically significant only if the underlying distribution is Gaussian. Otherwise, for α < 2, the sample variance tells nothing about the population variance as there is no population variance. Sample variances would be expected to be unstable and not tend to any value, even as the sample size increases. For α ≤ 1, the same goes for the mean, which also does not exist in the limit. Various studies showed that the Dow was characterised by a stable mean and infinite memory, in the manner of stable Levy fractal distributions. However, a market characterised by infinite variance does not mean that the variance is truly infinite, but as discussed in Section (10.2.5), there is eventually a time frame where fractal scaling ceases to apply, corresponding to the end of the natural period of the system. Hence, for market returns, there could be a sample size where variance does become finite, but it might be very big (hundreds of years). 10.2.7.2 The fractal dimension as a measure of risk We saw in the previous section that standard deviation measures the probability that an observation will be a certain distance from the average observation. However, this measure of dispersion is only valid if the underlying system is random. If the observations are correlated (or exhibit serial correlation), then the usefulness of standard deviation as a measure of dispersion is considerably weakened. Hence, while volatility is stated as the statistical measure of standard deviation of returns, that measure of comparative risk is of questionable usefulness. When stock returns are not normally distributed, the standard deviation becomes an invalid measure of risk. For instance, Peters [1991-96] described two stocks, one trendless and the other one trended, with similar volatilities that can have very different patterns of returns. See results in Table (10.1). It would make a lot more sense to compare different stocks by noting their fractal dimensions, D, taking values between 1 and 2. Table 10.1: Standard deviation and fractal dimension Observation 1 2 3 4 5 6 cumulative return standard deviation fractal dimension S1 2 -1 -2 2 -1 2 1.93 1.70 1.42 S2 1 2 3 4 5 6 22.83 1.71 1.13 The first stock, S1, has a fractal dimension close to that of a random walk, while the second stock, S2, has a fractal dimension close to that of a line. Given the relationship between the fractal dimension and the Hurst exponent in Equation (10.1.3), the first stock, S1, has the exponent H = 0.58 and the second stock, S2, has the exponent H = 0.87 showing long-memory. If returns in the capital markets exhibit Hurst statistics, then their probability distribution is not normal and the random walk does not apply. As a consequence, much of quantitative analysis collapses, especially the CAPM and the concept of risk as standard deviation or volatility. On the other hand, since the fractal dimension is higher if the time series of prices is more jagged, and since it is well defined for all time series, the fractal dimension is a better measure of the volatility of the stock prices. As a result, assuming the first moment of a time series to be defined, we can replace the standard deviation in the Sharpe type investment statistics described in Section (??) with the fractal dimension. Hence, the Shape ratio given in Equation (2.4.15) becomes MDR = E[Ra − Rb ] D 366 Quantitative Analytics where Ra is the asset return and Rb is the return of a benchmark asset such as the risk free rate or an index. This ratio, called Fractal Risk-Return, measures the excess return per unit of risk in an investment asset or a trading strategy. It correctly characterise how well the return of an asset compensates the investor for the risk taken. The higher the FRR ratio, the better the combined performance of risk and return. Similarly, we can define the fractal Information ratio as the mean over the fractal dimension of a series of measurements. We can also express the ratio in units of percent returns by modifying the Modigliani risk-adjusted performance measure with DP the fractal dimension of the asset/portfolio return and DM the fractal dimension of a benchmark return. Further, we can compute D+ the fractal dimension of positive returns, and D− the fractal dimension of negative returns and modify the Omega-Sharpe ratio, getting MDoR = rp − rT D− where rT is a minimal acceptable return. In that measure the portfolio manager will only be penalised for variability in negative returns. Similarly, the Sortino’s upside potential ratio becomes Pn 1 i=1 max (ri − rT , 0) n MDU P R = D− where only returns above a target value are considered. 10.3 Hurst exponent estimation methods We saw in Section (10.1.2) that monofractal and multifractal structures of financial time series are particular kind of scale invariant structures. Since the development of the rescaled range analysis (R/S) detailed in Section (10.2), a large number of fractal quantification methods called Wavelet analysis and Detrending Methods (DMs) have been proposed to accomplish accurate and fast estimates of the Hurst exponent H in order to investigate correlations at different scales in dimension one. While the R/S analysis makes the rough approximation that the trend is the average in each segment under consideration, the former uses spectral analysis, and the latter considers more advanced methods to detrend the series. Examples of the latter are detrended fluctuation analysis (DFA) and detrending moving average analysis (DMA). There exists many more methods for estimating the Hurst exponent such as the aggregated variance, the differenced variance, absolute values, boxed periodigram, Higuchi, modified periodigram, Whittle and local Whittle methods. As the finite sample properties of Hurst estimators revealed quite different from their asymptotic properties, various authors undertook empirical comparisons of etimators of the hurst exponent H, and the differencing parameter d. For instance, Taqqu et al. [1995] studied nine estimators for a single series length of 10, 000 data points, five values of both H and d, and 50 replications. They graphically represented the results in box plots with vertical axis indicating the deviation from the nominal value of H. Later, Taqqu et al. [1999] found that Whittle estimator was the most precise, and Clegg [2006] found that local Whittle and wavelet estimates provided the best estimates. A comparatively smaller number of methods have been proposed to capture spatial correlations operating in d ≥ 2. We are now going to describe some of these methods. 10.3.1 Estimating the Hurst exponent with wavelet analysis Wavelet transforms described in Appendix (F.3) can be used to characterise the scaling properties of self-similar fractal and multifractal objects (see Muzy et al. [1991]). In relation to financial time series, wavelet transform analysis has been extensively used in the determination of the scaling properties of fractional Brownian motion (fBm). We saw earlier that the smoothness of the fBm function, denoted BH (t) increases with the Hurst exponent H varying in the range 0 < H < 1. Fractional Brownian motions are nonstatinary random processes where the standard deviation, σ, of the fBm trace deviation ∆BH taken over a sliding window of length T scales as σ ∝ TH 367 Quantitative Analytics One method used to determine the exponent H from data suspected of fBm scaling is the Fourier power spectrum PF (f ), for which a fBm should scale as PF (f ) ∝ f −β , β = 2H + 1 and a logarithmic plot of power against frequency allows H to be determine from the slope of the spectrum. There has been much research carried out using Fourier transforms. Wavelet power spectra, PW (f ), exhibit similar scaling and can also be used to determine H. However, Simonsen et al. [1998] showed that the wavelet spectrum is in general much smoother due to the finite bandwidth of the spectral components associated with the wavelets, which is a big advantage when only a limited number of data sets are available. Analysing two real data sets with discrete wavelet coefficient based method, Simonsen et al. showed that the mean absolute discrete wavelet coefficient values scale as (H+ 12 ) < |Tm,n | >m ∝ am where < |Tm,n | >m is the mean absolute value of the wavelet coefficients at scale am defined in Appendix (F.3.2). Using dyadic grid Daubechies wavelets, am ∝ 2m , and setting the maximum a scale to unity, they obtained the average wavelet coefficient (AWC) function. Analysing the stock market index for shares taken from the Milan stock exchange over two and a half year period with both the AWC and the Fourier analysis, they concluded that only when a small number of examples are available, the wavelet method outperforms the Fourier method. Another method 2 >m of discrete for computing H directly from the wavelet coefficients is to use the scaling of the variance < Tm,n wavelet coefficients at scale index m defined in Appendix (F.3.4). Since the coefficient variance is related to the power spectrum as 2 PW (fm ) ∝< Tm,n >m combining the two expressions and noting that the frequency f is inversely proportional to the wavelet scale a(= 2m ), we get the scaling relationship 2 < Tm,n >m ∝ a(2H+1) m It should be stressed that this result is valid for any self-similar process with stationary increments (β = 2H + 1) and 2 be the variance long-range dependent processes (β = 2H − 1) corresponding to fBm and fGn, respectively. We let σm of the discrete wavelet coefficients at index m, and rewrite the relationship as 2 σm ∝ a(2H+1) m and taking the square root on both sides, we get (H+ 21 ) σm ∝ am Note, both the mean absolute value of the coefficients and the standard deviation of the coefficients are first order measures of spread. Furthermore, for an orthonormal multiresolution expansion using a dyadic grid, the scale a is proportional to 2m , so that we can take base 2 logarithms of both sides of the above expression to get 2 log2 (σm ) = (2H + 1)m + constant where the constant depends both on the wavelet used and the Hurst exponent. Flandrin [1992] defined the constant and found an explicit form in the case of Haar wavelet. Abry et al. [2000] considered a wavelet-based analysis tool, called the Logscale Diagram consisting of the above log-log plot together with confidence intervals assigned to each 2 log2 (σm ). Note, we can also consider the wavelet scaling energy Em defined in Appendix (F.3.4) and having the fractal scaling law log2 (Em ) = 2Hm + constant 368 Quantitative Analytics that is Em ∝ a2H which is similar to the scaling of σ, the standard deviation of the fBm trace deviation. This is because Em is a measure of the scale dependent variance of the signal. Note, the continuous transforms, T (a, b), exhibit the same scaling law E(a) ∝ a2H but the a scale parameter is continuous and the slope of the plot of log (E(a)) against log (a) is used to find H. We briefly describe a methodology proposed by Abry et al. [1993] [1998] to estimate the Hurst exponent 1. Compute the Discrete Wavelet Transform (DWT) of the signal and compute the second-order moment < 2 Tm,n >m at each scale m. 2. Perform a weighted-least squares fit between the scales j1 and j2 of the second-order moment on the scales m 1h( Ĥ(j1 , j2 ) = 2 Pj2 Pj2 Pj2 Pj2 i Sj ηj ) Sj j)( j=j Sj ) − ( j=j Sj ηj )( j=j 1 1 1 − 1 Pj2 Pj2 P j 2 ( j=j1 Sj )( j=j1 Sj j 2 ) − ( j=j Sj j)2 1 j=j1 2 where ηj = log2 (< Tj,n >j ) and Sj = n(log 2)2 2j+1 is the inverse of the theoretical asymptotic variance of ηj . It has been shown that this estimator of H is asymptotically unbiased and efficient. Nonetheless, further improvements have been carried out by Abry et al. [1999], defined as follow 1. At each scale level j, define gj = Ψ(2N −j−1 ) ξ(2, 2N −j−1 ) and Vj = log (2) (log (2))2 0 where Ψ(z) = Γ (z) Γ(z) and ξ(z, v) is the generalised Riemann Zeta function. 2 2. Perform the least square regression of log2 (< Tj,n >j ) − gj on the scales j weighted by Vj to find a slightly better estimate of the exponent H. 10.3.2 Detrending methods Following the R/S analysis, we take the returns {x(t)} of a time series of length T , having fluctuations similar to the increments of a (multifractal) random walk. It should be converted to a (multifractal) random walk by subtracting the mean value and integrating the time series. Hence, we construct the integrated series, or profile, X(t) = t X x(i) − x (10.3.11) i=1 for t = 1, ..., T where x denotes the mean of the entire time series. We then divide the integrated series into A adjacent sub-periods of length, n, such that An = T . 369 Quantitative Analytics 10.3.2.1 Detrended fluctuation analysis Improving on the R/S analysis, Peng et al. [1994] introduced the detrended fluctuation analysis (DFA) to investigate long-range power-law correlations along DNA sequences. The local detrended fluctuation function is calculated from n 2 FDF A (a) = 1X |X(i, a) − Z(i, a)|2 , a = 1, ..., A n i=1 where X(i, a) = X((a − 1)n + i), and Z(t, a) = c1,a t + c2,a is a linear local trend, for sub-period a = 1, .., A, computed with a standard linear least-square fit. To improve the computation of the local trend, some authors considered the polynomial fit of order l, noted Xn,l , of the profile which is estimated for each sub-period. Hence, we get the local detrended signal (or residual variation) Y (t, a) = X(t, a) − Xn,l (t, a) , a = 1, .., A (10.3.12) Pl where Xn,l (t, a) = k=0 ck,a tl−k and ck,a is a constant in the, a, sub-period. Linear, quadratic, cubic, or higher order polynomials can be used in the fitting procedure (conventionally called DFA1, DFA2, DFA3, ...) (see Figure 2 10.7). The local detrended fluctuation function, FDF A (a), becomes n 2 FDF A (a) = 1X |Y (i, a)|2 , a = 1, ..., A n i=1 2 which is the local mean-square (MS) variation of the time series. FDF A (a) is also called the detrended variance of each segment. Note, it is sometime expressed in terms of the scale-dependent measure µn (t, a) = FDF A (a) which is the local root-mean-square (RMS) variation of the time series. Since the detrending of the time series is done by the subtraction of the polynomial fits from the profile, different order DFA differ in their capability of eliminating trends in the series. Thus, one can estimate the type of polynomial trend in a time series by comparing the results for different detrending orders of DFA. Averaging the FDF A (•) over the A sub-periods gives the overall fluctuation, or overall RMS, FDF A (•), as a function of n FDF A (n) = A 1 X A 21 2 FDF (i) A i=1 The fast changing fluctuations in the time series X will influence the overall RMS, FDF A (n), for segments with small sample sizes (small scale), whereas slow changing fluctuations will influence FDF A (n) for segments with large sample sizes (large scale), Hence, we should compute FDF A (n) for multiple segments sizes (multiple scales) to emphasise both fast and slow evolving fluctuations influencing the structure of the time series. Doing so, we can be relate FDF A (n) to the Hurst exponent as follow FDF A (n) ∼ nH so that an exponent H 6= 21 in a certain range of n values implies the existence of long-range correlations in that time interval. A straight line can well fit the data between the interval log n = 1 and 2.6 which is called the scaling range. Outside the scaling range, the error bars are larger due to the finite size effects, and/or the lack of numerous data. Hence, the first few points at the low end of the log-log plot of FDF A (n) against n should be discarded as in this region the detrending procedure removes too much of the fluctuation. Similarly, for large n there a few boxes, A, for a proper averaging to be made. The main advantage of working with fluctuations around the trend rather than a range of signals is that we can analyse non-stationary time series. That is, DFA avoid spurious detection of correlations that are artifacts of nonstationarities in the time series. Even though the DFA can be based on different polynomial fits, trend can be constructed in a variety of ways such as Fourier transforms (see Chianca et al. [2005]), empirical mode decomposition (see Janosi 370 Quantitative Analytics −0.2 −0.6 Linear Fitting et al. [2005]), singular value decomposition (see Nagarajan [2006]), different types of moving averages (see Alessio et al. [2002]), and others. 0 5000 10000 15000 10000 15000 10000 15000 −0.2 −0.6 Quadratic Polynomial Fitting Time 0 5000 −0.2 −0.6 Cubic Polynomial Fitting Time 0 5000 Time Figure 10.7: Computation of the second-order difference between the time series and its polynomial fit for different polynomial interpolation order. 371 Quantitative Analytics 10.3.2.2 A modified DFA In the case of a linear polynomial, Xn,1 (t, a), Taqqu et al. [1995] proved that for large n, the averaged sample variances in the DFA has a resulting number proportional to n2H for fractional Gaussian noise (fGn) and ARFIMA models. That is, 2 E[FDF A (a)] = E[ n 2 1X X(t, a) − Xn,1 (t, a) ] ∼ CH n2H as n → ∞ n i=1 where 1 2 2 + − 2H + 1 H + 2 H + 1 To avoid some of the difficulties associated with choosing an appropriate interval within which to perform the linear fit, Costa et al. [2003] modified the approach described in Section (10.3.2.1). They rescaled the overall fluctuation FDF A (n) by normalising it with the overall standard deviation, S, of the original time series, and adjusted the parameter H so as to obtain the best agreement between the theoretical curve FH (n) given above in the case of a fBM, and the empirical data for FDF A (n). Rather than running a nonlinear regression, they simply varied H incrementally and decided visually when the theoretical curve best matches the empirical data. CH = 10.3.2.3 Detrending moving average Pλ−1 In signal processing, the moving average X λ (t) = λ1 k=0 X(t − k) of a time series X(t), with the time window λ, is a well-known low-pass filter (see details in Appendix (C.1.2)). In other words, it removes the low frequency motions from the signal. If X increases (resp. decreases) with time, then X < X (resp. X > X), thus, the moving average captures the trend of the signal over the considered time window λ. Vandewalle et al. [1998] observed that the density ρ of crossing points between any two moving averages with time windows respectively equal to λ1 and λ2 can be expressed as ρ= H−1 1 (∆λ)(1 − ∆λ) λ2 1 where ∆λ = λ2λ−λ and λ2 >> λ1 . This density is fully symmetric, it has a minimum in the middle of the ∆λ interval 2 and diverges for ∆λ = 0 and for ∆λ = 1, with an exponent which is the Hurst exponent. Hence, using the movingaverage method, they could extract the Hurst exponent of correlated time series, obtaining results comparable to DFA. As a result, self-affine signals characterised by the Hurst exponent H can be investigated through mobile average (see Ausloos [2000]). Hence, the density ρ is a measure of long-range power-law correlation in the signal. Since in the limit of λ → 0 we get X λ (t) → X(t), then the crossing points correspond to the zeroes of the first-order difference between X(t) and X λ (t). Alessio et al. [2002] looked at the properties of the second-order difference between the integrated process X(t) and the moving average X λ (t) and proposed the detrending moving average (DMA), where one does not need to divide the time series into sub-periods, but rather use deviations from the moving average of the whole series. Again, we take the returns {x(t)} of a time series of length T and compute the integrated series as in Equation (10.3.11). The detrended fluctuation is defined as T 2 FDM A,λ = 2 1 X X(t) − X λ (t) T −λ t=λ which is the variance of X(t) with respect to the moving average X λ (t). Alessio et al. computed the moving averages X λ (t) with different values of λ ranging from 2 to λmax where λmax ≈ T3 (see Figure 10.8(a)). The detrended fluctuation was then calculated over the time interval [λmax , T ] 372 Quantitative Analytics 2 FDM A,λ = 1 T − λmax T X X(t) − X λ (t) 2 t=λmax Plotting the values of FDM A,λ against λ on a log-log axes, they showed that the fluctuation scales as 2 2H FDM A,λ ∼ λ 0.3 0 0.4 Note, the moving average X λ (t) can take various forms in centring (backward, forward, centred) and weighting (weighted, not weighted, exponential). Using the above equation, we estimate the Hurst exponent by regressing log FDM A,λ against log λ and computing the slope (see Figure 10.8(b)). ● ● ● ● ● ● −2 ● ● ● ● ● 0.2 ● 0.1 ● ● ● ● ● ● ● ● ● −4 Error Variance ● ● ● ● ● ● ● ● ● −6 ● 0.0 Cumulative Returns ● ● ● ● ● ● ● H = 0.1 H = 0.3 H = 0.5 H = 0.7 H = 0.9 −8 −0.1 ● 0 2000 4000 6000 8000 ● 2 Time 3 4 5 6 7 Window Size (a) Time series of 8192 points with H=0.8 and two moving aver- (b) Log-regression of the error variance on the moving-average ages of size 256 (blue) and 1024 (red) window sizes Figure 10.8: (a) Synthetic time series of 8192 points with H=0.8 and two moving averages of size 256 and 1024. At each window size, we detrend the series with regards to its moving average and we compute the variance of the error. (b) We compute the error variance between the real series and its moving average at different scales and perform a log-regression to get the Hurst exponent 10.3.2.4 DMA in high dimensions Carbone [2007] proposed an algorithm to estimate the Hurst exponent of high-dimensional fractals, based on a generalised high-dimensional variance around a moving average low-pass filter. The method can capture spatial correlations operating in d ≥ 2, such as a basket of stocks. For simplicity of exposition we will only describe the case d = 2, where the generalised variance is defined as 2 σDM A = N1X −m1 1 (N1 − n1max )(N2 − n2max ) i =n −m 1 1 373 N2X −m2 1 i2 =n2 −m2 2 f (i1 , i2 ) − f n1 ,n2 (i1 , i2 ) Quantitative Analytics where the average f n1 ,n2 (i1 , i2 ) is given by f n1 ,n2 (i1 , i2 ) = 1 n1 n2 n1 −1−m X 1 n2 −1−m X 2 f (i1 − k1 , i2 − k2 ) k1 =−m1 k2 =−m2 where Nl for l = 1, 2 is the length of the sequence, nl for l = 1, 2 is the sliding window, and nlmax = max {nl } << Nl . The quantity ml = int(nl θl ) is the integer part of nl θl and θl is a parameter ranging from 0 to 1. The moving average f n1 ,n2 (i1 , i2 ) is calculated over sub-arrays with different size n1 × n2 for different values of the window nl 2 for l = 1, 2, ranging from 2 to the maximum value nlmax . A log-log plot of σDM A gives the relation q 2 2 2 2H ∼ sH σDM A ∼ [ n1 + n2 ] for s = n21 + n22 , which yields a straight line with slope H. 10.3.2.5 The periodogram and the Whittle estimator The periodogram, described by Geweke et al. [1983], is defined as I(λ) = N 1 X | Xj eijλ |2 2πN j=1 where λ is a frequency, N is the number of terms in the series, and Xj is the data. Since for a series with finite variance, the periodogram I(λ) is an estimator of the spectral density, a series with long-range dependence should have a periodogram proportional to |λ|1−2H close to the origin. Therefore, a regression of the logarithm of the periodogram on the logarithm of the frequency λ should give a coefficient of 1 − 2H. The Whittle estimator is a maximum likelihood estimator (MLE) which assumes a functional form for I(λ) and seeks to minimise parameters based upon this assumption. Using that periodogram, the Whittle estimator (see Fox et al. [1986]) uses the function Z π I(λ) Q(η) = dλ f −π (λ; η) where f (λ; η) is the spectral density at frequency λ, and where η denotes the vector of unknown parameters. The Whittle estimator is the value of η minimising the function Q. When dealing with fractional Gaussian noise (fGn) or ARFIMA models, η is simply the parameter H or d. If the series is assumed to be F ARIM A(p, d, q), then η also includes the unknown coefficients in the autoregressive and moving average parts. Note, this estimator provides confidence intervals, and it is obtained through a non-graphical method. However, it assumes that the spectral density is known. If the user misspecifies the underlying model, then errors may occur. The Local Whittle is a semi-parametric version of the Whittle estimator which only assumes a functional form for the spectral densities at frequencies near zero (see Robinson [1995]). 10.4 Testing for market efficiency 10.4.1 Presenting the main controversy A time series is described as possessing long-range dependence (LRD) if it has correlations persisting over all time scales. Long-range dependent processes provide an elegant explanation and interpretation of an empirical law commonly referred to as Hurst’s law or the Hurst effect. However, the existence of long-term correlations in the fluctuations of a time series implies the possibility of violation of the weak form of market efficiency. Long-range power-law correlations have been discovered in economic systems, and particularly in financial fluctuations (see Mandelbrot [1963]). Historical records of economic and financial data typically exhibit distinct cyclical patterns that are indicative of the 374 Quantitative Analytics presence of significant power at low frequencies (long-range dependence). As such, it has been recognised that systems like exchange markets display scaling properties similar to those of systems in statistical physics. Hence, we can therefore apply multifractal analysis to investigate the dynamics of weak form efficiency of financial market by means of Hurst exponent and fractality degree. We also saw in Section (10.1.2.4) that the characteristic exponent, α, of a Stable distribution was related to the Hurst exponent via Equation (10.1.7), implying that the fractal measure of a process was related to the statistical self-similarity of that process. However, we saw in Section (10.3) that there are a number of different statistics which could be used to estimate the parameter α, or, H, which are more or less reliable. Several authors tried to empirically assess the existence of long-term correlations in financial data using either fractal measures or the statistical self-similarity properties of the process. Hence, various statistical methods have been proposed to measure temporal correlations in financial data and to analyse them. However, due to the lack of a good statistics on the financial data, the problem of fully characterising the mathematical structure of the distributions of asset returns/variations (such as index, foreign exchange, etc.) is still an open problem. Consequently, the statistical investigations performed to test the presence or absence of long-range dependence in economic data have been the subject of an intense debate. As discussed by Willinger [1999] these investigations have often become a source of major controversies, mainly because of the important implications it has on many of the paradigms used in modern financial economics. It is inconsistent with the efficient market hypothesis. We are now going to present some of these authors findings and discuss the pros and cons of both methods. 10.4.2 Using the Hurst exponent to define the null hypothesis 10.4.2.1 Defining long-range dependence We let {X(t)}t∈N be a weakly stationary time series (it has a finite mean and the covariance depends only on the lag between two points in the series), and we let ρ(k) be the autocorrelation function (ACF) of X(t). A common definition of LRD in the time domain is as follow Definition 10.4.1 The time series X(t) is said to be long-range dependent if P∞ k=−∞ ρ(k) diverges. In general, in the limit |k| → ∞, the functional form ρ(k) ∼ Cρ |k|−α is assumed, with Cρ > 0 and α ∈ [0, 1]. It states that the ACF decays so slowly that in the limit |k| → ∞, its sum diverges Z ∞ ρ(k)dk = ∞ A for any 0 < A < ∞. The parameter α is related to the Hurst exponent via the equation α = 2 − 2H. This definition can be shown to hold in the frequency domain Definition 10.4.2 The weakly stationary time series X(t) is said to be long-range dependent if its spectral density obeys f (λ) ∼ Cf |λ|−β as λ → 0, for some Cf > 0 and some real β ∈ [0, 1]. The parameter β is related to the parameter α via α = 1 − β, so that the Hurst exponent is given by H = LRD can be thought of in two ways, 1+β 2 . Hence, 1. in the time domain it manifests as a high degree of correlation between distantly separated data points, and 375 Quantitative Analytics 2. in the frequency domain it manifests as a significant level of power at frequencies near zero. A direct and major practical consequence of LRD is that the estimation becomes very difficult. For instance, the variance of the sample mean µN decays as V ar(µN ) ∼ CN −α as N → ∞, which is much slower than the common N −1 . In general, for higher order sample moment estimation, such as variance, the estimations are strongly biased and have very slow decreasing variance. Note, LRD relates to a number of other areas of statistics, such as statistical self-similarity. We saw in Section (10.1.2) that for any (discrete) time-dependent self-affine function X(t), we can choose a particular point on the signal and rescale its neighbourhood by a factor, say c, using the Hurst exponent (see Definition (10.1.3)). A major consequence of this definition is that the moments of X behave as power laws of time (see Equation (10.1.5)). An exponent H < 12 involves an antipersistent behaviour, while H > 12 means a persistent signal. Hence, an exponent H 6= 12 in a certain range of t values implies the existence of long-range correlations in that time interval. As a result, the signal X can well be approximated by the fractional Brownian motion law. Mathematically, the correlation (see Equation (10.1.4)) of a future increment δθ X(t) = X(t + θ) − X(t) with past increment δθ X(0) is given by Cθ (t) = < δθ X(t)δθ X(0) > = 22H−1 − 1 < (δθ X(0))2 > where the correlations are normalised by the variance of X(t). Then, temporal correlations exist for H 6= 21 . The correlation assumes that the distribution of daily fluctuations (X(t + 1) − X(t)) is symmetric with respect to its zero mean. 10.4.2.2 Defining the null hypothesis Combining estimated Hurst exponent together with confidence intervals, we can test the null hypothesis that the markets behave independently. The alternative hypothesis being that markets are dependent. This can be done by using different methods of estimation of the Hurst exponent. For H = 21 we get a random walk, and we have weakly efficient market in the sense of Fama (F65). Moreover, from Equation (10.1.7) we know that such process has defined and finite second moment and thus finite variance implying martingale process as well, which in turn indicates efficient market in the sense of Samuelson (S65). Persistent process characterised by H > 12 implies rejection of independence which in turn rejects random walk and consequently efficient market of F65. However, the value of 12 < H < 1 implies 1 < α < 2 which in turn indicates undefined or infinite variance. This leads to infinite or undefined square root of variance, non-existence of martingale process, and in turn rejection of market efficiency in the sense of S65 (see Los [2008]). On the other hand, anti-persistent processes 0 < H < 21 do not lead to such strong implications because it implies 2 < α < ∞ so that the underlying distribution is not stable. Even though the non-stable distributions are not yet well studied, the crucial implication is that the process based on non-stable distribution is not independent with identically distributed innovations (see Der et al. [2006]) so that F65 efficiency is rejected. Nonetheless, non-stable distributions have finite variance so that S65 efficiency can not be rejected (see Da Silva et al. [2005]). Knowing the estimated expected values and standard deviations for each method estimating the Hurst exponent we can test market efficiency of financial time series. 10.4.3 Measuring temporal correlation in financial data 10.4.3.1 Statistical studies A large number of studies based on market prices (logarithmic prices) is concerned with the existence or not of long-, medium- or/and short-range power-law correlations in various economic systems. Neglecting any bias or trend in the signal X, various authors considered the excursion of the signal X after any time period θ, either in the raw value δθ X(t) or in the positive values, given by |δθ X(t)| 376 Quantitative Analytics which is related to the variance σ of the signal around its average value. For a self-affine signal, we have σ ∼ θH Some authors also considered the average price variation p Fθ (t) = < [δθ X(t)]2 > and suggested that the slope of the function, in double logarithmic scale, was given by the relation Fθ (t) ∼ θH , while others computed the histogram F (x, θ) of price variations x = δθ X(t) for several values of θ and checked the scaling hypothesis F (x, θ) = θH F (θH x, 1) = θH g(θH x) versus θH x. Some authors performed statistical analysis on daily, weekly, and monthly market by plotting F (x,θ) θH prices, while in other less frequent cases high-frequency data was chosen. Other authors considered the same statistics, but rather than taking the price difference as a signal, they analysed the logarithmic price change δθ L(t) = L(t + θ) − L(t) where L(t) = log X(t), obtaining the logarithmic return (see Muller et al. [1990]). This is the most appropriate quantity of investigation if the financial time series are assumed to be associated to multiplicative dynamical processes. However, for high-frequency data, the relative increments of the signal between consecutive times being small, no significative differences are supposed to exist if one performs statistical analysis with linear increments. While some authors claimed the distributions of stock return and FX price changes to be Paretian stable, or Student distributions, others rejected any single distribution, or even claimed that the process was heteroskedastic (see Diebold et al. [1989]). However, they all agreed on the fact that daily changes were leptokurtic and that there are substantial deviations from Gaussian random walk model. Going further, they now agree that the process is not stable (see Boothe et al. [1987]). Numerous articles were published contradicting the classic financial theory of efficient markets by showing the presence of long-term memory in financial time series. Mostly all of these studies did not find temporal correlations present in the system for price (logarithmic price) changes, but they did for absolute price (logarithmic price) changes, the average of absolute price changes, the square root of the variance, and the interquartile range of the distribution of price (logarithmic price) changes. Taylor [1986] studied the correlations of the transformed returns for 40 series and concluded that the returns process was characterised by substantially more correlation between absolute or squared returns than there was between the returns themselves. Kariya et al. [1990] obtained a similar result when studying Japanese stock prices. Examples of empirical studies identifying anomalous scaling for financial data can be found in Muller et al. [1990] followed by a large quantity of similar results reported in the emerging econophysics literature (see Mantegna et al. [1995], Fisher et al. [1997], Schmitt et al. [1999]). Other authors, such as Ding et al. [1993], Galluccio et al. [1997] to name a few, obtained similar results on the temporal correlations of the underlyings, but presented different conclusions regarding the nature of financial data. 10.4.3.2 An example on foreign exchange rates Muller et al. [1990] presented an empirical scaling law for mean absolute price changes over a time interval, and found that they were proportional to a power of the interval size. The distributions of price changes are found to be increasingly leptokurtic with decreasing intervals, and hence distinctly unstable. Given a collection of interbank spot prices published by Reuters, they considered two samples labelled 1 and 2 where the former is made of tick-by-tick samples for a period of three years from 1986 to 1989, and the latter is made of daily FX prices recorded at 3 pm NYT for 15 years starting in 1973. Taking the logarithmic middle prices Xj = 21 (log Pask,j − log Pbid,j ), such that the price changes ∆X over a time interval ∆t correspond to logarithmic returns (see details in Section (3.3.1)), they computed the autocorrelation of hourly changes ∆X of the logarithmic price, their absolute values, and their squares over the whole sample 1. They found that only the last two variables had a significant, strong autocorrelation for small time lags (a few hours) indicating the existence of volatility clusters or patterns. As a result, they studied the average absolute price changes 377 Quantitative Analytics |∆Xi | = nk 1 X |X(ti,k + ∆t) − X(ti,k )| nk k=1 where k is the index of the day or the week, nk is the total number of days (weeks) in sample 1, i is the index of the interval within the day or the week, and ∆t is the interval size (one hour or one day). They found the following empirical law 1 |∆X| = c(∆t) E where the bar indicates the average over the whole sample period, and E1 is the drift exponent. This is equivalent to the scaling Equation (11.1.13) with q = 1 and H = E1 . Note, Mandelbrot [1963] had already taken the mean absolute price change as main scaling parameter which is sometime called volatility (see Glassman [1987]). Since the 4 distributions of price vary over time, the existence of standard p deviations is not proved . Nonetheless, Muller et al. 2 also found scaling laws for the square root of the variance |∆X| and for the interquartile range of the distribution of ∆X. Both the intervals ∆t and the volatilities |∆X| are plotted on a logarithmic scale producing a straight line which is fitted with a linear regression (see Equation (11.1.14)). Since the |∆X| values for different intervals ∆t are not totally independent, as the larger intervals are aggregates of smaller intervals, the linear regression is an approximation. The scaling law was well obeyed for a large range of time intervals since the correlation coefficients between the logarithms of ∆T and |∆X| exceeded 0.999 and the standard errors of E1 was less than 1%. The scaling law exponents E1 was cluster around 0.59 for all rates, close together in sample 1 and farther apart in sample 2. No significant asymmetry of positive and negative changes were found. 10.4.4 Applying R/S analysis to financial data 10.4.4.1 A first analysis on the capital markets In order to apply R/S analysis to the capital markets, Peters [1991-96] used logarithmic returns and considered increments of time N = 6, 7, 8, ..., 240 months on monthly time series covering 40 years of data. The stability of the estimate is expected to decrease as N increases, as the number of observations decreases. One must be careful when estimating the exponent H by running a regression of log (N ) versus log ( R S ) for the full range of N and computing the slope. Doing so is not correct if the series has a finite memory and begins to follow a random walk. Peters [1991-96] applied the R/S analysis to the S&P 500, for monthly data over a 38 year period from January 1959 to July 1988 and found that the long memory process was at work for N for less than approximately 48 months with H ≈ 0.78. After that point, the graph follow the random walk line H = 12 showing that, on average, returns with more than 48 months apart have little measurable correlation left. Scrambling the series of monthly returns he obtained the new coefficient H = 0.51 showing that the scrambling destroyed the long memory structure of the original series and turned it into an independent series. Peters repeated the test on US single stocks and obtained Hurst exponents around 0.7. Stocks grouped by industry tend to have similar values of H and similar cycle lengths (maybe linked to economy cycles of the industry). Note, the S&P 500 has a higher value of H than any individual stocks, showing that diversification in a portfolio reduces risk. Similar tests were also applied on the bond market, the currency market, all exhibiting significant Hurst exponents showing that these markets are not random walks. However, a large quantity of market data is necessary for a well defined period. 10.4.4.2 A deeper analysis on the capital markets Using the tools described in Section (10.2.3), such as significance tests on R/S analysis, Peters [1994] repeated the tests on market time series made in his previous book, and described in Section (10.4.4.1), in order to analyse the type of systems exhibited in the markets. The R/S analysis is now performed on the AR(1) residuals defined in Equation (10.2.10), and follows the step-by-step method described in Section (10.2.2.2). Further, the data is made of 102 years 4 We have infinite variance in the stable Paretian distributions. 378 Quantitative Analytics of daily records on the Dow Jones covering the period from January 1888 to December 1990 and containing 26, 520 data points. The time series is sampled at different intervals, 5-day returns, 20-day returns, and 60-day returns. A four-year cycle was found independent of the time increment used for the R/S analysis, and a weaker evidence of a 40-day cycle was revealed. The Hurst exponent was most significant for 20-day returns, and much less for daily returns as the noise in higher frequency data makes the time series more jagged and random-looking. This evidence of persistence in the Dow Jones appeared to be very stable. Peters further studied intraday prices for the S&P 500 spanning four year of data from 1989 to 1992, and examined frequencies of 3-minute, 5-minute, and 30-minute. Even though high-frequency data experienced high level of serial correlation that could be reduced by using AR(1) residuals, Peters concluded that any analysis on these frequencies were questionable no matter what significance tests were used. His argument being that in dynamical system analysis a large number of observations covering a short time period may not be as useful as a few points covering a longer time period. This is because the existence of nonperiodic cycles can only be inferred if we average enough cycles together. As a result, data sufficiency depends on the length of a cycle. At these frequencies the level of noise was so high that Peters could barely measure determinism, and concluded that the time series was dominated by a short memory process, impying that traders have short memories and merely react to the last trade. However, this autoregressive process is much less significant once we analyse daily data. That is, information has a different impact at different frequencies, and different horizons can have different structures. While we see pure stochastic processes resembling white noise at high frequencies, as we step back and look at lower frequencies, a global structure becomes apparent. Peters [1994] also performed R/S analysis to test both realised and implied volatility from a daily file of S&P composite prices from 1928 to 1989. Defining the log t , he let the volatility be the standard deviation of contiguous 20-day increments of rt . return at time t as rt = log PPt−1 Assuming non-overlapping and independent increments, the variance Vn over n days is given by n Vn = 1 X (rt − r)2 n − 1 t=1 n . where r is the average value of r. The logarithm changes in volatility, denoted Ln is then given by Ln = log VVn−1 Both the realised and implied volatility were antipersitent with the exponent H = 0.31 and H = 0.44, respectively. Antipersistent Hurst exponent is related to the spectral density of turbulent flow described by the stable Levy distributions, which have infinite mean and variance. Turbulent systems having no average or dispersion levels that can be measured, volatility will be unstable. It will have no trends, and will frequently reverse itself. 10.4.4.3 Defining confidence intervals for long-memory analysis While the methods for estimating the Hurst exponent described in Section (10.3) only work for very long (more than 10,000 observations), or infinite time series (see Weron [2002]), the financial time series are much shorter. That is, in nature, there is no limit to time, and thus the exponent H is non-deterministic, as it may only be estimated based on the observed data. For instance, the most dramatic daily move upwards ever seen in a stock market index can always be exceeded during some subsequent day. We must therefore study the finite sample properties of described methods, such as R/S, M − R/S, and DFA for different degree of detrending. Since the condition for a time series to reject long-term dependence given by, H = 12 , is an asymptotic limit, various authors proposed correction for finite samples based on estimating the theoretical (R/S)n for scale n. Traditionally, the statistical approach is to test the null hypothesis of no or weak dependence against the alternative of strong dependence or long memory at some given significance level. However, to construct such a test we must know the asymptotic distribution of the test statistics, but no asymptotic distribution theory has been derived for the R/S analysis and DFA statistic. With or without known asymptotic properties, one way forward is to use Monte Carlo simulations to construct empirical confidence intervals (see Weron [2002]). The procedure consists in the following few steps 1. for a set of sample lengths L = 2N for N = 8, .., 16, generate a large number (10000) of realisations of an independent or a weakly dependent time series (Gaussian white noise). 2. compute the lower (0.5%, 2.5%, 5%) and upper (95%, 97.5%, 99.5%) sample quantiles for all sample lengths. 379 Quantitative Analytics 3. plot the sample quantiles against sample size and fit them with some functions which will be used to construct confidence intervals. The 5% and 95% quantiles designate the 90% (two-sided) confidence interval, the 2.5% and 97.5% quantiles designate the 95% confidence interval, and so on. For all estimators considered, the DFA statistic for L > 500 with n > 50 gave estimated values closest to the initial Hurst exponent (H = 12 ). Note, for L = 256 there is only three divisors greater than 50, (n = 64, 128, 256) leading to large errors in the linear regression. In view of testing the finite sample properties of the methods used to estimate the Hurst exponent and to compare results of different authors, Kristoufek [2009] performed the original test for time series from T = 29 up to T = 217 with minimum scale nmin = 16 trading days and maximum scale nmax = T4 . All steps of R/S analysis were performed on 10000 time series drawn from standardised normal distribution N (0, 1), and ET [H] and σT (H) were computed for all T . At T = 29 , H = 0.5686 for AL76 and H = 0.5992 for P94, while at T 17 , H = 0.5254 for AL76 and H = 0.5316 for P96. Even though the estimates converge to 12 , they do not get very close to the asymptotic H even for very high T . Computing the mean and standard deviation of the descriptive statistics together with the Jarque-Bera test for normality, the estimates of Hurst exponent were not equal to 21 as predicted by asymptotic theory. Consequently, one must be careful when accepting or rejecting hypotheses about long-term dependence present in time series solely on its divergence from 21 , especially for short time series. Further, since the JB test rejected normality of Hurst exponent estimates for time series lengths of 29 , 216 and 217 , following Weron [2002], Kristoufek [2009] suggested to use percentiles rather than standard deviations for the estimation of confidence intervals. Still he presented the 95% confidence intervals based on standard deviations for R/S and showed they were quite wide for short time series. For example, for T = 29 , E[H] = 0.57 with upper CI = 0.6843 and lower CI = 0.4684 so that for H = 0.65 we can not reject the hypothesis of a martingale process. Kristoufek concluded that AL76 outperformed both P94 and P94c, measured with respect to mean squared errors, and suggested to use AL76 for expected value of H for different T. 10.4.5 Some critics at Lo’s modified R/S statistic Even though the R/S analysis is a simple method for detecting long-range dependence from empirical data which is not reliable for small samples, it is still a highly effective and useful graphical method for large samples. One of its most useful feature is its relative robustness under changes in the marginal distribution of the data, especially if the marginals exhibit heavy tails with infinite variance (see Mandelbrot et al. [1969a] [1969b]). However, we saw in Section (10.2.3) that it is sensitive to the presence of explicit short-range dependence structures, and lack a distribution theory for the underlying statistic. To overcome these shortcomings, Lo [1991] proposed a modified R/S statistic obtained by replacing the sample standard deviation with a consistent estimator of the square root of the variance of the partial sum. He derived the limiting distribution of his statistic under both short-range and long-range dependence, claiming robustness to short-range dependence (see details in Section (10.2.4.2)). While most of the econometric literature acknowledge Lo’s results (see Hauser et al. [1994], Huang et al. [1995], Campbell et al. [1997]), Teverovsky et al. [1999] highlighted a number of problems associated with Lo’s method and its use in practice. They used fractional Gaussian noise (fGn) and fractional ARIMA (FARIMA) models to synthetically generate purely longrange dependent observations and hybrid short-range/long-range dependent data. The most important finding is that Lo’s method has a strong preference for accepting the null hypothesis of no long-range dependence, irrespective of whether long-range dependence is present in the data or not. As a result, Lo’s method should not be used in isolation, and other set of graphical and statistical methods should be considered for checking for long-range dependence (see Abry et al. [1998]). Using R/S analysis in the context of asset returns, Mandelbrot [1967] suggested H-values of around 0.55 to be representative for stock returns. Studying 200 daily stock return series of securities listed on the New York Stock Exchange, Greene et al. [1977] found significant evidence of long-range dependence in many of these series. In contrast, using his modified R/S statistics, Lo did not find evidence of long-range dependence in the Research in Security Prices (CRSP) data. While Lo found strong evidence that the series of absolute values of the CRSP daily stock returns exhibited long-range dependence (H = 0.85), he focused on the series itself. Choosing 380 Quantitative Analytics truncation lags λ = 90, 180, 270, 360, he found that daily stock returns did not exhibit long-range correlation because the values of Vλ (N ), for N ≈ 6400, were within the 95% confidence interval. Attributing the findings of Greene et al. to the failure of R/S analysis in presence of short-range dependence, he concluded that the dynamics of asset returns should be described by traditional short-range models. Using the CRSP daily stock return data, Willinger et al. [1999] revisited the question of whether or not actual stock market prices exhibit long-range dependence. Performing an in-depth analysis of the same data sets, they showed that Lo’s acceptance of the hypothesis for the CRSP data (no long-range dependence in stock market prices) was less conclusive than expected in the econometric literature. Upon further analysis of the data, they found empirical evidence of long-range dependence in stock price returns, but because the corresponding degree of long-range dependence was typically very low (H-values around 0.6), the evidence was not absolutely conclusive. In real life, the correlations at very large lags are so small that they are very sensitive to slight deviations. That is, financial time series do not have infinite memory, but rather behave like systems with bounded natural periods. Hence, they concluded that present statistical analyses could not be expected to provide a definitive answer to the presence or absence of long-range dependence in asset price returns. 10.4.6 The problem of non-stationary and dependent increments 10.4.6.1 Non-stationary increments From the definitions of long-range dependence (LRD) given in Section (10.4.2.1), we see that the statistical analysis performed in Section (10.4.3) and Section (10.4.4) are tailored for processes with stationary increments. However, since stock returns and FX rates suffer from systematic effects mainly due to the periodicity of human activities, they can not be considered as processes with stationary increments, and the standard scaling analysis should not be appropriate in this case. It is therefore desirable to get rid of these systematic effects. The scaling analysis has always been applied in statistical physics to processes with stationary time increments. For these processes, the presence of scaling is equivalent to the statement that there is no characteristic scale (or time, in our case) in the system. However, it strongly contrasts with the presence of time-scales associated with days, weeks and months present in financial data. Once these systematic effects are filtered out, we may hope to get clearer statistical properties of the signal. To eliminate problems due to periodic seasonality in the time signal, several authors introduced time transformation based on the use of volatility as an indicator of market activities (see Dacorogna et al. [1993], Galluccio et al. [1997]). They found correlations present in the system and highlighted the multiscaling behaviour of FX rates. They also suggested that the non-stationarity of the signal does affect the results of a statistical analysis, leading to unprecise or even wrong conclusions. 10.4.6.2 Finite sample In theory, the Hurst exponent only works for very long, or infinite, time series, such that the condition for rejecting LRD is an asymptotic limit. However, financial time series are much shorter, so that the Hurst exponent is nondeterministic, and one must therefore study the finite sample properties of the different methods. Further, financial time series have a finite memory and tend to follow random walk once the time period covered has exceeded the average nonperiodic cycle length. It defines the point where the memory of initial conditions is lost, corresponding to the end of the natural period of the system. We must therefore have sufficient data to detect the natural period when estimating the Hurst exponent. However, in the time domain, LRD is measured only at high lags (strictly at infinite lags) of the ACF, where only a few samples are available and where the measurement errors are largest. Similarly, in the frequency domain, LRD is measured at frequencies near zero, where it is hardest to make measurements. Even though the Hurst exponent is perfectly well defined mathematically, Clegg [2006] showed that is was a very difficult property to measure in real life, since • the data must be measured at high lags/low frequencies where fewer readings are available • all estimators are vulnerable to trends in the data, periodicity and other sources of corruption 381 Quantitative Analytics 10.4.6.3 Dependent increments We saw above that it was very difficult to measure temporal correlations for financial time series. However, even if the series is serially uncorrelated, it can still be dependent. If information comes in bunches, the distribution of the next return will depend on previous returns although they may not be correlated. Even if the returns autocorrelation vanishes, we can not conclude that returns are independent variables, since independence implies that all functions of returns should be uncorrelated variables. However, we saw earlier that numerous studies showed that volatility had a long memory. Examining the autocorrelation of rt and |rt |d for positive d, where rt is the S&P 500 stock return, Ding et al. [1993] found that the sample autocorrelations for absolute returns were greater than the one for squared returns at every lag up to at least 100 lags. It clearly showed that the return process was not an i.i.d. process. They also found from the autocorrelogram that |rt |d had the largest autocorrelation up to lag 100 when d ≈ 1, and that it gets smaller almost monotonically when d goes away from 1. We know from statistical physics that if the time increments are distributed according to a multifractal density, or equivalently, if the distribution of price changes p presents different scaling for different time intervals, the first moment < |X(t)| > is larger than the volatility V (t) = [X(t)− < X(t) >]2 . This is due to the convex property of the qth order moments ξq =< |δθ X(t)|q > as functions of q. Later, Galluccio et al. [1997] showed that FX rates do not have independent increments. They did so by analysing the correlation function of the absolute value of price variations Aθ (t) =< |δθ X(t)||δθ X(0)| > − < |δθ X(0)| >2 and the sign correlation function Sθ (t) =< sgn[δθ X(t)]sgn[δθ X(0)] > − < sgn[δθ X(0)] >2 and showed that these correlations were present in the economical system. 10.4.6.4 Applying stress testing Clegg [2006] tested the R/S parameter, aggregated variance, periodigram, the local Whittle and the wavelet techniques. Real life data is likely to have periodicity, trends, as well as quantisation effects if readings are taken to a given precision. Trial data sets with LRD and a kown Hurst exponent were generated with fractional autoregressive integrated moving average (FARIMA) model and fractional Gaussian noise (FGN). The data was first tested with the various methods listed above and then the same data was corrupted in several ways: addition of zero mean AR(1) model with a high degree of short-range correlation which might be mistaken for LRD, addition of periodic function (10 complete cycles of a sine wave are added to the signal), addition of linear trend simulating growth in the data. Note, technically the addition of a trend or of a periodic noise makes the time series non-stationary, such that the modified series is no-longer LRD. In addition, real life data were studied to provide an insight on the different measurement methods. For each of the simulation methods chosen, traces were generated with 100, 000 points for each trace, and the Hurst parameter was set to 0.7 and 0.9. Considering fGn models, for H = 0.7 all estimators were relatively close when no noise was added, but the addition of AR(1) noise confused all the methods. For H = 0.9 the R/S method was under-estimated and all methods performed badly with the addition of AR(1) noise. In all cases, adding sine wave and trend caused trouble to the time domain methods, but the frequency methods were not affected. Testing different FARIMA settings, Clegg obtained similar results. The case F ARIM A(2, d, 1) with the AR parameters φ1 = 0.5, φ2 = 0.2 and the MA parameter θ1 = 0.1, indicating strong short-range correlation, was the hardest to estimate. In this simple case, with known theoretical result, all the methods fail to get the correct answer. To get an understanding of this failure, Clegg considered visualising the ACF of the data up to lag 1000 for a data set of 100, 000 points of fGn data with H = 0.7. In this case, the log-log plot of the ACF is a straight line and all estimators performed well on that data. Note, at the higher lags the error on the ACF estimate was large. However, when adding AR(1) noise, the log-log plot of the ACF for low lags remained much higher than in the noise free data, with a concave shape making it difficult to fit a straight line. Further, the ACF was heavily perturbated in the log-log plot for lags over fifty. At last, displaying the ACF for the data generated with the F ARIM A(2, d, 1), even before adding noise, the shape was 382 Quantitative Analytics not a straight line for low lags and was perturbated for large lags. Clegg concluded that it is impossible to get a good estimate of LRD simply by fitting a straight line to the ACF, and that the addition of highly correlated short range dependent data was vastly changing the nature of the estimation problem. Moreover, when analysing real data with no genuine answer, he could not tell which method was more right than another. 10.4.7 Some results on measuring the Hurst exponent Since so many papers have been written comparing the different methods to measure the Hurst exponent both in theory and in practice, we are going to repeat some of the tests on R§ analysis, wavelet-based method, DMA and DFA. We will test the methods for a range of H value, different sample sizes, and we will also study the computation time as a function of the sample size for all the methods. 10.4.7.1 Accuracy of the Hurst estimation We test the different methods for monofractal series of 32, 768 points with different values of Hurst exponent using Wood and Chan algorithm (see Wood et al. [1994]) for the generation of fractional Brownian motion. For each Hurst exponent H, we independently generate 500 different series and we compute the averages and the standard deviations of the results for each method, assuming that the Hurst exponent follows a normal distribution. The results are presented in the table below, and the plots in the Figure 10.9 and Figure 10.10. From Table 1, we notice that all the methods perform well except for the R/S analysis which is significantly less precise than the other methods. Further, the performance of R/S analysis is highly dependent on the level of the Hurst exponent. For instance, the error is incredibly high for H = 0.1 but relatively accurate for a Hurst exponent around 0.7. Hurst 0.10 0.20 0.30 0.40 0.50 0.60 0.70 0.80 0.90 R/S Analysis 0.1979 ± 0.0077 0.2781 ± 0.0103 0.3584 ± 0.0127 0.4426 ± 0.0158 0.5276 ± 0.0182 0.6169 ± 0.0203 0.7027 ± 0.0231 0.7828 ± 0.0231 0.8568 ± 0.0236 Wavelet-based 0.1004 ± 0.0611 0.1997 ± 0.0387 0.2999 ± 0.0444 0.4007 ± 0.0403 0.4993 ± 0.0264 0.6000 ± 0.0300 0.7002 ± 0.0307 0.7999 ± 0.0982 0.9004 ± 0.0498 DMA 0.1099 ± 0.0073 0.2106 ± 0.0118 0.3107 ± 0.0152 0.4109 ± 0.0180 0.5120 ± 0.0205 0.6127 ± 0.0232 0.7120 ± 0.0292 0.8070 ± 0.0330 0.9004 ± 0.0390 DFA order 1 0.1093 ± 0.0052 0.2060 ± 0.0087 0.3036 ± 0.0115 0.4010 ± 0.0140 0.4998 ± 0.0157 0.5993 ± 0.0170 0.6986 ± 0.0199 0.7960 ± 0.0181 0.8960 ± 0.0222 DFA order 2 0.1166 ± 0.0043 0.2119 ± 0.0071 0.3085 ± 0.0096 0.4057 ± 0.0114 0.5045 ± 0.0130 0.6031 ± 0.0144 0.7024 ± 0.0154 0.8007 ± 0.0152 0.9007 ± 0.0178 Table 1: Accuracy of Hurst estimation on fractional Brownian motions with different methods. Figure 10.9 and Figure 10.10 are grouped bar plots representing the absolute error and the standard deviation, respectively, between the Hurst estimates and the theoretical Hurst exponent. As we said, R/S analysis performs badly whereas all the others are fairly accurate. However, we note that the wavelet-based method is much more accurate than the detrending methods (around 3 · 10−4 versus 6 · 10−3 ), but its standard deviation is higher (around 5 · 10−2 versus 1 · 10−2 ). Among the detrending methods (DMA, DFA1 and DFA2), DMA method is a little bit less accurate than DFA methods and its standard deviation is also slightly higher. We also remark that the second-order polynomial interpolation in the DFA is less accurate that the linear interpolation version of DFA but its standard deviation is slightly lower. However, since the gain in the standard deviation is very small, one would prefer a DFA method of order 1. 383 Quantitative Analytics Hence, according to these results, one would avoid R/S analysis and DMA methods, and the choice between the wavelet-based method, DFA1 and DFA2 being made according to the user constraints. For instance, if the user needs a Hurst exponent as accurate as possible, he would choose the wavelet-based method. However, if he wants the most stable estimator, he would choose the higher order DFA method. If he wants something both fairly accurate and stable, the DFA method with linear interpolation would be a good compromise. In short, for a large sample size, we have: R/S << DMA << DFA1 << DFA2 (stability) ∼ Wavelets (accuracy) 0.00 0.02 0.04 0.06 0.08 RS Wavelets DMA DFA 1st−order DFA 2nd−order 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Figure 10.9: Absolute error of Hurst estimates for fractional Brownian motions of 32768 points with different methods for different values of H. 384 Quantitative Analytics 0.00 0.02 0.04 0.06 0.08 RS Wavelets DMA DFA 1st−order DFA 2nd−order 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Figure 10.10: Standard deviation of Hurst estimates for fractional Brownian motions of 32768 points with different methods for different values of H. 10.4.7.2 Robustness for various sample size We are now going to test the different methods against the fractional Brownian motion generated by the Wood and Chan algorithm, for different sample sizes (128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768). For each pair (H, Sample size), we compute the absolute error and the standard deviation of the Hurst estimates. We provide below the detailed table of absolute errors for each pair (H, Sample size) and each method, and we also plot the average absolute errors and standard deviations focusing only on the effect of sample sizes (and not on the Hurst exponent values). 385 Quantitative Analytics Size 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 R/S Wavelets DMA DFA1 DFA2 R/S Wavelets DMA DFA1 DFA2 R/S Wavelets DMA DFA1 DFA2 R/S Wavelets DMA DFA1 DFA2 R/S Wavelets DMA DFA1 DFA2 R/S Wavelets DMA DFA1 DFA2 R/S Wavelets DMA DFA1 DFA2 R/S Wavelets DMA DFA1 DFA2 R/S Wavelets DMA DFA1 DFA2 128 256 512 1024 2048 4096 8192 16384 32768 0.1792 0.0904 NA 0.0604 0.1094 0.1544 0.0493 NA 0.0442 0.0888 0.1275 0.0346 NA 0.0308 0.0706 0.0994 0.0098 NA 0.0195 0.0562 0.0710 0.0030 NA 0.0120 0.0452 0.0394 0.0065 NA 0.0027 0.0349 0.0051 0.0158 NA 0.0015 0.0282 0.0346 0.0248 NA 0.0064 0.0232 0.0814 0.0421 NA 0.0094 0.0188 0.1629 0.1233 0.0526 0.0449 0.0788 0.1390 0.050 0.0566 0.0320 0.0625 0.1151 0.0265 0.0635 0.021 0.0476 0.0871 0.0143 0.0624 0.0123 0.0370 0.0613 0.0022 0.0614 0.0068 0.0301 0.0324 0.0036 0.0620 0.0007 0.0227 0.0062 0.0020 0.0666 0.002 0.0176 0.0312 0.0033 0.059 0.0073 0.0130 0.0751 0.0152 0.0521 0.0078 0.0121 0.1490 0.0850 0.0387 0.0326 0.0582 0.125 0.0058 0.0403 0.0219 0.0445 0.1021 0.0011 0.0429 0.0141 0.0341 0.0781 0.0005 0.043 0.0077 0.025 0.0551 0.000 0.0461 0.0035 0.0194 0.031 0.0008 0.0477 0.0005 0.0146 0.0042 0.003 0.0473 0.0034 0.0112 0.0279 0.0053 0.0415 0.0066 0.0077 0.0692 0.0000 0.0331 0.0082 0.006 0.1377 0.0503 0.0295 0.0252 0.0447 0.114 0.011 0.0305 0.0165 0.0335 0.0924 0.0017 0.0325 0.0104 0.0254 0.0703 0.0009 0.0333 0.0053 0.0186 0.0490 0.0020 0.0348 0.0016 0.0138 0.0279 0.0030 0.0365 0.0009 0.0102 0.0039 0.0082 0.0353 0.003 0.0074 0.0250 0.0019 0.0298 0.005 0.0051 0.064 0.0003 0.0203 0.0075 0.0036 0.1277 0.0071 0.0232 0.0329 0.0583 0.1055 0.001 0.0238 0.0232 0.0451 0.0837 0.0040 0.0251 0.016 0.0358 0.0629 0.0000 0.0257 0.0117 0.0285 0.0437 0.001 0.0270 0.0085 0.0226 0.0248 0.0012 0.0283 0.0060 0.0191 0.0038 0.0021 0.027 0.0050 0.0167 0.0225 0.0111 0.022 0.0034 0.0151 0.0590 0.0003 0.0125 0.0026 0.014 0.1188 0.0001 0.0185 0.0255 0.044 0.0974 0.0007 0.0188 0.0177 0.0342 0.0760 0.001 0.0199 0.0126 0.0267 0.0566 0.0005 0.0205 0.0087 0.0208 0.039 0.0038 0.0211 0.0058 0.0168 0.0223 0.0000 0.0225 0.00 0.0138 0.0036 0.0036 0.0218 0.0036 0.0121 0.0208 0.0005 0.0169 0.0020 0.0103 0.0541 0.0006 0.007 0.0015 0.0099 0.1110 0.0037 0.0150 0.0204 0.0356 0.0900 0.0006 0.0151 0.0138 0.0267 0.0694 0.0005 0.0159 0.0094 0.0206 0.0510 0.0007 0.016 0.0066 0.0160 0.035 0.0064 0.0172 0.0040 0.0124 0.0206 0.0032 0.018 0.0034 0.0109 0.0032 0.0079 0.0179 0.0028 0.0094 0.0195 0.0005 0.0130 0.0015 0.0077 0.0505 0.0013 0.0040 0.0008 0.0073 0.1039 0.0023 0.0121 0.0166 0.0290 0.0836 0.0003 0.0123 0.0110 0.0213 0.0633 0.0002 0.0127 0.0074 0.0163 0.0459 0.0062 0.0127 0.0054 0.0129 0.0317 0.0021 0.0142 0.0029 0.0095 0.0183 0.0020 0.015 0.0026 0.0088 0.0030 0.0106 0.015 0.0026 0.0075 0.01 0.01 0.0102 0.0012 0.0061 0.0475 0.0004 0.0016 0.0003 0.0054 0.0979 0.0003 0.0099 0.0092 0.0166 0.0780 0.0003 0.010 0.0059 0.0119 0.0584 0.0001 0.0106 0.0036 0.0084 0.0426 0.0007 0.0108 0.000 0.0057 0.0275 0.0006 0.0119 0.0001 0.0044 0.0168 0.0000 0.0127 0.000 0.0031 0.0027 0.0001 0.0119 0.0013 0.0023 0.0171 0.0000 0.0069 0.0040 0.0007 0.0431 0.0004 0.0003 0.003 0.0007 Table 2: Absolute error of the Hurst estimates for various Hurst exponent, various sample sizes and different methods From Table 2, we logically observe that for any method and any Hurst exponent value, the quality of the Hurst estimates worsen as the sample size get smaller. For example, when H = 0.1, the R/S statistic goes from an absolute 386 Quantitative Analytics error of 0.0979 for 32, 768 points to 0.1792 for 128 points; the wavelet method goes from 0.0003 to 0.0904; the DMA goes from 0.0099 to 0.0526 for 256 points; the DFA1 goes from 0.0092 to 0.0604 and the DFA2 goes from 0.0166 to 0.1094. 0.10 We also notice that except for the DMA method, the Hurst estimators work better for anti-persistent processes (H > 0.5) than for persistent processes (H < 0.5). For example, considering the sample size 512, the absolute error is increasing when the Hurst exponent decreases. However, the effect is still less significant compared to the sample size effect on the Hurst estimates. 0.06 0.04 0.00 0.02 Absolute Error 0.08 RS Wavelets DMA DFA1 DFA2 0 5000 10000 15000 20000 25000 30000 Size Figure 10.11: Absolute error of the Hurst exponent in function of the sample size. Figure 10.11 and Figure 10.12 represent respectively the absolute error and the standard deviation of the Hurst exponent averaged on the value of the Hurst exponent so that we get two plots with those two indicators exclusively in function of the sample sizes. The graphs emphasise our first observation. Both the absolute error of the Hurst exponent and the standard deviation are exponentially decreasing functions of the sample sizes. While the wavelets and DFA1 methods seem to be the two best methods for small sample sizes in terms of absolute error, the former has a standard deviation which is much higher than all the other methods in general, whereas the latter is much more stable. As a consequence, our previous conclusion still holds true for any sample sizes. The best choice among the methods depends on one’s wishes. The R/S analysis and DMA methods seem to be the poorest method compared to the two other methods. If the user does not work on large sample sizes, he has then two choices: either he need accuracy in which case he would choose the wavelet-based method, or, he needs relatively accurate but highly stable estimates and he would consequently choose the DFA method. The hierarchy is then: R/S << DMA << Wavelets (accuracy) ∼ DFA1 (stability) ∼ DFA2 (stability) 10.4.7.3 Computation time We now wish to apply the long-range dependence analysis (LRD) to the financial industry, which is well-known to be a highly fast-paced and competitive environment where every milli/micro-seconds are critical. It is therefore 387 0.25 Quantitative Analytics 0.00 0.05 0.10 0.15 Standard Deviation 0.20 RS Wavelets DMA DFA1 DFA2 0 5000 10000 15000 20000 25000 30000 Size Figure 10.12: Standard deviation of the Hurst exponent in function of the sample size. important to give indications on the computation time of those algorithms. We estimate and plot the computation time of the four methods as a function of the sample size. The following results are computed with a CPU Intel Core 2 Quad Processor Q9550 (2.83 GHz, 1333 MHz). 300 0 100 Computation Time 500 RS Wavelets DMA DFA1 DFA2 0 5000 10000 15000 20000 25000 30000 Size Figure 10.13: Computation time (in milliseconds) of the Hurst estimation methods in function of the sample size. From Figure 10.13, which represents the computation time in function of the sample size, we immediately distinguish two classes of methods. The wavelets and R/S analysis are linear in function of the sample size, their time complexity are in fact O(n) which is extremely fast (from 0.62 to 14.18 ms). The second class contains the DMA, DFA1, and DFA2. Their complexity are actually O(n2 ) but the DMA is actually faster than the DFA since computing 388 Quantitative Analytics an average is faster than a linear/polynomial interpolation. The DFA1 is faster than DFA2 since computing a linear interpolation is faster than a 2nd order interpolation. Therefore, in terms of computational time, we have: DFA2 << DFA1 << DMA << Wavelets ∼ R/S 389 Chapter 11 The multifractal markets 11.1 Multifractality as a new stylised fact 11.1.1 The multifractal scaling behaviour of time series 11.1.1.1 Analysing complex signals The use of fractional Brownian motion (fBm) described in Section (10.1.2), which involves a restriction to a certain Holder continuity H of the paths for all times of the process, is too restrictive for many applications, and variable time-dependent Holder continuities of the paths are needed. That is, in the case where the Hurst exponent, H, changes over time, the fractional Brownian motion becomes a somewhat restrictive model, unable to capture more fully the complex dynamics of the series. As explained by Kantelhardt et al. [2002], many series do not exhibit a simple monofractal scaling behaviour described with a single scaling exponent. There may exist crossover (time-) scales n× separating regimes with different scaling exponents, such as long-range correlations on small scales, n << n× , and another type of correlations or uncorrelated behaviour on larger scales n >> n× . Alternatively, the scaling behaviour may be more complicated, so that different scaling exponents are required for different part of the series. For instance, the scaling behaviour in the first half of the series differ from that in the second half. In complex system, such different scaling behaviour can be observed for many interwoven fractal subsets of the time series, in which case a multitude of scaling exponents is required for a full description of the scaling behaviour, and a multifractal analysis must be applied. While the term fractal was mainly associated with deterministic chaos, originating from a small number of generating equations, in the 80s a new class of stochastic fractals developed termed multifractals, with processes originating in high-dimensional systems (see Schertzer et al. [1991]). In general, two different types of multifractality in time series can be distinguished 1. Multifractality due to a broad probability density function (pdf) for the values of the time series. One can not remove the multifractality by shuffling the series. 2. Multifractality due to different long-range (time-) correlations of the small and large fluctuations. In this case, the pdf of the values can be a regular distribution with finite moments. The corresponding shuffled series will exhibit nonmultifractal scaling, since all long-range correlations are destroyed by the shuffling procedure. If both kinds of multifractality are present, the shuffled series will show weaker multifractality than the original series. The multifractal formalism (MF) provides a scale invariant mechanism for the analysis and generation of complex signals fitting well with the observed experimental properties of fully developed turbulence (FDT) as well as other physical systems ranging from natural images to heartbeat dynamics or econometric signals. The formalism also allows to highlight relevant dynamical features of the systems under study, and theoretical models can be devised to fit the observed multifractal properties. 390 Quantitative Analytics Improving on the standard partition multifractal formalism, the wavelet transform modulus maxima (WTMM) is based on wavelet analysis, and involves tracing the maxima lines in the continuous wavelet transform over all scales (see Arneodo et al. [1995]). A description is given in Section (??). Since the development of DFA and DMA, alternative methods have been proposed which we are now going to describe. 11.1.1.2 A direct application to financial time series Since response time distributions of financial time series have been found to be typically unimodal with fat tails and leptokurtosis, distributions like lognormal, Gamma, Weibull, and power law distributions have been suggested to model asset returns. However, all these models assume that the response times are trial-independent random variables. However, we saw in Section (10.4) that financial time series exhibit non-Gaussian distribution and long-range dependent dynamics. The long-range trial dependency of response time is numerically defined by a scaling exponent obtained by monofractal analyses (see details in Section()). However, it was observed that this scaling exponent decreased with increasing difficulty and an increased level of external economical perturbation. While conventional monofractal analysis numerically define a long-range dependency as a single scaling exponent, they assume that the response times are Gaussian distributed such that their variations are described by the second-order statistical moment (variance) alone. The presence of a non-Gaussian response time distribution indicates 1. that the variations can not be exclusively described by the scaling of variance alone, but that the scaling of higher order statistical moments such as skewness and kurtosis must be considered, 2. it also indicates intermittent changes in the magnitude of response time variation which might be due to feedback effects, or changes in investor’s behaviour. These intermittent changes in the response time variation provide temporal modulation of both the width and shape of the response time distribution, and consequently, temporal modulation of the scaling exponent. Multifractal analyses estimate a multifractal spectrum of scaling exponents containing the single exponent estimated by the conventional monofractal analyses. Various authors introduced numerical tools to define the scaling exponents of higher order statistical moments and the temporal modulation of a local scaling exponent. 11.1.2 Defining multifractality We saw in Section (10.1.2.4) that multifractality or anomalous scaling allows for a richer variation of the behaviour of a process across different scales. Equation (10.1.6) shows that this variability of scaling laws can be translated into the variability of the Hurst index, which is no-longer constant. Following Abry et al. [2002] and Wendt [2008] who both gave a synthetic overview of the concepts of scale invariance, scaling analysis, and multifractal analysis, we are going to introduce multifractality. 11.1.2.1 Fractal measures and their singularities In nonlinear physics, one want to characterise complicated fractal objects and describe the events occurring on them. For example, this characterisation applies to dynamical systems theory, diffusion-limited aggregation, percolation, to name a few. In general, one describe such events by dividing the object into pieces labelled by index i running from 1 to N . The size of the ith piece is li and the event occurring upon it is given by the number Mi . For instance, in the droplet theory of Ising model, the magnetisation has a value of the order of Mi ∼ l y where y is a critical index. Since these droplets should fill the entire space, the density of such droplets is ρ(l) ∼ 391 1 ld (11.1.1) Quantitative Analytics where d is the Euclidean dimension of space. Halsey et al. [1986] considered the case where each Mi is a probability that some event will occur upon the ith piece. They assumed the d-dimensional time series {Xi }N i=1 with trajectories lying on a strange attractor of dimension D, D < d and tried to find out how many times Ni would the time series i visit the ith box. They defined pi = limN →∞ N N and generated the measure on the attractor dµ(X), since pi = R dµ(X). That is, p is the probability (integrated measure) in the ith box. If a scaling exponent α 1 is defined i ith box by pqi ∼ liαq then α can take on a range of values, corresponding to different regions of the measure. They suggested that the 0 0 0 number of times α would take on value between α and α + dα should be of the form 0 0 dα ρ(α )l−f (α 0 ) 0 where f (α ) is a continuous function. It reflects the differing dimensions of the sets upon which the singularities 0 of strength α may lie. It is roughly equivalent to Equation (11.1.1) with the dimension d replaced by the fractal dimension f (α) which varies with α. Thus, fractal measures are modelled by interwoven sets of singularities of strength α, each characterised by its own dimension f (α). The function f (α) must then be related to observable properties of the measure. The most basic property of a strange attractor is its dimension, and the three main ones are the fractional (or similarity) dimension D of the support of the measure (see also box counting dimension), the information dimension σ, and the correlation dimension ν. Hentschel et al. [1983] showed these attractors are characterised by an infinite number of generalised dimension Dq , q > 0. Rather than considering droplet theory of Ising model, they let {Xi }N i=1 be the points on the attractor covering space with a mesh of d-dimensional cubes of size bd , and M (b) be the number of cubes containing points of the series. They let pα = NNα be the probability to fall in one of the boxes of type α and defined the rescaling hierarchy based on a box of size ld on the nth level covered with bins of size bd where the probability of the ith bin is denoted by pi (l, b). They showed self-similarity between the box of size ld on the nth level of the hierarchy and the box of size (( sl )α )d on the (n + 1)th level which is used to calculate the dimensions associated with the natural measure. So far, the exponent ν was related to correlations between pairs of point on the fractal, but Hentschel et al. [1983] considered higher order correlation functions or correlation integrals Cn (l) and showed that X Cn (l) ≈ Cn (l, b) = pni (l, b) i∈l scales like Cn (l, b) = Cn (l)bνn Obtaining Dn for an integer n, they generalised it to an uncountable infinity of quantities Dq with any q > 0 defined by Dq = lim l→0 1 ln χ(q) q − 1 ln l (11.1.2) where χ(q) = X pqi i∈l is a partition function. Hence, the generalised dimensions Dq correspond to the scaling exponents for the qth moments of the measure. Note, D0 is the fractional (similarity) dimension, D1 is the information dimension, and D2 is the 1 Lipschitz-Holder exponent 392 Quantitative Analytics correlation dimension. That is, multifractals have multiple dimension in the Dq versus q spectra, but monofractals stay rather flat in that area. Note, the term Sq = 1 ln χ(q) q−1 is called the Renyi entropy representing a one-parametric generalisation of Shannon’s entropy (for which it reduces for q → 1). Later, Halsey et al. [1986] related the function f (α) to the set of dimensions Dq , and after replacing pi with its definition above, they obtained Z Z 0 0 0 0 0 0 0 0 χ(q) = dα ρ(α )l−f (α ) lqα = dα ρ(α )lqα −f (α ) 0 0 0 0 Since l is very small, this integral is dominated by the value of α making qα − f (α ) smallest, provided that ρ(α ) 0 is nonzero. To find the minimum, they replaced α by α(q), which is defined by the external condition 0 d 0 0 qα − f (α ) dα α0 =α(q) =0 Differentiating one more time, we have 0 d2 0 qα − f (α ) d(α0 )2 0 α0 =α(q) >0 00 such that f (α(q)) = q and f (α(q)) < q. Remark 11.1.1 As a result of the optimisation process, α(q) is the value for which the expression qα − f (α) is extremal. Then, from the definition of the generalised fractal dimensions in Equation (11.1.2), they obtained Dq = 1 qα(q) − f (α(q)) q−1 (11.1.3) so that knowing f (α) and the spectrum of α values, one can define Dq . Alternatively, given Dq , one can get α(q) 2 since α(q) = d (q − 1)Dq dq Consequently, the generalised dimensions Dq provide an alternative description of the singular measure. Generalising the definition of the dimension Dq , they considered a strange set S embedded in a finite portion of d-dimensional Euclidean space, and partitioned the set into some number of disjoint pieces S1 , .., SN in which each piece has a measure pi and lies within a ball of radius ll , where each li is restricted by li < l. Then given the partition function Γ(q, τ, {Si , l}) = N X pq i liτ i=1 they argued that for large N , it is of the order unity only when τ = (q − 1)Dq . Defining Γ(q, τ ) = lim Γ(q, τ, l) l→0 2 d dq d qα(q) − f (α(q)) = α(q) + q dq α(q) − d d f (α) dq α(q) dα 0 = α(q) and f (α(q)) = q 393 Quantitative Analytics and arguing that the function τ (q) is unique, they defined Dq as (q − 1)Dq = τ (q) (11.1.4) which allows to recover α(q) and f (α(q)). That is, replacing in Equation (11.1.3), we get τ (q) = qα(q) − f (α(q)) (11.1.5) and d τ (q) dq α(q) = (11.1.6) Note, τ (q) is the Legendre transform of f (α). Further, this definition of Dq precisely makes D0 the Hausdorff dimension. They considered some simple examples to illustrate the quantities τ (q) and gain intuition about α(q) and f (α). This multifractal formalism (MF), which is very useful in the characterisation of singular measures, accounts for the statistical scaling properties of these measures through the determination of their singularity spectrum f (α) which is intimately related to the generalised fractal dimension Dq . It reflects a deep connection with the thermodynamic formalism (TF) of equilibrium statistical mechanics where τ (q) and q are conjugate theremodynamic variables to f (α) and α. In fact, the concept of multifractality originated from a general class of multiplicative cascade models introduced by Mandelbrot [1974] in the context of fully developed turbulence (FDT). In the past, the Dq has usually been used on real, or, computer experiments, and the f (α) curves were determined from the Legendre transform of the τ (q) curves, which involved first smoothing the former and then Legendre transforming. A few years later, Chhabra et al. [1989] proposed a direct evaluation of f (α) without resorting to the intermediate Legendre transform. Denoting the probabilities in the boxes of size l as pj (l), they constructed a one-parameter family of normalised measure µ(q) given by pq (l) µi (q, l) = P i q j pj (l) (11.1.7) and they obtained the singularity spectrum as P f (q) α(q) µi (q, l) ln µi (q, l) ln l P µ (q, l) ln pi (l) i = lim i l→0 ln l = lim i l→0 (11.1.8) which provides a relationship between the Hausdorff dimension f and an average singularity strength α as an implicit function of the parameter q. We are now going to discuss how one can estimate the f (α) spectrum based on the local dissipation. 11.1.2.2 Scaling analysis As explained in Section (11.1.2.1), processes with spectra obeying a power law within a given (and sufficiently wide) range of frequencies (scales) are often refered to as f1 processes ΓX (ν) = C0 |ν|−γ , νm ≤ |ν| ≤ νM where ΓX (ν) is any standard spectrum estimation procedure, 0 < γ < 1 and C0 is a positive constant. Two special cases where the scale range is semi-infinite, either at small frequencies, νm → 0 (equivalently large scales) or at large frequencies, νM → ∞ (small scales), define long-range dependent processes and monofractal processes. Scale 394 Quantitative Analytics invariance is generally defined as the power law behaviours of (the time average of the qth power of) multiresolution quantities, denoted TX (a, t) with respect to the analysis scale a, for a given (large) range of scales a ∈ (am , aM ), aM am >> 1 na 1 X |TX (a, k)|q ' cq aτ (q) na (11.1.9) k=1 where TX (a, k) describes the content of X around a time position t, and a scale a, such as a wavelet transform (see Muzy et al. [1991], Abry et al. [1995]). As explained in Section (11.1.2.1), τ (q) is a scaling exponent related to the generalised dimension via Equation (11.1.4). Hence, these quantities can be seen as some kind of spectral estimates. Definition 11.1.1 Scaling analysis The aim of scaling analysis is to validate the existence of power law behaviours as in Equation (11.1.9), and to measure the scaling exponents τ (q) that characterise them. As suggested by Equation (11.1.9), the analysis and estimation procedures consist in tracking straight lines and estimating slopes in log-log plots. The estimated exponents can then be used for the physical understanding of the data or the system producing them. Note, the central theoretical notion of scale invariance is that of self-similarity, where the statistical information obtained from an object is independent of the scale of observation. However, self-similarity is a very demanding property, as it implies exact invariance to dilatation for all scale factors a > 0 of all finite dimensional distributions, therefore involving all statistical orders of the process. In practice, investigation of scale invariance is often restricted to the statistical order 2, or only certain range of scale factors. To be more flexible, one definition of scale invariance is obtained by relaxing the self-similarity property. First, scale invariance has to hold only for a >> 1, rather than all a > 0. Second, the (single) self-similarity restricted range of scaling factors a ∈ (am , aM ), aaM m parameter H is replaced with the function τ (q), called the scaling function or the scaling exponents of X(t). Definition 11.1.2 Scale invariant stationary process Suppose X(t) is a process with stationary increments. Then it is scale invariant if E[|X(at)|q ] = |a|τ (q) E[|X(t)|q ] for a range of scale a ∈ (am , aM ), aM am >> 1 and some range of statistical orders q. which implies for the increment process E[|δθ X(t)|q ] = |θ|τ (q) E[|δ1 X(0)|q ] , 0 < θm < θ < θM < ∞ where δθ X(t) = X(t + θ) − X(t) is a longitudinal velocity increment over a distance θ. The single parameter H is replaced with a function τ (q), which is in general non-linear (τ (q) 6= qH), and hence represents a whole collection of parameters for the characterisation of the process. While the work of Frisch et al. [1985] and Halsey et al. [1986], described in Section (11.1.2.1), showed that there was an infinite hierarchy of exponents allowing for a much more complete representation of the fractal measures, the related ideas of multifractality have only been applied to self-similar sets. Barabasi et al. [1991] extended the concept of multifractality to self-affine fractals, providing a more complete description of fractal surfaces. They investigated the multiscaling properties of the self-affine function f (X) by calculating the qth order height-height correlation function Cq (∆t) = N 1 X |X(t, ∆t)|q N t=1 395 Quantitative Analytics where X(t, ∆t) = X(t) − X(t − ∆t), N >> 1 is the number of points over which the average is taken, and only the terms with |X(t, ∆t)| > 0 are considered. They showed that this correlation function exhibited a nontrivial multiscaling behaviour if Cq (∆t) ∼ (∆t)qH(q) (11.1.10) with H(q) changing continuously with q at least for some region of the q values. As a result, multiscaling in empirical data is typically identified by differences in the scaling behaviour of different (absolute) moments E[|X(t, ∆t)|q ] = c(q)(∆t)qH(q) = c(q)(∆t)τ (q) (11.1.11) where c(q) and τ (q) are deterministic functions of the order of the moment q. From Equation 11.1.11 we can see that τ (q) = qH(q), which motivates the definition of the generalised Hurst exponent as H(q) = τ (q) q (11.1.12) A similar expression holds for mono-scaling processes such as fBm E[|X(t, ∆t)|q ] = cH (∆t)qH (11.1.13) Remark 11.1.2 There exists different ways of defining the notion of scale invariance and multifractality in the literature. We will discuss it further in Section (11.2.4.3). In terms of the behaviour of moments, monofractal, self-affine processes, are characterised by linear scaling, while multifractality (anomalous scaling) is characterised by non-linear (typically concave) shape. Hence, to diagnose multifractality, we can consider the inspection of the empirical scaling behaviour of an ensemble of moments. The traditional approach in the physics literature consists in extracting the self-similarity exponent, τ (q), from a chain of linear log-log fits of the behaviour of the various moments q for a certain selection of time aggregation steps ∆t. We can therefore use regressions to the temporal scaling of moments of powers q ln E[|X(t, ∆t)|q ] = a0 + a1 ln (∆t) (11.1.14) and constructs the empirical τ (q) curve (for a selection of discrete q) from the ensemble of estimated regression coefficients for all q. An alternative and more widespread approach consists in looking directly at the varying scaling coefficients H(q). This is called multifractal analysis which we introduce in Section (11.1.2.3). While the unique coefficient H quantifies a global scaling property of the underlying process, the multiplicity of such coefficients in multifractal processes, called Holder exponents, can be viewed as local scaling rates governing various patches of a time series, leading to a characteristically heterogeneous (or intermittent) appearance of such series. Focusing on the concept of Holder exponents, multifractality analysis amounts to identifying the range of such exponents rather than a degenerate single H as in the case of monofractal processes. 11.1.2.3 Multifractal analysis So far, we focused on global properties such as moments and autocovariance, we are now going to adopt a more local viewpoint and examine the regularity of realised paths around a given instant. Contrary to scaling analysis which concentrate on the scaling exponent τ (q), the multifractal analysis (MFA) studies how the (pointwise) local regularity of X fluctuates in time (or space). Local Holder regularity describes the regularity of sample paths of stochastic processes by means of a local comparison against a power law function and is therefore closely related to scaling in the limit of small scales. The exponent of this power law, h(t), is called the (local) Holder exponent and depends on both time and the sample path of X. 396 Quantitative Analytics Definition 11.1.3 Pointwise regularity A function f (t), f : Rd → R is C α (t0 ) with α > 0, denoted as f ∈ C α (t0 ), if there exist C > 0, > 0 and a polynomial Pt0 (θ) of order strictly smaller than α such that if |θ| ≤ , |f (t0 + θ) − Pt0 (θ)| ≤ C|θ|α If such polynomial Pt0 (θ) exists, it is unique, and its constant part is always given by Pt0 (0) = f (t0 ). Definition 11.1.4 Holder exponent The Holder exponent hf (t0 ) of f at t0 is hf (t0 ) = sup {α : f ∈ C α (t0 )} Note, if Pt0 (0) = f (t0 ) reduces to a constant, the Holder exponent characterises the power law behaviour of the increments at t0 |f (t0 + θ) − f (t0 )| ≤ C(t0 )|θ|hf (t0 ) where C(t0 ) is called the prefactor at time t0 . Put another way, the exponent hf (t0 ) quantifies the scaling properties of the process at time t0 . The Holder exponent generalises the heuristic definition of singularity, so that it is also called the singularity exponent. That is, if f has Holder exponent h(t0 ) = hf (t0 ) < 1 at t0 , then f has at t0 either a cusp-type singularity |f (t0 + θ) − f (t0 )| ∼ C|θ|h(t0 ) (11.1.15) or an oscillating singularity |f (t0 + θ) − f (t0 )| ∼ C|θ|h(t0 ) sin ( 1 ) |θ|β (11.1.16) with oscillation exponent β > 0. Conversely, if f has either a cusp or an oscillating singularity at t0 and 1 > h(t0 ), then h(t0 ) = hf (t0 ) is the Holder exponent of f at t0 . Multifractal situations happen when the Holder exponent is no-longer unique, but vary from point to point. More precisely, when the regularity h(t) is itself a highly irregular function of t, possibly even a random process rather than a constant or a fixed deterministic function, the process X is said to be multifractal. The aim of multifractal analysis is to provide a description of the collection of Holder exponents h of the function f . Since the Holder exponent may jump from one point to another, it was understood that describing them for each time step was not of much importance. Hence, researchers focused on a global description of the regularity of the function of f in form of multifractal spectrum (also called the singularity spectrum) reflecting the size of the set of points for which the Holder exponent takes a certain value h. The measure of size most commonly used is the Hausdorff dimension which gives rise to the Hausdorff spectrum (called the multifractal spectrum). It describes the collection of Holder exponents h(t) by mapping to each value of h the Hausdorff dimension D(h) of the collection of points ti at which hf (ti ) = h. The main idea being that the relative frequency of the local exponents can be represented by a renormalised density called the multifractal spectrum. Definition 11.1.5 Iso-Holder sets The Iso-Holder sets If (h) is the collection of points ti for which the Holder exponent takes a certain value h. If (h) = {ti |hf (ti ) = h} For defining the Hausdorff dimension, we first need to define the Hausdorff measure. 397 Quantitative Analytics Definition 11.1.6 Hausdorff measure Let S ⊂ Rd , > 0, and let γ (S) be -coverings of S, that is, bounded sets {cn }n∈N of radius |cn | ≤ (maximal distance between two elements of cn ) that cover S : S ⊂ γ (S). Let C (S) be the collection of all -coverings γ (S) of S. The δ-dimensional Hausdorff measure of S is X mδ (S) = lim inf |cn |δ →0 C (S) γ (S) It can be shown that either mδ (S) = 0 if δ < δc , or mδ (S) = ∞ if δ > δc . The Hausdorff dimension of S is defined as the critical value δc . Definition 11.1.7 Hausdorff dimension The Hausdorff dimension dimH (S) of S ⊂ Rd is given by dimH (S) = inf {mδ (S) = ∞} = sup{mδ (S) = 0} δ δ The multifractal spectrum assigns now to each Holder exponent, as a measure of its geometric importance, the Hausdorff dimension of the set of points that share the same exponent h. Definition 11.1.8 Multifractal spectrum The multifractal spectrum of a function f is defined as the Hausdorff dimension of the iso-Holder sets If (h). Df (h) = dimH (If (h)) We can now review the definition of monofractal and multifractal processes. Definition 11.1.9 Monofractal function or process A function or process X(t) in Rd for which hX (t) is a constant, ∀t : hX (t) = H, is called monofractal. Definition 11.1.10 Multifractal function or process A function or process X(t) in Rd is called multifractal if it contains more than one Holder exponent h that is living on a support with non-zero Hausdorff dimension. All homogeneous processes X with Holder exponents hX (x) not constant have their exponents which are discontinuous everywhere and hence are highly variable and change widely from point to point. As pointed out by Abry et al. [2002], one of the major consequences of multifractality in processes lies in the fact that quantities called partition functions present power law behaviours in the limit of small scales 1 Sθ (q) = θ X |δθ X(kθ)|q ' c(q)|θ|τ (q)−1 , |θ| → 0 k=1 which correspond to Equation (11.1.10) with N = θ1 . For processes with stationary increments, the time averages θSθ (q) can be seen as estimators for the statistical averages E[|δθ X(t)|q ] for t = kθ. As a result, the above equation is highly reminiscent of the fundamental Equation (10.1.5) implied by self-similarity. However, the exponents τ (q) need not to follow the linear behaviour qH of self-similarity. 398 Quantitative Analytics 11.1.2.4 The wavelet transform and the thermodynamical formalism Considering the multifractal spectrum of a process to be the multifractal spectrum of each of his realisations, we can speak of multifractal spectrum for both functions and processes. Hence, multifractal analysis determine the multifractal spectrum which describe a local property, the point-wise regularity of a function, globally through the geometrical importance of different Holder exponents, disregarding any information on their precise geometric repartition. Following Parisi et al. [1985], under some assumptions on the homogeneity and isotropy of the statistics of local singularities, it is possible to derive a relation between self-similarity exponents τ (q) and the singularity spectrum D(h). They showed that the self-similarity exponents τ (q) could be computed from the the Legendre transformation 3 of the singularity spectrum D(h) τ (q) = inf {qh + d − D(h)} (11.1.17) h where d is the dimension of the embedding space. This is to be related to the work on fractal measures by Halsey et al. [1986] and described in Section (11.1.2.1). 0 Remark 11.1.3 It correspond to Equation (11.1.3) with Holder exponent satisfying α = h, that is, before it has been minimised. Once it has been minimised we can replace h with h(q). We also see that the multifractal spectrum D(h) corresponds to the singularity spectrum f (α(q)). Using this equation, one can then relate statistics and geometry. Note, the singularity spectrum is often estimated by using indirect methods which are numerically more stable, such as the Legendre spectrum. We can invert the equation above since the Legendre spectrum correspond to the Legendre transform of the self-singularity exponents τ (q). That is, the spectrum of Holder exponents (or multifractal spectrum, or Legendre spectrum) can be obtained by the Legendre transformation of the scaling function τ (q) as DL (h) = inf {qh + d − τ (q)} q which can be computed numerically since there exists a lot of estimation procedure for the scaling function τ (q). For example, Calvet et al. [2002] reported the spectrum of multiplicative measures when the random variable V is binomial, Poisson, or Gamma. Note, this method failed to fully characterise the singularity spectrum D(h), since only the strongest singularities are amenable to this analysis. In order to determine the whole singularity spectrum D(h), Muzy et al. [1991] considered the wavelet transform (WT) and established the foundations for a thermodynamical formalism (TF) for singular signals. In that setting, the singularity spectrum D(h) is directly determined from the scaling behaviour of partition functions defined from the wavelet transform modulus maxima (WTMM) (see Section (11.2.2.1) for details). Later, under the uniform Holder regularity condition for X, Wendt [2008] showed that DL (h) with τL (q) estimated from the wavelet Leader structure functions S L (j, q) = nj 1 X q LX (j, k) nj k=1 where LX (j, k) are wavelet Leader coefficients, provided a tight upper bound to the multifractal spectrum D(h) D(h) ≤ DL (h) Remark 11.1.4 The structure function S L (j, q) is a special case of the time average of the qth power of multiresolution quantities TX (a, t) in Equation (11.1.9), where TX (a, t) has been replaced with the wavelet Leader coefficients. We will see that other representations of the quantities TX (a, t) exist, defining alternative models. 3 The Legendre transformation is a mathematical operation transforming a function of a coordinate, g(x), into a new function h(y) whose dg(x) argument is the derivative of g(x) with respect to x, i.e., y = dx . 399 Quantitative Analytics The wavelet leader multifractal formalism (WLMF) asserts that this inequality turns into an equality ∀h , D(h) = DL (h) = inf {qh + d − τ (q)} q so that the Legendre spectrum of X can be interpreted in terms of the Holder singularities of X (see Wendt [2008]). One can then compute numerically the Legendre spectrum DL (h). Hence, the scaling exponents τ (q) and the multifractal spectrum D(h) are closely related via the Legendre transform. That is, the power law behaviours together with the multifractal spectrum constitute the fundamental relations establishing the connection between scale invariance and multifractality. 11.1.3 Observing multifractality in financial data As explained in Section (11.1.2.2), when different values of H are found in different regions of the signal, then the signal is multifractal rather than monofractal. These multifractal signals can only be described in terms of an infinite set of exponents and their density distribution. The characterisation of a multifractal process or measure by a distribution of local Holder exponents underlines its heterogeneous nature with alternating calm and turbulent phases. We are going to illustrate how this phenomena was observed in the financial literature. 11.1.3.1 Applying multiscaling analysis The moment-scaling properties of financial returns have been the object of a growing physics literature confirming that multiscaling is exhibited by many financial time series. While the temporal correlations of FX rates had been analysed on the daily evolution of several FX rates (see Peters [1991-96] [1994]), Galluccio et al. [1997] studied high-frequency data covering one year. Since FX rates suffer from systematic effects mainly due to the periodicity of human activities, they considered FX rates as processes with non-stationary increments, and introduced a time transformation to eliminate these systematic effects. The main idea, proposed by Dacorogna et al. [1993], is to use volatility as an indicator of the activity in the market, and expand times when this activity is large, and shrink times in the opposite situation. Using data on FX rates obtained by the Olsen & Associates Research Institute from 1992 to 1993, they found hidden correlations in the data. In the inner time statistics, in which the signal has stationary increments, the price variations scale in time with Hurst value of 21 . However, the FX rates were found to have a far more complex nature than simple random walk, since the sign correlation function and the absolute value correlation function showed correlations in the system, and FX rates also showed multiscaling behaviour. Vandewalle et al. [1997] performed a Detrending Fluctuation Analysis (DFA) (see details in Section (10.3.2.1)) on the daily evolution of several currency exchange rates from 1980 till 1996, where data was collected at 2.30 pm Brussels time. They found that the evolution of the JPY/USD exchange rate had a power law with exponent H = 0.55 ± 0.01 holding over two decades in time. Classifying the behaviour of exchange rates, they also found that the exponent values and the range over which the power law holds varied drastically from one currency exchange rate to another, obtaining three categories, the persistent behaviour, the antipersistent behaviour, and the strictly random one. In addition, they showed in the USD/DEM currency exchange rate that the Hurst exponent was changing with time with successive persistent and antiperisistent sequences. To probe the local nature of the correlations, Vandewalle et al. [1998c] constructed an observation box of length T placed at the beginning of the data and computed its Hurst exponent. They moved the box by a few points (4 weeks) toward the right and again computed the H value. Iterating the procedure for the 1980-1996 period, they obtained a local measurement of the degree of long-range correlations over T . Looking at the evolution of the USD/DEM ratio on a window of size T = 2 years, the global exponent was H = 0.56 ± 0.01, and the mobile (local) exponent was varying between 0.4 and 0.6. Repeating the test for the evolution of the GBP/DEM ratio, Vandewalle et al. [1998c] found the global exponent to be at H = 0.55, and the local exponent was mostly above 21 which when averaged got back the global value. The multifractality of the foreign exchange rate market was reported in further studies (see Schmitt et al. [1999]). Vandewalle et al. [1998] presented the H(q) spectrum and found the USD/DEM and JPY/USD exchange rates to be multifractal. However, the statistical tools identifying multifractal behaviour have been the subject to dispute as a number of studies showed that scaling in higher moments can easily 400 Quantitative Analytics be obtained in a spurious way without any underlying anomalous diffusion behaviour (see Granger et al. [1999]). For instance, Barndorff-Nielsen et al. [2001] found apparent scaling as a consequence of fat tails in the absence of true scaling. Randomising the temporal structure of financial data, Lux [2004] obtained a non-linear shape of the empirical τ (q) function, concluding that τ (q) and f (α) estimators were rather unreliable diagnostic instruments to identify multifractal structure in volatility. Note, even though econometricians did not look at scaling functions and Holder spectrums, the indication of multifractality was mentioned in economics literature. For instance, Ding et al. [1993] found that different powers of returns have different degrees of long-term dependence, and that the intensity of long-term dependence varies non-monotonically with q, which is consistent with concavity of scaling functions and provides evidence for anomalous behaviour. 11.1.3.2 Applying multifractal fluctuation analysis Analysing the NYSE daily composite index closes from 1966 to 1998 and the USD/DM currency exchange rates from 1989 to 1998, Pasquini et al. [2000] considered the de-averaged daily return defined as rt = log St+1 St+1 − < log > St St where St is the index quote or exchange rate quote at time t. They computed the autocorrelation for returns and showed that it was a vanishing quantity for all period L. They repeated the test for powers, γ, of absolute returns and found for γ = 1 a non-vanishing quantity up to L = 150, showing dependent return. Then, they introduced the cumulative returns φt (L) defined as L−1 1 X φt (L) = rt+i L i=0 which is the profile in DFA, and given N L non overlapping variables of this type, they computed the associated variance V ar(φ(L)). Using this tool, they confirmed that returns were uncorrelated. To perform the appropriate scaling analysis, they introduced the generalised cumulative absolute returns defined as φt (L, γ) = L−1 1 X |rt+i |γ L i=0 and showed that if the autocorrelation for powers of absolute returns C(L, γ) α(γ) ≤ 1 for large L, that is C(L, γ) ∼ L−α(γ) , it implies 4 exhibits a power-law with exponent V ar(φ(L, γ)) ∼ L−α(γ) Note, anomalous scaling can not be detected if |rt |γ are short-range correlated or power-law correlated with an exponent α(γ) > 1. They found that α(γ) was not a constant function of γ, showing the presence of different anomalous scales. Hence, different values of γ select different typical fluctuation sizes, any of them being power-law correlated with a different exponent. It is important to note that a direct analysis of the autocorrelations can not provide clear evidence for multiscale power-law behaviour, since the data show a wide spread compatible with different scaling hypothesis. On the other hand, the scaling analysis introduced by Pasquini et al. proves the power-law behaviour and precisely determines the coefficients α(γ). Following a different route, Richards [2000] demonstrated that exchange rates scale as fractals, and that the determinants of exchange rate/interest rates and differential in real rates of return, have also fractal properties. Assuming scale invariance from Definition (11.1.2), he estimated τ (q) by regressing the linear Equation (11.1.14). Following Schertzer et al. [1991b], he considered the theoretical distribution of τ (q) given by 4 C(L, γ) =< |rt |γ |rt+L |γ > − < |rt |γ >< |rt+L |γ > 401 Quantitative Analytics τ (q) τ (q) C(1) (q α − q) when α 6= 1 (α − 1) = qH − C(1)q ln q when α = 1 = qH − where the standard normal is given by H = 21 , α = 2, C(1) = 0 and τ (q) = qH. In the fractal case, C(1) 6= 0 and the scaling curve is nonlinear. As C(1) increases above zero and α decreases toward 1, then τ (q) becomes progressively more curved at higher orders of scaling. The degree of curvature is a measure of the turbulence of the process. Computing the first derivative of τ (q) at the origin, he estimated α and C(1). Working on time series of 18 currencies from 1971 to 1998, the reported values for H were lying in the range [0.53, 0.63] with a majority between 0.55 and 0.59 showing persistence. The nominal differential showed H in the range [0.44, 0.45] and the real differential showed H in the range [0.34, 0.35]. Richards [2000] found a crucial difference between the stochastic fractality found in capital markets and the multifractals identified in physics. The latter exhibit strong scaling symmetries, with proportionality relationships over a wide range of time scales, but in the former, scaling symmetries are much weaker, and hold only over shorter intervals. 11.2 Holder exponent estimation methods While the monofractal structure of financial signals are defined by single power law exponent, assuming that the scale invariance is independent on time and space, spatial and temporal variation in scale invariant structure often occurs, indicating a multifractal structure of the financial signals. We are now going to describe several methods for the multifractal characterisation of nonstationary financial time series. Remark 11.2.1 In Section (11.1.2) we denoted the generalised Hurst exponent as H(q) and the local Holder exponent as h(t). In the economic and financial literature, the former is sometime denoted as h(q) and the latter as H(t). When considering an article under study, we will use its notation, and clarify the meaning when necessary. 11.2.1 Applying the multifractal formalism Since scaling analysis and multifractal analysis developed, we saw in Section (??) that various authors performed empirical analysis to identify anomalous scaling in financial data. In order to illustrate the multifractal formalism, we choose to briefly describe the method proposed by Calvet et al. [2002], who investigated the MMAR model, which predicts that the moments of returns vary as a power law of the time horizon, and confirmed this property for Deutsche mark/US dollar exchange rates and several equity series. We let P (t) be the price of a financial asset on the bounded interval [0, T ] and define the log-price process as X(t) = ln P (t) − ln P (0) Calvet et al. first assumed that X(t) was a compound process X(t) = B[θ(t)], where B(t) is a Brownian motion, and θ(t) is a stochastic trading time. Second, they extended the model to get autocorrelated returns by modifying X(t) as X(t) = BH [θ(t)], where BH (t) is a fractional Brownian motion. On a given path, the infinitesimal variation in price around t is of the form | ln P (t + dt) − ln P (t)| ∼ C(t)(dt)α(t) where α(t) is the local Holder exponent or local scale of the process at time t. Partitioning [0, T ] into integer N with intervals of length ∆t, the partition function is given by Sq (T, ∆t) = N −1 X |X(i∆t + ∆t) − X(i∆t)|q i=0 402 Quantitative Analytics When X(t) is multifractal, the increments are identically distributed, and the scaling law yields E[Sq (T, ∆t)] = N c(q)(∆t)τ (q)+1 when the qth moment exists, which implies ln E[Sq (T, ∆t)] = τ (q) ln ∆t + c∗ (q) where c∗ (q) = ln c(q) + ln T since T = N ∆t. Various methods can be used for constructing an estimator τ̂ (q) from the sample moments of the data. As discussed in Section (11.1.2.4), the Legendre transform fˆ(α) is then applied to obtain an estimate of the multifractal spectrum, which can be mapped back into a distribution of the multipliers. In general, given a set of positive moments q and time scales ∆t, the partition functions Sq (T, ∆t) are calculated from the data, which are then plotted against ∆t in logarithmic scales. The linear equation above implies that these plots are approximately linear when the qth moment exists. Regression estimates of the slopes provide the corresponding scaling exponents τ̂ (q). Working with two data sets provided by Olsen and Associates, Calvet et al. [2002] investigated the multifractality of the Deutsche mark/US dollar exchange rates. The former is made of daily data from 1973 to 1996, and the latter contains high-frequency data from 1992 to 1993 which is modified to account for seasonality. Analysing the time series for ∆t spanning 15 seconds to 6 months, and five values of q ranging from 1.75 to 2.25, they observed linearity of the partition functions starting at ∆t = 1.4 hours and extending to six months. The slope was zero for q slightly smaller than 2, and they obtained Ĥ ≈ 0.53 implying very slight persistence in the DM/USD series. Then, in view of estimating the scaling functions τ̂ (q) for both data sets, they considered a larger range of moments 1.5 ≤ q ≤ 5 for ∆t between 1.4 hours and 6 months to capture information in the tails of the distribution of returns. Increasing variability of the partition function plots with the time scale ∆t was observed. An estimate of the multifractal spectrum fˆ(α) was obtained by a Legendre transform of the moments’ growth rates, which was concave for daily data. Given the estimated spectrum, they induced a generating mechanism for the trading time based MMAR model. From the shape of the estimated spectrum, nearly quadratic, they inferred a lognormal distribution (of multipliers M ) as the primitive of the generating mechanism and estimated its parameters. Simulating the process with MMAR model, they confirmed that the multifractal model replicated the moment behaviour found in the data. Since the estimated value of the most probable local Holder exponent was greater than 12 , the estimated multifractal process was therefore more regular than a Brownian motion. But the concavity of the spectrum also implied the existence of lower Holder exponents corresponding to more irregular instants of the price process, contributing disproportionately to volatility. Repeating the analysis in a sample of five major US stocks and an equity index for daily returns from 1962 to 1998, they further demonstrated the scaling behaviour for many scaling financial series. 11.2.2 The multifractal wavelet analysis We saw in Section (11.1.2.1) that multifractal theory identifies fractal objects that can not be completely described by using a single fractal dimension (monofractal), as they have an infinite number of dimension measures associated with them. The multifractal scaling of an object is characterised by N ∝ −f (α) where N is the number of boxes of length required to cover the object, and f (α) is the dimension spectrum, which can be interpreted as the fractal dimension of the set of points with scaling index α. We also saw that an alternative multifractal description consisted in extracting the spectrum D(h) of Holder exponents h of the velocity field from the inertial scaling properties of structure functions. However, we saw in Section (11.1.2.4) that there was fundamental drawbacks to these methods characterising the singularity spectrum f (α) and D(h). Considering wavelet decomposition tools, Mallat et al. [1990], Muzy et al. [1991], and Arneodo et al. [1991] generalised the multifractal formalism to singular signals. 403 Quantitative Analytics 11.2.2.1 The wavelet transform modulus maxima The wavelet transform (WT) can be used as a mathematical microscope to analyse the local regularity of functions. In particular, we get the power law for the WT of the isolated cusp singularity in f (x0 ), for fixed position x0 (or t0 ), defined as T (a, x0 ) ∼ |a|h(x0 ) for a → 0 in the condition that the wavelet has at least n vanishing moments 5 . Thus, one can extract the exponent h(x0 ), for fixed position x0 , from a log-log plot of the WT amplitude versus the scale a. However, the exponent h(x0 ) is governed by singularities accumulating at x0 , which results in unavoidable oscillations around the expected power-law behaviour of the WT amplitude, making the exact determination of h uncertain. Since there exist fundamental limitation to the measure of Holder exponents from local scaling behaviour in a finite range of scales, the determination of the singularity spectrum D(h) required a more appropriate investigation of WT local behaviour. An alternative solution is to use the WTMM tree for defining partition function based multifractal formalism (MF). Mallat et al. [1992] showed that for isolated cusp singularities (see Equation (11.1.15)), the location of the singularity could be detected, and the related exponent could be recovered from the scaling of the wavelet transform (WT), along the maxima line, converging towards the singularity. For this particular line, the WT reaches local maximum with respect to the position coordinate. Hence, they are likely to contain all the information on the hierarchical distribution of singularities in the signal. Connecting these local maxima within the continuous wavelet framework, we obtain the entire tree of maxima lines, and restricting oneself to such a collection provides a very useful representation called the wavelet transform modulus maxima (WTMM) of the entire continuous wavelet transform (CWT) (see Mallat et al. [1992b]). This method incorporates the main characteristics of the WT, that is, the ability to reveal the hierarchy of singular features, including the scaling behaviour. As discussed in Section (11.1.2.1), we find the multifractal spectrum of a signal by partitioning it into N boxes of length . A probability density, P (, i), of the signal in each box, labelled i, is calculated where P (, i) is the fraction of the total mass of the object in each box. The qth order moments M (, q) are then calculated as M (, q) = N X P (, i)q (11.2.18) i=1 For a multifractal object, this moment function scales as M (, q) ∝ τ (q) where τ (q) is a scaling exponent. From this scaling, we saw in Section (11.1.2.1) that both α and the singularity spectrum f (α) can be calculated from α(q) = dτ (q) dq and f (α) = qα(q) − τ (q) In the wavelet based method for calculating the f (α) spectrum, one approach proposed by Muzy et al. [1991] is to let the function in Equation (11.2.18) be replaced by the wavelet based moment function, getting X M (a, q) = |T (a, wi (a))|q ∼ aτ (q) for a → 0 Ω(a) 5 It is orthogonal to polynomials up to degree n, that is, R∞ −∞ xm ψ(x)dx = 0 ∀m, 0 ≤ m < n. 404 Quantitative Analytics where Ω(a) = {wi (a)} is the set of all maxima wi (a) at the scale a, and |T (a, wi (a))| is the ith wavelet transform modulus maxima found at scale a. The function M (a, q) is a partition function of the qth moment of the measure distributed over the wavelet transform maxima at the scale a considered. By summing only over the modulus maxima, it directly incorporates the multiplicative structure of the singularity distribution into the calculation of the partition function (see Muzy et al. [1991] [1993]). Since the moment q has the ability to select a desired range of values, small for q < 0, or large for q > 0, the scaling function τ (q) globally captures the distribution of the exponent h(x). Further, since we get τ (0) = −Df , where Df is the fractal dimension, then Df can be seen as the ratio of the logarithms of the average maxima multiplicative rate and the average scale factor, respectively. Following Chhabra et al. [1989], we can use the moment function M (a, q) to directly estimate α(q) and f (α) as 1 X d log M (a, q) = lim P (a, q, wi (a)) log |T (a, wi (a))| a→0 log a a→0 dq log a α(q) = lim Ω(a) where |T (a, wi (a))|q q Ω(a) |T (a, wi (a))| P (a, q, wi (a)) = P is the weighting measure for the statistical ensemble Ω(a). Similarly, we get 1 X P (a, q, wi (a)) log P (a, q, wi (a)) a→0 log a f (α(q)) = lim Ω(a) obtaining the spectrum in a parametric form (the parameter being q) from the log-log plots of the above quantities. Comparing these results with those obtained by Chhabra et al. we see that the probability pqi (l) corresponds to |T (a, wi (a))|q and that the parametric measure in Equation (11.1.7) corresponds to P (a, q, wi (a)). One drawback of tracking the WTMM is that there may exist extra maxima in the wavelet representation not corresponding to any singularity in the signal. In general, for multifractal processes τ (q) is an increasing convex nonlinear function of q, and its Legendre transform D(h) is a well-defined unimodal curve, the support of which extends over a finite interval hmin ≤ h ≤ hmax . The maximum of this curve D(h(q = 0)) = −τ (0) gives the fractal dimension of the support of the set of singularities of f . In general, τ (1) 6= 0, indicating that the cascade of WTMM is not conservative. Other wavelet formalism exist, mainly consisting in replacing the coefficients in the moment function M (a, q) with other coefficients. The solution relies on the use of the coefficients of either a continuous wavelet transform, or a discrete wavelet transform. For instance, one formalism considered the wavelet coefficients dX (j, k) leading to the wavelet coefficient based multifractal formalism (WCMF), while another formalism used wavelet Leaders leading to the wavelet Leader multifractal formalism (WLMF) (see Wendt [2008]). Riedi et al. [1999] developed a waveletbased multifractal model for use in computer traffic network modelling, and also considered applications to finance and geophysics. 11.2.2.2 Wavelet multifractal DFA We saw in Section (10.3) that DFA and its variants are methods used for analysing the behaviour of the average fluctuations of the data at different scales after removing the local trends. Further, wavelet transforms (WT) are well adapted to evaluate typical self-similarity properties. As a result, some authors (see Murguia et al. [2009], Manimaran et al. [2009]) merged the two approaches obtaining powerful tools for quantifying the scaling properties of the fluctuations. Using the vanishing moment property of wavelets, Manimaran et al. [2005] proposed to separate the trend from the fluctuations of time series with discrete wavelet method. That is, instead of a polynomial fit, we consider the different versions of the low-pass coefficients to calculate the local trend. Again, we work with the profile X(t) given in Equation (10.3.11) and compute the multilevel wavelet decomposition of that profile. For each scale m, we subtract the local trend to data 405 Quantitative Analytics Y (t, m) = X(t) − X(t, m) where X(t, m) is the reconstructed profile after removal of successive details coefficients at each scale m. We then divide the residual series Y (t, m) into A adjacent sub-periods of length n. For each sub-period, a, we can compute the local detrended fluctuations 2 FW DF A,q (a, m) = n q 1X 2 Ym (i, a) 2 , a = 1, ..., A n i=1 which is, for q = 2, the local root-mean-square (RMS) variation of the time series. Since the detrending of the time series depends of the wavelet decomposition at the scale, m, different level DFA differ in their capability of eliminating the trends in the series. Averaging over the A sub-periods, for different q, the qth order fluctuation function becomes A FW DF A,q (n, m) = 1 1 X 2 FW DF A,q (i, m) q A i=1 where q can take any real value, except zero. The value for q = 0 is computed via a logarithmic averaging procedure A FW DF A,q (n, m) = 1 X 2 ln FW DF A,2 (i, m) A i=1 We repeat this calculation to find the fluctuation function FW DF A,q (n, m) for many different box sizes n, which should reveal a power law scaling FW DF A,q (n, m) ∼ nh(q) where h(q) is the generalised Hurst exponent. 11.2.3 The multifractal fluctuation analysis We described in Section (3.2.2.2) the most common measures of variability when summarising the data. When studying the response time distributions of financial return, we saw in Section (10.4.3) that some authors considered the mean absolute price change (∆X where X is a logarithmic price) as their main scaling parameter, while other considered the square root of the variance and the interquartile range of the distribution of ∆X. An alternative approach is to directly work with the process X and to detrend it with a polynomial, or an averaging function and measure the error with the local root mean square. 11.2.3.1 Direct and indirect procedure All multifractal analyses of a response time series follow a step-wise procedure, which was described by Ihlen [2013], where the response is first decomposed into both time and scale domains by 1. computing a scale-dependent measure µn (t0 ) in a floating trial interval [t0 − n2 , t0 + n2 ] centred at time t0 , or by 2. computing a scale-dependent measure µn (t, a) in the non-overlapping trial interval [(a − 1)n + 1, an], defined as µn (t, a) = n 1 X n [X(i, a) − X̂n (i, a)]2 i=1 where X̂n (i, a) is a scale-dependent trend. 406 21 , a = 1, ..., A (11.2.19) Quantitative Analytics The analyses directly estimating the multifractal spectrum from µn (t) use method 1, while the analyses based on qorder statistics of the measure µn (t, a) use method 2. In the former, the temporal variation in the trial dependency of a response time series can be defined by the local exponents H(t0 ) when the measure µn (t0 ) satisfies the power law µn (t0 ) ∼ lim nH(t0 ) n→0 In general, the local exponent H(t) is estimated as the linear regression slope of log-log plot of the scale-dependent measure µn (t0 ) against the scale n. In the latter, the qth order statistical moments E[µqn (t, a)] satisfy the power law A E[µqn (t, a)] 1 X q µ (t, a) ∼ nτ (q) = A a=1 n when the response time series has a multifractal structure. The qth order scaling exponent τ (q) is estimated as the linear regression slope of E[µqn (t, a)] against n in log-log coordinates. 11.2.3.2 Multifractal detrended fluctuation Kantelhardt et al. [2002] proposed the multifractal detrended fluctuation analysis (MF-DFA) as a generalisation of the detrended fluctuation analysis (DFA), with the advantage that it can be used for non-stationary multifractal data. Rather than considering deviation from a constant, or, linear trend, in the computation of the range, they considered deviation from a polynomial fit of different moment q. Similarly to the rescaled range analysis, the integrated time series X(t) is divided into sub-periods, and the polynomial fit of order l, noted Xn,l , of the profile is estimated for each sub-period. For instance, if we set l = 1 we get the linear detrending signal Y (t, a) = X(t, a) − Xn,1 (t, a) for sub-period a = 1, .., A. For each sub-period of length, n, the local detrended fluctuation becomes 2 q FDF A,q (a) = µn (t, a) = n 1 X n Y 2 (i, a) q2 , a = 1, ..., A (11.2.20) i=1 2 where µn (t, a) = FDF A,1 (a) corresponds to the scale-dependent measure with X̂n (i, a) = Xn,l (i, a). It is then averaged over the A sub-periods, for different q, to form the qth order fluctuation function FDF A,q (n) = A 1 X A q1 2 FDF (i) A,q i=1 where q can take any real value, except zero. The value of h(0), corresponding to the limit of h(q) for q → 0, is computed via a logarithmic averaging procedure 1 FDF A,0 (n) = e A PA i=1 2 ln FDF A,2 (i) We repeat this calculation to find the fluctuation function FDF A,q (n) for many different box sizes n, which then scale as FDF A,q (n) ∼ nh(q) (11.2.21) where c is a constant independent of n, and h(q) is the generalised Hurst exponent for a particular degree of polynomial. Note, the value of FDF A,q (n) increases as n increases. The Hurst exponent is estimated through ordinary least squares regression on logarithms of both sides log FDF A,q (n) ≈ log c + h(q) log n N 4 (11.2.22) Note, the authors chose to exclude large scales n > from the fitting procedure as well as small scales n < 10. This method has important characteristics when it comes to examining processes with heavy tails since H(q) ≈ 1q for 407 Quantitative Analytics q > α, and h(q) ≈ α1 for q ≤ α where α is the parameter of stable distributions. Note, for q = 2, and stationary time series, we recover the standard DFA. Also, by comparing the MFDFA results for original series with those for shuffled series, on can distinguish multifractality due to long-range correlations from multifractality due to a broad probability density function. While the MFDFA may be compared to the WTMM method, there is no need to employ 2 a continuously sliding window or to calculate the supremum over all lower scales, since the variances FDF A (n, a) will always increase when the segment size, n, is increased. Moreover, note that the MFDFA method can only determine positive generalised Hurst exponents h(q), and it is inaccurate for strongly anti-correlated signals when h(q) is close to zero. One way forward is to integrate the time series before the MFDFA procedure, by replacing the single describing the profile from original data in Equation (10.3.11) with the double summation Psummation i X̃(i) = k=1 [X(k)− < X >]. In that setting, the fluctuation function scales as F̃DF A,q (n) ∼ nh̃(q) = nh(q)+1 F̃ (n) corresponds to leading to accurate scaling behaviour for h(q) smaller than zero but larger than 1. Note DF A,q n FDF A,q (n). Since the double summation leads to quadratic trends in the profile X̃(i), another solution is to use a second order MFDFA to eliminate these trends. 11.2.3.3 Multifractal empirical mode decomposition The multifractal empirical mode decomposition (MFEMD) is similar to the multifractal detrended fluctuation, but the scale-dependent trend Xn (t, a) is now defined by the intrinsic mode function d(t, a) defined by the empirical mode decomposition of X(t) (see Huang et al. [1998]). That is, X Xn (t, a) = d(t, a) dae where dae indicates that the sum is taken over all intrinsic mode functions d(t, a) with a scale larger than a. One way 1 of defining the scale of each d(t, a) is by considering the inverse of their mean instant frequency given by a = where the frequency ft,a is computed by differentiating the phase angle of the Hilbert transform of d(t, a), that dθ is, ft,a = dtt,a , using an algorithm suggested by Boashash [1992]. This detrending procedure was proposed by Manimaran et al. [2009]. 11.2.3.4 The R/S ananysis extented Rather than locally detrending multifractal time series by computing the qth order RMS variations and then averaging over equal-sized non-overlapping segments to measure the multifractals of financial time series, Kim et al. [2004] directly considered the qth price-price correlation function Fq (τ ) =< |p(t + τ ) − p(t)|q >∝ τ qh(q) where τ is the time lag, and {p(t1 ), .., p(tN )} is a price time series of length N . Building a time series of return {r1 (τ ), .., rN (τ )} where ri (τ ) = ln p(ti + τ ) − ln p(ti ), and dividing the series into A subseries of length n, they computed the rescaled range analysis with (R/S)n (τ ) ∝ nh(τ ) to study the tick behaviour of the yen-dollar exchange rate. Results for data ranging from January 1971 to June 2003 showed H(τ = 1) = 0.6513 which is significantly different from H = 21 . Once the process has been located in the persistence region, they studied the log-log plot F (τ ) of qq , q = 1, .., 6, against τ which is equivalent to plotting RMS against the scale. They could observe that the generalised Hurst exponent h(q) was a function of q converging as τ got larger. They also computed the probability distribution of returns and showed that the series was consistent with a Lorentz distribution, concluding that the yendollar exchange rate was multifractals. 408 Quantitative Analytics 11.2.3.5 Multifractal detrending moving average Gu et al. [2010] extended the DMA method to multifractal detrending moving average (MFDMA) in order to analyse multifractal time series and multifractal surfaces. The algorithm for the one-dimensional MFDMA is similar to that of the DMA, where the moving average accounts for backward average (θ = 0), centred average θ = 12 , and forward average θ = 1 X λ (t) = 1 λ d(λ−1)(1−θ)e X X(t − k) k=−b(λ−1)θc where bxc is the largest integer not greater than x, dxe is the smallest integer not smaller than x, and θ is the position parameter with values ranging in [0, 1]. The moving average considers d(λ − 1)(1 − θ)e data points in the past and b(λ − 1)θc points in the future. We then compute the detrended signal (residual series) Y (t) = X(t) − X λ (t) where λ − b(λ − 1)θc ≤ t ≤ T − b(λ − 1)θc. The residual series Y (t) is divided into A disjoint segments with the same size, n, where A = b N n − 1c. Each segment is denoted by Y (t, a) = Y ((a − 1)n + t) , t = 1, .., n The qth function FDM A,q (a) with segment size n is given by 2 FDM A,q (a) = n 1 X n Y 2 (i, a) q2 , a = 1, .., A i=1 and the qth order overall fluctuation function satisfies FDM A,q (n) = A 1 X A q1 2 FDM (i) A,q i=1 where q can take any real value, except zero. Varying the values of segment size n, we define the power-law relation between the function FDM A,q (n) and the size scale n FDM A,q (n) ∼ nh(q) (11.2.23) Note, the window size λ used to determine the moving average function must be identical to the partitioning segment size, otherwise FDM A,q (n) does not show power-law dependence on the scale n. We can then compute the multifractal exponent τ (q) given in Equation (11.1.17), and the singularity spectrum f (α). Gu et al. concluded that the backward MFDMA with the parameter θ = 0 exhibits the best performance when compared with centred and forward MFDMA. They also showed that it was better than the MFDFA because it gave better power-law scaling in the fluctuations and more accurate estimates of the multifractal scaling exponents and singularity spectrum. 11.2.3.6 Some comments about using MFDFA Ihlen [2012] presented a step-by-step tutorial of MFDFA in an interactive Matlab session. In order to guide users when applying MFDFA to financial time series, we follow the best practice proposed by Ihlen. We saw in Section (10.3.2.1) that the DFA identifies the monofractal structure of a time series as the power law relation between the overall RMS computed for multiple scales. The slope, H, of the regression line defines a continuum between a noise like time series and a random walk like time series. The Hurst exponent will take values in the interval between 0 and 1 in the former, and it will take values above 1 in the latter. The pink noise H = 1 separates between the noises H < 1 having more apparent fast evolving fluctuations, and random walks H > 1 having more apparent slow evolving 409 Quantitative Analytics fluctuations. Monofractal and multifractal have a long-range dependent structure with Hurst exponent between 0.7 and 0.8. Differentiating between random walk and noise like time series, Eke et al. [2002] proposed to run a monofractal DFA before running MFDFA as it should be performed on a noise like time series. If the series have Hurst exponent between 0.2 and 0.8, it is a noise like series and can be directly employed without transformation, otherwise if the time series are random walk, it can either be differentiated first, or the conversion to a random walk can be eliminated. Errors in the estimation of the generalised Hurst exponent h(q) occur when the RMS is close to zero because log FDF A,q (n) for negative q’s become infinitely small. Extreme large h(q) will be present for negative q’s as output, so that local RMS close to zero will lead to large right tails for the multifractal spectrum. One reason is that the polynomial trend fit Xn,l of the time series can be overfitted in segments with small sample sizes (small scale). This overfitted trend will be close, or similar, to the time series causing the residual fluctuations in Equation (10.3.12) to be close to zero. The sample size of the smallest segment should therefore be much larger than the polynomial order l to prevent from an overfitted trend. Another reason, is that the time series might be smooth with little apparent variation, hence, similar to the polynomial trend even for low order l. In that case, the value of the smallest scales should be raised, and the scale invariance checked carefully. This problem of segments with RMS close to zero can be solved by eliminating RMS below a certain threshold . The scale invariance of a time series can be detected when the log-log plot of FDF A,q (n) versus n yield a linear relationship for a given q. If the relationship is curved or S-shaped the qth order Hurst exponent h(q) should not be estimated by a linear regression. One reason for non-linear relation in the log-log plot is an insufficient order l for the polynomial detrending. One solution is to run MFDFA with different l and compare their log-log plot. Another reason is that local fluctuations RMS close to zero for small scales can yield a non-linear dip in the lower end of the log-log plot. This dip can be prevented by elimination of RMS below the threshold . Further, a non-linear relationship might originate from phenomenon recorded in the time series causing scale invariance to break down at the smallest scales. F (n) , One way to detect sub-regions with scale invariance is to look for periods with approximately constant DF A,q n F (n) q = 1, .., in a log-log plot against the sample size n within the entire scaling range. The scales where log DF A,q n are no-longer constant indicates the segment sizes above and below which the local fluctuations (RMS) are no-longer scale invariant. Defining the optimal length T of a time series being investigated, as well as the minimum scale nmin and its maximum value nmax , is still an open problem. Grech et al. [2004] proposed to use the scale range 5 < n < T 5 , and applied DFA procedure on several segments of the time series. They chose 500 segments, and looked at 140 < T < 300 to define the optimal T on the basis of minimum standard deviation of estimated H exponents, and [H] . Alternatively, Einstein et al. [2001] proposed to use nmin = 4 minimum measure of statistical uncertainty σ̂ETT(H) T and nmax = 4 , Weron [2002] proposed to use nmin = 10 for short time series of 256 or 512 observations and nmin = 50 for longer series, and Matos et al. [2008] and Kantelhardt proposed to use nmax = T4 and suggested to be cautious for small ranges as they can significantly overestimate the resulting Hurst exponent. Even though one usually choose the minimum segment sample size to be nmin ≈ 10, it might be too small for large trend order l. On the other hand, the maximum segment size nmax should be small enough to provide a sufficient number of segments 1 in the computation of FDF A,q (n). For instance, a maximum segment size below 10 of the size N of the time series will provide at least 10 segments in the computation of FDF A,q (n). The parameter q, deciding the qth order weighting of the local fluctuation RM S, should consist of both positive and negative values in order to weight the periods with large and small variation in the time series. Since the choice of the qth order should avoid large negative and positive values because they inflict larger numerical errors in the tails of the multifractal spectrum, a sufficient choice would be for q to range between −5 and 5. Further, as the local fluctuation RMS is computed around a polynomial trend whose shape is defined by the order l, a higher order l yield a more complex shape of the trend, but it might lead to overfitting for time series within small segment sizes. Thus, l = 1 − 3 are a sufficient choice when the smallest segment sizes contains 10 − 20 samples. 410 Quantitative Analytics Note, the MFDFA can be extended to include more adaptive detrending procedure like wavelet decomposition (see Manimaran et al. [2009]), moving average, and empirical mode decomposition. An adaptive fractal analysis is shown to perform better than DFA with polynomial detrending when employed to biomedical time series with strong trends (see Gao et al. [2011]). At last, statistical parameters other than RMS can be used to define the local fluctuation in a time series. For instance, in multifractal analyses based on wavelet transformations, the local fluctuation is defined as the convolution product between the time series and a waveform fitted within local segments of the time series. One can then compare MFDFA with wavelet transformation modulus maxima (WTMM), multifractal analysis with wavelet leaders (see Jaffard et al. [2006]), and gradient modulus wavelet projection. Further, in an entropy-based estimation of the multifractal spectrum, the local fluctuation is defined as the sum of the time series within the local segment relative to the total sum of the entire time series. It uses a qth order entropy function instead of a qth order RMS, and directly estimates α(q) and f (α) as the regression slope of the qth order entropy functions (see Chhabra et al. [1989]). 11.2.4 General comments on multifractal analysis 11.2.4.1 Characteristics of the generalised Hurst exponent Even though monofractal and multifractal time series have similar RMS and slopes, H, they have different structures. The generalised Hurst exponent, h(q), is a decreasing function of q for multifractal time series, and a constant for monofractal processes. For monofractal time series with compact support, h(q), is independent of q. Only if small and large fluctuations scale differently, will there be a significant dependence of h(q) on q. For positive (negative) values of q, the exponent h(q) describes the scaling behaviour of segments with large (small) fluctuations. Usually, the large fluctuations are characterised by a smaller scaling exponent h(q) for multifractal series than the small fluctuations. More precisely, multifractal time series have local fluctuations with both extreme small and extreme large magnitudes which are absent in the monofractal time series, resulting in a normal distribution for the monofractal time series (variations are characterised by the first two moments). On the other hand, in the multifractal time series, the behaviour of the local fluctuations is such that the qth order statistical moments must be considered. This is why we introduced the qth order fluctuation in the MFDFA above, where the qth order weights the influence of segments with large and 2 small fluctuations. The local fluctuations FDF A,q (a) with large and small magnitudes is graded by the magnitude of the negative or positive q-order, respectively. The midpoint q = 0 is neutral to the influence of segments with small 2 and large FDF A,q (a). Note, the difference between the qth order RMS for positive and negative q’s are more visually apparent at the small segment sizes than at the large ones because the small segments can distinguish between the local periods with large and small fluctuations as they are embedded within these periods. On the other hand, the large segments cross several local periods with both small and large fluctuations averaging out their differences in magnitude. Hence, for the largest segment sizes, the qth order RMS of the multifractal time series converges to that of the monofractal series. As a result, the function h(q) is decreasing with respect to the q’s, indicating that the segments with small fluctuations have a random walk like structure whereas segments with large fluctuations have a noise like structure. 11.2.4.2 Characteristics of the multifractal spectrum Definition We saw in Section (11.1.2.1) that multifractal series are also described by the singularity spectrum f (α) through the Legendre transform (see Peitgen et al. [1992]) α(q) = dτ (q) , f (α) = arg min (qα − τ (q)) q dq where f (α) denotes the fractal dimension of the series subset characterised by the singularity strength, or Holder exponent, α. The Holder exponent quantifies the local scaling properties (local divergence) of the process at a given point in time, that is, it measures the local regularity of the price process. The spectrum f (α) describes the distribution of the Holder exponents. For monofractal signals, the singularity spectrum produces a single point in the f (α) plane, 411 Quantitative Analytics whereas multifractal processes yield a humped function (see Figure 11.1). From the definition of the generalised Hurst exponent in Equation (11.1.12), we can directly relate the singularity α and spectrum f (α) to h(q) by replacing its value in the above equation α(q) = h(q) + q dh(q) and f (α) = q[α(q) − h(q)] + 1 dq Following Schumann et al. [2011], the multifractality degree (or strength of multifractality) in finite limit [−q, +q] can be described by ∆hq = h(−q) − h(+q) (11.2.24) Since large fluctuations in the response time series are characterised by smaller scaling exponent h(q) than small fluctuations, then h(−q) are larger than h(+q), so that ∆hq is positively defined. Another quantifier for the multifractality degree (or width) for the same limit is ∆α = α|q=−q − α|q=+q (11.2.25) We let α0 be the position of the maximum spectrum f (α) and define the skew parameter as r= α|q=+q − α0 α0 − α|q=−q with r = 1 for symmetric shapes, r > 1 for right-skewed shapes, and r < 1 for left-skewed shapes. The width of the spectrum ∆α measures the degree of multifractality in the series (the wider the range of fractal exponents, the richer the structure of the series). The skew parameter r determines the dominant fractal exponents, that is, fractal exponents describing the scaling of small fluctuations for right-skewed spectrum, or fractal exponents describing the scaling of large fluctuations for left-skewed spectrum. These parameters allow to measure the complexity of a series. A signal having a high value of α0 , a wide range ∆α of fractal exponents, and a right-skewed shape r > 1 may be considered more complex than one with opposite characteristics (see Shimizu et al. [2002]). The parameters (α0 , ∆α, r) are called the measures of complexity of a series. Interpretation We saw in Section (11.2.4.3) that h(q) is only one of several types of scaling exponents used to parametrise the multifractal structure of time series. The plot of the singularity strength (exponent) α(q) versus the singularity spectrum f (α) is referred to as the multifractal spectrum. The multifractal time series has multifractal exponent τ (q) with a curved q-dependency, and a decreasing singularity exponent α(q). That is, the resulting multifractal spectrum is a large arc where the difference between the maximum and minimum α(q) are called the multifractal spectrum width (or degree) given in Equation (11.2.25). The Hurst exponent defined by the monofractal DFA represents the average fractal structure of the time series and is closely related to the central tendency of multifractal spectrum. The deviation from average fractal structure for segments with large and small fluctuations is represented by the multifractal spectrum width. Thus, each average fractal structure in the continuum of Hurst exponents has a new continuum of multifractal spectrum widths representing the deviations from the average fractal structure. Moreover, the shape of the multifractal spectrum does not have to be symmetric, it can have either a left or a right truncation originating from a levelling of the q-order Hurst exponent for positive or negative q’s, respectively. The spectrum will have a long left tail when the time series have a multifractal structure being insensitive to the local fluctuations with small magnitudes, but it will have long right tail when the structure is insensitive to the local fluctuations with large magnitudes. Consequently, the width and shape of the multifractal spectrum can classify a wide range of different scale invariant structures of time series. 11.2.4.3 Some issues regarding terminology and definition We discussed in Section (11.1.2.1) the singularity spectrum f (α) associated with the singularity strength α, and we showed how they were derived and how to estimate them. We also discussed in Section (11.1.2.2) how to extract the 412 1.0 Quantitative Analytics 0.2 0.4 f(alpha) 0.6 0.8 ● 0.0 Monofractal H=0.30 Monofractal H=0.75 Multifractal ● 0.2 0.4 0.6 0.8 1.0 1.2 1.4 alpha Figure 11.1: Multifractal spectrum (α(q), f (α)). The multifractral spectrum is the log-transformation of the normalised probability distribution of local Hurst exponents. Therefore, when the width of the spectrum is wide (red), the series is multifractal. On the contrary, when the width of the spectrum is small (black and blue), the series is monofractal. In this case, the peak is reached on the Hurst exponent. spectrum D(h) of Holder exponents h. The concepts and terminologies from econophysics have some time been mixed up in finance, leading to confusion or incomplete statements. We present some of the issues regarding terminology and definition used in recent financial articles on detrending fluctuation analysis. First of all, depending on the way multifractality is defined, the interpretation of the exponents in the fluctuation analysis differs. For instance, when considering the multifractal model of asset returns (MMAR), since the multipliers defined at different stages of the cascade are independent, Calvet et al. [2002] inferred E[µ(∆t)q ] = (∆t)τ (q)+1 where τ (q) = − ln E[M q ] − 1 and by extension to stochastic processes defined multifractality as Definition 11.2.1 A stochastic process {X(t)} is called multifractal if it has stationary increments and satisfies E[|X(t)|q ] = c(q)tτ (q)+1 for all t ∈ F , q ∈ Q where τ (q) and c(q) are functions with domain Q. Denoting by H the self-affinity index, the invariance condition X(t) = tH X(1) implies that E[|X(t)|q ] = tqH E[|X(1)|q ] so that c(q) = E[|X(1)|q ] and as a result τ (q) = qH − 1. In this special case, the scaling function τ (q) is linear and fully determined by its index H. In the more general case, τ (q) is a nonlinear function of q. That is, τ (q) is a linear function for monofractal signals, and a nonlinear one for 413 Quantitative Analytics multifractal signals (see Figure 11.2). Note, this definition of multifractality is slightly different from the one given in Equation (11.1.11), where τ (q) = qH(q), leading to a modified exponent τ (q). 3 ● 2 ● 1 ●● ● ●●●● ●● ●● ● ●● ●● ●● ● ●● ● ● ●● ● ● ● ●● ● ● ●● ● ● ●● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● ● −2 ● ●● −3 ● ● ●● ● ● ● ● ●●● ●● ● ● ● ● ● 0 −1 tau ● ● −4 ● ● ● ● ● ● ● ● ● ● ● ● ● ●● ●● ●● ●● ●● ●● ●● ● ● ● ● ●● ●● ●● ●● ●● ● ●● ● ● ● ● ● ●●● ● ●● −2 ● ● ● 0 Monofractal H=0.30 Monofractal H=0.75 Multifractal 2 4 ● ● q ● ● ● Figure 11.2: Multifractal scaling exponent τ (q). The multifractal scaling exponent is nonlinear when the time series exhibit a multifractal structure. For example, applying Definition (11.2.1) in finance, Kantelhardt et al. [2002] showed that if we consider only stationary, normalised and positive series 6 defining a measure with compact support, it is possible to omit the detrending procedure in the MFDFA. In that setting, similarly to Barabasi et al. [1991], they showed that the multifractal scaling exponent h(q) was related to the classical multifractal exponent τ (q) defined by the standard partition multifractal formalism. To prove their statement, they considered the relation Ns 1 1 X |X(ks) − X((k − 1)s)|q q ∼ sh(q) Ns k=1 and assuming that the length N of the series is an integer multiple of the scale s, that is, Ns = becomes N s , the above equation N s X |X(ks) − X((k − 1)s)|q ∼ sqh(q)−1 k=1 Further, since the term X(ks) − X((k − 1)s) is identical to the sum of the numbers xk within each segment k of size s, then, it is known as the box probability ps (k) in standard multifractal formalism for normalised series (see Section (11.1.2.1)). The scaling exponent τ (q) being defined via the partition function Zq (s) as 6 xk ≥ 0 and PN k=1 xk = 1. 414 Quantitative Analytics N Zq (s) = s X |ps (k)|q ∼ sτ (q) k=1 where τ (q) is the scaling function related to the multifractal spectrum via the Legendre transform. Relating the two equations they found the relation between the two sets of multifractal scaling exponents to be τ (q) = qh(q) − 1 which correspond to Equation (11.1.17). 11.3 The need for time and scale dependent Hurst exponent 11.3.1 Computing the Hurst exponent on a sliding window 11.3.1.1 Introducing time-dependent Hurst exponent Even though the Hurst exponent can only be estimated together with a confidence interval, the stability of the Hurst exponent is related to the fact that a process is self-similar only when the coefficient H is well defined. Examining the stability of H on financial time series on the basis of characteristic values, such as rescaled ranges or fluctuations analysis, some authors (see Vandewalle et al. [1998c], Costa et al. [2003], Cajueiro et al. [2004], Grech [2005]) observed that the values of H could be significantly higher or lower for a specific scale. For example, using the DFA method, Costa et al. [2003] analysed the behaviour of the Sao Paulo stock exchange Ibovespa index covering over 30 years of data from 1968 till 2001, amounting to 8, 209 trading days. For the complete time series they obtained H = 0.6, indicating persistence in the Ibovespa index. They also computed the local Hurst exponent with a three year sliding window, and found that H(t) varied considerably over time. They found that the local exponent was always greater than 21 before 1990, and then rapidly dropped towards 12 and stayed there afterwards. They interpreted this phenomena as a consequence of the economic plan adopted in March 1990, corresponding to structural reforms in the Brazilian economy. Separate analysis of the two periods gave H = 0.63 for the former and H ≈ 21 for the latter, indicating multifractality of the process. Several authors proposed to use methods of long-range analysis such as DFA or DMA to determine the local correlation degree of the series by calculating the local scaling exponent over partially overlapping subsets of the analysed series (see Vandewalle et al. [1998c], Costa et al. [2003], Cajueiro et al. [2004], Carbone et al. [2004], Matos et al. [2008]). The proposed technique examines the local Hurst exponent H(t) around a given instant of time. The ability of DFA and DMA algorithm to perform such analysis relies on the local scaling properties of the scaledependent measure given in Equation (11.2.19). Following this method, we can calculate the exponent, H(t), without any a priori assumption on the stochastic process and on the probability distribution function of the random variables entering the process. As a result, one can deduce trading strategies from these instabilities of the Hurst exponent H, such as optimal investment horizon (see Lo [1991]). However, the existence of such optimal investment horizons contradicts both EMH and FMH. In the former, it implies potential predictability of the market, while in the latter it implies that self-similar structure of the market breaks down, turning the market into a spiral. Consequently, these authors introduced time-dependent Hurst exponent for which the examination of different scales solely is not possible. In that setting, we can focus on significant changes in values of Hurst exponent as such changes imply significant shift of rescaled ranges or fluctuations at either low or high scales. 11.3.1.2 Describing the sliding window Again, we consider the integrated returns X(t) of a time series of length T which we divide into, A, adjacent subperiods of length, n, such that An = T . However, rather than computing the Hurst exponent on the whole series, we 415 Quantitative Analytics introduce a sliding window Ws of size Ns , moving along the series with step, δs , and compute the scaling exponent on each window obtaining a sequence of Hurst exponent. That is, the window is rolled δs points forward, eliminating the first δs observations and including the next ones, and the Hurst exponent is re-estimated. In the trivial case of a unique window coinciding with the entire series, the size of the sequence is 1. On the other hand, in the case of a sliding window moving point-by-point along the series, δsmin = 1, then the size of the sequence is T − Ns . To determine a local Hurst exponent H at a particular time t, one has to consider a time interval around t that is considerably smaller than the total time spanned by the data, but still sufficiently large to contain enough points for a meaningful statistics. Starting at the beginning of the time series, one compute the exponent H considering only data points within Ns from the initial point, and then we roll the window, obtaining the curve for H(t) where t denotes the origin of each window. Alternatively, we can shift the time t so that it denotes the mid-point of each window, that is, (t − N2s , t + N2s ). While the question of finding the correct window’s size in which to estimate the Hurst exponent is an open problem, there is a tradeoff between the minimum necessary number of points to get proper statistics and the maximum number of points to obtain constant, or almost constant, Hurst exponent. One way forward is for the size of the sliding window to reflect some cycles (economical or political) in the country under study. Another way is to let the minimum size Nsmin of each window be defined by the condition that the scaling law in Equation (11.2.21) holds in each window (typically Nsmin ∼ 2000 − 3000). The maximum resolution of the technique is achieved with Nsmin and δsmin . Hence, rather than operating on the global properties of the series by Legendre or Fourier transform of qth order moment (power spectrum analysis), this technique allows for the examination of the local scaling exponent H(t) around a given instant of time. The main reason why the rolling window approach is favoured to attain the local Hurst exponent is that the Hurst exponent obtained from the whole series does not necessarily imply the presence or absence of long-range correlations, since the exponent obtained could be due to the averaging of those negative and positive correlations. Further, the rolling window approach can also disclose the dynamics of market efficiency. The choice of the length of the rolling sample varies for different purposes. Some authors used window length of 1, 008 business days, or around 4 years of data, to analyse the evolution of market efficiency, while others (see Wang et al. [2011]) used shorter window length of 250 business days, or around 1 year of data, in their researches. While the former is more stable, it is believed that the Hurst exponent can lose its locality if the length of the rolling window is too large (see Grech et al. [2004]). However, for too small periods, the fluctuations in the values of H are too large to be trusted. Costa et al. [2003] found that a 3-year period (736 trading days) was an acceptable compromise between the two opposing demands. 11.3.1.3 Understanding the time-dependent Hurst exponent In order to understand the time dependence of the Ibovespa Hurst exponent, Costa et al. [2003] considered a theoretical framework based on the multifractal Brownian motion (MFBM) characterised by the Hurst function H(t) = 0.63 − 0.076 arctan(30t − 24) This example was chosen to mimic the generic trend seen in the Ibovespa where H(t) could be viewed as having (on average) two distinct plateaus, one before 1990 and the other one after. Simulating N = 213 data points from the (bi-fractal) MFBM path, and assuming that the DFA fluctuation function FDF A (n) exhibits an approximate scaling regime given by FDF A (n) ∼ nH , they found H = 0.6, up to about n = 160. Hence, they interpreted the scaling exponent H as a kind of average Hurst exponent for the MFBM time series. While the region of small H was only about 20% of the total time series, it had nonetheless a significant weight on the exponent H, since its value was a lot smaller than the one obtained by simply averaging the curve H(t) (Havg = 0.68). Therefore, regions of large fluctuations (smaller H) tend to dominate the behaviour of FDF A (n) for small to intermediate values of n (see Hu et al. [2001]). Hence, the Hurst exponent obtained by applying fluctuation analyses (DFA, DMA etc.) to financial time series may only capture average behaviour over the time period spanned by the data. It was clearly illustrated by their study on the Ibovespa index where H = 0.6 on the complete time series (spanning over 30 years of data), whereas during that period H(t) was ranging within [0.76, 0.42]. As a result, when dealing with long financial time series, a 416 Quantitative Analytics more localised (in time) analysis is necessary to determine a possible dependence of H on time. In particular, a global Hurst exponent equal to 12 does not necessarily imply absence of correlation, as there could be positive and negative correlations at different periods of time averaging out to yield an effective H = 12 . 11.3.1.4 Time and scale Hurst exponent We saw above that one way of generalising the global behaviour of the Hurst exponent was to estimate the local Hurst exponent H(t) for fixed size widows, Ns , in view of studying its time dependency. Exploring the dichotomy between emerging and mature markets, Matos et al. [2008] considered the local Hurst exponent H(t, Ns ) as a function of both time t and scale Ns . To do so, they applied DFA on the interval (t − N2s , t + N2s ) in order to recover a power of the scale inside each sub-interval. The technique called time and scale Hurst exponent (TSH) is performed with maximum scale Nsmax = T4 . In that framework H(t, Ns ) is the focus of the analysis, and the DFA or DMA are implementation details. Its goal is to provide a map of the evolution of markets to maturity, including significant episodes (major events affecting markets), but also gradual changes in response times. Considering daily data for a set of worldwide market indices from America, Asia, Africa, Europe and Oceania, they observed several notable features • They can distinguish mature markets by the stability of H values around 12 , and emergent markets by the stability of H values above 12 . • For some periods, a phase transition occurs, sometimes observable across all scales, sometimes across partial scales only. This is reflected by spikes occurring for both lower and larger scales. • They expected smooth variations of H for large scales since it takes more data into account leading to greater robustness to sudden changes of the data. It was confirmed empirically. • Some markets evolve in time, where they observed a shift from emergent to mature features. The other markets slowly decreased in the values of the Hurst exponent. • Significant events, causing marked change in the Hurst exponent behaviour was seen in almost all markets. We see that studying the Hurst behaviour for multiple time and scale intervals gives more refined details on the time series. Matos et al. proposed a refined classification of financial markets in three states • mature markets: they have H around 12 . The presence of regions with higher values of H is limited to small periods and well defined both in time and scale. • emergent markets: they have H well above 12 . The presence of regions with values of H around defined both in time and in scale. 1 2 is well • hybrid markets: unlike the two other cases, the distinction between the mature and emergent phases is not well determined, with behaviour seemingly mixing at all scales. 11.3.2 Testing the markets for multifractality 11.3.2.1 A summary on temporal correlation in financial data We saw that long-range dependence (LRD) is defined by hyperbolically declining autocorrelations either for a process itself or some functions of it. This property was analysed in the context of fractional integration of Brownian motion (fBm) by Mandelbrot [1967] and Mandelbrot et al. [1968]. Using R/S analysis in the context of asset returns, they suggested H-values of around 0.55 to be representative for stock returns. In contrast, using his modified R/S statistics, Lo [1991] did not find evidence of long-range dependence in the Research in Security Prices (CRSP) data, and attributed the previous findings to the failure of R/S analysis in presence of short-range dependence. Based on the work of Lo [1991], various authors generally believed that there was little evidence of fractional integration in 417 Quantitative Analytics stocks and FX returns. Since then, LRD has been well documented in squared and absolute returns for many financial data sets, but not in raw returns (see Muller et al. [1990], Ding et al. [1993], Dacorogna et al. [1993]). Many continuous multifractal models, such as the multifractal model of asset returns (MMAR), have been proposed to capture the thick tails and long-memory volatility persistence exhibited in the financial time series. Such models are consistent with economic equilibrium, implying uncorrelated returns and semimartingale prices, thus precluding arbitrage in a standard two-asset economy. Returns have a finite variance, and their highest finite moment can take any value greater than 2. However, the distribution does not need to converge to a Gaussian distribution at low frequencies and never converges to a Gaussian at high frequencies, thus capturing the distributional nonlinearities observed in financial series. These multifractal models have long memory in the absolute value of returns, but the returns themselves have a white spectrum. That is, there is long memory in volatility, but absence of correlation in returns. Eveven though it has been assumed little evidence of fractional integration in stock returns (see Lo [1991]), long memory has been identified in the first differences of many economic series. For instance, Maheswaran et al. [1993] suggested potential applications in finance for processes lying outside the class of semimartingales. Later, using the same CRSP data, Willinger et al. [1999] showed that Lo’s acceptance of the hypothesis for the CRSP data was strongly biased, and found empirical evidence of long-range dependence in stock price returns. As a result, some authors modelled financial series directly with the fBm or the discrete-time ARFIMA specification. Accounting for autocorrelation in returns together with multifractality in volatility, Calvet et al. [2002] proposed the fractional Brownian motion of multifractal time. Most of the studies made on LRD were performed in the time or frequency domain by neglecting any bias or trend in the signal, even though the statistical methods used were designed for processes with stationary time increments. However, stock returns and FX rates suffer from systematic effects mainly due to the periodicity of human activities, and can not be considered as processes with stationary increments. Clegg [2006] showed that LRD was a very difficult property to measure in real life because the data must be measured at high lags/low frequencies where fewer readings are available, and all estimators are vulnerable to trends in the data, periodicity and other sources of corruption. A better approach for analysing the characteristics of financial markets is to consider the detrended fluctuation analysis (DFA) introduced by Peng et al. [1994] to investigate long-range power-law correlations along DNA sequences. In this method, one filters the series not only from a constant trend, but also from higher order polynomials. Constructing an integrated series and estimating the local detrended fluctuation function for a particular sub-period computed with a standard linear least-square fit, they averaged the functions over all sub-periods to get the overall fluctuation. The main advantage of working with fluctuations around the trend rather than a range of signals is that we can analyse non-stationary time series. Analysing the daily evolution of several currency exchange rates with the help of DFA, Vandewalle et al. [1997] found long-range power-law correlations in the data, and they also found that the exponent values and the range over which the power law holds varied drastically from one currency to the next. To probe the local nature of the correlations, they build a sliding window of length T which they moved along the historical data and reported a local exponent varying between 0.4 and 0.6 for some currencies. Similarly, analysing daily returns of the NYSE from 1966 to 1998 by using fluctuation analysis of the generalised cumulative absolute return, Pasquini et al. [2000] found that volatility exhibited power-laws on long time scales with a non-unique exponent. The scaling analysis they introduced proves the power-law behaviour and precisely determines the different coefficients. This is not the case for a direct analysis of the autocorrelations, since the data would show a wide spread compatible with different scaling hypothesis. 11.3.2.2 Applying sliding windows We saw in Section (??) that the moment-scaling properties of financial returns were the object of a growing physics literature (see Galluccio et al. [1997], Vandewalle et al. [1998b], Pasquini et al. [2000]), confirming multiscaling in 418 Quantitative Analytics financial time series. Kantelhardt et al. [2002] proposed the multifractal detrended fluctuation analysis (MF-DFA) as a generalisation of the detrended fluctuation analysis (DFA), with the advantage that it can be used for non-stationary multifractal data. Later, measuring multifractality with either DFA, DMA, or wavelet analysis, and computing the local Hurst exponent on sliding windows, a large number of studies confirmed multifractality in stock market indices, commodities and FX markets, such as Matia et al. [2003], Kim et al. [2004], Matos et al. [2004], Norouzzadeh et al. [2005]. Further studies confirmed multifractality in stock market indices such as Zunino et al. [2007] [2008], Yuan et al. [2009], Wang et al. [2009], Barunik et al. [2012], Lye et al. [2012], Kristoufek et al. [2013], Niere [2013], to name but a few. Other studies confirmed multifractality on exchange rates such as Norouzzadeh et al. [2006], Wang et al. [2011b] Barunik et al. [2012], Oh et al. [2012], while some confirmed multifractality on interest rates such as Cajueiro et al. [2007], Lye et al. [2012], as well as on commodity such as Matia et al. [2003], Wang et al. [2011]. Carbone et al. [2004] first tested the feasibility and the accuracy of the dynamic detrending technique (DMA) on artificial series behaving as fBm with assigned Hurst exponent, and then they applied the technique to the log-return of German financial series, the DAX and the BOBL (tick by tick sampled every minute). They chose T = 220 for the artificial series with H = 12 , a sliding window with size Ns = 5, 000 which is rolled δs = 100 points, and they let λ varies from 10 to 1, 000 with step 2. The artificial series was characterised by a local variability of the correlation exponent weaker than those of the BOBL and DAX series. Considering the small fluctuations exhibited by the local scaling exponent H(t) of the artificial series as the limits of accuracy of the method, the results showed evidence that the financial returns are a more complex dynamical system with higher standard deviation than the artificial series for about the same mean of Hurst exponent (H ≈ 12 ). To properly characterise the efficiency of the Latin-American market indices, Zunino et al. [2007] considered two independent ranks, the Hurst and Tsallis parameters. The former was used as a measure of long-range dependence, while the latter was used to measure deviations from the Gaussian hypothesis. The dynamics of the Hurst exponent was obtained via a wavelet rolling sample approach (sliding window). While a small window around a particular time t must be considered, it must also be sufficiently large to contain enough points for a significant statistics. The authors chose a sliding window of size Ns = 1, 024 (about 4 years) rolled δs = 16 points to avoid redundant information. Further, to rank the different countries under study, they build the following measure of inefficiency MInef f = |Ĥ − 21 | σĤ expressed as the distance of the estimated Hurst exponents from the critical value 12 and normalised with the standard deviation. Thus, it can be used to asses whether returns or volatility returns possess LRD. If the score is larger than 2, they confirm the hypothesis of long-range dependence with a 95% confidence interval. They applied this measure to sliding windows on data ranging from January 1995 to February 2007 with about 3, 169 observations per country, and considered the percentage of significant windows as a meaningful indicator for assessing the relative inefficiency of stock markets. They concluded that long memory was categorically present in the volatility measures, but that there was little evidence of it in the returns. Nonetheless, considering the series as a whole, there is stronger long-range dependence in returns for emerging markets than for developed ones. Further, the US return was shown to have a clear antipersistent behaviour. To conclude, the efficiency of stock markets evolve in time, where periods of inefficiency alternate with periods of efficiency. Zunino et al. [2008] used MFDFA to analyse the multifractality degree of a collection of developed and emerging stock market indices. Collecting daily returns from Bloomberg database for 32 different countries starting in 1995 and ending in 2007, the average multifractality degree ∆h for developed markets were 0.336 ± 0.059 (q ∈ [−20, 20]) and 0.257 ± 0.054 (q ∈ [−10, 10]), while they were 0.459 ± 0.137 (q ∈ [−20, 20]) and 0.373 ± 0.131 (q ∈ [−10, 10]) for emerging markets. Further, the width of the multifractal spectrum of the original time series was shown to be a monotonically increasing function of the correlation exponent of the magnitude (volatility) time series. These results provide evidence that the multifractality degree for a broad range of stock markets isassociated with the stage of their development. 419 Quantitative Analytics Using MFDFA method on the Shanghai stock price daily returns, Yuan et al. [2009] found two different types of sources for multifractality, the fat-tailed probability distributions and nonlinear temporal correlations. To analyse the local Hurst exponent, they considered a sliding window of 240 frequency data in 5 trading days, and found that when the price index fluctuates sharply, a strong variability characterise the generalised Hurst exponent h(q). As a result, two measures were proposed to better understand the complex stock markets. Gu et al. [2010] analysed the return time series of the Shanghai Stock Exchange Composite (SSEC) Index with the one-dimensional MFDMA model within the time period from January 2003 to April 2008, and confirmed that the series exhibits multifractal nature, not caused by fat-tailedness of the return distribution. They found the generalised Hurst exponent h(q) to have the values h(−4) = 0.66 ± 0.005, h(−2) = 0.624 ± 0.002, h(0) = 0.591 ± 0.001, h(2) = 0.53±0.003, and h(4) = 0.493±0.008. With h(2) close to 21 , and ignoring the nonlinearity in h(q), one could infer that the return time series of the SSEC was almost uncorrelated. However, the span of the multifractal singularity strength function (see Equation (11.2.25)) for the SSEC time series was ∆α = 0.72 − 0.39 = 0.33 indicating that the series has multifractal nature. Shuffling the return time series and repeating the analysis, the singularity spectrum shrunk, implying that the fat-tailedness of the returns played a minor role in the multifractality of the series which was mainly driven by correlations. Lye et al. [2012] used MFDFA coupled with the rolling window approach to scrutinise the dynamics of weak form efficiency of Malaysian sectoral stock market, and showed that it was adversly affected by both Asian and global financial crises, and also negatively impacted by the capital control implemented by the Malaysian government during the Asian financial crisis. They considered daily closing price indices from a period ranging from 1/11/1993 to 30/06/2011, with a total of 4, 609 observations. Comparing results with the binomial multifractal model, they found multifractality due to both fat-tailed probability distribution and long-range correlations. Since the JB test showed that the local Hurst exponents were not normally distributed, instead of using the mean to rank the sectorial indices, they considered the median, and defined a new measure 1 | Median − | 2 to provide a better view of the ranking. Using this measure on the data, the Hurst exponents showed significant deviations way from H = 21 during the Asian and global financial crises, September 11 attacks, dot-com bubble, as well as when the Malaysian Ringgit was pegged to the US dollar, which was on line with the results found by Chin [2008b]. Applying MFDFA to the daily time series data of six composite stock price indices in the Association of Southeast Asian Nation (ASEAN) region covering the period from January 2006 to June 2013, Niere [2013] provided empirical evidence of the presence of multifractality in these time series. To capture the dynamics of local Hurst exponents, a sliding window approach was used in applying MFDFA, with a cubic polynomial, and scale varying from 20 to N4 with a step of four. The window length was 240 days (around 1 year) with a shift between windows equal to 5 trading days. He obtained a spectrum of Hurst exponents in all six indices, manifesting the presence of multifractality. Based on the efficiency measure Mef f = |H − 21 | σĤ where H is the mean of h(2), an efficiency ranking of stock markets of the six countries under study was provided to guide investors seeking profit opportunity. Stosic et al. [2014] analysed the transition from managed to independent floating currency rates in eight countries with MFDFA, and found changes in multifractal spectrum indicating an increase in market efficiency. The observed changes were more pronounced for developed countries having an established trading market. Applying the MFDFA method with a second degree polynomial to analyse logarithmic returns of daily closing exchange rates, they obtained parameters (α0 , ∆α, r) describing multifractal spectrum. 420 Quantitative Analytics 11.4 Local Holder exponent estimation methods 11.4.1 The wavelet analysis While the partition function-based methodology, described in Section (11.1.2), provides only global estimates of scaling (τ (q), h(q), or D(h)), there are cases when local information about scaling provides more relevant information than the global spectrum. It generally happens for time series where the scaling properties are non-stationary, due to intrinsic changes in the signal scaling characteristics, or even boundary effects. Until recently, the estimation of both local singularity and their spectra were very unstable and prone to gross numerical errors (see details in Section (11.2.2.1)). However, using the wavelet transform multiscale decomposition, Struzik [1999] proposed stable procedures for both the local exponent and its global spectrum. 11.4.1.1 The effective Holder exponent Struzik [1999] [2000] started from the fact that for cusp singularities, the location of the singularity could be detected, and the related exponent recovered from the scaling of the wavelet transform (WT), along the maxima line converging towards the singularity. More precisely, the Holder exponent of cusp singularity can be estimated from the slope of the maxima lines approaching isolated singularities (see Section (11.2.2)). In addition, we saw that the scaling of the maxima lines was stable in the log-log plot only below some critical scale. However, it is not possible to estimate the slope of the plot other than in the case of isolated singular structures from the WT. This is because in the case of densely packed singularities, the logaritmic rate of increase, or decay, of the corresponding WT maximum line fluctuates wildly. Struzik [1999] proposed an approach to circumvent this problem, while retaining local information, consisting in modelling the singularities as created in some kind of a collective process of a very generic class. He chose to bound the local Holder exponent by explicitly calculating bounds for the slope locally in scale, and then discard (or ignor) the parts of the maxima lines for which the slope exceeds the imposed bounds (see Struzi [1998]). As an example, he used |h̃| < 2 bound on the local slope h̃ of each maximum. Doing so, he obtained the set of non-diverging values of the maxima lines corresponding to the singularities in the time series. However, even with the diverging parts of the maxima removed, it was still not possible to obtain local estimates of the scaling behaviour other than for isolated singular structures, since the local slope of WT maxima was strongly fluctuating. Nonetheless, the fluctuations carry very relevant information to the scaling properties of the process underlying the origin of the input time series. Hence, Struzik defined the local effective Holder exponent by considering multiplicative cascade model where each point of the cascade is uniquely characterised by a sequence of weights (a1 , .., an ) taking values from the binary set {1, 2}, and acting successively along a unique process branch leading to this point. Doing so, he obtained a model-based approximation of the local scaling exponent. Denoting κ(Fi ) the density of the cascade at the generation level Fi , for i ∈ [0, max], then it can be written as κ(Fmax ) = pa1 , ..., pan κ(F0 ) = PFF0max κ(F0 ) such that the local exponent is related to the product PFF0max of these weights max hF = F0 log PFF0max log ( 21 )max − log ( 12 )0 Since the weights pi are not known and hi must be estimated, in multiplicative cascade model, the effective product of the weighting factors is reflected in the difference of logarithmic values of the densities at F0 and Fmax along the process branch max hF = F0 log κ(Fmax ) − log κ(F0 ) log ( 21 )max − log ( 12 )0 The densities κ(Fi ) can be estimated from the value of the wavelet transform along the maxima lines corresponding to the given process branch. Hence, the estimate of the effective Holder exponent becomes 421 Quantitative Analytics log T (alo , wpb ) − log T (ahi , wpb ) log alo − log ahi where T (a, wpb ) is the value of the wavelet transform at the scale a, along the maximum line wpb corresponding to the given process branch. The scale alo corresponds to the generation of Fmax , while the scale ahi corresponds to that of F0 . In general one would choose haahi = lo ahi ≡ aSL = log ( Sample Length) to estimate T (ahi , wpb ), but the wavelet transform coefficients at that scale are heavily distorted by finite size effects. One solution is to estimate the value of T (ahi , wpb ) with the mean h exponent. For multiplicative cascade, the mean value of the cascade at scale a is given by M (a) = M (a, 1) M (a, 0) where M (a, q) is the partition function of the qth moment. We can then estimate the mean value of the local Holder exponent as a linear fit logM (a) = h log(a) + c In order for the Holder exponent to be the local version of the Hurst exponent, we can take the second moment in the partition function to define the mean h0 s 0 M (a, 2) M (a) = M (a, 0) 0 and use the linear fit above, replacing M with M . The estimate of the local Holder exponent ĥ(x0 , a) becomes ĥaaSL ≈ lo 11.4.1.2 log T (alo , wpb ) − (h0 log a + c) log alo − log aSL (11.4.26) Gradient modulus wavelet projection The gradient modulus wavelet projection (GMWP), introduced by Turiel et al. [2006], defines a scale-dependent measure with the help of a continuous wavelet transformation. We let Ns be a small segment size, and consider a floating time interval (or sliding window) defined for the range [tind − N2s , tind + N2s ] around the time index tind . The small segment size Ns is assumed to be odd to align the centre of the segments according to a time index. In that setting, the range of the time index satisfies [ N2s , N − N2s ], and the local fluctuation for a segment is given by N − N2s FGM W P (Ns ) = X µNs (tind ) tind = N2s where the scale-dependent measure is defined as µNs (tind ) = Ns X |xi,tind |ψNs ( i=0 Ns 2 Ns − i) 2 and xi,tind = x(tind − + i). The continuous wavelet transformation is the convolution of the response time series and a waveform ψNs (•) scaled to the floating time interval [− N2s , N2s ]. Since the detrending of the response series 2 is dependent on the shape of the waveform, the authors used the Laplacian wavelet ψs,t = (1 + ts )−2 because it performs well on the smallest scales (see Turiel et al. [2003]). 422 Quantitative Analytics 11.4.1.3 Testing the performances of wavelet multifractal methods Multifractality is a property verified in the infinitesimal limit only, while empirical data have an inherent discrete nature. As a result, any tools designed to validate the multifractal character of a given signal faces several difficulties linked to the finite size and the discretisation of the data. Moreover, any technique used to validate the multifractal behaviour of a signal necessarily involves some interpolation scheme introducing some bias. As a result, one should know the range of validity, limitations and biases, and the theoretical foundation of any method to determine the degree of reliability of the estimates obtained. Turiel et al. [2006] studied the theoretical foundations, performance and reliability of four different validation techniques for the analysis of multifractality from experimental data. They considered the moment (M) method, the wavelet transform modulus maxima (WTMM) method, the gradient modulus wavelet projection (GMWP) method and the gradient histogram (GH) method, which were used to estimate the singularity spectra of multifractal signals. They showed that all the methods always gave better estimates of the left part of the spectra than of the right part, and as the spectrum width increased the quality on its determination decreased. The main conclusion was that GMWP method got the best overall performance, providing reliable estimates which can be improved with increasing statistics. All the other methods were affected by problems such as the linearisation of the right tail of the spectrum. 11.4.2 The fluctuation analysis 11.4.2.1 Local detrended fluctuation analysis We saw in Section (11.3) that some researchers tried to estimate the local Hurst exponent at time t as the Hurst exponent computed on a sliding window of size n from t − n + 1 till t. However, all methods estimating the Hurst exponent work well only in a large size window, and are therefore not capable of detecting local jumps. Following Struzik [2000], who combined a multiplicative cascade model with the wavelet transform modulus maxima (WTMM) method to estimate the local Hurst exponent, Ihlen [2012] detailed a method that retrieve the local Hurst exponent from a small window size using detrended fluctuation analysis (DFA). That is, rather than using the WTMM tree for defining the partition function-based multifractal formalism, he considered the DFA model, obtaining a good estimate of the local Hurst exponent. Following Ihlen [2012], we are now going to explain how to estimate the local Hurst exponent. As opposed to the time independent Hurst exponent estimated by the monofractal DFA, the local Hurst exponent, H(t), estimated for a multifractal time series will strongly fluctuate in time. In order to estimate the local 2 Hurst exponent, H(t), the local mean-square (MS) fluctuation FDF A,2 (a) given in Equation (11.2.20) has to be defined within a translating segment centred at sample (or time index), a = tind , instead of within non-overlapping segments. That is, given the small segment size, Ns , the sliding window is defined for the range [tind − N2s , tind + N2s ]. Ihlen [2012] considered the vector of small segment sizes [7, 9, 11, 13, 15, 17] where the segment sizes increases with two samples in order to align the centre of segments according to a time index. Taking the largest segment size, Ns,max , N N the time index tind is defined for the range [ s,max , N − s,max ]. For each small segment size, Ns , we compute the 2 2 local fluctuations for a translating segment centred at time index tind , getting N− FDF A,2 (Ns ) = Ns,max X2 2 FDF A,1 (tind ) N tind = s,max 2 where q 2 FDF A,q (tind ) = µNs (tind ) = Ns q 1 X Y 2 (i, tind ) 2 Ns i=0 with Y (i, tind ) = X(i, tind ) − XNs ,l (i, tind ) 423 Quantitative Analytics 2 and X(i, tind ) = X(tind − N2s +i). We already saw that the difference between the overall qth order RMS, FDF A,q (n), computed with Equation (11.2.22) for q in the range [−5, 5], converge toward each other with increasing scale. It forms an envelope with a maximum and minimum variations. The regression line for q = 0 is the centre of the spread of RMS in log-coordinates. The same convergence exists for the local RMS, of small segment size, which is used to estimate the local Hurst exponents (linear regression). It is estimated as the slope of the line from local RMS in logcoordinates to the endpoint of the regression at the largest scale N . That is, we fit the line RL,q given by Equation (11.2.22) for q = 0 on large scales, getting RL,0 (n) = log FDF A,0 (n) ≈ log c + h(0) log n where h(0) = h(q)|q=0 . We then extrapolate the fitted line on the small segment sizes, and compute the residual from 2 that line and the local fluctuations, FDF A,1 (tind ) = µNs (tind ), for all time index tind Ns,max Ns,max , ..., N − 2 2 Defining the log-scale for the segment size Ns as L(Ns ) = log (N ) − log (Ns ), the coarse-grained singularity exponent, HNs (t), is obtained by dividing the residuals by the log-scale and adding the slope h(q)|q=0 of the regression line 2 Res(Ns , tind ) = RL,0 (Ns ) − log FDF A,1 (tind ) , tind = HNs (tind ) = Res(Ns , tind ) + h(q)|q=0 L(Ns ) Hence, the local Hurst exponent H(t) is estimated from the coarse-grained exponent HNs (t) in the limit Ns → 0. As explained by Ihlen et al. [2014], the local DFA is conducted in the same way as the conventional DFA with three important differences 1. the RMS of the detrended residuals is computed in a floating time interval across the time series instead of in non-overlapping time intervals as in DFA. 2 2. the obtained RMS measure FDF A,1 (tind ) = µNs (tind ) is dependent on both time and scale, in contrast to the 2 RMS measure FDF A,1 (a) of the DFA which only depend on scale. 2 3. the local DFA scaling exponent HNs (tind ) is numerically defined by the linear slope of log FDF A,1 (tind ) versus log Ns for each time instant tind , instead of the time-independent log FDF A (n) versus log(n) for the DFA. Note, the coarse-grained singularity exponent, HNs (t), can be rewritten as HNs (tind ) = Res(N, tind ) L(Ns ) where N is the length of the time series. Remark 11.4.1 This expression for the estimated local Holder exponent is to be related to the effective Holder exponent in Equation (11.4.26). The multifractal spectrum Dh is defined by the normalised distribution Ph of H(t0 ) in log-coordinates Dh = lim 1 − →0 1 Ph log ( ) log Ph,max (11.4.27) where is the bin size of the histogram used to define Ph , and Ph,max is the maximum probability at the mode h(0) of H(t0 ) (see Turiel et al. [2008]). The small H(t) in the periods of the multifractal time series with local fluctuations of large magnitudes reflects the noise like structure of the local fluctuations, while the larger H(t) in the periods with local fluctuations of small 424 Quantitative Analytics magnitudes reflects the random walk like structure of the local fluctuations. The local Hurst exponent H(t) in periods with fluctuations of small and large magnitudes is therefore consistent with the qth order Hurst exponent h(q) for negative and positive q’s, respectively. The advantage of the local Hurst exponent, H(t), compared with the qth order Hurst exponent, h(q), is its ability to identify the instant in time of a structural changes within the time series. 11.4.2.2 The multifractal spectrum and the local Hurst exponent We have previously discussed how to transform the q-order Hurst exponent h(q) to the mass exponent τ (q), and finally to the multifractal spectrum f (α) with its associated singularity α. Following Ihlen [2012], we are now going to explain how to estimate directly the multifractal spectrum from the local fluctuations. The temporal variation of the local Hurst exponent can be summarised in a probability distribution, and the multifractal spectrum is just the normalised probability distribution in log-coordinates. Thus, the width and shape of the multifractal spectrum reflect the temporal variation of the local Hurst exponent (the temporal variation in the local scale invariant structure of the time series). More precisely, the temporal variations of the local Hurst exponent H(t) can be summarised in a histogram representing the probability distribution Ph of H(t). The multifractal spectrum f (α) is simply defined by the log-transformation of the normalised probability distribution P̃h . The probability distribution Ph are computed by dividing the number of local Hurst exponents in each bin by the total number of local Hurst exponents. The multifractal spectrum f (α) are therefore directly related to the distribution Ph of the local fractal structure of the time series via Equation (11.4.27). As an example, we plot the multifractal spectrum and its estimation computed via the local Hurst in Figure (11.3). The probability distribution obtained this way is relatively accurate as it is fairly similar to the multifractal spectrum. However, we can see that the distribution is slightly biased to the right for the monofractal series with H = 0.3 and to the left for the series with H = 0.7. Note, these differences are minor and the main properties of the distribution are conserved. 11.4.3 Detection and localisation of outliers In general, outlier difference itself from noise through its inherently isolated and local character, leading to nonstationarity and highly erratic behaviour. Hence, one must determine whether a particular extreme observation belongs to the bulk of the data or should be treated as an outlier. To do so, we need a methodology capable of determining the statistical nature of the non-stationarity process both in a global and local sense. Struzik et al. [2002] used the effective local Holder analysis, described in Section (11.4.26), not only to detect the outliers, but also to localise them in time and space. Computing the singularity h(q) (or α(q)) and the spectrum D(h) (or f (α)), he found that the spectrum for the clean version was narrow and focused around the mean value of the singularity strength hmean , but that it was very broad in the dirty version, and gradually falling off to zero dimension values for decreasing h < hmean . This phenomena corresponds with positive q values having the ability to select exponents of a relatively lower value than the hmean value. Note, the way to distinguish multifractal processes from outliers is through the relative values of D(h) and the spacing between the q values. The former requires dense coverage of h(q) values (dimension 1 on a line), while point-wise events have support 0, so that for D(h) near 0 we have weak support and strong probability of an outlier. Hence, comparing the values of h(q) and D(h) for positive q can allow us to detect the presence of spikes in the time series. To localise the spikes we need the local value of h(x) instead of the global average, which can be estimated with the help of the effective local Holder exponent ĥ(x, a). Plotting the local exponents, the value cluster around hmean , but strong singular events drop well below the mean value, such that selecting an appropriate threshold we can filter the outliers from the series. Struzik et al. chose as a threshold the mean value of the local Holder exponent h0 described in Section (11.4.26). This is because the micro-canonical geometric mean h0 does not coincide with the hmean mode value of the D(h) distribution in presence of outliers. That is, the probability of outliers is high when the hmean differs significantly from h0 . 425 1.0 Quantitative Analytics ● 0.6 0.4 0.0 0.2 Log Normalised distribution 0.8 Monofractal H=0.30 Monofractal H=0.75 Multifractal ● 0.0 0.5 1.0 1.5 2.0 Bins Figure 11.3: Multifractal estimation and its estimation via local Hurst estimates at scale 7 over a samples of size 8192 for series with different fractal structures. 11.4.4 Testing for the validity of the local Hurst exponent We are now going to test for the validity of the local Hurst exponent observed at time t and computed as the Hurst exponent on a sliding window against the one computed with the local detrended analysis (LDA) described in Section (11.4.2.1). In the following, we will call the former "Local" Hurst exponent with double quotes and the latter Local Hurst exponent without any quote. 11.4.4.1 Local change of fractal structure In order to perform the test, we construct a fractional Brownian motion (fBm) of size 8, 192 with Hurst exponent H = 21 and we introduce two local changes of size 25 at time 4, 096 and time 6, 120 with Hurst exponent H = 0.8 and H = 0.2, respectively. The "Local" Hurst exponent is a wavelet-based Hurst estimate on a sliding window of size 1, 024 and the other one is estimated using the LDA algorithm described above. The results are given in Figure ( 11.4). The "Local" Hurst exponent computed on the sliding window has Hurst exponent comprised between 0.4 and 0.8 without any noticeable change in its structure, whereas the local Hurst exponent computed with the LDA evolves around 0.5 and shows two singular points. The first one peaks at 0.8 around the time 4, 096, and the second one reaches 0.2 approximately at time 6, 120. These two singularities observed in the series are in perfect accordance with the artificial changes we made to the data. 426 1.2 Quantitative Analytics 0.8 0.6 0.4 0.0 0.2 Hurst Exponent 1.0 Local Hurst Exponent "Local" Hurst Exponent 1000 2000 3000 4000 5000 6000 7000 8000 Time Figure 11.4: Hurst exponents computed on an artificial series of 8192 points containing abrupt local change in structure at time 4096 and 6120. 11.4.4.2 Abrupt change of fractal structure We now construct a time series using two fractional Brownian motions with different Hurst exponent that we combine together. The first part of the constructed series is a fractional Brownian motion of size 4, 096 with Hurst exponent H = 0.4, and the second part of the series is a fractional Brownian motion of size 4, 096 with Hurst exponent H = 0.7. As a whole, the final series has a Hurst exponent H = 0.4 from time (point) 1 to 4, 096 and an exponent H = 0.7 from time (point) 4, 097 to 8, 1924. Similarly to the previous experiment, we compute the Local Hurst exponent with the two methods described above. The first one is wavelet-based Hurst estimates on a moving window of size 1, 024, and the second one uses the algorithm described just above. The results are given in Figure 11.5 below. It can immediately be seen that the local Hurst exponent computed with the multifractal method shows an important change in values, going from 0.4 to 0.8 at around time 4, 096. It corresponds exactly to the time where we changed the fractal structure of the series. On the other hand, the "Local" Hurst exponent starts to have slight changes at time 5, 000, which is approximately equal to 4, 096 (the exact location of change) plus 1, 024 (sliding window size). In other words, the "Local" Hurst exponent takes the change into account only when it considers a series with a major part containing data of H = 0.8 in its sliding window. 11.4.4.3 A simple explanation The inability for the "Local" Hurst exponent computed on a sliding window to detect large local changes of fractal structure may be easily explained. Assuming that the Hurst exponent of a sample time series is approximately equal 427 1.2 Quantitative Analytics 0.8 0.6 0.4 0.0 0.2 Hurst Exponent 1.0 Local Hurst Exponent "Local" Hurst Exponent 1000 2000 3000 4000 5000 6000 7000 8000 Time Figure 11.5: Hurst exponents computed on an artificial series of 8192 containing abrupt change in structure at time 4096 with H = 0.4 before time 4096 and H = 0.8 after time 4096. to the average of the local Hurst exponent on the sample (see details in Section (11.3.1.3)), noting L the length of the time interval, then the Hurst exponent at time t satisfies Z 1 t HL (t) = Ht dt L t−L Thus, for a local change (pulse) happening on a time interval much smaller than L, the pulse does not have enough weight when averaged to have a significant impact. As a result, even for a large change of fractal structure, the local Hurst exponent computed on a sliding window is not an appropriate estimate of the true local Hurst of a time series. On the other hand, the local Hurst exponent computed with the LDA is perfectly capable of capturing the local structure of the time series. Consequently, the most appropriate estimate of local Hurst exponent is the one introduced by Ihlen [2012], as it can precisely capture abrupt changes of fractal structure in a time series without lagging. 11.5 Analysing the multifractal markets 11.5.1 Describing the method In order to analyse the markets for multifractality, we consider the S&P 500 Index daily prices provided by Bloomberg from April 4th, 1928 to September 5th, 2014, and compute the local Hurst exponent by using the two different techniques described earlier. 428 Quantitative Analytics 1. We estimate the pseudo local Hurst exponent on a sliding window of 2, 048 days computed using the DFA method as detailed in Section (11.3.1). 2. We compute the proper, or effective, local Hurst exponent following the method described in Section (11.4.2.1). We saw in Section (11.1.2.3) that the local Hurst exponent H(t) describing multifractal processes was itself a random process. Since it is now well known that financial data have a multifractal nature, we expect the local scaling to change erratically and randomly in time. For presentation purposes, Costa et al. [2003] smoothed out the original curve H(t) by performing a 20-day moving average procedure. Similarly, in order to concentrate on the main characteristics of the estimated local Hurst exponent, we choose to denoise it with the wavelet denoising technique, and only plot the resulting trend. The estimated local Hurst being highly fluctuating, we can therefore gain in readability and focus on its dynamic properties. 0 0.0 0.2 Hurst Exponent 0.6 0.4 1000 500 S&P 500 Index 1500 0.8 1.0 2000 The results in Figure 11.6 show an increase in value of the S&P Index from 1928 till 2014, with increasing price fluctuations from the early 1980s onward. As a result, we would expect an important drop in the local Hurst exponent starting from these years. However, even though the pseudo local Hurst exponent does decrease from 1997, going from 0.55 to 0.45, the change in value is clearly not significant. Further, the local Hurst exponent quickly goes back to values around 0.5, suggesting that returns do not have long-memory. 1928 1938 1947 1957 1967 1977 1987 1997 2007 Date Figure 11.6: S&P 500 Index from April 4th, 1928 to September 5th, 2014 (black line) and its corresponding denoised Hurst exponent by DFA method on a sliding window of 2048 days (red line). We now compute the proper local Hurst exponent and show the results in Figure 11.7. In this setting, we observe that the Hurst exponent drops substantially from 0.7 − 0.8 (low fluctuations) in 1928 − 1950 to 0.2 (high fluctuations) from 1997. As a result, we can infer that the S&P 500 Index had a strong persistent behaviour in the first period, and a strong anti-persistent behaviour in the more recent years. This is therefore a clear evidence of long-range dependence in data series of stock returns. This is on line with the results found in Section (11.4.4) showing the inability of the pseudo local Hurst to detect large changes of fractal structure in financial time series as opposed to the proper local 429 0 0.0 0.2 Local Hurst Exponent 0.6 0.4 1000 500 S&P 500 Index 1500 0.8 1.0 2000 Quantitative Analytics 1928 1938 1947 1957 1967 1977 1987 1997 2007 Date Figure 11.7: S&P 500 Index from April 4th, 1928 to September 5th, 2014 (black line) and its corresponding denoised Local Hurst exponent by MFDFA method (red line). Hurst technique. As a result, we will only consider the second approach when detecting multifractality in financial markets. 11.5.2 Testing for trend and mean-reversion 11.5.2.1 The equity market We are now going to consider the price of "Google US" from August 22nd, 2012 to September 5th, 2014, and apply the same techniques as above to detect trends and mean reverting behaviours on a close-to-close strategy (we trade only at the close of the market everyday). The Figure 11.8 represents Google prices from August 22nd, 2014 to September 5th, 2014. We have also plotted its trend computed using a wavelet denoising method. We observe that the stock prices and the trend coincides in most of the period, except in few time intervals, where it is strongly pushed away and then pulled back. For example, the prices fluctuates around the trend just before 2013, in January 2014 and more significantly between March and May 2014. This phenomena suggest to adapt a trend-following strategy when the price process coincides with the local trend, and on the contrary, we want to apply a mean reverting strategy when the price fluctuates around the trend. To do so, we need a indicator that allows us to take a decision systematically. We observe that the local Hurst exponent coincides exactly with the time interval where we observed strong fluctuations around the trend of the price process. Indeed, just before 2013, we observe a local minimum on the local Hurst exponent corresponding exactly with the fluctuations. The same observations may be made in January 2014. More significantly, between February and May 2014, the local Hurst exponent dropped from 0.55 to 0.35, and again, this phenomena exactly corresponds to the huge fluctuations interval observed in the price process. In addition, the global minimum of the local Hurst exponent occurs exactly when the price jumped from 450 to 500 in August 2013. In that period of time, the price is indeed highly mean reverting, since the difference between the trend (blue) and the actual process (black) is high. Hence, we can infer 430 Quantitative Analytics 2012 2013 1.0 0.6 0.4 560 0.2 Local Hurst Exponent 580 0.8 2014 0.0 0.0 520 350 0.2 540 Google US Equity 0.6 0.4 Local Hurst Exponent 500 450 400 Google US Equity 550 0.8 600 600 1.0 with a high probability that the process is more likely to come back to its trend. The autocorrelation is thus highly negative and the local Hurst exponent is subsequently close to zero. 2014−01 Date 2014−04 2014−07 Date Figure 11.8: Google Equity Price from August 22nd, 2012 to September 5th, 2014 (black line) its trend (blue line) and its corresponding denoised Local Hurst exponent by MFDFA method (red line) and a zoom between January 2014 and August 2014 11.5.2.2 The FX market The high liquidity in the FX market allows us to define trading strategies at a high-frequency. As illustrated in the figure below, the data is very noisy on this time scale, making it highly difficult to trade directly on the currency pair. One solution could be to use wavelet analysis to extract the trend of the currency pair for different time scales and then build a strategy considering those market imperfections on each time scaling. Figure 11.9 represents the EUR / GBP currency pair from August 31st to September 5th. We plotted its trend showing its moves of scale 4 (which represents 4 minutes) and its trend for the moves of scale 2 (which depicts 1 minute). While we observe that the two trends are roughly equal in most of the period, we can also see that the red line sometimes slightly fluctuates around the blue line. This is the case on the September 1st at around 10:00, the September 2nd at around 10:00, the September 3rd at around 10:00 and on the September 4th at around 14:00. In those periods, when the red line is below the blue line, the red line is most likely going to increase in the next ticks, and conversely, when the red line is above the blue line, it is most likely going to decrease in the next ticks. This phenomena exactly corresponds to a mean-reverting behaviour of the red process around its local mean, modelled by a longer trend (blue process). Further, this behaviour also coincides exactly with a drop in the local Hurst exponent. Therefore, we can propose a simple trading strategy: 1. When the local Hurst exponent is under a fixed threshold (typically 0.3 here), we compute the two trends (blue and red) of the EUR/GBP currency pair and we check the relative position of the blue line on the red line. If the red line is under the blue line, we buy Euros since its value will most likely increase. On the contrary, if the red line is above the blue line, we short sell Euros since its value will most likely decrease. 431 Quantitative Analytics 2. When the local Hurst exponent is over the fixed threshold, we buy and hold Euros if the trend is upward. On the contrary, we sell Euros if the trend is downward. 08−31 15:00 09−01 15:00 09−02 15:00 09−03 15:00 09−04 15:00 Local Hurst Exponent 0.0 0.2 0.4 0.6 0.790 0.794 0.798 EUR / GBP Obviously, to get an exact idea of the viability of this strategy in practice, many other factors have to be taken into account, such as taxes, transaction costs, technological means and the total traded amount, since the moves in the price are very low in this frequency (around 1/100 euros per tick). 09−05 15:00 Date Figure 11.9: Tick-by-tick (20sec) EUR / GBP currency pair from August 31st, 2014 to September 5th, 2014 (grey line), its trend on different scale (red and blue lines) and its corresponding denoised Local Hurst exponent by MFDFA method (thin red line). 11.5.3 Testing for crash prediction Since around 2003, many articles have been published in the literature on crash prediction in finance using the "local" (pseudo) Hurst exponent. For instance, Grech et al. [2004] studied the "local" Hurst exponent in the Dow Jones Index and showed significant predictability in the 1929 and the 1987 crashes. Czarnecki et al. [2008] obtained the same results in the Warsaw Stock Exchange. Then Xu et al. [2009] also applied the technique to predict sudden drop in the Shanghai Stock Exchange. In this section, we conduct our own investigation in order to predict some of the recent crisis by using the local Hurst exponent defined by Ihlen. 11.5.3.1 The Asian crisis in 1997 The Asian crisis hit East Asia from July 1997, leading to a financial contagion in many emerging countries, such as Argentina and Brasil. It began from the collapse of the Thai Baht (THB) in Thailand, and propagated to all the other countries in East Asia. Indonesia, South Korea, Thailand, Hong Kong, Malaysia, Laos and Philippines were the most affected by the crisis. Japan was also severely hitten as shown by the Nikkei 225 Index dropping from 19, 943 points to 17, 019 (−12.47%) in 1 week from January 7th to 13th. In Figure 11.10, we plot the THB/USD currency pair from December 14th, 1995 to September 8th, 1999. Before May 1997, we observe that the THB/USD FX rate was slightly increasing with little fluctuations, since the local Hurst exponent is around 1, indicating a very high level of persistence. However, after June of 1997, the THB value has become incredibly low. More precisely, before June 1997, 1 USD could be exchanged for 25 THB, but around February 432 Quantitative Analytics 1998, 1 USD was exchanged for 55 THB. In a period of time of less than a year, the Thai Baht has lost half of his value. 0.6 0.4 0.2 Local Hurst Exponent 1.0 0.8 45 40 35 25 0.0 30 THB USD Currency 50 1.2 55 Could it be predicted by using the local Hurst exponent? Analysing the local Hurst exponent, we observe that it was fluctuating around 1 before 1997, indicating that the THB/USD FX rate grew nearly as a pure trend. It suddenly dropped at the beginning of 1997, just before the huge loss of value that occurred during 1997 and 1998. The local Hurst exponent has immediately detected abnormal fluctuations in the FX rate, implying an abrupt change in the fractal structure of the time series. In other word, it has locally detected a huge amount of fluctuations compared to the previous pure trend regime of the Thai Baht, indicating the beginning of a monetary crisis in Thailand. 1995−12 1996−08 1997−05 1998−02 1998−10 1999−07 Date Figure 11.10: Thai BAHT / USD currency pair (black) from December 14th, 1995 to September 08th, 1999 and its local Hurst exponent (red). 11.5.3.2 The dot-com bubble in 2000 The Dot-Com Bubble occurred from 1997 to 2000, and affected all the sectors related to information technology. It has been enhanced by the growth of the World Wide Web which led to speculations on this type of stocks. We are now going to investigate if the local Hurst exponent can provide us with some indications on this phenomena. Figure 11.11 represents France Telecom SA (former name of Orange SA) stock prices from March 11th, 1998 =/Cshare) till 2000 (180 =/Cshare) and its burst to September 7th, 2001. Indeed, it shows a growing bubble from 1999 (50 that occurred in around 2000. The local Hurst exponent fluctuated around 0.6 before 1999, roughly indicating a slight persistent behaviour of the stock prices. It has then suddenly dropped after August 1999, indicating that the market was becoming highly turbulent, since the market prices were increasingly quickly growing. This predicted the forthcoming crash that indeed occurred in the beginning of 2000. 433 0.4 0.2 Local Hurst Exponent 0.6 150 100 50 France Telecom SA Prices 0.8 Quantitative Analytics 1998−03 1998−11 1999−08 2000−04 2001−01 Date Figure 11.11: France Telecom SA daily prices (black) from March 11th, 1998 to September 07th, 2001 and its local Hurst exponent (red). 11.5.3.3 The financial crisis of 2007 Last but not least, we investigate how the local Hurst exponent varied during the Financial Crisis of 2007. The financial crisis that started in 2007 was characterised by a liquidity and solvency crisis of many financial institutions which propagated to many countries. It is considered by many economists as the worst financial crisis since 1929. Figure 11.12 represents the NASDAQ Composite Index from 2005 to 2009. We observe that the NASDAQ Index had quite a "normal" behaviour from 2005 till mid-2006, and that from that date onward, more and more erratic fluctuations occurred over time, to finally suddenly drop from 2, 500 points to 1, 400 points at the end of 2008. The local Hurst exponent fluctuated around 0.6 before 2006, then slightly decreased to 0.5 between September 2006 and late 2007, to finally reach 0.4 after 2007. Going further in the analysis, we see that the local Hurst exponent varied more after 2006, indicating a change in its fractal structure. We observe a local minimum of the local Hurst exponent in March 2007, reaching 0.4, which indicates a sudden drop in the index. Again, a similar local minimum is observed in August 2007, and another one in February 2008, to finally reach its global minimum of 0.2 in October 2008, corresponding to a huge loss of 1, 000 points (−56%) in the index. Note, the huge loss in October 2008 did not suddenly appear. We have identified at least three periods of time where the Hurst exponent alarmed us on the possibility of a forthcoming huge drop. We believe that many losses might be avoided by portfolio managers if they correctly interpreted the local Hurst exponent. As a consequence, through those three experiments on Asian Crisis, Dot-Com Bubble and the 2008 Financial Crisis, we do complete the results from Grech et al., Czarnecki et al. and other authors who claimed that the local Hurst exponent may predict financial crashes. However, we do not pretend that the Hurst exponent is the best way to predict them since the same fluctuations of the Hurst exponent could be observed without leading to any crisis. However, we claim that the fractal structure (and thus the Hurst exponent) do change just before each crisis and as a 434 Quantitative Analytics 0.4 0.2 Local Hurst Exponent 0.6 2500 2000 1500 NASDAQ Composite Index 0.8 result, it provides a good partial predictive indicator of financial crisis. More generally, the local Hurst exponent gives valuable indications on extreme values (upward and downward) in data series. 2005−04 2005−12 2006−09 2007−05 2008−02 2008−10 Date Figure 11.12: NASDAQ Composite Index (black) from April 4th, 2005 to January 05th, 2009 and its local Hurst exponent (red). 11.5.4 Conclusion While outliers have an inherently isolated and local character, with erratic behaviour (spikes), we saw in Section (11.4.3) that they could be detected and localised in time with the help of the effective local Holder exponents (ELHE) (see Section (11.4.26)). Following the same approach to analyse markets for multifractality, we obtained highly random local Holder exponents, emphasising the strong multifractal nature of financial data. Even the denoised effective exponents obtained with wavelet transform are random with abrupt change in values happening continuously, and extremely fast. That is, the denoised local Holder exponents oscillate around a level of Hurst exponent with a succession of small and large amplitudes (similar to spikes), and is capable of sudden, or abrupt, change to a different level of Hurst exponent in presence of lage extreme price fluctuations related to market crashes. Various authors already suggested that financial markets could be described as a system of a number of coupled oscillators, subject to stochastic regulation (see Matia we al. [2003]). The source of multifractality of financial markets were shown to be due to nonlinear phase ordering as well as the essential contribution of extreme events resulting in fat tails of the event distribution. Even though the width of the multifractal spectra is capable of indicating the presence of large shocks, the oscillating nature of the local Holder exponent characterise the continuously changing dynamics of the response time distribution. Comparing the behaviour of the stock market to that of a healthy heartbeat dominated by two antagonistic systems (sympathetic and parasympathetic) the pessimists who sell stocks and the optimists who buy stocks, leading to a continuously varying number of active agents (degrees of freedom), Struzik [2003] showed that both systems were at work at any moment in time. Hence, the multifractal spectra can detect a change of level of the Hurst exponent (contribution to fat tails), but it can not be used to identify the intermittent changes in the magnitude of response time variation due to, for example, feedback effects. Similarly to outliers, the latter requires a methodology capable of 435 Quantitative Analytics determining the statistical nature of the non-stationary process both globally and locally, such as the effective local Holder exponent. 11.6 Some multifractal models for asset pricing In this section we follow Segnon et al. [2013] who explained the construction of simple multifractal measures and detailed multifractal processes designed as models for financial returns. The origins of multifractal theory date back from Kolmogorov [1941] and his work on fully developed turbulence (FDT). Later, Mandelbrot [1974] introduced multifractal measures where he proposed a probabilistic approach for the distribution of energy in turbulent dissipation. Building upon earlier models of energy dissipation from Kolmogorov, he proposed that energy should dissipate in a cascading process on a multifractal set from long to short scales where the set results from operations performed on probability measures. The multifractal cascade starts by assigning uniform probability to a bounded interval, for instance the unit interval [0, 1] which is split up into two subintervals receiving fractions m0 and 1 − m0 , respectively, of the total probability mass of unity of their mother interval. Different choices are possible for the length of the subintervals, such as 12 . In the next step, the two subintervals are split up again into similar subintervals of shorter length, receiving again fractions m0 and 1 − m0 of the probability mass of their mother intervals. This process being repeated ad infinitum in principle, a heterogeneous, fractal distribution of the overall probability mass results which even in the simplest case has a visual resemblance to time series of returns and volatility in financial markets. This construction reflects the underlying idea of dissipation of energy from the long scales (mother intervals) to the finer scales, preserving the joint influence of all the previous hierarchical levels in the built-up of the cascade. Many variations of this generating mechanism of a simple Binomial multifractal have been proposed, all being implementation of the general form given in Equation (10.1.6) defining multifractality from the scaling behaviour across scales. The recursive construction principles are directly responsible for the multifractal properties of the pertinent limiting measures in accordance to Equation (11.1.11). Denoting by µ a measure defined on [0, 1], we get E[µq (t, t + ∆t)] ∼ c(q)(∆t)τ (q)+1 so that in the simple case of the Binomial cascade we have τ (q) = − ln E[M q ] − 1 with M ∈ {m0 , 1 − m0 } with probability 21 . One must therefore determine the scaling function τ (q) and the Holder spectrum f (α), as well as the existence of moments in the limit of a cascade with infinite progression. Multifractal measures have been adapted to asset pricing by using them as a stochastic clock for transformation of chronological time into business time. That is, a time transformation can be represented by stochastic subordination, where θ(t) is the subordinating process, and the asset price change, r(t), is given by a subordinated process (for example a Brownian motion) measured in transformed time θ(t). Mandelbrot et al. [1967] introduced the idea of stochastic subordination in financial economics. Later, Mandelbrot et al. [1997] proposed the multifractal model of asset returns (MMAR) where multifractal measure serves as a time transformation from chronological time to business time. It assumes that returns r(t) follow the compound process r(t) = BH [θ(t)] where the incremental fBm with Hurst index H, BH [•], is subordinate to the cumulative distribution function θ(t) of a multifractal measure constructed as described above. It shares essential regularities observed in financial time series including long tails and long memory in volatility originating from the multifractal measure θ(t) applied for the transition from chronological time to business time. That is, the heterogeneous sequence of the multifractal measure serves to contract or expand time, and as a result Rlocally contract or expand the homogeneous second moment of t the subordinate Brownian motion. Writing θ(t) = 0 dθ(t) we see that the incremental multifractal random measure dθ(t) (which is the limit of µ(t, t + ∆t) for ∆t → 0 and k → ∞ (the number of hierarchical levels)) can be considered as the instantaneous stochastic volatility. Hence, the MMAR essentially applies the multifractal measure to capture the time-dependency and non-homogeneity of volatility. Mandelbrot et al. discussed estimation of the underlying parameters of the model via matching of the f (α) and τ (α) functions, and showed that the temporal behaviour of various absolute moments of typical financial data squares well with the theoretical results for the multifractal model. Considering the binary cascade described above, the obtained subintervals are assigned fractions of the probability 436 Quantitative Analytics mass of their mother interval drawn from different types of random distributions. Calvet et al. [2002] discussed Binomial, Lognormal, Poisson and Gamma distributions and associated τ (α) and f (α) functions. Note, the functions τ (α) and f (α) capture various moments of the data, so that using them for determination of parameters is similar to moment matching. Estimation of alternative multifractal models has made use of efficient moment estimators as well as other more standard statistical techniques. As the MMAR suffered from the combinatorial nature of the subordinator θ(t) and its non-stationarity due to the restriction of this measure to a bounded interval, analogous iterative time series models were introduced (see Calvet et al. [2001] and [2004]). Rather than using the grid-based binary splitting of the underlying interval, they assumed that θ(t) was obtained in a grid-free way by determining a Poisson sequence of change points for the multipliers at each hierarchical level of the cascade. In the limit k → ∞ the Poisson multifractal exhibits typical anomalous scaling, carrying over from the time transformation θ(t) to the subordinate process for asset returns, BH [θ(t)]. As opposed to the MMAR, the Poisson multifractal possesses a Markov structure allowing for better statistical tractability. This model motivated the development of the discrete Markov-switching multifractal model (MSM) that is wildly applied in empirical finance. Later, Lux et al. [2013] interpreted the Poisson MMAR as a regime-switching diffusion process with 2k different volatility states. In the discrete version, the volatility dynamics can be interpreted as a discrete time Markov-switching process with a large number of states. Returns follow Equation (3.4.13) with innovations t drawn from a standard normal distribution N (0, 1) and instantaneous volatility being determined by the product of k volatility components or multipliers Mt1 , ..., Mtk and a constant scale factor σ, that is, rt = σt t with σt2 =σ 2 k Y Mti i=1 such that the volatility components Mti are persistent, non-negative and satisfy E[Mti ] = 1. Further, the volatility components at time t are statistically independent. Each Mti is renewed at time t with probability γi depending on its rank within the hierarchy of multipliers and remains unchanged with probability 1 − γi . Assuming γi = 1 − (1 − γ1 )(b i−1 ) with γ1 ∈ [0, 1] the component at the lowest frequency that subsumes the Poisson intensity parameter λ, and b ∈ (1, ∞), the discretised Poisson multifractal converges to the continuous time limit for ∆t → 0. Calvet et al. [2004] assumed a Binomial distribution for Mti with parameters m0 and 2 − m0 such that E[Mti ] = 1 for all i. Ignoring convergence to the limit, one can choose the simpler parametrisation γi = b−i . Note, the lognormal distribution for the distribution of the multipliers Mti was also considered (see Liu et al. [2007]), with parameter λ and s, Mti ∼ Ln(−λ, s2 ) such that for s2 = 2λ we get E[Mti ] = 1. However, the binomial and lognormal multipliers have almost identical results showing that the former is sufficiently flexible. In the econophysics literature, the multifractal random walk (MRW) developed almost simultaneously as a different type of causal, iterative process. It is essentially a Gaussian process with built-in multifractal scaling via an appropriately defined correlation function. Even though various distributions for the multipliers as the guideline for the construction of different versions of MRW replicating their autocorrelation structures can be used, the literature concentrated on the lognormal distribution. For instance, Bacry et al. [2001] defined the MRW as a Gaussian process with a stochastic variance given by r∆t (τ ) = ew∆t (τ ) ∆t (τ ) 437 Quantitative Analytics where ∆t is a small discretisation step, ∆t (•) is a Gaussian variable with mean zero and variance σ 2 ∆t, and w∆t (•) is the logarithm of the stochastic variance with τ a multiple of ∆t along the time axis.In the special case where w∆t (•) follows a Gaussian distribution, we get lognormal volatility draws. For longer discretisation steps (for example daily unit time intervals), we get the returns as t r∆t (t) = ∆t X ew∆t (i) ∆t (i) i=1 To mimic the dependency structure of a lognormal cascade, the returns are assumed to have covariances Cov(w∆t (t)w∆t (t + h)) = λ2 ln (ρ∆t (h)) with T (|h|+1)∆t for |h| ≤ 0 otherwise ρ∆t (h) = T ∆t −1 where T is the assumed finite correlation length (a parameter to be estimated) and λ2 is the intermittency coefficient characterising the strength of the correlation. For the variance of r∆t (t) to converge, one must assume that w∆t (•) obey T ) = −V ar(w∆t (i)) ∆t Assuming a finite decorrelation scale, rather than a monotonic hyperbolic decay of the autocorrelation, serves to guarantee stationary of the multifractal random walk. Hence, the MRW model does not obey an exact scaling function in the limit t → ∞, as it is only characterised by apparent long-term dependence over a bounded interval. Nonetheless, it possesses nice asymptotic properties facilitating applications of many standard tools of statistical inference. Note, Bacry et al. [2008] showed that the continuous limit of MRW can also be interpreted as a time transformation of a Brownian motion subordinate to a lognormal multifractal random measure. Hence, the MRW can be reformulated like the MMAR model as E[w∆t (i)] = −λ2 ln ( r(t) = B[θ(t)] for all t ≥ 0 where θ(t) is a random measure for the transformation of chronological time to business time, and B(t) is a Brownian motion independent of θ(t). The business time θ(t) is obtained along the lines of the MRW model as Z t θ(t) = lim e2w∆ (u) du ∆→0 0 where w∆ (u) is the stochastic integral of Gaussian white noise dW (s, t) over a continuum of scales, s, truncated at the smallest and largest scales ∆ and T leading to a cone-like structure defining w∆ (u) as the area delimited in time (over the correlation length) and a continuum of scales, s, in the (t, s) plane Z T Z u+s w∆ (u) = dW (v, s) ∆ u−s A particular correlation structure of the Gaussian elements dW (v, s) must be imposed in order to replicate the weight structure of the multipliers in discrete multifractal models. That is, the multifractal properties are obtained for the following choices of expectation and covariances of dW (v, s) 0 0 0 0 Cov(dW (v, s), dW (v , s )) = λ2 δ(v − v )δ(s − s ) and 438 1 dvds s2 Quantitative Analytics 1 dvds s2 Bacry et al. [2003] showed that the limiting continuous-time process exists and possesses multifractal properties. Later, Bacry et al. [2013] provided results for the unconditional distribution of returns obtained from this process, demonstrating that it is characterised by fat tails and that it becomes less heavy tailed under time aggregation. They also showed that standard estimators of tail indices are ill-behaved for data from a MRW data-generating process due to the high dependency of adjacent observations. Note, a similar mismatch between implied and empirical tail indices applies to other multifractal models. E[dW (v, s)] = −λ2 While price fluctuations in assert markets exhibit a well known degree of asymmetry due in part to leverage effects, the models described so far assumed complete symmetry for both positive and negative returns. To remedy this problem Pochart et al. [2002] proposed the discrete time skewed multifractal random walk (DSMRW) as an extended version of the MRW by incorporating a direct influence of past realisations on contemporaneous volatility X w̃∆t (i) = w∆t (i) − K(k, i)∆t (k) k . The choice of the dynamics for each vector Mi,t is that volatility arrivals are correlated but not necessarily simultaneous across markets, depending on the correlation coefficient λ. Considering β α two random variables Ii,t and Ii,t being equal to 1 if each series c ∈ {α, β} is hit by an information arrival with probability γi , and equal to zero otherwise, Calvet et al. specified the arrival vector to be i.i.d. and assumed its β α unconditional distribution to satisfy three conditions. First, the arrival vector is symmetrically distributed, (Ii,t , Ii,t )= β α α (Ii,t , Ii,t ) in distribution. Second, the switching probabilities of both series are equal for each level i, P (Ii,t = 1) = β P (Ii,t = 1) = γi , with γi as in the univariate MSM. Third, there exists λ ∈ [0, 1] such that β α P (Ii,t = 1|Ii,t = 1) = (1 − λ)γi + λ 439 Quantitative Analytics β α ) whose joint switching probabilities can easily be These there conditions define a unique distribution of (Ii,t , Ii,t determined. The univariate dynamics of each series coincides with a univariate MSM model. Liu [2008] considered a closely related bivariate multifractal model based on the assumption that two time series have a certain number of joint cascade levels in common, while the remaining one are chosen independently. The returns are given by k n Y Y 1 rq,t = ( Mi,t )( Ml,t ) 2 t i l=k+1 where q = 1, 2 refers to the two time series, both having an overall number of n levels of their volatility cascades, and they share a number k of joint cascade levels which govern the strength of their volatility correlation. These bivariate models have been generalised for more than two assets in various ways. Similarly, Bacry et al. [2000] proposed a generalisation of the MRW, called the multivariate multifractal random walk (MMRW). Peltier et al. [1995] proposed the multifractal Brownian motion (MFBM) in which the scaling exponent H is allowed to vary in time. We only present the main properties of the MFBM. Let H(t) be a Holder continuous function in the interval t ∈ [0, 1] with Holder exponent β > 0, such that for any t > 0 we have 0 < H(t) < min (1, β). The MFBM {WHt (t), t > 0} is the Gaussian process defined by Z t 1 H −1 H −1 (t − s)+ t 2 − (−s)+ t 2 dB(t) WHt (t) = 1 Γ(Ht + 2 ) −∞ where Γ(x) is the Gamma function, (x)+ equals x if x > 0 and 0 otherwise, and B(t) is a Brownian motion. One important aspect of that process is that its increments are no-longer stationary since it can be shown that 2 E[ WHt+k (t + k) − WHt (t) ] ≈ k 2H(t) as k → 0 Because of its nonstationarity, the MFBM is no-longer a self-similar process either, but it is possible to define the concept of locally asymptotically similarity at the point t0 > 0 in the following way WHt0 +at (t0 + at) − WHt0 (t0 ) = WHt0 (t) as a → 0 aHt0 Hence, one can think of the process WHt (t) as a process that resemble, at local time t, a fractional Brownian motion BHt (t). Peltier et al. presented a practical way to generate a MFBM path, and provided an algorithm for its implementation. Different properties of this process have been studied such as Holder continuity of the paths and Hausdorff dimension, local times of MFBM, and estimates for the local Hurst parameters (see Bertrand et al. [2013]). In white noise analysis, MFBM was considered by Lebovits et al. [2014] together with its respective stochastic calculus. 440 Chapter 12 Systematic trading This chapter is under construction and will be completed in the next version. 12.1 Introduction Through out this book we saw that the equilibrium theory of market prices could not explain the qualitative aspect coming from human decision making process and the resulting market predictability. New tools developed to analyse financial data, such as the wavelet analysis (see Chapter (6)) and the fractal analysis (see Chapter (10)), highlighting the multifractal nature of financial markets (see Chapter (11)). As a result, new theories emerged to explain financial markets, among which is a multitude of interacting agents forming a complex system characterised by a high level of uncertainty. Complexity theory deals with processes where a large number of seemingly independent agents act coherently. Multiple interacting agent systems are subject to contagion and propagation phenomena generating feedbacks and producing fat tails. Real feedback systems involve long-term correlations and trends since memories of long-past events can still affect the decisions made in the present. Most complex, natural systems, can be modelled by nonlinear differential, or difference, equations. These systems are characterised by a high level of uncertainty which is embedded in the probabilistic structure of models. As a result, econometrics can now supply the empirical foundation of economics. For instance, science being highly stratified, one can build complex theories on the foundation of simpler theories. That is, starting with a collection of econometric data, we model it and analyse it, obtaining statistical facts of an empirical nature that provide us with the building blocks of future theoretical development. New techniques combining elements of learning, evolution and adaptation from the field of Computational Intelligence developed, aiming at generating profitable portfolios by using technical analysis indicators in an automated way. In particular, subjects such as Neural Networks, Swarm Intelligence, Fuzzy Systems and Evolutionary Computation can be applied to financial markets in a variety of ways such as predicting the future movement of stock’s price or optimising a collection of investment assets (funds and portfolios). These techniques assume that there exist patterns in stock returns and that they can be exploited by analysis of the history of stock prices, returns, and other key indicators (see Schwager [1996]). With the fast increase of technology in computer science, new techniques can be applied to financial markets in view of developing applications capable of automatically manage a portfolio. Consequently, there is substantial interest and possible incentive in developing automated programs that would trade in the market much like a technical trader would, and have it relatively autonomous. A mechanical trading systems (MTS), founded on technical analysis, is a mathematically defined algorithm designed to help the user make objective trading decisions based on historically reoccurring events. With the growing quantity of data available, machine-learning methods that have been successfully applied in science are now applied to mining the markets. Data mining and more recent machine-learning methodologies provide a 441 Quantitative Analytics range of general techniques for the classification, prediction, and optimisation of structured and unstructured data (see details in Chapter (13)). Neural networks, classification and decision trees, k-nearest neighbour methods, and support vector machines (SVM) are some of the more common classification and prediction techniques used in machine learning. Further, combinatorial optimisation, genetic algorithms and reinforced learning are now widespread. Using these automated techniques, one can describe financial markets through degrees of freedom which may be both qualitative and quantitative in nature, each node being the siege of complicated mathematical entity. One could use a matrix form to represent interactions between the various degrees of freedom of the different nodes, each link having a weight and a direction. Further, time delays should be taken into account, leading to non-symmetric matrix (see Ausloos [2010]). For instance, conditional relationships can efficiently be described in a hierarchical fashion like a decision tree. A decision tree is a simple set of if-then-else rules, making it intuitive and easy to analyse, where the most important relationships are first considered, and the less significant ones are considered farther out in the branches of the tree. Sorensen et al. [1998] applied a classification and regression technique (CART) to construct optimal decision trees to model the relative performance of the S&P 500 with respect to cash. The model assigns different probabilities to three market states: outperform, underperform, and neutral. Since the CART allows for the variables to have non-linear behaviour and conditional relationships, the explanatory variables used can be capital market data such as steepness of the yield curve, credit spread, equity risk premium, dividend yield. The final result is a decision tree of non-linear if-then-else rules where each rule is conditioned on previous rules. 12.2 Technical analysis 12.2.1 Definition While trading involves the study of technical factors governing short-term market movements together with the behaviour of the market, technical trading rules involve the use of technical analysis (TA) (see Section (2.1.5)) to design indicators (called technical indicators) helping a trader determine whether current behaviour is indicative of a particular trend, together with the timing of a potential future trade. TA is the search for recurrent and predictable patterns in the stock prices by using the past price or volume data in order to help investors anticipate what is most likely to happen to the prices over time. Two important points from the Dow Theory are 1. prices discount everything: current price of stock fully reflects all the information. TA utilise the information captured by the price to interpret what the market is saying with the purpose of forming a view on the future 18 2. price movements are not totally random: most technicians believe that there are inter spread period of trending prices in between random fluctuations. The aim of the technicians is to identify the trend and then make use of it to trade or invest. As a result, in order to apply TA, we must assume that the historical data in the markets forms appropriate indications about the market future performance. Hence, by analysing financial data and studying charts, we can anticipate the way the market is most likely to go. Due to the difficulty of managing complex models of the market and using rigorous, adaptive decision techniques, day traders tend to use simpler and more intuitive decision rules. This rule of thumb approach is quite effective (see Ramamoorthy [2003]) and has been considered a good candidate for automation (see Dempster et al. [1999]). The main assumption behind TA is that a robust strategy can be designed by composing multiple intuitive strategies. Robustness and relatively complex behaviours can be achieved by synthesising multiple, intuitive strategies. For instance, if an agent were to buy a share at a low price and sell it at a higher price, then a profit of high price - low price would be made, and numerous such trades over the day would accumulate profit for the trader. However, the future prices are unknown and it is therefore not clear whether a decision to buy or sell in anticipation of favourable movements in the future would yield profit. This decision is further complicated by the strict need to unwind, as it is the case in intraday trading. Unwinding is the process of selling excessive shares, if in excess, and buying the number of shares required to make up the deficit, when short. 442 Quantitative Analytics 12.2.2 Technical indicator As there is no single kind of technical indicator (TI) which can work for all the stocks in the market, there is no optimal way of combining the different TI, so that technical analysis (TA) is more of an art than a science. This led technicians to use a large number of individual TI, and open source library for TI developed. For instance, Chauhan [2008] used 14 TI and coded his own ones to introduce some form of heuristic and generate more robust buy or sell signals. TI is defined as a series of data points that are derived by applying a formula to the price data of security which can be combination of the open, high, low or close over a period of time 18. These data points can be used to generate buy or sell signal. TI can provide unique viewpoint on the strength and direction of the underlying price action. In general, it is difficult to combine TI since they should complement each other rather than moving in unison and generate the same signal 18. Hence, we must make sure that the combination we choose provides different perspective towards the underlying price or volume movement. In addition, a combination that might work for one stock might not work for another one. Further, for each combination of TI, there are many parameters which need to be optimised (the size of the window of observation). 12.2.3 Optimising portfolio selection The areas of artificial intelligence and its application to technical trading and finance have seen a significant growth in interest over the last ten years, especially the use of genetic algorithms (GA) and genetic programming (GP). These approaches have found financial applications in option pricing (see Allen et al. [1999]), the calibration of implied volatility (see Bloch et al. [2011]), and as an optimisation tool in technical trading (see Dempster et al. [2001]). Evolutionary learning algorithms derive inspiration from Darwinian evolution. GPs are a variation of the standard genetic algorithm, wherein string lengths may vary within the solution space. While GAs are populationbased optimisation algorithms, GPs are an extension of this idea proposed by Koza [1992] with a view to evolving computer programs. A simple starting point with using GAs is to represent the solution space as a finite number of strings or binary digits. Binary strings are an effective form of representation since complex statements as well as numerical values of parameters can be represented in this form. The resulting search space is finite when parameters take only discrete values to yield a binary representation as a string of fixed length. We then need to evaluate the fitness of the constituents of the solution space, that is, the suitability of each potential solution in terms of its performance. When selecting trading rules the fitness can be viewed as the profitability of the rule tested over a time series of historical price data, or a function of this variable. Unlike in GAs, solutions in GP can be seen as non-recombining decision trees (see Papagelis et al. [2000]) with non-terminal nodes as functions and the root as the function output. These are usually the optimisation algorithm of choice in cases of evolving strategies based on Boolean operators, when the solution may be evolved with varying depth in the tree (see Dempster et al. [2001b]). It is inherently more flexible than the GA, but care needs to be taken in representation to avoid over-fitting (the phenomenon where a classifier is trained too minutely to fit the training data, causing diminished performance on data outside of the training sample called the out-sample data). Measures calculated over a period of time, such as the Sharpe ratio and the Sortino ratio, are used as the fitness function to evaluate the performance of each member of a population in every generation. Hence, the goal of the evolution process is to find the combination of weights maximising the fitness functions for a given set of training days (in sample). However, even though we can find such weights, there is no guarantee that we will maximise profit over the out of sample data. One must design trading strategies that resemble a technical trader who would systematically, and based on a set of pre-specified evaluation criteria, choose a subset of trading strategies from a larger set of trading rules, and evaluate the performance of these strategies in various competitive scenarios. We should combine trading strategies and rules with the use of GAs and GPs and evolve strategies that are aimed to be profitable and perform well under the different evaluation criteria involved. In an attempt at making a profitable, robust strategy, by using simple intuitive laws that appeal to the human trader, we use multiple technical trading rules in a weighted combination to produce a unified strategy. The generation of effective strategies using complete, comprehensible indicator strategies may help in the understanding of these component strategies, their effects and limitations. In this formulation, we use a number of 443 Quantitative Analytics basic (indicator) strategies in a weighted combination to produce a cumulative trading action at every tick. 12.2.3.1 Classifying strategies For example, the algorithm can consider the principles from the weighted majority algorithm (see Littlestone et al. [1992]) in the use of suggestions from the component strategies and combining them using a weighted majority. They considered the use of a similar suggestion or voting mechanism wherein each indicator would signal a buy, sell, or do nothing action. The steps involved in trading in this environment include getting the raw order book data, evaluation of a recommended action by each of the indicator strategies and combining these indicators using the respective weights giving us a cumulative suggestion (a weighted majority). This is followed by a multiple model control mechanism (CM) that determines the mode it should trade in, based on the current holdings of the agent. The control mechanism is like a faucet acting as the final regulator on the trading decision and volume suggested by the composite strategy so far. It has the power to veto a trading decision suggested by the composite algorithms, when in the safe mode or allow the trade to continue unaltered in the regular mode. Assuming that a trader would behave differently when in an extremely long or short position as opposed to a neutral share position, the agent can evaluate its current share position, and if necessary, it can keep away from following a possibly unidirectional market trend to the end of the day, and reaching a very long or short position. This mechanism is a control measure to ensure the agent achieves a share position as close to neutral (zero accumulation or deficit) as possible. This multiple model scheme examines the agent’s share position and provides a mode of operation that the agent should follow. This regulation is combined with the decision that is output by the composit strategy to arrive at a final trading decision to buy, sell or do nothing together with the volume to be traded. The indicators, although complete strategies in themselves, only provide the system with suggestions to buy or sell. Weights (ω1 , .., ωn ) are applied to the indicators to arrive at a weighted suggestion W × I. The final decision depends on this weighted suggestion together with the output of multiple model control mechanism which gives the final action to be performed by the agent. The weighted suggestion to trade a certain way determines the volume of shares to be traded at a tick. The weights (ω1 , .., ωn ), represented as two discrete bits in a bit string, are tuned offline with a genetic algorithm. A sign bit associated with each weight is used to evaluate the effect of the weight on the rule. Moody et al. [2001] used an adaptive algorithm called Recurrent Reinforcement Learning (RRL) to optimise a portfolio and showed that direct reinforcement can be used to optimise risk adjusted returns. The RRL algorithm learns profitable trading strategies by maximising risk adjusted returns measured by the Sharpe ratio, and avoid the downside risk by maximising the Downside Deviation (DD) ratio. RRL trader performed far better than Q trader and enables a simpler problem representation. The extended classifier system (XCS) is an accuracy based classifier system where classified fitness is derived from estimated accuracy of reward prediction rather than from reward prediction themselves. It is an online learning machine (OLM) which improves its behaviour with time by learning through reinforcement. That is, if it does well we give it positive reward, else we penalise it in some form. Chauhan [2008] improved the learning of the classifier system by incorporating different reinforcement learning algorithm. Assuming that price movements follow some patterns of ups and downs, he tried to model financial forecasting as a multi step process and implemented Q(1) and Q(λ) RL algorithm. In his settings the agents present in the current system converts the information given by the technical indicators into input (binary string) for the XCS. The system further tries to learn the optimum decision it should take when faced with a particular combination of binary bits. The quality of the learning process for the system to be robust and produces reliable decision (buy, sell or hold) depends on the way we combine the technical indicator information in the system. As a result, one must experiment with the combination of the technical indicators as well as with the reward mechanism of the system. 444 Quantitative Analytics 12.2.3.2 Examples of multiple rules Many traders aim to practise TA as systematically as possible without automation (rule construction) while others use TA as the basis for constructing systems that automatically recommend trade positions (system construction) (see Pictet et al. [1992]). Even though there exists a large number of technical trading strategies in intraday stock trading, most of them are too simplistic and too coarse, but combining them with genetic algorithm (GA) to tune the relative merits of the individual rules, much like traders would do, provides much better results. Various attempts at synthesising multiple rules to come up with a composite trading strategy have been tried before, with the component rules being everything from complete rules (see Li et al. [1999]) to very basic predicates and operators that are combined to generate complex rules (see Oussaidene et al. [1997]). Refenes [1995] considered the method of genetic-based global learning in a trading system in order to find the best combination of indicators for prediction and trading. Similarly, Dunis et al. [1998] used a genetic algorithm on a currency exchange system to optimise parameters based on an ensemble of simple technical trading indicators. In the same spirit Neely et al. [1997] used GP to discover profitable trading rules. Generalising the approach, Dempster et al. [2001] proposed a framework for systematic trading system construction and adaptation based on genetic programs. Work in using a multiple model approach for the development of an effective intraday trading strategy was proposed by Ramamoorthy [2003]. Attempts at designing a strategy in the PLAT 1 domain using reinforcement learning and hill climbing as well as a market maker to be used in completion in the domain have been explored by Sherstov [2003]. Subramanian [2004] aimed at synthesising a strategy where the component rules are independent strategies in themselves, so that they would appeal to a human trader. He tried to see if existing, simple, intuitive strategies could be composed in some way to make a robust, profitable strategy. Subramanian studied the effect of combining multiple intuitive trading rules within the framework of PLAT by exploring two schemes of operation (adding weights to the trading suggestions or deleting certain rules) wherein the automated agent trades based on a combination of signals it receives from the various simplistic rules. Subramanian showed that technical indicators are not as profitable when used alone as they are when used in conjunction with other technical trading rules. Ramamoorthy et al. [2004] designed safe strategies for autonomous trading agents by considering a qualitative characterisation of the stochastic dynamics of some simple trading rules. 1 The PLAT domain uses the Penn Exchange Server (PXS) (real world, real time stock market data for simulated automated trading) to which the trading agents can plug in (see 19). PXS works in a maner very similar to the Island electronic crossing network (ECN). 445 Part V Numerical Analysis 446 Quantitative Analytics In this part we present a few numerical tools to perform the necessary computation when performing quantitative trading strategies. 447 Chapter 13 Presenting some machine-learning methods Machine learning is about programming computers to learn and to improve automatically with experience. While computers can not yet learn as well as people, algorithms have been devised that are effective for certain types of learning tasks, and a theoretical understanding of learning has emerged. Computer programs developed, exhibiting useful types of learning, especially in speech recognition and data mining (see Mitchell [1997]). Machine learning is inherently a multidisciplinary field drawing results from artificial intelligence, probability and statistics, computational complexity theory, control theory, information theory, philosophy, psychology, neurobiology, and other fields. We are going to introduce some of these fields as they have been extensively used in the financial industry to devise systematic trading strategies. 13.1 Some facts on machine-learning 13.1.1 Introduction to data mining The rapid growth and integration of databases provided scientists, engineers, and business people with a vast new resource that can be analysed to make scientific discoveries, optimise industrial systems, and uncover financially valuable patterns. New methods targeted at large data mining problems have been developed. Data Mining (DM) is the analysis of (large) observational data sets to find unsuspected relationships and to summarise the data in novel ways that are both understandable and useful to the data owner (see Hand et al. [2001]). There exists several functionalities to DM, such that data characterisation summarising the general characteristics or features of a target class of data, and data discrimination comparing the general features of target class data objects with the general features of objects from a set of contrasting classes. Further, association analysis is the discovery of association rules showing attribute value conditions occurring frequently together in a given set of data. Classification is the process of finding a set of models (or functions) that describe and distinguish data classes or concepts, for the purpose of being able to use the model to predict the class of objects whose class label is unknown. Machine learning have been traditionally used for classification, where models such as decision trees, SVM, neural networks, Bayesian belief networks, genetic algorithm etc have been considered. The ability to perform classification and be able to learn to classify objects is paramount to the process of decision making. One classification task, called supervised learning, consists of a specified set of classes, and example objects labelled with the appropriate class. The goal being to learn from the training objects, enabling novel objects to be identified as belonging to one of the classes. The process of seeking relationships within a data set involves a number of steps 1. Model or pattern structure: determining the nature and structure of the representation to be used. 2. Score function: deciding how to quantify and compare how well different representations fit the data (choosing a score function). 448 Quantitative Analytics 3. Optimisation and search method: choosing an algorithmic process optimising the score function. 4. Data management strategy: deciding what principles of data management are required for implementing the algorithms efficiently. While a model structure is a global summary of a data set making statements about any point in the full measurement space, pattern structures only make statements about restricted regions of the space spanned by the variables. Score functions judge the quality of a fitted model, and should precisely reflect the utility of a particular predictive model. While the task of finding the best values of parameters in models is cast as an optimisation problem, the task of finding interesting patterns (such as rules) from a large family of potential patterns is cast as a combinatorial problem, and is often accomplished using heuristic search techniques. At last, data management strategy is about the ways in which the data are stored, indexed, and accessed. The success of classification learning is heavily dependent on the quality of the data provided for training, as the learner only has the input to learn from. On the other hand, we want to avoid overfitting the given data set, and would rather find models or patterns generalising potential future data. Note, even though data mining is an interdisciplinary exercise, it is a process relying heavily on statistical models and methodologies. The main difference being the large size of the data sets to manipulate, requiring sophisticated search and examination methods. Further difficulties arise when there are many variables (curse of dimensionality), and often the data is constantly evolving. Recently, a lot of advances have been made on machine learning strategies mimicking human learning, and we refer the reader to Battula et al. [2013] for more details. 13.1.2 The challenges of computational learning While the ability to perform classification and be able to learn to classify objects is paramount to the process of decision making, there exists several types of learning (see Mitchell [1997]), such as • Supervised learning: learning a function from example data made of pairs of input and correct output. • Unsupervised learning: learning from patterns without corresponding output values • Reinforcement learning: learning with no knowledge of an exact output for a given input. Nonetheless, online or delayed feedback on the desirability of the types of behaviour can be used to help adaptation of the learning process. • Active learning: learning through queries and responses. More formally, these types of learning are part of what is called inductive learning where conclusions are made from specific instances to more general statements. That is, examples are provided in the form of input-output pairs [X, f (X)] and the learning process consists of finding a function h (called hypothesis) which approximates a set of samples generated by the function f . The search for the function h is formulated in such a way that it can be solved by using search and optimisation algorithms. Some of the challenges of computational learning can be sumarised as follow: • Identifying a suitable hypothesis can be computationally difficult. • Since the function f is unknown, it is not easy to tell if the hypothesis h generated by the learning algorithm is a good approximation. • The choice of a hypothesis space describing the set of hypotheses under consideration is not trivial. As a result, a simple hypothesis consistent with all observations is more likely to be correct than a complex one. In the case where multiple hypotheses (an Ensemble) are generated, it is possible to combine their predictions with the aim of reducing generalisation error. For instance, boosting works as follow 449 Quantitative Analytics • Examples in the training set are associated with different weights. • The weights of incorrectly classified examples are increased, and the learning algorithm generates a new hypothesis from this new weighted training set. The process is repeated with an associated stopping criterion. • The final hypothesis is a weighted-majority of all the generated hypotheses which can be based on different mixture of expert rules. The difficult part being to know when to stop the iterative process and how to define a proper measure of error. One way forward is to consider the Probably Approximately Correct (PAC) learning which can be described as follow: • A hypothesis is called approximately correct if its error insample lies within a small constant of the true error. • By learning from a sufficient number of examples, one can calculate if a hypothesis has a high probability of being approximately correc. • There is a connection between the past (seen) and the future (unseen) via an assumption stating that the training and test datasets come from the same probability distribution. It follows from the common sense that nonrepresentative samples do not help learning. More formally, a concept class C is said to be PAC learnable using a hypothesis class H if there exists a learning algorithm L such that for all concepts in C, for all instance distributions D on an instance space X, ∀ , δ 0 < , δ < 1 when given access to the example set, produces with probability at least (1 − δ), a hypothesis h from H with error no-more than . To specify the problem we get a set of instances X, a set of hypotheses H, a set of possible target concepts C, training instances generated by a fixed, unknown probability distribution D over X, a target value c(x), some training examples < x, c(x) >, and a hypothesis h estimating c. Then, the error of a hypothesis h satisfies errorD = Px∈D (c(x) 6= h(x)) and the deviation of the true error from the training error satisfies • Training error: h(x) 6= c(x) over training instances. • True error: h(x) 6= c(x) over future random instances. We must now measure the difference between the true error and the training error. Any hypothesis h is consistent when for all training samples, h(x) = c(x) If the hypothesis space H is finite, and D is a sequence of m ≥ 1 independent random examples of some target concept c, then for any 0 ≤ ≤ 1, the probability that V SH,D contains a hypothesis with error greater than is less than |H|e−m and P (1of |H|hyps.consistentwithmexs.) < |H|e−m . Considering a bounded sample size, for the probability to be at most δ, that is, |H|e−m ≤ δ, then 1 1 ln |H| + ln δ More can be found on agnostic learning and infinite hypothesis space in books by Mitchell [1997] and Bishop [2006]. m≥ 450 Quantitative Analytics 13.2 Introduction to information theory 13.2.1 Presenting a few concepts Shannon [1948] introduced Information Theory (IT) by proposing some fundamental limits to the representation and transmission of information. Since then, IT has provided the theoretical motivations for many of the outstanding advances in digital communications and digital storage. One generally uses the following digital communication model in the transfer of information 1. The source is the source of (digital) data 2. The source encoder serves the purpose of removing as much redundancy as possible from the data. It is called the data compression portion. 3. The channel coder puts a modest amount of redundancy back in order to perform error detection or correction. 4. The channel is what the data passes through, possibly becoming corrupted along the way. 5. The channel decoder performs error correction or detection. 6. The source decoder undoes what is necessary to recover the data back. There are other blocks that could be inserted in that model, such as • a block enforcing channel constraints sometime called a line coder. • a block performing encryption/decryption. • a block performing lossy compression. One of the key concept in IT is that information is conveyed by randomness, that is, information is defined in some mathematical sense, which is not identical to the one used by humans. However, it is not too difficult to make the connection between randomness and information. Another important concept in IT is that of typical sequences. In a sequence of bits of length n, there are some sequences which are typical. For example, in a sequence of coin-tossing outcomes for a fair coin, we would expect the number of heads and tails to be approximately equal. A sequence not following this trend is thus atypical. A good part of IT is capturing this concept of typicality as precisely as possible and using it to concluding how many bits are needed to represent sequence of data. The main idea being to use bits to represent only the typical sequences, since the other ones are rare events. This concept of typical sequences corresponds to the asymptotic equipartition property. Given a discrete random variable X, with x a particular outcome occurring with probability p(x). Then, we assign to that event x the information that it conveys via the uncertainty measure uncertainty = − log p(x) where the base of the logarithms determines the units of information. The units of log2 are in bits, that of loge are in nats. For example, a random variable having two outcomes, 0 and 1, occurring with probability p(0) = p(1) = 21 , then each outcome conveys 1 bit of information. However, if p(0) = 1 and p(1) = 0, then the information conveyed when 0 happens is 0. We get no information from it, as we knew all along that it would happen. Hence, the information that 1 happens is ∞, as we are totally surprised by its occurrence. In general, one commonly use the average uncertainty provided by a random variable X taking value in a space χ, leading to the notion of entropy. 451 Quantitative Analytics 13.2.2 Some facts on entropy in information theory The entropy functional, defined on a Markov diffusion process, plays an important roll in the theory of information and statistical physics, informational macrodynamics and control systems. In information theory (IT), entropy is the average amount of information contained in each message received. That is, entropy is a measure of unpredictability of information content. Named after Boltzmann’s H-theorem, Shannon [1948] defined the entropy H of a discrete random variable X with possible values {x1 , .., xn } and probability mass function P (X) as H(X) = E[I(X)] = E[− log P (X)] where I(X) is the information content of X, which is itself a random variable. When taken from a finite sample, the entropy can explicitly be written as Definition 13.2.1 The entropy H(X) of a discrete random variable X taking values {x1 , .., xn } is H(X) = n X p(xi )I(xi ) = − i=1 n X p(xi ) logb p(xi ) i=1 where b is the base of the logarithm used. The unit of entropy is bit for b = 2, nat for b = e (where e is Euler’s number), and dit (or digit) for b = 10. Given the well-known limit limp→0+ p log p = 0, in the case where P (xi ) = 0 for some i, the value of the corresponding summand is taken to be 0. For example, taking a fair coin, we get 1 1 1 1 H(X) = −( log + log ) = 1 bit 2 2 2 2 For a biased coin with p(0) = 0.9, we get H(X) = −(0.9 log 0.9 + 0.1 log 0.1) = 0.469 bit If X is a binary random variable X= 1 with probability p 0 with probability 1 − p then the entropy of X is H(X) = −p log p − (1 − p) log (1 − p) P For some function g(X) of a random variable, we get E[g(X)] = x∈X g(x)p(x) so that for g(x) = log H(X) = E[g(X)] = E[log 1 p(x) 1 ] p(X) We are now interested in the entropy of pairs of random variables (X, Y ). Definition 13.2.2 If X and Y are jointly distributed according to p(X, Y ), then the joint entropy H(X, Y ) is XX H(X, Y ) = −E[log p(X, Y )] = − p(x, y) log p(x, y) x∈X y∈Y Definition 13.2.3 If (X, Y ) ∼ p(x, y), the conditional entropy of two events X and Y is given by XX H(Y |X) = −Ep(x,y) [log p(Y |X)] = − p(x, y) log p(y|x) x∈X y∈Y 452 we get Quantitative Analytics This quantity should be understood as the amount of randomness in the random variable Y given that you know the value of X. The conditional entropy can also be written as E[Y |X] = − X p(x) x∈X = − X X p(y|x) log p(y|x) y∈Y p(x)H(Y |X = x) x∈X Theorem 13.2.1 chain rule H(X, Y ) = H(X) + H(Y |X) We can also have a joint entropy with a conditioning on it. Corollary 2 H(X, Y |Z) = H(X|Z) + H(Y |X, Z) The inspiration for adopting the word entropy in information theory came from the close resemblance between Shannon’s formula and very similar known formulae from statistical mechanics. In statistical thermodynamics the most general formula for the thermodynamic entropy S of a thermodynamic system is the Gibbs entropy X S = −kB pi ln pi i where kB is the Boltzmann constant, and pi is the probability of a microstate. The Gibbs entropy translates over almost unchanged into the world of quantum physics to give the von Neumann entropy, introduced by John von Neumann in 1927 S = −kB T r(ρ ln ρ) where ρ is the density matrix of the quantum mechanical system and T r() is the trace. Note, at a multidisciplinary level, connections can be made between thermodynamic and informational entropy. In the view of Jaynes (1957), thermodynamic entropy, as explained by statistical mechanics, should be seen as an application of Shannon’s information theory: the thermodynamic entropy is interpreted as being proportional to the amount of further Shannon information needed to define the detailed microscopic state of the system, that remains uncommunicated by a description solely in terms of the macroscopic variables of classical thermodynamics, with the constant of proportionality being just the Boltzmann constant. 13.2.3 Relative entropy and mutual information Another useful measure of entropy that works equally well in the discrete and the continuous case is the relative entropy of a distribution. Given a random variable with true distribution p, which we do not know due to incomplete information, instead we assume the distribution q. Then, the code will need more bits to represent the random variable, and the difference in bits is denoted by D(p||q). The relative entropy is defined as the Kullback-Leibler divergence from the distribution to the reference measure q as follows. Definition 13.2.4 The relative entropy or Kullback-Leibler distance between two probability mass functions p(x) and q(x) is defined as X p(x) p(x) DKL (p||q) = Ep [log ]= p(x) log q(x) q(x) x∈X 453 Quantitative Analytics This form is not symmetric, and q appears only in the denominator. Alternatively, assume that a probability distribution p is absolutely continuous with respect to a measure q, that is, it is of the form p(dx) = f (x)q(dx) for some nonnegative q-integrable function f with q-integral 1, then the relative entropy can be defined as Z Z DKL (p||q) = log f (x)p(dx) = f (x) log f (x)q(dx) In this form the relative entropy generalises (up to change in sign) both the discrete entropy, where the measure q is the counting measure, and the differential entropy, where the measure q is the Lebesgue measure. If the measure q is itself a probability distribution, the relative entropy is non-negative, and zero if p = q as measures. It is defined for any measure space, hence coordinate independent and invariant under co-ordinate reparametrisations if one properly takes into account the transformation of the measure q. The relative entropy, and implicitly entropy and differential entropy, do depend on the reference measure q. Another important concept, called mutual information, describes the amount of information a random variable tells about another one. That is, observing the output of a channel, we want to know what information was sent. The channel coding theorem is a statement about mutual information. Definition 13.2.5 Let X and Y be random variables with joint distribution p(X, Y ) and marginal distributions p(x) and p(y). The mutual information I(X; Y ) is the relative entropy between the joint distribution and the product distribution I(X; Y ) = D(p(x, y)||p(x)p(y)) X X p(x, y) = p(x) p(x, y) log p(x)p(y) x∈X y∈Y Note, when X and Y are independent, p(x, y) = p(x)p(y), and we get I(X; Y ) = 0. That is, in case of independence, Y , can not tell us anything about X. An important interpretation of mutual information comes from the following theorem. Theorem 13.2.2 I(X; Y ) = H(X) − H(X|Y ) which states that the information that Y tells us about X is the reduction in uncertainty about X due to the knowledge of Y . By symmetry we get I(X; Y ) = H(Y ) − H(Y |X) = I(Y ; X) Using H(X, Y ) = H(X) + H(Y |X), we get I(X; Y ) = H(X) + H(Y ) − H(X, Y ) The information that X tells about Y is the uncertainty in X plus the uncertainty about Y minus the uncertainty in both X and Y . We can summarise statements about entropy as follows I(X; Y ) = H(X) − H(X|Y ) I(X; Y ) = H(Y ) − H(Y |X) I(X; Y ) = H(X) + H(Y ) − H(X, Y ) I(X; Y ) I(X; X) = I(Y ; X) = H(X) 454 Quantitative Analytics When dealing with the sequence of random variables X1 , .., Xn drawn from the joint distribution p(x1 , .., xn ), a variety of chain rules have been developed. Theorem 13.2.3 The joint entropy of X1 , .., Xn is H(X1 , .., Xn ) = n X H(Xi |Xi−1 , .., X1 ) i=1 The chain rule for entropy leads us to a chain rule for mutual information. Theorem 13.2.4 I(X1 , .., Xn ; Y ) = n X I(Xi ; Y |Xi−1 , ..., X1 ) i=1 13.2.4 Bounding performance measures A large part of information theory consists in finding bounds on certain performance measures. One of the most important inequality used in IT is the Jensen’s inequality. We are interested in convex functions because it is known that over the interval of convexity, there is only one minimum (for details see Appendix (A.1)). The following theorem describe the information inequality. Theorem 13.2.5 log x ≤ x − 1, with equality if and only if x = 1. We can now characterise some of the information measures defined above. Theorem 13.2.6 D(p||q) ≥ 0, with equality if and only if p(x) = q(x) for all x. Corollary 3 Mutual information is positive, I(X; Y ) ≥ 0, with equality if and only if X and Y are independent. We let the random variable X takes values in the set X , and we let |X | denotes the number of elements in that set. For discrete random variables, the uniform distribution over the range X has the maximum entropy. Theorem 13.2.7 H(X) ≤ log |X |, with equality if and only if X has a uniform distribution. Note, if you can show that some performance criterion is upper-bounded by some function, then by showing how to achieve that upper bound, we have found an optimum. We see that the more we know, the less uncertainty there is. Theorem 13.2.8 Condition reduces entropy: H(X|Y ) ≤ H(X) with equality if and only if X and Y are independent. Theorem 13.2.9 H(X1 , ..., Xn ) ≤ n X H(Xi ) i=1 with equality if and only if Xi are independent. The following theorem allow us to deduce the concavity (or convexity) of many useful functions. 455 Quantitative Analytics Theorem 13.2.10 Log-sum inequality For non-negative numbers a1 , ..., an and b1 , .., bn , n X Pn n X ai ai ai log ≥ ai log Pi=1 n b i i=1 bi i=1 i=1 with equality if and only if ai bi = constant . The conditions on this theorem are much weaker than the one for Jensen’s inequality, since it is not necessary to have the sets of numbers add up to 1. Using this inequality, one can prove a convexity statement about the relative entropy function. Theorem 13.2.11 If (p1 , q1 ) and (p2 , q2 ) are pairs of probability mass function, then D(λp1 + (1 − λ)p2 ||λq1 + (1 − λq2 )) ≤ λD(p1 ||q1 ) + (1 − λ)D(p2 ||q2 ) for all 0 ≤ λ ≤ 1. That is, D(p||q) is convex in the pair (p, q). Further, Theorem 13.2.12 H(p) is a concave function of p. Theorem 13.2.13 Let (X, Y ) ∼ p(x, y) = p(x)p(y|x). The mutual information I(X; Y ) is a concave function of p(x) for fixed p(y|x) and a convex function of p(y|x) for fixed p(x). The data processing inequality states that no matter what processing we perform on some data, we can not get more information out of a set of data than was there to begin with. In a sense, it provides a bound on how much can be accomplished with signal processing. Definition 13.2.6 Random variable X, Y , and Z are said to form a Markov chain in that order, denoted by X → Y → Z if the conditional distribution of Z depends only on Y and is independent of X. (That is, if we know Y , then knowing X also does not tell us any more than if we only know Y ). if X, Y , and Z form a Markov chain, then the joint distribution can be written p(x, y, z) = p(x)p(y|x)p(z|y) The concept of a state is that knowing the present state, the future of the system is independent of the past. The conditional independence idea means p(x, z|y) = p(x, y, z) p(x, y)p(z|y) = = p(x|y)p(z|y) p(y) p(y) Note, if Z = f (Y ) then X → Y → Z. Theorem 13.2.14 Data processing inequality If X → Y → Z, then I(X; Y ) ≥ I(X; Z) If we think of Z as being the result of some processing done on the data Y , that is, Z = f (Y ) for some deterministic or random function, then there is no function that can increase the amount of information that Y tells about X. 456 Quantitative Analytics 13.2.5 Feature selection A fundamental problem of machine learning is to approximate the functional relationship f (•) between an input X = {x1 , x2 , .., xM } and an output Y , based on a memory of data points, {Xi , Yi }, i = 1, .., N , where the Xi are vectors of reals and the Yi are real numbers. There are some cases where the output Y is not determined by the complete set of the input features X = {x1 , x2 , .., xM }, but it is only decided by a subset of them {x(1) , x(2) , .., x(m) }, where m < M . When we have sufficient data and time, we can use all the input features, including the irrelevant ones, to approximate the underlying function between the input and the output. However, in practice the irrelevant features raise two problems in the learning process. 1. The irrelevant input features will induce greater computational cost. 2. The irrelevant input features may lead to overfitting As a result, it is reasonable and important to ignore those input features with little effect on the output, so as to keep the size of the approximator model small. While the feature selection problem has been studied by the statistics and machine learning communities for decades, it has received much attention in the field of data mining. Some researchers call it filter models, while other classify it as wrapped around methods. It is also known as subset selection in the statistics community. Since the computational cost of brute-force feature selection method is prohibitively high, with considerable danger of overfitting, people resort to greedy methods, such as forward selection. We must first clarify the problem of performance evaluation of a set of input features. Even if the feature sets are evaluated by test-set cross-validation or leave-one-out cross validation, an exhaustive search of possible feature sets is likely to find a misleadingly well scoring feature set by chance. To prevent this from happening, we can use a cascaded cross-validation procedure, which selects from increasingly large sets of features (and thus from increasingly large model classes). 1. Shuffle the data set and split into a training set of 70% of the data and a test-set of the remaining 30%. 2. Let j vary among feature set sizes j = (0, 1, .., m) (a) Let fsj = best feature set of j, where best is measured as the minimiser of the leave-one-out crossvalidation error over the training set. (b) Let T estscorej = the RMS prediction error of feature set fsj on the test-set. 3. Select the feature set fsj for which the test-set score is minimised. The score for the best feature set of a given size is computed by independent cross-validation from the score for the best size of feature set. Note, this procedure does not describe how the search for the best feature set of size j in step 2a) is done. Further, the performance evaluation of a feature selection algorithm is more complicated than the evaluation of the feature set. This is because we must first ask the algorithm to find the best feature subset. We must then give a fair estimate of how well the feature selection algorithm performs by trying the first step on different data sets. Hence, the full procedure of evaluating the performance of a feature selection algorithm (described above) should have two layers of loops (see algorithm below). The inner loop using an algorithm to find the best subset of features, and the outer loop evaluating the performance of the algorithm with different data sets. 1. Collect a training data set from the specific domain. 2. Shuffle the data set. 3. Break it into P partition, say P = 20. 4. For each partition (i = 0, 1, .., P − 1) 457 Quantitative Analytics (a) Let OuterT rainset(i) = all partitions except i. (b) Let OuterT estset(i) = the ith partition. (c) Let InnerT rain(i) = randomly chosen 70% of the OuterT rainset(i). (d) Let InnerT est(i) = the remaining 30% of the OuterT rainset(i). (e) For j = 0, 1, .., m Search for the best feature set with j components fsij using leave-one-out on InnerT rain(i). Let InnerT estScoreij = RMS score of fsij on InnerT est(i) End loop of (j). (f) Select the fsij with the best inner test score. (g) Let OuterScorei = RMS score of the selected feature set on OuterT estset(i). End of loop of (i). 5. Return the Mean Outer Score We are now going to introduce the forward feature selection algorithm, and explore three greedy variants of this algorithm improving the computational efficiency without sacrifying too much accuracy. The forward feature selection procedure begins by evaluating all feature subsets consisting of only one input attribute. We start by measuring the leave-one-out cross-validation (LOOCV) error of the one-component subsets {X1 }, {X2 }, ..{XM }, where M is the input dimensionality, so that we can find the best individual feature X(1) . Next, the forward selection finds the best subset consisting of two components, X(1) , and one other feature from the remaining M − 1 input attributes. Hence, there are a total of M − 1 pairs. We let X(2) be the other attribute in the best pair besides X(1) . Then, the input subsets with three, four, and more features are evaluated. According to the forward selection, the best subset with m features is the m-tuple consisting of {X1 }, {X2 }, ..{Xm }, while overall, the best feature set is the winner out of all the M steps. Assuming that the cost of a LOOCV evaluation with i features is C(i), then the computational cost of forward selection searching for a feature subset of size m out of M total input attributes will be M C(1) + (M − 1)C(2) + ... + (M − m + 1)C(m) For example, the cost of one prediction with one-nearest neighbour as the function approximator, using a kd-tree with j inputs, is O(j log N ) where N is the number of data points. Thus, the cost of computing the mean leave-one-out error, which involves N predictions, is O(jN log N ). Hence, the total cost of feature selection using the above formula is O(m2 M N log N ). An alternative solution to finding the total best input feature set is to employ exhaustive search. This method starts with searching the best one-component subset of the input features, which is the same in the forward selection algorithm. Then, we need to find the best two-component feature subset which may consist of any pairs of the input features. Afterwards, it consists in finding the best triple out of all the combinations of any three input features, etc. One can see that the cost of exhaustive search is M M M C(1) + C(2) + .... + C(m) 2 m and we see that the forward selection is much cheaper than the exhaustive search. However, the forward selection may suffer due to its greediness. For example, if X(1) is the best individual feature, it does not guarantee that either {X(1) , X(2) } or {X(1) , X(3) } must be better than {X(2) , X(3) }. As a result, a forward selection algorithm may select a feature set different from that selected by the exhaustive searching. Hence, with a bad selection of the input features, the prediction Yq of a query Xq = {x1 , x2 , ..., xM } may be significantly different from the true Yq . 458 Quantitative Analytics In the case where the greediness of forward selection does not have a significantly negative effect on accuracy, we need to know how to modify the forward selection algorithm to be greedier in order to further improve the efficiency. There exists several greedier feature selection algorithms whose goal is to select no more than m features from a total of M input attributes, and with tolerable loss of prediction accuracy. We briefly discuss three of these algorithms 1. The super greedy algorithm: do all the 1-attribute LOOCV calculations, sort the individual features according to their LOOCV mean error, then take the m best features as the selected subset. Thus, we do M computations involving one feature and one computation involving m features. If the nearest neighbour is the function approximator, the cost of super greedy algorithm is O((M + m)N log N ). 2. The greedy algorithm: do all the 1-attribute LOOCV and sort them, take the best two individual features and evaluate their LOOCV error, then take the best three individual features, and so on, until m features have been evaluated. Compared with the super greedy algorithm, this algorithm may conclude at a subset whose size is smaller than m but whose inner tested error is smaller than that of the m component feature set. Hence, the greedy algorithm may end up with a better feature set than the super greedy one does. The cost of the greedy algorithm for the nearest neighbour is O((M + m2 )N log N ). 3. The restricted forward selection (RFS): (a) caculate all the 1-feature set LOOCV errors, and sort the features according to the corresponding LOOCV errors. We let the features ranking from the most important to the least important be X(1) , X(2) , ..., X(M ) . (b) do the LOOCV of 2-feature subsets consisting of the winner of the first round, X(1) , along with another feature, either X(2) or X(3) , or any other one until X( M ) . There are M 2 of these pairs. The winner of this 2 round will be the best 2-component feature subset chosen by RFS. (c) calculate the LOOCV errors of M 3 subsets consisting of the winner of the second round, along with the other M features at the top of the remaining rank. In this way, the RFS will select its best feature triple. 3 (d) continue this procedure until RFS has found the best m-component feature set. (e) From step 1) to step 4), the RFS has found m feature sets whose sizes range from 1 to m. By comparing their LOOCV errors, the RFS can find the best overall feature set. One of the difference between RFS and conventional forward selection (FS) is that at each step, when inserting an additional feature into the subset, the FS considers all the remaining features, while the RFS only tries the part of them which seems the more promising. The cost of RFS for the nearest neighbour is O(M mN log N ). We are left with finding out how cheap and how accurate all these varieties of forward selection are compared with the conventional forward selection method. Using real world data sets from StatLib/CMU and UCI’s machine learning data repository coming from different domains such as biology, sociology, robotics etc, it was demonstrated that Exhaustive Search (ES) is prohibitively time consuming. Even though the features selected by FS may differ from the result of ES because some of the input features are not mutually independent, ES is far more expensive than the FS, while it is not significantly more accurate than FS. In order to investigate the influence of greediness on the above three greedy algorithms, we consider 1. the probabilities for these algorithms to select any useless features 2. the prediction errors using the feature set selected by these algorithms 3. the time cost for these algorithms to find their feature sets It was found that FS does not eliminate more useless features than the greedier competitors except for the Super Greedy one. However, the greedier the algorithm, the more easily confused by the relevant but corrupted features it becomes. Further, the three greedier feature selection algorithms do not suffer great loss in accuracy, and RFS performs almost 459 Quantitative Analytics as well as the FS. As expected, the greedier algorithms improve the efficiency. It was found that the super greedy algorithm (Super) was ten time faster than the FS, while the greedy algorithm (Greedy) was seven times faster, and the restricted forward selection (RFS) was three times faster. Finally, the RFS performed better than the conventional FS in all aspects. Inserting more independent random noise and corrupted features to the data sets, the probability for any corrupted feature to be selected remained almost the same, while that of independent noise reduced greatly. To conclude, while in theory the greediness of feature selection algorithms may lead to great reduction in the accuracy of function approximation, in practice it does not often happen. The three greedier algorithms discussed above improve the efficiency of the forward selection algorithm, especially for larger data sets with high input dimensionalities, without significant loss in accuracy. Even in the case where the accuracy is more crucial than the efficiency, restricted forward selection is more competitive than the conventional forward selection. 13.3 Introduction to artificial neural networks 13.3.1 Presentation We saw in Section (6.1.1.2) that we could use wavelet analysis to decompose complex system into simpler elements, in order to understand them. We are now going to show how to gather simple elements to produce a complex system. Networks is one approach among others achieving that goal. They are characterised by a set of interconnected nodes seen as computational units receiving inputs and processing them to obtain an output. The connections between nodes, which can be unidirectional or bidirectional, determine the information flow between them. We obtain a global behaviour of the network, called emergent, since the abilities of the network supercede the one of its elements, making networks a very powerful tool. Since Neural Nets have been widely studied by computer scientists, electronic engineers, biologists, psychologists etc, they have been given many different names such as Artificial Neural Networks (ANNs), Connectionism or Connectionist Models, Multi-layer Percepetrons (MLPs), or Parallel Distributed Processing (PDP). However, a small group of classic networks emerged as dominant such as Back Propagation, Hopfield Networks, Competitive Networks and networks using Spiky Neurons. Among the different networks existing, the artificial neural networks (ANNs) is inspired from natural neurons receiving signals through synapses located on the dendrites, or membrane of the neuron. When the signals received are strong enough (surpass a certain threshold), the neuron is activated and emits a signal through the axon, which might be sent to another synapse, and might activate other neurons. ANN is a high level abstraction of real neurons consisting of inputs (like synapses) multiplied by weights (strength of the respective signals), and computed by a mathematical function determining the activation of the neuron. Another function computes the output of the artificial neuron (sometimes in dependence of a certain threshold). Depending on the weights (which can be negative), the computation of the neuron will be different, such that by adjusting the weights of an artificial neuron we can obtain the output we want for specific inputs. In presence of a large number of neurons we must rely on an algorithm to adjust the weights of the ANN to get the desired output from the network. This process of adjusting the weights is called learning or training. Artificial neural networks (ANNs) provide a general, practical method for learning real-valued, discrete-valued, and vector-valued functions from examples. Algorithms such as back-propagation use gradient descent to tune network parameters to best fit a training set of input-output pairs, making the learning process robust to errors in the training data. Various successful applications to practical problems developed, such as learning to recognise handwritten characters (see LeCun et al. [1989]) and spoken words (see Lang [1990]), learning to detect fraudulent use of credit cards, drive autonomous vehicles on public highways (see Pomerleau [1993]). Rumelhart et al. [1994] provided a survey of practical applications. Since McCulloch et al. [1943] introduced the first ANN model, various models where developed with different functions, accepted values, topology, learning algorithms, hybrid models where each neuron has a larger set of 460 Quantitative Analytics properties etc. For simplicity of exposition we are briefly going to describe the back-propagation algorithm proposed by Rumelhart et al. [1986]. The idea being that multilayer ANN can approximate any continuous function. This algorithm is a layer feed-forward ANN, since the artificial neurons are organised in layers with signals sent forward and with errors propagated backwards. The network receives inputs via neurons in the input layer, and the output of the network is given via neurons on the output layers. There may be one or more intermediate hidden layers. The back-propagation algorithm uses supervised learning where we provide the algorithm with examples of the inputs and outputs we want the network to compute, and then the error (difference between actual and expected results) is calculated. Defining the network function ψ as a particular implementation of a composite function from input to output space, the learning problem consists in finding the optimal combination of weights so that ψ approximates a given function f as closely as possible. However, in practice the function f is not given explicitly but only implicitly through some examples. 13.3.2 Gradient descent and the delta rule One way forward to finding the optimal combination of weights is to consider the delta rule which uses gradient descent to search the hypothesis space of possible weight vectors to find the weights best fitting the training examples. The gradient descent provides the basis for the backpropagation algorithm, which can learn networks with many interconnected units. Given a vector of input x ∈ Rn , we consider the task of training an unthresholded perceptron, that is, a linear unit for which the output O is given by O(x) = w.x A linear unit is the first stage of a perceptron without the threshold. We must specify a measure for the training error of a hypothesis (weight vector), relative to the set D of training examples. A common measure is to use p E(w) = 1X (Oi − di )2 2 i=1 where di is the target output for training example i and Oi is the output of the linear unit for training example i. One can show that under certain conditions, the hypothesis minimising E is also the most probable hypothesis in H given the training data. The entire hypothesis space of possible weight vectors and their associated E values produce an error surface. Given the way in which we defined E, for linear units, this error surface must always be parabolic with a single global minimum. The gradient descent search determines a weight vector minimising E by starting with an arbitrary initial weight vector, and then repeatedly modifying it in small steps. At each step, the weight vector is altered in the direction that produces the steepest descent along the error surface, until a global minimum error is reached (see details in Appendix (A.9)). This direction is found by computing the derivative of E with respect to each component of the vector w, called the gradient of E with respect to w, given by ∂E ∂E , ..., ∂w1 ∂wn The gradient specifies the direction that produces the steepest increase in E, and its negative produces the steepest decrease. Hence, the training rule for gradient descent is ∇E(w) = w ← w + ∆w where ∆w = −η∇E(w) where η > 0 is the learning rate determining the step size in the gradient descent search. The negative sign implies that we move the weight vector in the direction that decreases E. Given the definition of E(w) we can easily differentiate ∂E the vector of ∂w derivatives as i 461 Quantitative Analytics p ∂E ∂ 1X = (Ok − dk )2 , i = 1, ..., n ∂wi ∂wi 2 k=1 which gives after some calculation p X ∂E = (Ok − dk )xi,k ∂wi k=1 where xi,k is the single input component xi for training example k. The weight update rule for gradient descent is ∆wi = −η p X (Ok − dk )xi,k = η k=1 p X (dk − Ok )xi,k k=1 In the case where η is too large, the gradient descent search may overstep the minimum in the error surface rather than settling into it. One solution is to gradually reduce the value of η as the number of gradient descent steps grows. Gradient descent is a strategy for searching through a large or infinite hypothesis space which can be applied whenever 1. the hypothesis space contains continuously parameterised hypotheses. 2. the error can be differentiated with respect to these hypothesis parameters. The key practical difficulties in applying gradient descent are 1. converging to a local minimum can sometimes be quite slow. 2. if there are multiple local minima in the error surface, then there is no guarantee that the procedure will find the global minimum. While the gradient descent training rule computes weight updates after summing over all the training examples in D, the stochastic gradient descent approximate this gradient descent search by updating weights incrementally, following the calculation of the error for each individual example. Hence, as we iterate through each training example, we update the weight according to ∆wi = η(d − O)xi where the subscript i represents the ith element for the training example in question. One way of viewing this stochastic gradient descent is to consider a distinct error function Ek (w) defined for each individual training example k as follow 1 (dk − Ok )2 2 where dk and Ok are the target value and the unit output value for training example k. We therefore iterates over the training examples k in D, at each iteration altering the weights according to the gradient with respect to Ek (w). The sequence of these weight updates provides a reasonable approximation to descending the gradient with respect to the original error function E(w). This training rule is known as the delta rule, or sometimes the least-mean-square (LMS) rule. Note, the delta rule converges only asymptotically toward the minimum error hypothesis, but it converges regardless of whether the training data are linearly separable. Ek (w) = 13.3.3 Introducing multilayer networks While a single perceptron can only express linear decision surfaces, multilayer networks are capable of expressing a rich variety of nonlinear decision surfaces. Since multiple layers of cascaded linear units can only produce linear functions, we need to introduce another unit to represent highly nonlinear functions. That is, we need a unit whose output is a nonlinear function of its inputs, but which is also a differentiable function of its input. We are now going to discuss such a unit and then describe how to apply the gradient descent in the case of multilayer networks. 462 Quantitative Analytics 13.3.3.1 Describing the problem We consider a feed-forward network n input and m output units consisting of k hidden layers which can exhibit any desired feed-forward connection pattern. We are also given a training set {(x1 , d1 ), ..., (xp , dp )} consisting of p ordered pairs of n- and m-dimensional vectors called the input and output patterns, respectively. We assume that the primitive functions at each node of the network is continuous and differentiable, and that the weights of the edges are real numbers selected randomly so that the output Oi of the network is initially different from the target di . The idea being to minimise the distance between Oi and di for i = 1, ..., p by using a learning algorithm searching in a large hypothesis space defined by all possible weight values for all the units in the network. There are different measures of error (see Section (14.2.1.2)), and for simplicity we let the error function of the network be given by p 1X E= ||Oi − di ||22 2 i=1 which is a sum of L2 norms. After minimising the function with a training set, we can consider new unknown patterns and use the network to interpolate it. We use the backpropagation algorithm to find a local minimum to the error function by computing recursively the gradient of the error function and correcting the initial weights. Every one of the j output units of the network is connected to a node evaluating the function 12 (Oi,j − di,j )2 where Oi,j and di,j denote the jth component of the output vector Oi and the target vector di , respectively. The outputs of the additional m nodes are collected at a node which adds them up and gives the sum Ei as its output. The same network extension is built for each pattern di . We Ppcan then collect all the quadratic errors and output their sum, obtaining the total error for a given training set E = i=1 Ei . Since E is computed exclusively through composition of the node functions, it is a continuous and differentiable function of the q weights w1 , .., wq in the network. Therefore, we can minimise E by using an iterative process of gradient descent where we need to calculate the gradient ∇E = ∂E ∂E , ..., ∂w1 ∂wq and each weight is updated with the increment ∆wi = −η ∂E for i = 1, .., q ∂wi where η is a learning constant, that is, a proportionality parameter defining the step length of each iteration in the negative gradient direction. Hence, once we have a method for computing the gradient,we can adjust the weights iteratively until we find a minimum of the error function where ∇E ≈ 0. Remark 13.3.1 In the case of multilayer networks, the error surface can have multiple local minima. Hence, the minimisation by steepest descent will only produce a local minimum of the error function, and not necessarily the global minimum error. 13.3.3.2 Describing the algorithm For simplicity of exposition we first describe the algorithm in the case where there is no hidden layer and the training set consists of a single input-output pair (p = 1). We assume a set of artificial neurons {fi,j }, each receiving {xi }ni=1 input and computing {Oj }m j=1 output, and we focus our attention on one of the weights, wi,j , going from input i to neuron j in the network. We let W denote the n × m matrix with element wi,j at the ith row and the jth column and we let w(j) be the n × 1 row vector for the jth column. In the back-propagation algorithm the activation function is given by the weighted sum Aj (x, w) = x.w(j) = n X i=1 463 xi wi,j , j = 1, .., m Quantitative Analytics which only depends on the inputs and the weights wi,j from input i to neuron j. We let the output function (or threshold box) be a function g of the activation function, getting Oj (x, w) = g(Aj (x, w) + bj ) , j = 1, .., m where x = (x1 , .., xn ) and bj is a bias value. In compact form the output vector of all units is O(x, w) = g(xW ) using the convention that we apply the function g(•) to each component of the argument vector. The simplest output function is the identity function. When using a threshold activation function, if the previous output of the neuron is greater than the threshold of the neuron, the output of the neuron will be one, and zero otherwise. Further, to simplify computation, the threshold can be equated to an extra weight. The error being the difference between the actual and the desired output, it only depends on the weights. Hence, to minimise the error by adjusting the weights, we define the error function for the output of each neuron. The error function for the jth neuron satisfies Ej (x, w, d) = (Oj (x, w) − dj )2 , j = 1, .., m where dj is the jth element the desired target vector d. In that setting, the total error of the network is simply the sum of the errors of all the neurons in the output layer m E(x, w, d) = 1 1X ||O(x, w) − d(x)||22 = Ej (x, w, d) 2 2 j=1 To minimise the error, we will update the weights of the network so that the expected error in the next iteration is lower using the method of gradient descent. Each weight is updated using the increment l+1 l ∆wi,j = wi,j − wi,j = −η ∂E l ∂wi,j where l is the iteration counter, and η ∈ (0, 1] is a learning rate. The size of the adjustment depends on η and on the contribution of the weight to the error of the function. The adjustment will be largest for the weight contributing the most to the error. We repeat the process until the error is minimal. We use the chain rule to compute the gradient of the error function. Since this method requires computation of the gradient of the error function at each iteration step, we must guarantee the continuity and differentiability of the error function. One way forward is to use the sigmoid, or logistic function (see details in Appendix (A.2)), a real function fc : R → (0, 1) defined as 1 1 + e−cx where the constant c can be chosen arbitrarily, and its reciprocal 1c is called the temperature parameter. For c → ∞ the sigmoid converges to a step function at the origin. Further, limx→∞ fc (x) = 1, limx→−∞ fc (x) = 0, and limx→0 fc (x) = 21 . The derivative of the sigmoid with respect to x is fc (x) = d ce−cx fc (x) = = cfc (x)(1 − fc (x)) dx (1 + e−cx )2 To get a symmetric output function, we can consider the symmetrical sigmoid fs (x) defined as 1 − e−x 1 + e−x x which is the hyperbolic tangent for the argument 2 . Several other output functions can be used and have been proposed in the back-propagation algorithm. Note, smoothed output function can lead to local minima in the error function which would not be there if the Heavised function had been used. fs (x) = 2f1 (x) − 1 = 464 Quantitative Analytics 13.3.3.3 A simple example To explain the method, we first consider a two-layers ANN model, where the most common output function used with a threshold is the sigmoidal function Oj (x, w) = 1 1 + eAj (x,w) with the limits limAj →∞ = 0, limAj →−∞ = 1, and limAj →0 = 12 allowing for a smooth transition between the low and high output of the neuron. We compute the gradient of the total error with respect to the weight wi,j , noted ∇E(wi,j ), where it is understood that the subscripts i and j are fixed integers within i = 1, ..., n and j = 1, .., m. From the linearity of the total error function, the gradient is given by m ∂E 1 X ∂Ej = , i = 1, ..., n ∂wi,j 2 j=1 ∂wi,j where the subscripts i and j are fixed integers in the partial derivatives. We first differentiate the total error with respect to the output function ∂E = (Oj − dj ) ∂Oj and then differentiate the output function with respect to the weights ∂Oj ∂Aj ∂Oj = = Oj (1 − Oj )xi ∂wi,j ∂Aj ∂wi,j since ∂Aj ∂wi,j = xi . Putting terms together, the adjustment to each weight becomes ∆wi,j = −η(Oj − dj )Oj (1 − Oj )xi We can use the above equation to train an ANN with two layers. Given a training set with p input-output pairs, the error function can be computed by creating p similar networks and adding the outputs of all of them to obtain the total error of the set. 13.3.4 Multi-layer back propagation In the case of a multilayer network, again we consider a single input-output pair and assume a set of artificial neurons 0 {fi,j,l }kl=0 where the multilayer subscript l = 0 corresponds to the set of inputs {xi }ni=1 and l = k corresponds to the nk set of outputs {yi }i=1 . In that setting, we define the output function of the jth node for the kth layer as Oj,k (x, w) = g(Aj,k−1 (x, w) + bj,k ) , j = 1, .., nk and we let the corresponding activation function satisfies nk−1 Aj,k−1 (x, w) = X k−1 Oi,k−1 (x, w)wi,j and Oj,0 (x, w) = Aj (x, w) = i=1 where k−1 wi,j n0 X i=1 is the weight going from the ith node in layer k − 1 to the jth node in layer k. 465 0 xi wi,j Quantitative Analytics 13.3.4.1 The output layer k−1 k−1 We start with the output layer k and compute the gradient ∇E(wi,j ) for the weight wi,j going from the ith node in layer k − 1 to the jth node in layer k. From the definition of the total error, the gradient satisfies k−1 ∇E(wi,j )= ∂ ∂ E(x, w, d) = (Oj,k − dj ) k−1 (Oj,k − dj ) k−1 ∂wi,j ∂wi,j since the subsripts i and j are fixed integers. Expending the output function Oj,k , we get ∂ ∂ E(x, w, d) = (Oj,k − dj ) k−1 g Aj,k−1 (x, w) + bj,k k−1 ∂wi,j ∂wi,j Using once again the chain rule, we obtain ∂ ∂ ∂ E(x, w, d) = (Oj,k − dj ) g(Ãj,k−1 (x, w)) k−1 Aj,k−1 (x, w) k−1 ∂A ∂wi,j ∂wi,j j,k−1 k−1 where Ãj,k−1 (x, w) = Aj,k−1 (x, w)+bj,k . The only term that depends on wi,j in the activation function Aj,k−1 (x, w) k−1 is Oi,k−1 (x, w)wi,j , and the rest of the sum will zero out after derivation. Therefore, the gradient becomes ∂ E(x, w, d) k−1 ∂wi,j = (Oj,k − dj ) ∂ ∂ k−1 g(Ãj,k−1 (x, w)) k−1 Oi,k−1 (x, w)wi,j ∂Aj,k−1 ∂wi,j = (Oj,k − dj ) ∂ g(Ãj,k−1 (x, w))Oi,k−1 (x, w) ∂Aj,k−1 k−1 and we obtain the adjustment to each weight ∆wi,j . We let δj,k = (Oj,k − dj ) be the error signal and rewrite the partial derivative as ∂ ∂ E(x, w, d) = δj,k g(Ãj,k−1 (x, w))Oi,k−1 (x, w) k−1 ∂Aj,k−1 ∂wi,j so that the stochastic gradient descent rule for output units bebome k−1 ∆wi,j = −η ∂ ∂ E = −ηδj,k g(Ãj,k−1 (x, w))Oi,k−1 (x, w) k−1 ∂A ∂wi,j j,k−1 k−1 We observe that the weight update rule ∆wi,j is a multiplication of the error introduced to the output times the gradient of the output function of the current neurons input times this neurons input. 13.3.4.2 The first hidden layer k−2 The next step is to consider the hidden layer k − 1 and compute the gradient for the weight wi,j going from the ith node on layer k − 2 to the jth node in layer k − 1. Note, since the subscripts i and j are taken, for notation purpose, k−2 k−2 we use the subscript s to represent the nodes on the kth layer. The gradient ∇E(wi,j ) for the weight wi,j becomes n k−2 ∇E(wi,j )= k X ∂ ∂ E(x, w, d) = (Os,k − ds ) k−2 (Os,k − ds ) k−2 ∂wi,j ∂w i,j s=1 which gives n k X ∂ ∂ E(x, w, d) = (Os,k − ds ) k−2 g As,k−1 (x, w) + bs,k k−2 ∂wi,j ∂wi,j s=1 466 Quantitative Analytics Using once again the chain rule, we obtain n k X ∂ ∂ ∂ g(Ãs,k−1 (x, w)) k−2 As,k−1 (x, w) E(x, w, d) = (Os,k − ds ) k−2 ∂As,k−1 ∂wi,j ∂wi,j s=1 Pnk−1 k−1 k−2 where As,k−1 (x, w) = j=1 Oj,k−1 (x, w)wj,s . The only term that depends on wi,j in the activation function k−1 As,k−1 (x, w) is Oj,k−1 (x, w)wj,s , and the rest of the sum will zero out after derivation. Therefore, the gradient simplifies to n k X ∂ ∂ ∂ k−1 E(x, w, d) = (Os,k − ds ) g(Ãs,k−1 (x, w))wj,s O (x, w) k−2 k−2 j,k−1 ∂As,k−1 ∂wi,j ∂wi,j s=1 which becomes n k X ∂ ∂ ∂ k−1 E(x, w, d) = (Os,k − ds ) g(Aj,k−2 (x, w) + bj,k−1 ) g(Ãs,k−1 (x, w))wj,s k−2 k−2 ∂A ∂wi,j ∂w s,k−1 i,j s=1 Using once again the chain rule, we obtain n k X ∂ ∂ ∂ ∂ k−1 E(x, w, d) = (Os,k − ds ) g(Ãs,k−1 (x, w))wj,s g(Ãj,k−2 (x, w)) k−2 Aj,k−2 (x, w) k−2 ∂As,k−1 ∂Aj,k−2 ∂wi,j ∂wi,j s=1 Pnk−2 k−2 k−2 where Aj,k−2 (x, w) = i=1 Oi,k−2 (x, w)wi,j . The only term that depends on wi,j in the activation function k−2 Aj,k−2 (x, w) is Oi,k−2 (x, w)wi,j , and the rest of the sum will zero out after derivation. Therefore, given the error signal δs,k = (Os,k − ds ), we get ∂ E(x, w, d) k−2 ∂wi,j = = nk X s=1 nk X s=1 δs,k δs,k ∂ ∂As,k−1 k−1 g(Ãs,k−1 (x, w))wj,s ∂ ∂Aj,k−2 g(Ãj,k−2 (x, w)) ∂ k−2 O (x, w)wi,j k−2 i,k−2 ∂wi,j ∂ ∂ k−1 g(Ãs,k−1 (x, w))wj,s g(Ãj,k−2 (x, w))Oi,k−2 (x, w) ∂As,k−1 ∂Aj,k−2 k−2 and we obtain the adjustment to each weight ∆wi,j . Thinking in terms of the error signal, the error from the previous layer is given by δj,k−1 = nk X s=1 δs,k ∂ ∂As,k−1 k−1 g(Ãs,k−1 (x, w))wj,s Remark 13.3.2 Some authors refer to the term Downstream of unit j to describe all units whose direct inputs include the output of unit j. Hence, we see that the error from the previous layer is scaled down in proportion to the amount of how the previous k−2 layer influenced it. Again, the weight update rule ∆wi,j is a multiplication of the error introduced to the output times the gradient of the output function of the current neurons input times this neurons input. That is, 467 Quantitative Analytics ∂ ∂ g(Ãj,k−2 (x, w))Oi,k−2 (x, w) E(x, w, d) = δj,k−1 k−2 ∂Aj,k−2 ∂wi,j 1 By iteration, we repeat this procedure until we reach ∆wi,j . Note, we differentiate the error function with respect to the bias value bj,k in the same way. 13.3.4.3 The next hidden layer k−3 Going one step backward, we consider the hidden layer k − 2 and compute the gradient for the weight wi,j going from the ith node on layer k − 3 to the jth node in layer k − 2. We will also assume that it corresponds to the input layer. Note, since the subscripts i and j are taken, for notation purpose, we use the subscript s to represent the nodes on the kth layer and t to represent the nodes on the (k − 1)th layer. We get n k X ∂ ∂ E(x, w, d) = (Os,k − ds ) k−3 (Os,k − ds ) k−3 ∂wi,j ∂wi,j s=1 which gives n k X ∂ ∂ E(x, w, d) = (Os,k − ds ) k−3 g As,k−1 (x, w) + bs,k k−3 ∂wi,j ∂wi,j s=1 Using once again the chain rule, we obtain n k X ∂ ∂ ∂ E(x, w, d) = (Os,k − ds ) g(Ãs,k−1 (x, w)) k−3 As,k−1 (x, w) k−3 ∂A ∂wi,j ∂wi,j s,k−1 s=1 Pnk−1 k−1 where As,k−1 (x, w) = t=1 Ot,k−1 (x, w)wt,s . Replacing in the equation we get nk−1 nk X X ∂ ∂ ∂ k−1 E(x, w, d) = (O − d ) O (x, w)wt,s g( Ã (x, w)) s,k s s,k−1 k−3 k−3 t,k−1 ∂A ∂wi,j ∂w s,k−1 i,j s=1 t=1 which gives nk−1 nk X X k−1 ∂ ∂ ∂ E(x, w, d) = (O − d ) g( Ã (x, w)) g At,k−2 (x, w) + bt,k−1 wt,s s,k s s,k−1 k−3 k−3 ∂As,k−1 ∂wi,j ∂wi,j s=1 t=1 Using the chain rule, we obtain nk−1 nk X X ∂ ∂ ∂ ∂ k−1 E(x, w, d) = (O −d ) g( Ã (x, w)) g(Ãt,k−2 (x, w)) k−3 At,k−2 (x, w)wt,s s,k s s,k−1 k−3 ∂A ∂A ∂wi,j ∂w s,k−1 t,k−2 i,j s=1 t=1 Pnk−2 k−2 k−3 where At,k−2 (x, w) = j=1 Oj,k−2 (x, w)wj,t . The only term that depends on wi,j in the activation function k−2 At,k−2 (x, w) is Oj,k−2 (x, w)wj,t , and the rest of the sum will zero out after derivation. Therefore, given the error signal δs,k = (Os,k − ds ), we get nk−1 nk X X ∂ ∂ ∂ ∂ k−2 k−1 E(x, w, d) = δ g( Ã (x, w)) g(Ãt,k−2 (x, w)) k−3 Oj,k−2 (x, w)wj,t wt,s s,k s,k−1 k−3 ∂A ∂A ∂wi,j ∂w s,k−1 t,k−2 i,j s=1 t=1 468 Quantitative Analytics which becomes ∂ E(x, w, d) = k−3 ∂wi,j nk X δs,k s=1 nk−1 ∂ ∂As,k−1 g(Ãs,k−1 (x, w)) X t=1 ∂ ∂ k−2 k−1 g(Ãt,k−2 (x, w)) k−3 g(Aj,k−3 (x, w) + bj,k−2 )wj,t wt,s ∂At,k−2 ∂wi,j Setting δ̂t,k−1 = δs,k ∂ ∂As,k−1 k−1 g(Ãs,k−1 (x, w))wt,s we get nk nX k−1 X ∂ ∂ ∂ k−2 E(x, w, d) = δ̂t,k−1 g(Ãt,k−2 (x, w)) k−3 g(Aj,k−3 (x, w) + bj,k−2 )wj,t k−3 ∂A ∂wi,j ∂w t,k−2 i,j s=1 t=1 Note, from linearity we can interchange the summation operators and rewrite the above equation as nk−1 nk XX ∂ ∂ ∂ k−2 E(x, w, d) = δ̂t,k−1 g(Ãt,k−2 (x, w)) k−3 g(Aj,k−3 (x, w) + bj,k−2 )wj,t k−3 ∂A ∂wi,j ∂w t,k−2 i,j t=1 s=1 We then recover the error term δt,k−1 = nk X δ̂s,k = s=1 nk X δs,k s=1 ∂ ∂As,k−1 k−1 g(Ãs,k−1 (x, w))wt,s such that the equation simplifies to nk−1 X ∂ ∂ ∂ k−2 E(x, w, d) = g(Ãt,k−2 (x, w)) k−3 g(Aj,k−3 (x, w) + bj,k−2 )wj,t δt,k−1 k−3 ∂A ∂wi,j ∂w t,k−2 i,j t=1 Using once again the chain rule, we obtain nk−1 X ∂ ∂ ∂ ∂ k−2 E(x, w, d) = δt,k−1 g(Ãt,k−2 (x, w)) g(Ãj,k−3 (x, w)) k−3 Aj,k−3 (x, w)wj,t k−3 ∂A ∂A ∂wi,j ∂wi,j t,k−2 j,k−3 t=1 Pnk−3 k−3 k−3 where Aj,k−3 (x, w) = i=1 Oi,k−3 (x, w)wi,j . The only term that depends on wi,j in the activation function k−3 Aj,k−3 (x, w) is Oi,k−3 (x, w)wi,j , and the rest of the sum will zero out after derivation. Therefore, the gradient simplifies to ∂ E(x, w, d) k−3 ∂wi,j nk−1 = X δt,k−1 t=1 nk−1 = X t=1 δt,k−1 ∂ ∂ ∂ k−3 k−2 g(Ãt,k−2 (x, w)) g(Ãj,k−3 (x, w)) k−3 Oi,k−3 (x, w)wi,j wj,t ∂At,k−2 ∂Aj,k−3 ∂wi,j ∂ ∂At,k−2 g(Ãt,k−2 (x, w)) ∂ ∂Aj,k−3 469 k−2 g(Ãj,k−3 (x, w))Oi,k−3 (x, w)wj,t Quantitative Analytics Writing the error from the previous layer in terms of the Downstream of unit j as nk−1 δj,k−2 = X t=1 δt,k−1 ∂ ∂At,k−2 k−2 g(Ãt,k−2 (x, w))wj,t the gradient becomes ∂ ∂ g(Ãj,k−3 (x, w))Oi,k−3 (x, w) E(x, w, d) = δj,k−2 k−3 ∂Aj,k−3 ∂wi,j so that the stochastic gradient descent rule for the next hidden layer units bebome k−3 ∆wi,j = −η ∂ ∂ g(Ãj,k−3 (x, w))Oi,k−3 (x, w) 3−1 E = −ηδj,k−2 ∂A ∂wi,j j,k−3 which corresponds to the multiplication of the error introduced to the output times the gradient of the output function of the current neurons input times this neurons input. This is the general rule for updating internal unit weights in arbitrary multilayer networks. Hence, the error signal travels from the output layer to the input layer. Further, the weights influence the error by some degree, and they must be taken into consideration when propagating the error. 13.3.4.4 Some remarks Since the error surface for multipayer networks may contain many different local minima, the backpropagation algorithm can only converge toward some local minima in E which is not necessarily the global minimum error. Nonetheless, when the gradient descent falls into a local minimum with respect to one of these weights, it will not necessarily be in a local minimum with respect to other weights. Hence, higher dimensions might provide escape routes to the steepest descent to continue searching the space of possible network weights. In addition, the sigmoid threshold function being approximately linear when the weights are close to zero, we can initialise the network weights to values near zero so that in the early steps the network will represent a very smooth function approximately linear in its inputs. There exists several heuristic to avoid being stuck in a local minima such as adding a momentum term to the weight-update rule or using a stochastic gradient descent. One of the best approach is to train multiple networks using the same data, but initialising each network with different random weights. One can then select the best network according to one of these two methods 1. select the network with the best performance over a separate validation data set. 2. all networks can be retained and treated as a committee of networks whose output is the weighted average of the individual network outputs. Various authors investigated the backpropagation algorithm to find out which function classes could be described by which types of networks. Three general results are known • Boolean functions: every boolean function can be represented exactly by some network with two layers of units, although the number of hidden units required grows exponentially in the worst case with the number of network inputs. • Continuous functions: every bounded continuous function can be approximated with arbitrarily small error (under a finite norm) by a network with two layers of units (see Cybenko [1989]). • Arbitrary functions: any function can br approximated to arbitrary accuracy by a network with three layers of units (see Cybenko [1988]). This is because any function can be approximated by a linear combination of many localised functions having value 0 everywhere except for some small region, and that two layers of sigmoid units are sufficient to produce good local approximations. 470 Quantitative Analytics The hypothesis space for backpropagation is the n-dimensional Euclidean space of the n network weights. Further, as opposed to decision tree where the hypothesis space is discrete , it is continuous for backpropagation leading to a well-defined error gradient. Also, the inductive bias of backpropagation learning is characterised by smooth interpolation between data points. An important property of backpropagation is its ability to discover useful intermediate representations at the hidden unit layers inside the network. This ability of multilayer networks to automatically discover useful representations at the hidden layers is a key feature of ANN learning as it provides extra degree of flexibility to invent features not explicitly introduced by the human designer. 13.4 Online learning and regret-minimising algorithms 13.4.1 Simple online algorithms First, we introduce some notation which will be used through out this section. We use relint (S) to refer to the relative interior of a convex set S, which is the set S minus all of the points on the relative boundary. We use closure (S) to refer to the closure of S, the smallest closed set containing allPof the limit points of S. For any subset S of Rd , we let n H(S) denote the convex hull of S. We let ∆n = {x ∈ Rn : i xi = 1, xi ≥ 0∀i} be the n-dimensional probability simplex. 13.4.1.1 The Halving algorithm To introduce online learning we are first going to present the Halving algorithm where a player has access to the prediction of N experts denoted by f1,t , ..., fN,t ∈ {0, 1} At each time t = 1, .., T , we observe fi,t , i=1,..,N, and predict pt ∈ {0, 1}. We then observe yt ∈ {0, 1} and suffer loss I{pt 6=yt } . Suppose ∃j such that fj,t = yt for all t ∈ [T ]. The the Halving theorem predict pt = majority(Ct ), where C1 = [N ] and Ct ⊆ [N ] is defined below for t > 1. Theorem 13.4.1 If pt = majority(Ct ) and Ct+1 = {i ∈ Ct : fi,t = yt } then we will make at most log2 N mistakes. In fact, for every t at which there is a mistake, at least half of the experts in Ct are wrong, so that |Ct+1 | ≤ |C2t | . It 1| follows that |CT | ≤ |C where M is the tolal number of mistakes. Further, since there is a perfect expert, |CT | ≥ 1. 2M As a result, recalling that C1 = [N ], then 1 ≤ 2NM , such that, after rearranging we get M ≤ log2 N . 13.4.1.2 The weighted majority algorithm To illustrate online, no-regret learning, we consider the problem of learning from expert advice where an algorithm must make a sequence of predictions based on the advice of a set of N experts and receive a corresponding sequence of losses. The aim of the algorithm being to achieve a cumulative loss that is almost as low as the cumulative loss of the best performing expert in hindsight. No statistical assumptions are made about these losses. At every time step t ∈ {1, .., T }, every expert i ∈ {1, .., N } predict fi,t ∈ [0, 1] and receives a loss li,t = l(fi,t , yt ) ∈ [0, 1] such that PT the cumulative loss of expert i at time T is given by Li,T = t=1 li,t . We let the algorithm A (or player) maintains a PN weight wi,t for each expert i at time t, where i=1 wi,t = 1. Hence, these weights can be seen as a distribution over the experts. The algorithm then receives its own instantaneous loss 471 Quantitative Analytics lA,t = N X wi,t li,t i=1 which can be interpreted as the expected loss the algorithm would receive if it always chose an expert to follow according to the current distribution. The cumulative loss of A up to time T is defined as LA,T = T X lA,t = t=1 T X N X wi,t li,t t=1 i=1 For simplicity of exposition we use lt , Lt , and wt to refer to the vector of losses, vector of cumulative loss, and vector of weights, respectively, for each expert on round t. We will use the dot product to relate these vectors. Since the algorithm will not achieve a small cumulative loss if none of the experts perform well, we generally measure the performance of an algorithm in terms of its regret, defined as the difference between the cumulative loss of the algorithm and the loss of the best performing expert RT = LA,T − min i∈{1,...,N } Li,T Hence, the algorithm is said to have no-regret if the average per time step regret approaches 0 as T → ∞. The Randomized Weighted Majority (WM) algorithm (see Littlestone et al. [1994]) is an example of a no-regret algorithm, where the Weighted Majority uses weights e−ηLi,t−1 wi,t = PN −ηLj,t−1 j=1 e where η > 0 is a learning rate parameter and the player’s predict is pt = weighted majority algorithm is PN i=1 wi,t fi,t . The pseudo code for the 1. for t = 1, .., t do • player observes f1,t , .., fN,t • player predicts pt • adversary reveals outcome yt • player suffers loss l(pt , yt ) • experts suffer loss l(fi,t , yt ) 2. end for After T trials, the regret of WM can be bounded as RT = LW M (η),T − such that if T is known in advance, setting η = q setting η = 8 logT N we get the bound q min i∈{1,...,N } log N T r RT ≤ Li,T ≤ ηT + log N η √ yields the standard O( T log N ) regret bound. Further, T log N 2 472 Quantitative Analytics 13.4.2 The online convex optimisation 13.4.2.1 The online linear optimisation problem Given the probability simplex ∆N , the pseudo code for the online linear optimisation is 1. for t = 1, .., t do • player predicts wt ∈ ∆N (wt is essentially a probability distribution) • adversary reveals lt ∈ RN • player suffers loss wt .lt where li,t = l(fi,t , yt ) 2. end for The learner suffers regret RT = T X wt .lt − min w∈∆N t=1 T X w.lt t=1 where lt (w) = w.lt . Note, for the simplex, the distribution w will place all the probability on the best expert. That is, the experts setting is just a special case of the online linear optimisation, where the set K is the N-simplex ∆n . It was proved that the weights chosen by WM are precisely those minimising a combination of empirical loss and an entropic regularisation term (see Kivinen et al. [1997]). That is, the weight vector wt at time t is the solution to the following minimisation problem 1 min w.Lt−1 − H(w) η w∈∆N where Lt−1 is the vector of cumulative loss at time t − 1, ∆N is the probability simplex, and H(•) is the entropy function (see Appendix (13.2.2)) N X H(w) = − wi log(wi ) i=1 Remark 13.4.1 The entropy function acts as a regularisation function for the weight vector w. 13.4.2.2 Considering Bergmen divergence Given the online linear optimisation problem described in Section (13.4.2.1), we consider the minimisation problem for the weight vector wt+1 wt+1 arg min η w∈K t X lt (w) + R(w) s=1 for some convex function R(•). We define Φ0 (w) = R(w) and Φt (w) = Φt−1 (w) + ηlt (w). We also let Df (x, y) be the Bergman divergence between x and y with respect to the function f (see details in Appendix (A.1.6)). Lemma 13.4.1 Suppose K = RN , then for any u ∈ K we get η T X [lt (w) − lt (u)] = DΦ0 (u, w1 ) − DΦT (u, wT +1 ) + t=1 T X t=1 473 DΦT (wt , wt+1 ) Quantitative Analytics and we also get T X lt (w) ≤ inf u∈K t=1 X T X lt (u) + η −1 DR (u, w1 ) + η DΦt (wt , wt+1 ) t=1 Now, suppose that ∇R(w1 ) = 0 and RN = K, then wt+1 = arg min ηlt (w) + DΦt−1 (w, wt ) w∈RN and the two minimisation problems are equivalent. That is, ηlt (w) = Φt (w) − Φt−1 (w) ηlt (w) + DΦt−1 (w, wt ) = Φt (w) − Φt−1 (w) + DΦt−1 (w, wt ) Assuming that the two equations are equivalent for τ ≤ t, and w minimises Φt−1 ∇w DΦt−1 (w, wt ) = ∇w Φt−1 (w, wt ) − ∇w Φt−1 (wt ) ∇Φt (wt+1 ) = ∇Φt−1 (wt ) = ... = ∇R(w1 ) = 0 thus, wt+1 = arg minw∈K Φt (w). Assuming lt ’s are linear functions, and letting R∗ be the Legendre dual of the function R(•) (see details in Appendix (A.1.4)), we get Corollary 4 1. η P lt .wt − P P lt .u = DR (u, w1 ) + DR (u, wt+1 ) + DR (wt , wt − 1) for any u ∈ RN 2. wt+1 = ∇R∗ (∇R(wt ) − ηlt ) 1 Recall, the online gradient descent is wt+1 = wt − ηlt . Further, if R = 21 || • || 2 , ∇R(w) = w, ∇R∗ (w) = w, and if lt (•) are convex (but not necessary linear), then > N η∇l (w) w + DR (w, wt ) Lemma 13.4.2 If we choose wt+1 = arg min P w∈R > t (or equivalently wt+1 = arg minw∈RN η ∇lt (w) w + R(x) ), then T T X X lt (wt ) − lt (u) ≤ η −1 DR (u, w1 ) + DR (wt , wt+1 ) t=1 13.4.2.3 t=1 More on the online convex optimisation problem The WM is an example of a broader class of algorithms collectively known as Follow the Regularized Leader (FTRL) algorithm (see Hazan et al. [2008]). The FTRL template can be applied to a wide class of learning problems falling under the general framework of Online Convex Optimisation (see Zinkevich [2003]). Other problems falling into this framework include online linear pattern classification, online Gaussian density estimation, and online portfolio selection. Further, the online linear optimisation problem is an extension of the expert setting where the weights wt are chosen from a fixed bounded convex action space K ⊂ RN (see Rakhlin [2009]). The algorithm follows 1. Input: convex compact decision set K ⊂ RN . 2. Input: strictly convex differentiable regularisation function R(•) defined on K. 3. Parameter: η > 0. 474 Quantitative Analytics 4. Initialise: L1 =< 0, .., 0 >. 5. for t = 1, .., T do 6. The learner selects action wt ∈ K according to 1 wt = arg min w.Lt−1 + R(w) w∈K η 7. Nature reveals lt , learner suffers loss lt .wt 8. The learner updates Lt = Lt−1 + ll 9. end for Abernethy et al. [2012] showed that the FTRL algorithms for online learning and the problem of pricing securities in a prediction market have a strong syntactic correspondence. To do so they needed to make two assumptions Assumption 2 For each time step t, ||lt || ≤ 1. Assumption 3 The regulasier R(•) has the Legendre property (see Cesa-Bianchi et al. [2006]). R is strictly convex on relint (K) and ||∇R(w)|| → ∞ as w → relint (K). As a result, the solution to the above algorithm will always occur in the relative interior of K such that the optimisation is unconstrained. 13.5 Presenting the problem of automated market making We consider a securities market offering a set of contingent securities (or claims) such as Arrow-Debreu prices, or, more generally oprtion prices. In general, a securities market consists of the tuple O, ρ, Π, R where O is the outcome space, ρ is the payoff function, Π ⊆ Rd is a convex compact set of feasible prices, and R : Rd → R is a strictly convex function with domain Π. The cost function C of the market is assumed to be the conjugate of R with respect to the set Π. The market is complete if it offers at least |O| − 1 linearly independent securities over the outcomes set O. 13.5.1 The market neutral case Various authors proposed a framework to design automated market makers for such markets, where an automated market maker is a market institution setting prices for each security, and always willing to accept trades at these prices. For instance, the Logarithmic Market Scoring Rule (LMSR) market maker is a popular standard prediction market mechanism over combinatorial outcome spaces (see Hanson [2003]). To illustrate the main idea we consider a market maker offering |O| Arrow-Debreu securities 1 , each corresponding to a potential outcome. He uses a differentiable cost function, C : R|O| → R to determine the cost of each security. We let qo be the number of shares of security o held by traders, and assume that a trader wants to purchase a bundle of ro shares 2 for each security o ∈ O. The trader should pay to the market maker the cost of a bundle r as C(q + r) − C(q), where q = r1 + .. + rt is the vector of previous purchases. We let po (q) be the instantaneous price of security o given by ∂C(q) ∂qo . The cost function used in the LMSR model is X qo C(q) = b log eb o∈O 1 2 ρi (0) equals 1 if o is the ith outcome and 0 otherwise. where each ro can be positive for a purchase, negative for a sale, or zero if not traded. 475 Quantitative Analytics where b > 0 is a parameter controlling the rate at which prices change. Hence, the corresponding price function for each security o is qo ∂C(q) eb po (q) = =P q 0 o ∂qo b o0 ∈O e In that setting, the monetary loss of an automated market maker is upper-bounded by b log |O|. To design an automated market maker we need first to determine an appropriate set of properties that the market maker should satisfy. In the case of the LMSR defined above, we get 1. The cost function is differentiable everywhere, so that the instantaneous price po (q) can always be obtained for the security associated with any outcome o. 2. The market incorporate information from the traders, since the purchase of a security corresponding to outcome o causes po to increase. 3. The market does not provide explicit opportunities for arbitrage. The sum of the instantaneous prices of the securities po (q) is always 1 (see Remark below). 4. the market is expressive in the sense that a trader with sufficient funds is always able to set the market prices to reflect his beliefs about the probability of each outcome. Remark 13.5.1 In addition to preventing arbitrage, these properties ensure that prices can be interpreted naturally as probabilities. As a result, prices can represent the market’s current estimate of the distribution over outcomes. Remark 13.5.2 The conditions of no-arbitrage and the properties of market prices are well known and have been extensively studied (see Appendix (E.4)). These conditions lead to some natural mathematical restrictions on the costs of security bundles. Further, we assume that each trader may have his own information about the future, which we represent as a distribution p ∈ ∆|O| over the outcome space, where ∆n = {x ∈ Rn≥0 } is the n-simplex. While the pricing mechanism incentivise the trader to reveal p, it also avoid providing arbitrage opportunities. In a complete market offering n Arrow-Debreu securities for the n mutually exclusive and exhaustive outcomes, we define a set of market makers by equating the set of allowable prices Π to the n-simplex ∆n . A market maker satisfying the above conditions can use the cost function C(q) = sup x.q − R(x) (13.5.1) x∈∆n for a strictly convex function R(•). Hence, Pn the market price x(q) = ∇C(q) is the optimal solution to the convex optimisation. Further, when R(x) = b i=1 xi log xi , which is the negative entropy function, we recover the LMSR market maker. Note, Agarwal et al. [2011] solved the problem of automated market making by formulating a minimisation problem with an associated penality function playing a similar role to the convex function R(•), but without using the conjugate duality. 13.5.2 The case of infinite outcome space When |O| is large or infinite, calculating the cost of a purchase becomes intractable. To address this problem Abernethy et al. [2012] restricted the market maker to offer only K securities for some reasonably sized K, and assumed that the payoff of each security could be described by an arbitrary (but computable) function ρ : O → Rn≥0 . Such a security space is called complex. They formalised the properties of a reasonable market, and precisely characterised the set of all cost functions satisfying these conditions. They obtained the following conditions 476 Quantitative Analytics 1. Existence of instantaneous prices: C is continuous and differentiable everywhere on RK . 2. Information incorporation: For any q and r ∈ RK , C(q + 2r) − C(q + r) ≥ C(q + r) − C(q) (13.5.2) 3. No arbitrage: For all q and r ∈ RK , there exists an o ∈ O such that C(q + r) − C(q) ≥ r.ρ(o) (13.5.3) 4. Expressiveness: For any p ∈ ∆|O| we write xp = Eo∼p [ρ(o)] Then for any p ∈ ∆|O| and any > 0 there is some q ∈ RK for which ||∇C(q) − xp || ≤ . We can interpret these conditions as 1. Condition 1: The gradient of C, denoted ∇C(q) is well defined. 2. Condition 2: There can not be more than one way of expressing one’s information. This translate in the convexity of the cost function given by Equation (13.5.2). 3. Condition 3: It is never possible for a trader to purchase a security bundle r and receive a positive profit regardless of the outcome. 4. Condition 4: The gradient ∇C(q) represents the traders’ current estimates of the expected payoff of each security denoted by xp . Note, for a given time t, we have C(qt+1 ) − C(qt ) ≈ ∇C(qt ).(qt+1 − qt ) = xt .rt , where qt = r1 + ... + rt is the vector of previous purchases. Hence, we see that the No-Arbitrage Equation (13.5.3) implies that the instantaneous price xp must be greater or equal to the payoff ρ(o) for each security o ∈ O (depending on the future outcome o). Strong of these conditions, Abernethy et al. formalised the pricing framework as 1. a pricing mechanism can always be described precisely in terms of a convex cost function C. 2. the set of reachable prices of a mechanism, that is the set {∇C(q) : q ∈ RK }, must be identically the convex hull of the payoff vectors for each outcome H(ρ(O)) except possibly differing at the relative boundary of H(ρ(O)). For complete markets, it implies that the set of achievable prices should be the convex hull of the n standard basis vectors. The conditions introduced in the complex space imply that in this setting, we should use a cost function based market with a convex, differentiable cost function such that closure ({∇C(q) : q ∈ RK }) = closure (H(ρ(O))) The condition 2 on information incorporation ensures the convexity of the cost function via Equation (13.5.2). Recall, the set of derivatives {∇C(q) : q ∈ RK } of any convex function C must form a convex set. Further, condition 4 is equivalent to the statement that every element xp ∈ H(ρ(O)) is a limit point of the set {∇C(q) : q ∈ RK }. Since {∇C(q) : q ∈ RK } ⊆ closure (H(ρ(O))) the only case where xp does not equal ∇C(q) for some q is when xp lies on the relative boundary of H(ρ(O)). Abernethy et al. used convex analysis, and in particular, the notion of conjugate duality (see Appendix (A.1.4)) to design and compare properties of cost functions satisfying these criteria. The result being, pick any closed strictly convex function R with domain containing H(ρ(O)), and set C := R∗ . We get the following steps 477 Quantitative Analytics • Input: security space Rk and a bounded payoff function ρ : O → RK . • Input: convex compact price space Π, typically assumed to be H(ρ(O)). • Input: closed strictly convex and differentiable R with relint (Π) ⊆ dom (R). • Output cost function C : RK → R defined by C(q) = x∈ sup x.q − R(X) relint (Π) Hence, the space of feasible price vectors should be Π = H(ρ(O)), the convex hull of the payoff vectors for each outcome. Note, the duality based approach leads to markets that are efficient to implement whenever H(ρ(O)) can be described by a polynomial number of simple constraints. Further, since the construction of C is based on convex programming, the problem of automated market making is reduced to the problem of optimisation. At last, this methods yields simple formulas for properties of markets, such as the worst-case monetary loss and the worst-case information loss. That is, the choice of the conjugate function R impacts market properties, and in many situations, an ideal choice would be λ ||x − x0 ||2 (13.5.4) 2 which is the squared Euclidean distance between x and an initial price vector x0 ∈ Π, scaled by λ2 . The market maker can tune λ appropriately according to the desired tradeoff between worst-case market depth and worst-case loss. However, the tradeoff tighten when R has a Hessian that is uniformly a scaled identity matrix, or when R takes the form in Equation (13.5.4). Requiring the conjugate function R to be a pseudo-barrier, we make sure that the instantaneous price vector ∇C(q) always lies in relint (Π), and does not become a constant near the boundary. For instance, the negative entropy function X H(x) = xi log xi R(x) = i defined on the n-simplex ∆n is an example of a convex function that is simultaneously bounded and a pseudo-barrier. Note, the LMSR can be described by the choice R(x) = bH(x) where the price space is Π = ∆n . Note, assuming Π = H(ρ(O)) we can find scenarios for which this hull has a polynomial number of constraints, allowing to efficiently set prices via convex optimisation. However, this may not always be the case, especially when H(ρ(O)) has exponentially (or infinitely) many constraints. In this case, Abernethy et al. proposed to use an efficient separation oracle to get alternative methods for optimisation. If such a tool is not available, they suggested to modify H(ρ(O)) to get an alternate price space Π which could work more efficiently. In order to obtain some relaxation of the price space, they allowed for Π to be distinct from H(ρ(O)), and showed that the no-arbitrage condition 3 could be relaxed but not the expressiveness condition 4. Theorem 13.5.1 For any duality-based cost function market maker, the worst-case loss of the market maker is unbounded if ρ(O) * Π. That is, condition 4 is necessary for the market maker to avoid unbounded loss. If o is the final outcome and ρ(o) ∈ / Π, then there exists a k > 0 such that ||ρ(0) − ∇C(q)|| ≥ k, ∀k, and it is possible to make an infinite sequence of trades such that each trade causes a constant amount of loss to the market maker. On the other hand, one can choose π to be a superset of H(ρ(O)), since expanding Π do not hurt the market maker. As long as the initial price vector lies in H(ρ(O)), any such situations where a trader can earn a guaranteed profit are effectively created (and paid for) by other traders. If the final price vector ∇C(q) falls outside the convex hull, the divergence term will be strictly positive, improving the bound. 478 Quantitative Analytics 13.5.3 Relating market design to machine learning Even tough the problem of learning in an online environment is semantically distinct from the problem of pricing securities in a prediction market, the tools developed are similar. A learning algorithm receives losses and selects weights according to the following steps • the learner is given access to a fixed space of weights K • the learning algorithm must select a weight vector w ∈ K • the learner uses a convex regulariser R(•), which is a parameter of FTRL • the learner receives loss vectors lt • the learning algorithm maintains a cumulative loss vector Lt and updates according to Lt+1 ← Lt + ll • FTRL selects the weight vector by solving 1 wt+1 = arg min w.Lt + R(w) w∈K η • the learner suffers regret RT = T X wt .lt − min w.LT w∈K t=1 On the other hand, a market maker manages trades and set prices according to the following steps • the market maker has an outcome space O and a payoff function ρ : O → RK , which define a feasible price space Π = H(ρ(O)) • the market maker must select instantaneous security prices x ∈ Π • the market maker uses a convex conjugate R(•), which is a parameter of the pricing function C(•) • the market maker receives security bundle purchases rt • the market maker maintains a quantity vector qt and updates according to qt+1 ← qt + rt • the market mechanism sets prices via xt+1 = arg max x.qt − R(x) x∈Π • the market maker suffers worst-case loss C(q0 ) − C(qT ) + max x.qT x∈Π 479 Quantitative Analytics These algorithms emphasise the fact that we can identify the objects Π, R(•), and {rt } with the objects K, R(•) η , and {−lt }, respectively. As a result, the mechanisms for choosing an instantaneous price vector xt ∈ Π and selecting a weight vector wt ∈ K are identical. That is, considering the security bundles rt as the negative loss vectors lt , the market mechanism becomes the FTRL in the above algorithm. Note, in the last pair of statements, the FTRL regret and the market maker’s worst case loss seems very different but they are not so far apart. First, the term maxx∈Π x.qT matches the term − minw∈K w.LT . Second, doing a first-order approximation on the first term we get C(qT ) − C(q0 ) = T X C(qt+1 ) − C(qt ) ≈ t=1 T X t=1 ∇C(qt ).(qt+1 − qt ) = T X xt .rt t=1 since the instantaneous price vector xt is equal to ∇C(qt ). Hence, the total earned by the market maker C(qT )−C(q0 ) is roughly the sum of these payments over all trades. To conclude, the expert setting (K = ∆n ) correspond to complete markets. Weighted Majority corresponds to the LMSR with the learning rate η playing the same role as the parameter b (see Chen et al. [2008]). 13.5.4 The assumptions of market completeness Even though no particular distributions have been specified for the determination of contingent securities, we saw that a set of conditions, or axioms, was necessary in order to define the expected behaviour of a market. These conditions have naturally been selected to satisfy the complete market theory underlying the efficient market hypothesis (EMH) discussed throughout this guide. The EMH lead to the notion of independent identically distributed prices and martingale processes. While path independence helps reducing arbitrage opportunities, it also helps reducing the strategic play of traders, since traders need not reason about the optimal path leading to some target position. One major consequence of the assumption of path independence on the security purchases was that they could be represented by a convex cost function. We saw in Section (13.5) that the space of feasible price vectors should be Π = H(ρ(O)), the convex hull of the payoff vectors for each outcome. These results have been formalised a long time ago in the option pricing theory (OPT) and extensively commented since then (see Appendix (E.3.3)). In a complete market, we must assume that contingent claims have convex payoffs and that the volatility depends only on time and the current stock price. As a result, the price of the contingent claim is a convex function of the price of the stock. However, if one of these assumptions is violated, contingent claims can be non-increasing, non-convex. Abernethy et al. [2012] showed that including additional price vectors in Π does not impact the market maker’s worst-case loss, as long as the initial price vector lies in H(ρ(O)), even though the no-arbitrage condition is violated. However, traders will incur the costs. 13.6 Presenting scoring rules 13.6.1 Describing a few scoring rules 13.6.1.1 The proper scoring rules While Sroring Rules (SR) have been used in the evaluation of probabilistic forecasts, in the context of information elicitation SR are used to encourage individuals to make careful assessments and truthfully report their beliefs. In the context of machine learning, SR are used as loss functions to evaluate and compare the performance of different algorithms (see Reid et al. [2009]). We let {1, ..., n} be a set of mutually exclusive and exhaustive outcomes of a future event. A scoring rule s maps a probability distribution p over outcomes to a score si (p) for each outcome i, with si (p) taking values in the range [−∞, ∞]. This score represents the reward received by a forecaster for predicting the distribution Pn p if the0 outcome turns out to be i.0 A scoring rulePisn said to be regular relative to the probability simplex ∆n if i=1 pi si (p ) ∈ [−∞, ∞) for all p, p ∈ ∆n , with i=1 pi si (p) ∈ (−∞, ∞), implying that si (p) is finite whenever pi > 0. Hence, a scoring rule is said to be proper if a risk-neutral forecaster the true Pbelieving Pndistribution 0 0 n over outcomes is p has no incentive to report any alternate distribution p , that is, if i=1 pi si (p) ≥ i=1 pi si (p ) 480 Quantitative Analytics 0 0 for all distributions p . The rule is strictly proper if this inequality holds with equality only when p = p . For instance, the quadratic scoring rule (see Brier [1950]) si (p) = ai + b 2pi − n X p2i i=1 and the logarithmic scoring rule (see Good [1952]) si (p) = ai + b log pi (13.6.5) where b > 0 and ai for i = 1, .., n are parameters, are examples of regular, strictly proper scoring rules used both in information elicitation and machine learning. The following characterisation theorem of Gneiting et al. [2007] gives the precise relationship between convex functions and proper scoring rules. Theorem 13.6.1 A regular scoring rule is (strictly) proper if and only if there exists a (strictly) convex function G : ∆n → R such that for all i ∈ {1, .., n}, 0 0 si (p) = G(p) − G (p).p + Gi (p) 0 0 0 where G (p) is any subgradient of G at the point p, and Gi (p) is the ith element of G (p). Note, for a scoring rule defined in terms of a function G, n X pi si (p) = i=1 n X 0 0 pi G(p) − G (p).p + Gi (p) = G(p) i=1 the above theorem indicates that a regular scoring rule is (strictly) proper if and only if its expected score function G(p) is (strictly) convex on ∆n , and the vector with elements si (p) is a subgradient of G at the point p. Therefore, every bounded convex function G over ∆n induces a proper scoring rule. Gneiting et al. [2007] detail P the properties n and characterisations of proper scoring rules. Some important results states that if we define S(p̃, p) = i=1 pi si (p̃) as the expected score of a forecaster with belief p but predicts p̃, then G(p) = S(p, p). Further, if a scoring rule is regular and proper, then d(p̃, p) = S(p, p) − S(p̃, p) is the associated divergence function that captures the expected score loss ifa forecaster predicts p̃ rather than his true belief p. Also, it is known that if G(p) is differentiable, the divergence function is the Bregman divergence (see Appendix (A.1.6)) for G, that is, d(p̃, p) = DG (p̃, p). 13.6.1.2 The market scoring rules The Market Scoring Rules (MSR) introduced by Hanson [2003] [2007] are sequentially shared scoring rules. More precisely, the market maintains a current probability distribution p, and at any time t, a trader can enter the market and 0 change this distribution to an arbitrary distribution p of his choice. If the outcome turns out to be i, the trader receives 0 the (possibly negative) payoff si (p ) − si (p). For instance, when using the logarithmic scoring rule in Equation 0 0 (13.6.5), a trader changing the distribution from p to p receives the payoff b log pi pi , which is equivalent to the cost 0 function based formulation of the LMSR in the sense that a trader changing the market probabilities from p to p in the MSR formulation receives the same payoff for every outcome i as a trader changing the quantity vectors from any q to 0 0 0 q , such that market prices become x(q) = p and x(q ) = p in the cost function based formulation. We see that using proper scoring rules, MSR preserve the nice incentive compatible property of proper scoring rules for myopic traders. Hence, a trader believing the true distribution to be p, and only caring about the payoff of his action, maximises his expected payoff by changing the market’s distribution to p. One advantage of the MSR is the simplicity to bound the market maker’s worst case loss, since each trader is responsible for paying the previous trader’s score, so that the market maker is only responsible for paying the score of 481 Quantitative Analytics the final trader. If we let p0 be the initial probability distribution of the market, then the worst case loss of the market maker is given by max sup si (p) − si (p0 ) i∈{1,..,n} p∈∆n Note, the LMSR market maker is not the only market which can be defined either as a market scoring rule, or as a cost function based market. In fact, Chen et al. [2007] noted a correspondence between certain market scoring rules and certain cost function based markets. They showed that the MSR with scoring function s and the cost function based market with cost function C are equivalent if for all q and all outcomes i, we get C(q) = qi − si (x(q)). 13.6.2 Relating MSR to cost function based market makers Abernethy et al. [2012] proposed very general conditions under which a market scoring rule (MSR) is equivalent to a cost function based market, and they provided a way of translating a MSR to a cost function based market, and vice versa. Given the cost function in Equation (13.5.1) we let RC denote the function R corresponding to the cost function C. According to Theorem (13.6.1), there is one-to-one and onto mapping between strictly convex and differentiable RC and strictly proper, regular scoring rules with differentiable scoring functions si (x), where for evry pair we have RC (x) = n X xi si (x) i=1 and si (x) = RC (x) − n X ∂RC (x) j=1 ∂xj xj + ∂RC (x) ∂xi Abernethy et al. proved the following theorem showing that the cost function based market using RC and the MSR using si (x) are equivalent in term’s of trader’s profit and reachable price vectors. Theorem 13.6.2 Given a pair of strictly convex, differentiable RC (x) and strictly proper, regular scoring rule with differentiable scoring functions si (x) defined above, the corresponding cost function based market and market scoring rule market are equivalent in the following two aspects • The profit of a trade is the same in the two markets if the trade starts with the same market prices and results in the same market prices and the prices for all outcomes are positive before and after the trade. • Every price vector p achievable in the market scoring rule is achievable in the cost function based market. 482 Chapter 14 Introducing Differential Evolution 14.1 Introduction While almost any problem found in everyday life can be thought as an optimisation problem, we saw that in classical economics the agent decision making process was represented as the maximisation of some expected utility functions. Assuming randomness, portfolio selection and fair price were introduced, such as CAPM and BS formula, and quantitative optimisation techniques could be used. Further, econometric models were devised to forecast price processes in view of either computing the CAPM/BS formula, or, taking advantage of market inefficiencies. In the former, simplicity led to a single optimal solution, while in the latter, complexity led to a range of fair values. With the growing quantity of data available, machine learning methods that have been successfully applied in science are now applied to mining the markets. Data mining and more recent machine-learning methodologies provide a range of general techniques for the classification, prediction, and optimisation of structured and unstructured data. All of these methods require the use of quantitative optimisation techniques known as stochastic optimisation algorithms, such as combinatorial optimisation, simulated annealing (SA), genetic algorithms (GA), or reinforced learning. While stochastic methods have some degree of randomness when operating, heuristic methods incorporate additional strategies or knowledge to their operation. Some of these algorithms use heuristics inspired by real life processes. For instance, genetic algorithms are inspired by the process of evolution, and simulated annealing is inspired by the process of annealing metals. We are going to consider an Evolutionary Algorithm (EA) which we will illustrate with the problem of model calibration to a finite set of option prices. 14.2 Calibration to implied volatility 14.2.1 Introducing calibration 14.2.1.1 The general idea For every parametric model that one can define, such as regression models or option pricing models, we need to estimate the model parameters from the market prices or the implied volatility surface. It leads to an ill-posed inverse problem because the inversion is not stable and amplifies market data errors in the solution. To be more precise, letting x be the vector of model parameters and y be the vector of market prices, we want to solve Tx = y where T : X → Y is a (non-linear) operator between reflexive Banach spaces X, Y , with inverse T −1 which is not continuous. We further assume that only noisy data y δ with 483 Quantitative Analytics ||y δ − y|| ≤ δ is available. The operator T −1 can be found by solving a measure among a set of measures, such as ||T x − y δ ||2 The ill-posness of the problem means that a small error on market data y can lead to a big error on the solution (model parameters) x. Regularisation techniques allow one to capture the maximum information on x from the set y in a stable fashion. See Tankov [2005] for details on regularisation techniques. 14.2.1.2 Measures of pricing errors We choose to estimate implicitly the vector Ψ of model parameters by minimising, given a measure, the distance between the liquid market price Pt (Ti , Ki ) and the model price Ct (Ti , Ki ) for i ∈ I where I is the total number of market prices considered. Note, the market price for the ith stock Si is denoted by Pi (t) while the option price for maturity Ti and strike Ki is denoted by Pt (Ti , Ki ). We consider some benchmark instruments with payoff (Hi )i∈I with obsereved market prices (Pi∗ )i∈I in the range Pi∗ ∈ [Pib , Pia ] representing the bid/ask prices. In the option world, we also need to consider a set of arbitrage free model Q such that the discounted asset price (S t )t∈[0,T ] is a martingale under each Q ∈ Q with respect to its own history Ft and ∀Q ∈ Q , ∀i ∈ I , E Q [|Hi |] < ∞ , E Q [Hi ] = Pi∗ Since the market price Pi∗ is only defined up to the bid-ask spread we get ∀Q ∈ Q , ∀i ∈ I , E Q [|Hi |] < ∞ , E Q [Hi ] ∈ [Pib , Pia ] Further, different choices of norms for the vector (Pi∗ −E Q [Hi ])i∈I lead to different measures for the calibration error. For example, we have ||P ∗ − E Q [H]||∞ ||P ∗ − E Q [H]||1 sup |Pi∗ − E Q [Hi ]| i∈I X = |Pi∗ − E Q [Hi ]| = i∈I ∗ Q ||P − E [H]||p = X |Pi∗ − E Q [Hi ]|p p1 i∈I Obviously we need to choose a measure among this set of measures, and traditionally practitioners consider the Price Norm f1 (i) = Pt (Ti , Ki ) − Ct (Ti , Ki ; Ψ) 2 Pt (Ti , Ki ) − Ct (Ti , Ki ; Ψ) Pt (Ti , Ki ) 2 or the Relative Price Norm f2 (i) = 484 Quantitative Analytics 14.2.2 The calibration problem Since the Black-Scholes model [1973] and the celebrated BS-formula, market prices of index options and foreign exchange options have reached a high degree of liquidity such that they became the benchmark to mark to market or calibrate option pricing models for pricing and hedging exotic options. More formally, using market prices, we need to estimate the vector Ψ of model parameters in order to price exotic options. This amount to solving the following inverse problem. Problem 1 Given prices Ct (Ti , Ki ) for i ∈ I where I is the total number of market prices considered, find the vector Ψ of model parameters such that the discounted asset price Ŝt = e−rt St is a martingale and the observed option prices are given by their risk-neutral expectations ∀i ∈ I , Ct (Ti , Ki ) = e−r(T −t) E Ψ [(S(Ti ) − Ki )+ |St = S] That is, we need to retrieve the risk-neutral process and not just the conditional densities which is equivalent to a moment problem for the process S. However, in practice we do not know the call and put prices for all strike prices but only for a finite number of them so that extrapolation and interpolation is needed, resulting in solutions at best approximately verifying the constraints. It is typically an ill posed problem as there may be either no solution at all or an infinite number of solutions (see Cont et al. [2002] for more details). Therefore, one need to use additional criterions for choosing a solution. It means that we need to reformulate the calibration as an approximation problem, for instance minimising the in-sample quadratic pricing error Ψ∗ = J (Ψ) = arg inf J (Ψ) (14.2.1) Ψ n X wi Pt (Ti , Ki ) − Ct (Ti , Ki ; Ψ) 2 i=1 where wi is a weight associated to each market option price. Market practice is to solve the optimisation problem with a gradient-based minimisation method to locate the minima. In that case we can always find a solution but the minimisation function is not convex and the gradient descent may not succeed in locating the minimum. However, the number of parameters to calibrate a model is less important, from a numerical point of view, than the convexity of the objective function to minimise in a gradient based method. Non-Linear Least Square solution does not resolve the uniqueness and stability issues, and the inverse problem remains ill-posed. In order to circumvent these difficulties various authors proposed different regularisation methods all consisting in adding to the objective function a penalisation criterion. As a result, it makes the problem well-posed and allow for gradient-based optimisation algorithm. For example, we choose to estimate the vector Ψ of model parameters implicitly by minimising, given a measure, the distance between the liquid market price Pt (Ti , Ki ) and the model price Ct (Ti , Ki ) for i ∈ I where I is the total number of market prices considered. Obviously we need to define a measure, and for simplicity, we will only expose the optimisation problem. One way of achieving our objective is to minimise a Tikhonov-type functional (see Tikhonov et al. [1998]) Ψ∗ J (Ψ) = = arg inf J (Ψ) (14.2.2) Ψ n X wi Pt (Ti , Ki ) − Ct (Ti , Ki ; Ψ) 2 + αH(Q, Q0 ) i=1 where H is a measure of closeness of the model Q to a prior Q0 . Many choices are possible for the penalisation function H. To get uniqueness and stability of the solution, the function should be convex with respect to the model parameters. So, the target function is made of two components 485 Quantitative Analytics 1. penalisation function convex in model parameters Ψ 2. quadratic pricing error measuring the precision of calibration The coefficient α is the regularisation parameter and defines the relative importance of the two terms such that when α → 0 we recover the standard Least Square Error which is no-longer a convex function. If α is large enough, the target function inherits the convexity properties of the penalising function and the problem becomes well-posed. The correct choice of α is important and can not be fixed in advance since its optimal value depends on the data and on the level of error δ one wants to achieve. 14.2.3 The regularisation function The regularisation function H(Ψ, Ψ0 ) is a positive function satisfying H(Ψ, Ψ0 ) ≥ 0 and H(Ψ0 , Ψ0 ) = 0 and it must be a convex function. So, for sufficiently large α the optimisation function J (Ψ) can be made globally convex, improving the performance of most numerical optimisation schemes using a gradient based method. However, the penalty may influence the loss function too much, leading to biased parameters. There are many choices to get such a function, but to obtain stability in model prices from one day to the next we can choose to relate the vector of model parameters to its previously estimated values at time t − 1. Setting Ψ0 = Ψt−1 , the regularisation function becomes H(Ψ, Ψt−1 ) = |Ψ − Ψt−1 |L2 which is the L2 norm of the difference of the two vector of model parameters. This penalty should improve hedging as the paths of the estimated parameters are now smoothed over time. An alternative approach to solving for the vector of model parameters Ψ0 is to solve the standard least squares method in Equation (14.2.1) getting Ψ∗0 . The objective function not being convex, a simple gradient procedure will not give the global minimum. However, the solution (Ψ0 , Q0 ) will be iteratively improved and should be viewed as a way to regularise the optimisation problem in Equation (14.2.2). We can define a measure of model error (Ψ0 , Q0 ) = 0 which represent the distance of market prices to model prices and gives an a priori level of quadratic pricing error. This error is typically positive, that is 0 > 0. Now, given the regularisation parameter α > 0 we get the solution (Ψα , Qα ) with the a posteriori quadratic pricing error given by (Ψα , Qα ). Note we expect α > 0 since by adding the entropy term we have given up some precision to gain in stability. The Morozov discrepancy principle is an example of an a posteriori parameter choice rule (see Morozov [1984]). It consists in minimising this loss of precision through regularisation by choosing α∗ such that (Ψα , Qα ) ≈ 0 Practically, the a priori error is 20 = inf Ψ0 n X wi Pt (Ti , Ki ) − Ct (Ti , Ki ; Ψ0 ) 2 i=1 So, for δ > 1, for example δ = 1.1 we solve (Ψα , Qα ) = δ0 Since the optimisation problem in Equation (14.2.2) is a differentiable function of α, we can get the solution α∗ with a small number of iterations using the Newton-Raphson method. 486 Quantitative Analytics 14.2.4 Beyond deterministic optimisation method The difference between normal (deterministic) and stochastic optimisation methods (SOM) is that normal methods use some knowledge of the problem such as the derivative of a function (gradient), the continuity of the function etc., and the SOM do not assume any external knowledge. While the additional knowledge makes deterministic optimisation methods more powerful, they are also less robust. In general, we do not know with certainty if the objective function has a unique global minimum, and if it exists, if it can be reached with a gradient based method. Many model parameters can reproduce the call prices with equal precision due to many local minima or flat region (low sensitivity to variations in model parameters). This means that the model is very sensitive to the input prices and the starting point in the algorithm. In addition, in an incomplete market, a deterministic optimisation method will at best locate one of the local minima of the fitting criterion but will not guarantee the global minima and will not acknowledge the multiplicity of solutions of the initial calibration problem. To overcome these issues, we are going to detail an alternative approach to solving non-linear programming problems under constraints that do not require computing the gradient of the model. To do so, we will need to consider an evolutionary algorithm that handle constraints in a simple and efficient way. 14.3 Nonlinear programming problems with constraints 14.3.1 Describing the problem 14.3.1.1 A brief history Evolutionary algorithms introduced by Fogel [1966] and Holland [1975] are robust and efficient optimisation algorithms based on the theory of evolution proposed by Darwin [1882], where a biological population evolves over generations to adapt to an environment by mutation, recombination and selection. They search from multiple points in space instead of moving from a single point like gradient-based methods do. Moreover, they work on function evaluation alone (fitness) and do not require derivatives or gradients of the objective functions. Among the different EA’s commonly used to solve CNOPs such as evolutionary programming, evolution strategies, genetic algorithm and many more, differential evolution (DE) became very popular. DE is a population-based approach to function optimisation generating a new position for an individual by calculating vector differences between other randomly selected members of the population. The DE algorithm is found to be a powerful evolutionary algorithm for global optimisation in many real problems. As a result, since the original article of Storn and Price [1995] many authors improved the DE model to increase the exploration and exploitation capabilities of the DE algorithm when solving optimisation problems. Since EAs are search engines working in unconstrained search spaces they lacked until recently of a mechanism to deal with the constraints of the problems. The first attempts to handle the constraints were either to incorporate methods from mathematical programming algorithms within EAs such as penalty functions or to exploit the mathematical structure of the constraints. Then, a considerable amount of research proposed alternative methods to improve the search of the feasible global optimum solution. Most of the research on DE focused on solving CNOPs by using a sole DE variant, a combination of variants or combining DE with another search method. One of the most popular constraint handling mechanisms is the use of the three feasibility rules proposed by Deb [2000] on genetic algorithms. Using some of the improvements to the DE algorithm combined with simple and robust constraint handling mechanisms we propose a modified algorithm for solving our optimisation problem under constraints which greatly improves its performances. 14.3.1.2 Defining the problems We consider a system with the real-valued properties gm for m = 0, .., P − 1 487 Quantitative Analytics making the objectives of the system to be optimised. Given a N -dimensional vector of real-valued parameter X ⊂ RN the optimisation problem can always be written as min fm (X) where fm (.) is a function by which gm is calculated and where each element X(i) of the vector is bounded by lower and upper limits Li ≤ X(i) ≤ Ui which define the search space S. We follow Lueder in [1990] who showed that all functions fm (.) can be combined in a single objective function H : X ⊂ RN → R expressed as the weighted sum H(X) = P X wm fm (X) m=1 where the weighting factors wm define the importance of each objective of the system. Hence, the optimisation problem becomes min H(X) so that all the local and global minima (when the region of eligibility in X is convex) can be found. However, since the problems of calibration in finance involves a single objective function, the optimisation function simplifies. Most complex search problems such as optimisation problems are constrained numerical problem (CNOP) more commonly called general nonlinear programming problems with constraints given by gi (X) ≤ 0 , i = 1, .., p hj (X) = 0 , j = 1, .., q Equality constraints are usually transformed into inequality constraints by |hj (X)| − ≤ 0 where is the tolerance allowed. Given the search space S ⊂ RN , we let F be the set of all solutions satisfying the constraints of the problems called the feasible region. It is defined by the intersection of S and the set of p + q additional constraints. At any point X ∈ F, the constraints gi (.) that satisfy gi (X) = 0 are active constraints at X while equality constraints hj (.) are active at all points of F. Many practical problems have objective functions that are non-differentiable, non-continuous, non-linear, noisy, multi-dimensional and have many local minima. This is the case of the calibration problem defined in Section (14.2.2). Evolutionary algorithms (EAs) introduced by Holland in [1962] and later in [1975] as well as by Fogel in [1966] are robust and efficient optimisation algorithms based on the theory of evolution proposed by Darwin in [1882], where a biological population evolves over generations to adapt to an environment by mutation, recombination and selection. They search from multiple points in space instead of moving from a single point like gradient-based methods do. Moreover, they work on function evaluation alone (fitness) and do not require derivatives or gradients of the objective functions. Since EAs are search engines working in unconstrained search spaces they lacked until recently of a mechanism to deal with the constraints of the problems. The first attempts to handle the constraints was to incorporate methods from mathematical programming algorithms within EAs such as penalty functions. Then, a considerable amount of research proposed alternative methods to improve the search of the feasible global optimum solution. Among the different EA’s commonly used to solve CNOPs such as evolutionary programming, evolution strategies, genetic algorithm and many more, differential evolution (DE) became very popular. DE is a population-based approach to function optimisation generating a new position for an individual by calculating vector differences between other randomly selected members of the population. Most of the research on DE focused on solving CNOPs by using a sole DE variant, a combination of variants or combining DE with another search method. One of the most popular constraint handling mechanisms is the use of the three feasibility rules proposed by Deb in [2000] on genetic algorithms. 488 Quantitative Analytics 14.3.2 Some optimisation methods Before detailing differential evolution (DE), we introduce a few alternative optimisation methods (see Witkowski [2011]). For simplicity of exposition we define a few operators used in several optimisation methods. We let RU (a, b) to return a random uniformally distributed value between a (inclusive) and b (exclusive), and RN (µ, σ) to return a random normally distributed value drawn from a normal distribution with mean µ and standard deviation σ. Further, we define the mutation operator M (X, δ), where X is a vector of size N and δ is the mutation strength, as follow Begin i ← R_U (1, N ) X_i ← ± R_U (0, 1). δ return X End 14.3.2.1 Random optimisation Random optimisation is an iterative optimisation method designed for single objective problem which consists in assigning uniformally distributed random values to an individual. In each iteration, the individual is modified by adding a normally distributed vector to it, in the case where the resulting individual is better than the source individual. We let f : RN → R be the fitness function subject to optimisation, and we let X ∈ RN be a position in the search space. The vector X is initialised as follow X ← [RU,1 (0, 1), ..., RU,N (0, 1)] and the algorithm satisfies Begin while not terminationCriterion() do Xˆ0 ← X + [R_N , 1(µ, σ), ..., R_N , N (µ, σ)] if f (Xˆ0 ) > f (X) then X ← Xˆ0 end if end while End When the value of an individual is subject to a constraint, we consider four strategies where one or more genes do not fit the constraints. • Dropping the individual altogether: the algorithm leaves the old value of the individual. • Dropping only the offending gene: the old gene is left. • Trimming the gene to the constraint: trimming either to the left or to theright value of the constraint. • Bounce back: if gmin and gmax are the minimum and maximum values of the gene, respectively, then do Begin while not notConstraints(g) do if g > g_max then g ← g_max − |g − g_max| else g ← g_min + |g_min − g| 489 Quantitative Analytics end if end while End 14.3.2.2 Harmony search The Harmony search is a type of evolutionary algorithm inspired by the process of improving jazz musicians. We consider a band participating in improvisation over chord changes of a song. The overall available harmony can be imagined as a search space of some problem where better sounding harmonies are fitter than the bad ones. Each musician represents a decision variable where at each and every practice session (one iteration) he generates some new note (a value of the decision variable). When practicing, musicians either make something up as they play along (representing a randomly created value), or use/modify some note that they have found good in the previous practice session. Notes are taken out of the memory with some given probability P (chooseF romM emory) and can be modified according to some probability P (pitchAdjust). Further, we define M S as the memory size, memory as the harmony search memory where the memory should be at all times sorted so that ∀i = 1, .., N − 1 f (memoryi ) ≥ f (memoryi+1 ) also, δ is the pitch adjustment strength, N is the size of the decision variable, f (•) is the fitness function, and memoryM S is the worst element from memory according to the fitness function. The algorithm is as follow: First we initialise the memory Begin for i = 1 to MS do memory_i ← [R_U , 1(0, 1), ..., R_U , N (0, 1)] end for End then we perform Begin while not terminationCriterion() do for i = 1 to N do if R_U (0, 1) ≤ P (chooseF romM emory) then X ← memory(R_U (0, N )) Xˆ0 ← X + R_N (µ, σ) if R_U (0, 1) ≤ P (pitchAdjust) then X_i ← M (X_i, δ) end if else X_iˆ0 ← R_U (0, 1) end if end for if f (Xˆ0 ) > f (memory_M S) then memory_M S ← Xˆ0 end if end while End 490 Quantitative Analytics 14.3.2.3 Particle swarm optimisation Particle swarm optimisation is an optimisation algorithm simulating swarming/social behaviour of agents (particles). In this scheme, a single particle is a solution candidate flying through the search space with some velocity, remembering its best position, and learning the best position known to its neighbour particles. While traveling the search space, the particles adjust their speed (both direction and value) based on their personal experiences and on the knowledge of their neighbourhood particles. Since various schemes for determining particle neighbourhood can be imagined, we can discern • the global neighbourhood: all particles are neighbours to each other. • the neighbourhood determined by Euclidean distance. • the neighbourhood determined by normalised Euclidean distance. where the normalisation process adjust the size of the neighbourhood so that the dimension of the search space is accounted for. It is a parallel direct search method using N P parameter vector Xi for i = 1, .., N P as a population with vector of velocity V . The initialisation is given by X0 ...XN P ← [RU,1 (0, 1), ..., RU,N (0, 1)] V0 ...VN P ← [RU,1 (0, 1), ..., RU,N (0, 1)] and the algorithm is as follow Begin while not terminationCriterion() do for i = 1 to N P do for j = 1 to N do φ_1 ← R_U (0, 1) φ_2 ← R_U (0, 1) V _ijˆ0 ← w V _ij + σ φ_1 C_1 (best(p_i)_j − X_ij) + φ_2 C_2 (best_N hood(p_i)_j − X_ij) end for if V ˆ0 > V _max then V ˆ0 ← V _max end if if V ˆ0 < −V _max then V ˆ0 ← −V _max end if X_iˆ0 ← X_i + V _iˆ0 end for X ← Xˆ0 V ← vˆ0 end while End where N is the number of dimension of the search space, X is a vector of particle positions, V is a vector of particle velocities (each velocity is a vector with N elements), Vmax is the maximum possible velocity, w is the velocityweight or inertia factor (how much the particle will base its next velocity on its previous one), σ is the position weight 491 Quantitative Analytics determining the importance of the particles position to the next particle velocity, φi for i = 1, 2 are uniform random variables taken as an additional weight when determining the next particle velocity, C1 is the self confidence weight (or self learning rate), C2 is the swarm confidence weight (or neighbourhood learning rate), bestN hood (p) is an operator returning the best (most fit) position known to the particle and its neighbourhood, and best(p) is an operator returning the most fit position that a particle has visited. 14.3.2.4 Cross entropy optimisation The cross entropy optimisation consists of two steps 1. generating a sample population from a distribution. 2. updating the parameters of the random mechanism to produce a better (fitter) sample in the next population. This behaviour conceptually substitutes the problem of finding an optimal individual to that of iteratively finding a random distribution that generate good individuals. We start by using a random Gaussian distribution to produce variables, and then improve the distribution by means of importance sampling, finding a new distribution from the best samples. We let N be the number of dimensions of the search space, Nsize be the sample size, (X1 , .., XN ) denotes the optimisation population, and we assume that the population is sorted so that ∀i = 1, .., N − 1 , f (Xi ) ≥ f (Xi+1 ) We then define the mean and standard deviation as mean(X, Nsample ) = Std(X, Nsample ) = 1 Nsample X Xi Nsample i=0 v u Nsample u X 1 t (Xi − mean(X, Nsample ))2 Nsample i=0 Since X is a vector, then mean(X) and Std(X) work on a set of vectors and return a vector of elements, that is, a vector of means and standard deviations of columns of the given input matrix. Additional importance sampling with the size of Nsample isperformed on the given set. The initialisation is as follow X0 ...XN P ← [RU,1 (0, 1), ..., RU,N (0, 1)] and µ ← mean(X, Nsample ) σ ← Std(X, Nsample ) The algorithm is as follow Begin while not terminationCriterion() do for i = 1 to N P do X_i ← [R_N , 1(µ_1, σ_1), ..., R_N , N (µ_N , σ_N )] end for µ ← mean(X, N _sample) σ ← Std(X, N _sample) end while End 492 Quantitative Analytics In addition, the values of the mean µ and standard deviation σ can be smoothed over time (from iteration to iteration), improving the convergence of the algorithm. 14.3.2.5 Simulated annealing Simulated annealing is a probabilistic optimisation method inspired by the physical process of annealing metals where a metal is slowly cooled so that its structure is frozen in a minimal energy configuration (see Tsitsiklis et al. [1993]). The algorithm is similar to hill climbing where an individual will iteratively go to a better neighbourhood position (picked at random), additionally an individual may go to a worse position with a probability proportional to its temperature. The probability that an individual will go to a worse position is calculated by the Boltzmann probability − E(pos) T factor e kB where E(pos) is the energy at the new position (calculated as a difference of fitness of two positions), kB is the Botzmann constant (1.38065052410−23 J/K), and T is the temperature of the solid. The rate at which the solid is frozen is called a cooling schedule, and we consider two variants 1. getT emp(t) = Tstart (at ) where Tstart is the starting temperature, t is the current iteration, and a is a parameter of the cooling schedule. Further, a > 0 ∧ a ≈ 0. 2. t getT emp(t) = Tstart (1 − ) m where and m are parameters of the cooling schedule. Further, 0 < ≤ 1. The initialisation is as follow: X ← [RU,1 (0, 1), .., RU,N (0, 1)] and Xbest ← X We let f : RN → R, and M (X, δ) be the mutation operator and define the algorithm as follow: Begin while not terminationCriterion() do Xˆ0 ← M (X, δ) ∆ E ← f (X) − f (Xˆ0 ) if ∆ E ≤ 0 then X ← Xˆ0 if (f (X)) > f (X_best) then X_best ← X end if else T ← getT emp(t) ∆ E if R_U (0, 1) < eˆ k_Bˆt then 0 X ← Xˆ end if end if t ← t+1 End 493 Quantitative Analytics 14.3.3 The DE algorithm The Differential Evolution (DE) proposed by Storn and Price [1995] is an algorithm that can find approximate solutions to nonlinear programming problems. It is a parallel direct search method which uses N P parameter vector Xi,G for i = 0, .., N P − 1 as a population for each generation G like any evolutionary algorithms. Each of the N P parameter vectors undergoes mutation, recombination and selection. 14.3.3.1 The mutation The role of mutation is to explore the parameter space by expanding the search space. For a given parameter vector Xi,G called the Target vector, the DE generates a Donor vector V made of three or more independent parent vectors Xrl ,G for l = 1, 2, .. where rl is an integer chosen randomly from the interval [1, N P ] and different from the running index i. In the spirit of Wright in [1991], the main idea is to perturbate a Base vector V̂ with a weighted difference vector (called differential vectors) X V = V̂ + F Xr2l−1 ,G − Xr2l ,G l=1 where the mutation factor F is a constant taking values in [0, 2] and scaling the influence of the set of pairs of solutions selected to calculate the mutation value. Most of the time, the Base vector is defined as the arithmetical crossover operator V̂ = λXbest,G + (1 − λ)Xr1 ,G where λ ∈ [0, 1] allows for a linear combination between the best element Xbest,G of the parent population vectors and a randomly selected vector Xr1 ,G . It is called a global selection when λ = 1 while when λ = 0 the base vector is the same as the target vector, Xr1 ,G = Xi,G and we get a local selection. In the special case where the mutation factor is set to zero, the mutation operator becomes a crossover operator. 14.3.3.2 The recombination Recombination incorporates successful solutions from the previous generation. That is, according to a rule, we combine elements of the Target vector Xi,G with elements of the Donor vector Vi,G to create an offspring called the Trial vector Ui,G . In order to increase the diversity of the parameter vectors, elements of the Donor vector enter the Trial vector with probability CR. In the DE algorithm, each element of the Trial vector satisfies Ui,G (j) = Vi,G (j) for j = nr mod dim, (nr + 1) = Xi,G (j) for all other j ∈ [0, .., N P − 1] mod dim, ..., (nr + L − 1) mod dim where dim is the dimension of the vector V (here dim = N ) and the starting index nr is a randomly chosen integer from the interval [0, dim−1]. Hence, a certain sequence of the element of U is equal to the element of V while the other elements get the original element of Xi,G . We only choose a subgroup of parameters for recombination, enhancing the search in parameter space. The integer L denotes the number of parameters that are going to be exchanged and is drawn from the interval [1, dim] with probability P (L > ν) = (CR)ν , ν > 0 The random decisions for both nr and L are made anew at each new generation G. The term CR ∈ [0, 1] is the crossover factor controlling the influence of the parent in the generation of the offspring. A higher value means less influence from the parent. Most of the time, the mutation operator in Section (14.3.3.1) is sufficient and one can directly set the Trial vector equal to the Donor vector. 494 Quantitative Analytics 14.3.3.3 The selection The tournament selection only needs part of the whole population to calculate an individual selection probability where subgroups may contain two or more individuals. In the DE algorithm, the selection is deterministic between the parent and the child. The best of them remain in the next population. We compute the objective function with the original vector Xi,G and the newly created vector Ui,G . If the value of the latter is smaller than that of the former, the new Target vector Xi,G+1 is set to Ui,G otherwise Xi,G is retained Xi,G+1 = Ui,G if H(Ui,G ) ≤ H(Xi,G ) , i = 0, .., N P − 1 = Xi,G otherwise Mutation, recombination and selection continue until some stopping criterion is reached. The mutation-selection cycle is similar to the prediction-correction step in the EM algorithm or in the filtering problems. 14.3.3.4 Convergence criterions We allow for different convergence criterion in such a way that if one of them PN Pis−1reached, the algorithm terminates. We let fmin be the fittest design in the population and define fa,G = N1P i=0 f (Xi,G ) as the average objective value in a generation. Then, when the percentage difference between the average value and the best design reaches a specified small value 1 |fa,G − fmin | × 100 ≤ 1 |fa,G | we terminate the algorithm. Also, we let fminOld be the fittest design in the previous generation and consider as a criterion the difference fminOld − fmin < 2 where 2 is user defined. In that case, the DE algorithm will continue until there is no appreciable improvement in the minimum fitness value or some predefined maximum number of iterations is reached. 14.3.4 Pseudocode We now present the pseudo code of a standard DE algorithm. Initialise vectors of the population NP Evaluate the cost of each vector for i=0 to Gmax do repeat Select some distinct vectors randomly Perform mutation Perform recombination Perform selection if offspring is better than main parent then replace main parent in the population end if until population is completed Apply convergence criterions next i 495 Quantitative Analytics 14.3.5 The strategies Over the years, Storn and Price as well as a large number of other authors made improvement to the DE model so that there are now many different DE models. They vary in the type of recombination operator used as well as in the number and type of solutions used to calculate the mutation values. We are now going to list the main ones. 14.3.5.1 Scheme DE1 To improve convergence on a set of optimisation problems using the Scheme DE4 introduced in Section (14.3.5.4), Storn and Price considered for each vector Xi,G a trial vector V generated according to the rule V = Xr1 ,G + F Xr2 ,G − Xr3 ,G where the integer rl for l = 1, 2, 3 are chosen randomly in the interval [0, N P − 1] and are different from the running index i. Also, F is a scalar controlling the amplification of the differential variation Xr2 ,G − Xr3 ,G . We can slightly modify the scheme by doing V = Xr1 ,G + F Xr2 ,G + Xr3 ,G − Xr4 ,G − Xr5 ,G As a simple rule, F is usually in the range [0.5, 1]. The population size should be between 3N and 10N and generally we increase N P if misconvergence happens. In the case where N P is increased we should decrease F . 14.3.5.2 Scheme DE2 Similarly to the Scheme DE1 in (14.3.5.1) the trial vector V is generated according to the rule V = Xi,G + λ Xbest,G − Xi,G + F Xr2 ,G − Xr3 ,G where λ is a scalar controlling the amplification of the differential variation Xbest,G − Xi,G . It enhance the greediness of the scheme by introducing the current best vector Xbest,G . It is useful for non-critical objective functions, that is, when the global minimum is relatively easy to find. It gives a balance between robustness and fast convergence. 14.3.5.3 Scheme DE3 In the same spirit, Mezura-Montes et al. [2006] also modified the Scheme DE1 in (14.3.5.1) by incorporating information of the best solution as well as information of the current parent in the current population to define the new search direction. V = Xr3 ,G + λ Xbest,G − Xr2 ,G + F Xi,G − Xr1 ,G where λ is a scalar controlling the amplification of the differential variation Xbest,G − Xr2 ,G . This scheme has the same properties as the Scheme DE2 in (14.3.5.2). 14.3.5.4 Scheme DE4 The oldest strategy developed by Storn and Price is for the trial vector V to be generated according to the rule V = Xbest,G + F Xr1 ,G − Xr2 ,G where F is a scalar. However, in that setting they found several optimisation problems where misconvergence occurred. To improve the convergence, we can consider the strategy V = Xbest,G + λj Xr1 ,G − Xr2 ,G 496 Quantitative Analytics where λj is a random parameter such that λj = (0.0001 ∗ δ + F ) where δ is a uniformly distributed random variable in the interval [0, 1]. It is a jitter which add fluctuation to the random target. The jitter is the time variation of a periodic signal in electronics and telecommunications (swing dancer). It is tailored for small population sizes and fast convergence. We can also modify the scheme by doing V = Xbest,G + λj Xr1 ,G + Xr2 ,G − Xr3 ,G − Xr4 ,G 14.3.5.5 Scheme DE5 Similarly to the Scheme DE1 in (14.3.5.1) the trial vector V is generated according to the rule V = Xr1 ,G + λd Xr2 ,G − Xr3 ,G where λd is a computer dithering factor λd = F + δ ∗ (1 − F ) and δ is as above. It is a per-vector dither making the Scheme DE1 more robust. Note, we can also have λd,G = F + δG ∗ (1 − F ) which is a per-generation dither factor. In that algorithm, choosing F = 0.3 is a good start. 14.3.5.6 Scheme DE6 A more complex algorithm than the Scheme DE1 in (14.3.5.1) is to introduce the choice between two strategies. In the either-or algorithm, the trial vector V is generated according to the rule V = Xr1 ,G + F Xr2 ,G − Xr3 ,G = 1 Xr1 ,G + (λ + 1) Xr2 ,G + Xr3 ,G − 2Xr1 ,G I(δ≥ 21 ) 2 I(δ< 21 ) where δ is as above. It alternates between differential mutation and three-point recombination. 14.3.5.7 Scheme DE7 Alternatively, we have the two possible strategies using an either-or algorithm. If we favor the r1 event we have V = Xr1 ,G + F Xr2 ,G − Xr3 ,G I(δ 0 offspring. Among these newly generated solutions, the best of them is selected to compete against its parent, increasing the chances to generate fitter offspring. 14.3.6.4 Self-adaptive parameters Balamurugan et al. [2007] considered the key parameters of control in DE algorithm such as the crossover CR and the weight applied to random differential F to be self-adapted. That is, the control parameters are not required to be pre-defined and can change during the evolution process. These control parameters are applied at the individual levels in the population so that better values lead to better individuals producing better offspring and hence better values. F is a scaling factor controlling the amplification of the difference between two individuals to avoid search stagnation. At generation G = 1 the amplification factor Fk,G for the kth individual is generated randomly in the range [0.1, 1.0]. Then, at the next generations the control parameter is given by FL + U (0, 1)FU if U (0, 1) < τ1 Fk,G+1 = Fk,G otherwise where FL = 0.1, FU = 0.9 and τ1 represent the probability to adjust the parameter F . 14.3.6.5 Selection Santana-Quintero et al. [2005] maintained two different populations (primary and secondary) according to some criteria and considered two selection mechanisms that are activated based on the total number of generation Gmax and the parameter sel2 ∈ [0.2, 1] which regulates the selection pressure. That is Random if G < (sel2 ∗ Gmax ) Type of selection = Elitist otherwise a random selection is first adopted followed by an elitist selection. In the random selection, three different parents are randomly selected from the primary population while in the elitist selection they are selected from the secondary 499 Quantitative Analytics one. In both selections, a single parent is selected as a reference so that all the parents of the main population will be reference parents only once during the generating process. 14.4 Handling the constraints 14.4.1 Describing the problem We saw above that EAs in general and DE in particular lacked a mechanism to deal with the constraints of the problems. Recently, various academics worked on solving that problem, and one of the most popular constraint handling mechanisms was proposed by Deb [2000] on genetic algorithms who used the three feasibility rules. Before reviewing his method and showing how it was improved, we recall that Michalewicz [1995] discussed different constraint handling methods used in GAs and classified them in five categories • methods based on preserving feasibility of solutions, that is, we use a search operator that maintains the feasibility of solutions • methods based on penalty functions • methods making distinction between feasible and infeasible solutions using different search operators for handling infeasible and feasible solutions • methods based on decoders using an indirect representation scheme which carries instructions for constructing feasible solutions • hybrid methods where evolutionary methods are combined with heuristic rules or classical constrained search methods In a single-objective optimisation problem, the traditional approach for handling constraints is the penalty function method. The fitness of a candidate is based on a scale function F which is a weighted sum of the objective function value and the amount of design constraint violation F (X) = f1 (X) + p X ωk max (gk (X), 0) + k=1 q X ωk |hk (X)| k=p+1 where ωk are positive penalty function coefficients and such that the kth constraint gk (.) and hk (.) should be normalised. This method requires a careful tuning of the coefficients ωk to obtain satisfactory design, that is a balance between the objective function and the constraints but also between the constraints themselves. 14.4.2 Defining the feasibility rules To overcome this problem, Deb [2000] proposed a penalty function approach based on the non-dominance concept, ranking candidates using the definition of domination between two candidates. Definition 14.4.1 A solution i is said to dominate a solution j if both of the following conditions are true 1. solution i is no worse than solution j in all objective ∀fm (Xi ) ≤ fm (Xj ) 2. solution i is strictly better than solution j in at least one objective ∃fm (Xi ) < fm (Xj ) 500 Quantitative Analytics The constrained domination approach ranks candidates according to the following definition Definition 14.4.2 A solution i is said to constrained-dominate a solution j if any of the following conditions is true 1. solutions i and j are feasible and solution i dominates solution j. 2. solution i is feasible and solution j is not. 3. both solutions i and j are infeasible but solution i has a smaller constraint violation. He let the fitness function be F (X) = f (X) if gk (X) ≤ 0 ∀k = 1, 2, .. fmax + T ACV otherwise where fmax is the objective value with the worst feasible solution in the population and (TACV) is the total amount of constraint violation T ACV = p+q X max (gk (X), 0) k=1 Therefore, solutions are never directly compared in terms of both objective function and constraint violation information. However, the high selection pressure generated by tournament selection will induce the use of additional procedure to preserve diversity in the population such as niching or sharing. Clearly, there is no tuning of the penalty function coefficients when the number of constraint is one. But, when multiple constraints are considered some considerations must be taken to relate constraints together. One way forward is to normalise the constraints such that every constraint has the same contribution to the comparing value as was done by Landa Becerra et al. [2006]. Letting gmax (k) be the largest violation of the constraint max (gk (X), 0) found so far, we define the new TACV as N T ACV = p X max (gk (X), 0) k=1 14.4.3 gmax (k) Improving the feasibility rules Again, many different approaches were proposed, for instance Coello Coello [2000] modified the definition of the constrained domination approach given in Definition (14.4.2) such that if the individuals are infeasible he compares the number of constraints violated first and only in the case of a tie would he use the total amount of constraint violation in the definition, getting Definition 14.4.3 A solution i is said to constrained-dominate a solution j if any of the following conditions is true 1. solutions i and j are feasible and solution i dominates solution j. 2. solution i is feasible and solution j is not. 3. both solutions i and j are infeasible but solution i violates less number of constraints than solution j. 4. both solutions i and j are infeasible and violating the same number of constraints but solution i has a smaller TACV than solution j. In that setting, the fitness of an infeasible solution not only depends the amount of constraint violation, but also on the population of solutions at hand. However, this technique may not be very efficient when the degrees of violation of constraints gk (X) are significantly different because the TACV is a single value. Alternatively, Coello Coello et al. [2002] handled constraints as additional objective functions and used the non-dominance concept (on objective functions) in Definition (14.4.1) to rank candidates. As a result, it required solving the objective function a large number of time. Going one step further, Oyama et al. [2005] introduced dominance in constraint space. 501 Quantitative Analytics Definition 14.4.4 A solution i is said to dominate a solution j in constraint space if both of the following conditions are true 1. solution i is no worse than solution j in all constraints ∀gk (Xi ) ≤ gk (Xj ) 2. solution i is strictly better than solution j in at least one constraint ∃gk (Xi ) < gk (Xj ) Introducing the idea of non-dominance concept to the constraint function space, their proposed constraint-handling method is Definition 14.4.5 A solution i is said to constrained-dominate a solution j if any of the following conditions is true 1. solutions i and j are feasible and solution i dominates solution j in objective function space. 2. solution i is feasible and solution j is not. 3. both solutions i and j are infeasible but solution i dominates solution j in constraint space. In that setting, any non-dominance ranking can be applied to feasible designs and infeasible designs separately. As a result, in a single-objective constrained optimisation problem, Bloch [2010] modified the dominance-based tournament selection of Coello and Mezura with the non-dominance concept of Oyama et al., getting Definition 14.4.6 The new dominance-based tournament selection is 1. if solutions i and j are both feasible and solution i dominates in objective function solution j then solution i wins. 2. if solution i is feasible and solution j is not, solution i wins. 3. if solutions i and j are both infeasible and solution i dominates in constraint space solution j then solution i wins. 4. if solutions i and j are infeasible and non-dominated in constraint space, if solution i violates less number of constraints than solution j then solution i wins. 5. if solutions i and j are both infeasible, non-dominated in constraint space and violating the same number of constraints but solution i has a smaller TACV than solution j then solution i wins. 14.4.4 Handling diversity In order to explore new regions of the search space and to avoid premature convergence, a set of feasibility rules coupled with a diversity mechanism is proposed by Mezura-Montes et al. [2006]. It maintains besides competitive feasible solutions some solutions with a promising objective function value allowing for the DE to reach optimum solutions located in the boundary of the feasible region of the search space. Given a parameter Sr one can choose to select between parent and child based either only on the objective function value or on feasibility. As more exploration of the search space is required at the beginning of the process, the parameter Sr will be decreasing in a linear fashion with respect to the number of generation. Given an initial value Sr,0 and a terminal value Sr,∞ , the adjustment of the parameter is 502 Quantitative Analytics Sr,G+1 = S Sr,G − ∆Sr if G > Gmax Sr,∞ otherwise −S r,∞ where ∆Sr = r,0 Gmax . After some generations, assuming that promising areas of the feasible region have been reached, we focus on keeping the feasible solutions found discarding the infeasible ones. In that setting, infeasible solutions with good objective function values will have a significant probability of being selected which will slowly decrease as the number of generation increases. In some problems, it does not make sense to use the infeasible individual unless they are very close to the boundary between the feasible and infeasible region. This is the case of the calibration problem given in Section (14.2.2) where the constraints ensure that prices do not violate the AAO rules. To circumvent this issue, Mezura-Montes et al. [2004a] proposed that at each generation the best infeasible solution with lowest amount of constraint violation both in the parents (µ) and the children (λ) population will survive. Either of them being chosen with an appropriate probability, it will allows for infeasible solutions close to the boundary to recombine with feasible solutions. The pseudo code for introducing diversity in the DE algorithm is f lip(S_r) then Select the best infeasible individual from the children population else Select the best individual based on five selection criteria end if if 14.5 The proposed algorithm Using the improvements in Section (14.3.6) and applying the Definition (14.4.6) on dominance-based tournament selection to handle the constraints, the pseudo code for the DE algorithm with constraints becomes Begin G = 0 and Age_i, G = 0 ∀ i, i = 1, .., N P Create a random initial population X_i, G ∀ i, i = 1, .., N P Evaluate f (X_i, G) ∀ i, i = 1, .., N P while niter < max_iter and G < Gmax do f min_old = f min for i = 1 to N P do for k = 1 to N _K do Select randomly r_1 6= r_2 6= r_3 6= i j_r = U (1, N ) for j = 1 to N do if U (0, 1) < CR or j = j_r then U _i, G(j) = X_r_3, G(j) + F (X_r_1, G(j) − X_r_2, G(j)) else U _i, G(j) = X_i, G(j) end if end for if k > 1 then if U _i, G(j) is better than U _i_best, G(j) based on five selection criteria then U _i_best, G(j) = U _i, G(j) else 503 Quantitative Analytics U _i_best, G(j) = U _i, G(j) end of for Apply diversity : if f lip(S_r) then if f (U _i_best, G) ≤ f (X_i, G) then X_i, G + 1 = X_i, G = U _i_best, G else X_i, G + 1 = X_i, G end if else if U _i_best, G is better than X_i, G based on five selection criteria then X_i, G + 1 = X_i, G = U _i_best, G else if Age_i, G < N _A or i = i_best then X_i, G + 1 = X_i, G else Select randomly r_4 6= i X_i, G + 1 = X_r_4, G Age_i, G = 0 end if end if end if if f min > f (X_i, G) f min = f (X_i, G) i_best = i end if end for Apply convergence criterions : if f min_old − f _min < precision niter = niter + 1 else niter = 0 end if G=G+1 end while End 14.6 Describing some benchmarks According to the No Free Lunch theorem stating that any two algorithms A and B on average perform identially, it is very difficult (see Wolpert et al. [1997]), if not impossible, to devise a test suite identifying the best algorithm among different algorithms. Nonetheless, we can design a benchmark for assessing the performances of these algorithms based on some criteria, such as, • the amount of iterations. • the time taken by an algorithm to find a known optima, or how quickly it improves the best known solution of some optimisation problem. • the number of evaluations of the fitness function needed to find the best solution. 504 Quantitative Analytics • the rate of deterioration of the algorithm as the dimensions of the problem increase. • whether the algorithms find the best solution. • the distance to the known optimum. We are now going to present a few test functions considered as benchmark for different optimisation methods. Some of these benchmark functions and set of engineering problems are detailed by Mezura-Montes et al. [2006b] and Witkowski [2011]. We are going to describe a few of them. To do so we let fnN : RN → R be the test function where N represents the dimensionality of the problem and n is a referrence number. 14.6.1 Minimisation of the sphere function The problem consists in minimising the function f1N (X) = N X Xi2 i=1 where 1. Search domain: |Xi | < 5.12, i = 1, 2, ..., N 2. Global minimum: X ∗ = (0, ..., 0), f (X ∗ ) = 0 3. No local minima besides the global minimum 14.6.2 Minimisation of the Rosenbrock function The problem consists in minimising the function f2N (X) = N −1 X 100(Xi2 − Xi+1 )2 + (Xi − 1)2 i=1 where 1. Search domain: |Xi | < 5.12, i = 1, 2, ..., N 2. Global minimum: X ∗ = (1, ..., 1), f (X ∗ ) = 0 3. Several local minima 14.6.3 Minimisation of the step function The problem consists in minimising the function f3N (X) = N X bXi c i=1 where 1. Search domain: |Xi | < 5.12, i = 1, 2, ..., N 2. Global minimum: X ∗ : Xi ≤ −5, f (X ∗ ) = −6N , i = 1, 2, ..., N 3. No local minima besides the global minimum 505 Quantitative Analytics 14.6.4 Minimisation of the Rastrigin function The problem consists in minimising the function f4N (X) = 100N + N X Xi2 − 10 cos (2πXi ) i=1 where 1. Search domain: |Xi | < 5.12, i = 1, 2, ..., N 2. Global minimum: X ∗ = (0, ..., 0), f (X ∗ ) = 0 3. Several local minima 14.6.5 Minimisation of the Griewank function The problem consists in minimising the function f5N (X) N N Y X Xi Xi2 cos ( √ ) + 1 − = 4000 i i=1 i=1 where 1. Search domain: |Xi | ≤ 600, i = 1, 2, ..., N 2. Global minimum: X ∗ = (0, ..., 0), f (X ∗ ) = 0 3. Several local minima 14.6.6 Minimisation of the Easom function The problem consists in minimising the function f6N (X1 , X2 ) = − cos (X1 ) cos (X2 )e−(X1 −π) where 1. Number of variables: 2 2. Search domain: |Xi | ≤ 100, i = 1, 2 3. Global minimum: X ∗ = (π, π), f (X ∗ ) = −1 4. No local minima besides the global minimum 506 2 −(X2 −π)2 , Xi : |Xi | ≤ 100 Quantitative Analytics 14.6.7 Image from polygons We consider the problem of finding the best combination of N semi-transparent coloured D-gons (100 ≤ N ≤ 1000, 3 ≤ D ≤ 10) that when rendered will produce an image I. We want to minimise the difference between the rendered image and the given one. The polygons are encoded so that each polygon is represented by 2D + 4 real numbers 0 ≤ Xi ≤ 1, and the first 2D values correspond to the positions of the points of the polygon. The last four values correspond the RGBA (Red, Green, Blue and Alpha). Given the encoding {0, 0, 0, 1, 1, 0, 1, 0, 0, 0.5} and an input image I with the width of wI and height hI the encoded polygon will render to a fully red triangle with 50% alpha formed with by points (0, 0), (0.hI ), (wI , 0). The problem consists in minimising the function f7N,D,I (X) = wI X hI X 0 I(i, j) − I (i, j) 2 i=1 j=1 where 1. Large number of variables: [1000, 14000] 2. Search domain: 0 ≤ Xi < 1, i = 1, 2, ..., N.(2D + 4) 3. Global minimum: X ∗ = (π, π), f (X ∗ ) = −1 4. Unknown global minimum 5. Unknown quantity of local minima 14.6.8 Minimisation problem g01 The problem consists in minimising the function f (X) = 5 4 X Xi − 5 4 X Xi2 − i=1 i=1 13 X Xi i=5 subject to the constraints g1 (X) = 2X1 + 2X2 + X10 + X11 − 10 ≤ 0 g2 (X) = 2X1 + 2X3 + X10 + X12 − 10 ≤ 0 g3 (X) = 2X2 + 2X3 + X11 + X12 − 10 ≤ 0 g4 (X) = −8X1 + X10 ≤ 0 g5 (X) = −8X2 + X11 ≤ 0 g6 (X) = −8X3 + X12 ≤ 0 g7 (X) = −2X4 − X5 + X10 ≤ 0 g8 (X) = −2X6 − X7 + X11 ≤ 0 g9 (X) = −2X8 − X9 + X12 ≤ 0 where the bounds are 0 ≤ Xi ≤ 1 for i = 1, .., 9, 0 ≤ Xi ≤ 100 for i = 10, 11, 12, and 0 ≤ X13 ≤ 1. The global optimum is located at X ∗ = (1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 3, 3, 1) where f (X ∗ ) = −15. Constraints gi for i = 1, .., 6 are active. 507 Quantitative Analytics 14.6.9 Maximisation problem g03 The problem consists in maximising the function N Y √ f (X) = ( N )N Xi i=1 subject to the equality constraint h(X) = N X Xi2 − 1 = 0 i=1 where N = 10 and 0 ≤ Xi ≤ 1 for i = 1, ..., N . The global maximum is located at Xi∗ = f (X ∗ ) = 1. 14.6.10 √1 N for i = 1, ..., N where Maximisation problem g08 The problem consists in maximising the function f (X) = sin3 (2πX1 ) sin (2πX2 ) X13 (X1 + X2 ) subject to g1 (X) = X12 − X2 + 1 ≤ 0 g2 (X) = 1 − X1 + (X2 − 4)2 ≤ 0 where 0 ≤ X1 ≤ 10 and 0 ≤ X2 ≤ 10. The global optimum is located at X ∗ = (1.2279713, 4.2453733) where f (X ∗ ) = 0.095825. 14.6.11 Minimisation problem g11 The problem consists in minimising the function f (X) = X12 + (X2 − 1)2 subject to the equality constraint h(X) = X2 − X12 = 0 where −1 ≤ X1 ≤ 1 and −1 ≤ X2 ≤ 1. The global optimum is located at X ∗ = (± √12 , 12 ) where f (X ∗ ) = 0.75. 14.6.12 Minimisation of the weight of a tension/compression spring The problem consists in minimising the weight of a tension/compression spring subject to the constraints on minimum deflection, shear stress, surge frequency, limits on outside diameter and on design variables (see Arora [1989]). The design variables are the mean coil diameter D (X2 ), the wire diameter d (X1 ) and the number of active coils N (X3 ). Formally, the problem is to minimise (N + 2)Dd2 subject to 508 Quantitative Analytics g1 (X) = g2 (X) = g3 (X) = D3 N ≤0 71785d4 4D2 − dD 1 −1≤0 + 12566(Dd3 − d4 ) 5108d2 D+d −1≤0 1.5 1− where 0.05 ≤ X1 ≤ 2, 0.25 ≤ X2 ≤ 1.3, and 2 ≤ X3 ≤ 15. 509 Chapter 15 Introduction to CUDA Programming in Finance This chapter has been written by Sebastien Gurrieri and we thank him for his time and effort. 15.1 Introduction 15.1.1 A birief overview Parallel programming on Graphics Processing Units (GPUs) in Finance has gone from a curiosity in 2007 at the first release of CUDA by NVIDIA to a natural solution at the time of writing (2014). CUDA is now used in production environments for many applications in the Finance industry, including pricing of exotics or of large portfolios of vanillas, optimization and calibration problems, or risk calculations such as Value-at-Risk (VaR) or Potential Exposure (PFE) and Credit Valuation Adjustment (CVA). On the consumer side, secrecy and competition lead to scarcity of details on how the technology is used. Bloomberg (see WST [2009]) and BNP Paribas [2009] were early adopters. JP Morgan reports deployment of GPU applications globally with large gains for risk calculations (see NVIDIA [2014a]). According to Davidson [2013], ING, Barclays, Société Générale, are known to use GPUs. Information is more easily available on the software industry side, where companies readily report the introduction of GPU programming in their capabilities. A large number of solutions exist and we can unfortunately not cite all of them here - for a recent overview (see NVIDIA [2014a]). Several types of software are now available to banks and investment companies planning to use GPUs. Proprietary financial solutions such as Murex, Sungard offer fully integrated pricing and risk engines. Numerical libraries such as NAG can be used by the company’s developers to link to their internal code, and applications such as MATLAB or SciFinance provide higher-level languages that benefit from GPU speed-ups without requiring to write explicit GPU code. A last type of solutions are "translators" such as Xcelerit, that wrap around the single-thread code of the developer (for instance C++) and translate it into CUDA. When using a full proprietary software, numerical software to write high-level language or translators/wrappers around single-thread code, the company gives up some amount of control on the code. It may have no knowledge of the code at all, or have partial knowledge as in the case of the wrappers, but will not have full understanding of how the GPU code is translated from the higher-level language they have used. The company may not want to forgo this control, for instance because it may consider it can reach larger speed gains by having its developers have full control 510 Quantitative Analytics over the syntax in order to reach the optimum speed. In such a case, quants with a knowledge of parallel programming and in particular of CUDA, will be required in order to write the translation by themselves in CUDA. This document is meant to be a brief introduction for these quants who are interested in the subject of GPU programming, may want to use it for their own work by directly coding on the GPU, but have no or little experience of parallel programming. The learning curve can be quite steep, and we believe that there are few available resources to help this process: one can easily find very technical documents such as the CUDA manual (see NVIDIA [2014b]) or books that tend to assume a pre-existing familiarity with parallel programming and a background in computer science, in general without connection to Finance. The quant who wants to take the step and switch to CUDA without prior knowledge of parallel programming may then be left with few means of learning, most of which written in the language she will have difficulties understanding. The other type of learning resources is quant literature that is more easily understandable and directly related to the subject, but is unfortunately particularly scarce on the subject. In this article we will attempt to bridge this gap by providing the first few steps that can then put the reader on the right track to continue the learning with the other resources mentioned above. This document is organised in the following manner: • we will continue this introduction by a few words on parallel programming in general, GPU programming, CUDA, and why they can be used advantageously in Finance. • we will then go into more details of the CUDA programming paradigm and syntax in section 2, keeping only what is necessary to start and gain a broad understanding of the main concepts. • in section 3 we will describe two case studies: a Monte-Carlo simulation for exotic pricing with gains in the ∼ 100x, and a multi-dimensional optimisation for implied volatility calibration using the Differential Evolution algorithm with gains of about ∼ 14x on cheap retail devices. • we will then conclude with our views of future directions in this field. 15.1.2 Preliminary words on parallel programming Parallel programming relies on the idea that independent calculations can be performed simultaneously on computing engines that have several "nodes" with the ability to execute actions concurrently. In an ideal situation, N nodes would lead to a speed-up factor of N x, that is, the parallel calculation will be N times faster than if implemented on a single node. This is only an upper bound. In practice the speed gain will be lower than this due to several reasons among which: • the algorithm may only be partially parallel. Most algorithms contain a sequential part that will not benefit from parallel hardware. • parallel calculation speeds are often limited by data transfers to/from/within the nodes and read/write accesses to memory, which tend to be slow compared to arithmetic calculations on the nodes. • the individual nodes on the parallel hardware may not be as powerful as the single node of the sequential calculation engine used for comparison. This is why programming in parallel will usually involve the following actions: • maximise the amount of parallel versus sequential tasks possibly by re-writing the algorithm. • maximise the amount of active nodes (keep the hardware busy). • minimise data transfers relatively to algebraic operations 511 Quantitative Analytics 15.1.3 Why GPUs? Parallel hardware has existed since the 1950s, but remained for a long time only affordable to large institutions and research centers, constituting the so-called "super-computers". For several years now, multi-core CPUs have been available in retail computers at cheap starting prices. At the moment of writing (2014), typical retail computers contain 4 to 8 cores. Note that "cores" on CPUs and GPUs are usually able to calculate several streams of the parallel algorithm, also called "threads". Thanks to hyper-threading, a CPU core may run 2 threads in parallel, such that the upper bound on speed gain with an Intel i7 CPU (8 cores) using hyper-threading would be 16x. The comparison with GPUs is clear. A typical retail GPU (as of 2014) such as the NVIDIA GTX 750Ti contains 640 cores for a cost of about 150 $. As GPU cores can run 32 threads simultaneously (a "warp"), this yields a maximum number of 20, 480 concurrent threads, several orders of magnitudes above what is available on CPUs at comparable levels of technology/cost. The advantage of GPUs is not only in the present raw power, but also in their evolution through time. While the first GPU commercialised in 1999 by NVIDIA had 4 cores, 15 years later in 2014 a mid-level GPU will have hundreds of cores, while professional ones have thousands, not counting the fact that several GPUs can be added on the same machine. In the mean time, CPUs have made slower progress To illustrate this point, it is common to observe the evolution of the number of floating-point operations executable per second (GFLOP/s), a rough estimate of the speed, displayed in Figure ( 15.1). Figure 15.1: Comparison of theoretical GFLOP/s (extract from the CUDA programming guide, v6.5) One can clearly see that GPUs have increased their computing power at a much larger pace than the CPUs over the last few years, especially for single precision. This means that, provided programming on GPUs is scalable, code written in the present will keep benefiting from significant speed gains in the coming years, which may not be so easily achievable on CPUs. It should be kept in mind that, both on CPUs and GPUs, the maximum number of threads are usually poor indications of the actual speed-ups, in particular due to the limitations mentioned at the beginning of this section. 512 Quantitative Analytics Furthermore, although the GPUs have a massive number of cores, these cores are usually less powerful than those of CPUs. Nevertheless, as we will show in this document, GPUs can bring speed gains up to 100x and more to financial applications, and can be considered as "game-changers". 15.1.4 Why CUDA? This is all well but will not be very useful if there is no possibility to program the GPUs to perform the numerical calculations required by financial applications. This is where CUDA comes to help. GPUs were originally used for video processing in video games and were optimised for image processing tasks, which were the main possible operations. Courageous pioneers realised that such operations are essentially multiplications and additions and that they could attempt to translate their code in video language in order to let the GPU calculate, thinking it was working on an image while it was actually calculating, say, a numerical integral. CUDA is a C-based programming language introduced by NVIDIA in 2006 in order to shortcut this translation process. With CUDA, there is no longer any need to rewrite scientific algorithms in a video language. The CUDA compiler does it for the programmer. CUDA has additional features that make it very suitable for use in the financial industry. We will come back to these in more details later, but let us briefly mention them here: • scalability: no need to rewrite the code when updating the hardware, code written on one device will benefit from speed improvements when run on the next generation of devices, without need for re-coding/re-building. • compatibility with C: essentially a set of additional C-like commands, CUDA’s syntax can easily be learnt by C programmers. • free. • integrates well in Microsoft Visual Studio. • it has good debugging and profiling tools, in particular through the use of Nsight. 15.1.5 Applications in financial computing Although in principle any set of independent operations can be accelerated by the use of GPUs and CUDA, in practice the application of these techniques to Finance tend to be in either of the three following groups: 1. Pricing: numerical pricing of individual complex products such as exotics can greatly benefit from GPU programming, especially when using the Monte-Carlo method that is "embarrassingly parallel", but also, to a lesser extent, with PDE methods. Significant gains can also be achieved when pricing very large portfolios of more simple products. This has been well illustrated in a number of references in the quant literature • Asian options in Black-Scholes, Monte-Carlo, ∼ 150x. • Cancellable swaps in the BGM model, Monte-Carlo, ∼ 100x. • PRDCs in Hybrid Local Volatility, Monte-Carlo, ∼ 100x. • Structured equity options, Stochastic and Local Volatility, Monte-Carlo, ∼ 100x. • Rainbow/basket options, Black-Scholes, PDE, ∼ 15x. • PRDCs in Hybrid CEV, PDE, ∼ 40x. • Options, Stochastic Volatility, PDE, ∼ 50x. 513 Quantitative Analytics 2. Market/Credit Risk: significant gains can be obtained in the calculation of the Value-at-Risk and Credit/Counterparty risk measures such as the PFE and CVA. These methods tend to be based on Monte-Carlo simulations to generate future scenarios of the risk factors and repricing, which can be very efficiently implemented on GPUs. The gains depend a lot on the hardware and the particular algorithm, but speed-up of orders of ∼ 100x are consistently reported on GPUs (see Analytics Engines [2014], Dixon et al. [2009]). JP Morgan reported risk calculation speed-up leading to minutes rather than hours of calculations (see NVIDIA [2014a]), while HSBC experimented with intra-day CVA rather than overnight (see Woodie [2013]). 3. Calibration: much less represented than the other two applications above, and possibly included in the pricing, we believe that GPUs can significantly improve the calibration methods for complex models. For instance, it has been illustrated by Bernemann et al. [2011] for the piecewise time-dependent Heston model, and by Gurrieri [2012b] for the Hybrid Local Volatility (Dupire) model. Speed gains can be obtained from several sources, from the nature of the pricing formula (numerical integral, Monte-Carlo) to the fact that the models must usually be calibrated to a possibly large number of market instruments. Moreover, one may even consider parallelising the optimisation algorithm itself. We will describe one example of such calibration in this document. 15.2 Programming with CUDA This section is largely inspired from the CUDA programming guide by NVIDIA [2014b]. We refer the reader to it for more details. Our goal here is to give more background and suitable application for quants in Finance. We introduce what we see as the most important points that can put the reader on the right track to start working, and leave aside deeper technical details that can be learnt later. 15.2.1 Hardware For the purpose of this document, it is sufficient to understand a GPU as a collection of cores that have the ability to run simultaneous executions of operations. An indicator for the possible speed-ups of a GPU is this number of cores, but this can only give a rough estimate as numerous technical details have an impact on the effective number of simultaneous operations. In reality, each core can execute a limited number of threads by construction of the hardware, but this number is also limited by the amount of memory required by the algorithm on each thread, with subtleties due to the thread hierarchy that we will discuss in the next section. As a result, it is quite difficult to predict the effective number of concurrent threads, but the number of cores on the device is certainly a decisive factor. Another important hardware parameter is the amount of memory on the device as this can impact the choice of algorithm and/or the runtime configuration. Financial engineering algorithms may require storage of large amounts of data, for instance random numbers in Monte-Carlo simulations, and it is possible in realistic applications that the algorithm may ask for more memory than the device can provide (typically of the order of the GB). Joshi [2014] showed a good example of how to think about the algorithm in relation to the memory capacity of the GPU. 15.2.2 Thread hierarchy Although there are certainly limitations to the possible algorithm configurations due to the hardware capabilities, the CUDA programming model is constructed in order to achieve scalability. One of the main goals is for parallel codes to run independently of the hardware. This is in opposition to past programming frameworks where knowledge of the hardware was often a requirement (for instance, knowing the number of cores), and this dependence was hard-coded in the algorithm. 514 Quantitative Analytics This good level of independence is achieved in CUDA through a layer of abstraction, the "thread hierarchy". The parallel algorithm is written on a tree-like abstract structure made of a grid which contains blocks which contain threads, where the threads are running the parallel instructions. This is an abstract construction in the sense that the number of these structures is not tied to the hardware, and the user has no real control of how many blocks on the grid and threads within a block are concurrently running. Which threads and blocks are launched by the hardware is decided by the scheduler based on various considerations, an important one being available memory. Provided the programmer writes her code on this abstract structure, the same code will run on any CUDA-enabled GPU 1 . The thread hierarchy is illustrated in Figure ( 15.2). As in the C language, vector items are numbered from 0. In this example we have a 2-dimensional 2 grid of 6 blocks, and each block is 2-dimensional with 12 threads. It is crucial for the programmer to keep in mind that she does not know how many of these blocks and threads are running simultaneously and in which order. For instance, one cannot be certain that Block(0, 1) will be launched after Block(0, 0), so the algorithm should not rely on such assumptions. In the same fashion, the programmer cannot know if T hread(0, 1) within Block(1, 1) will be run before or after T hread(2, 1) (or simultaneously), so again, such assumptions should never be made when coding an algorithm. How many block/threads are run concurrently and in which order is hardware/application/time dependent, and it is by attributing this control to the scheduler rather than the user that CUDA achieves good scalability. Contrary to what one may think, not having this control is a good thing. One of the reasons for the existence of the concept of Blocks is for a more efficient use of memory. As we will see in the next section, there are several types of memories on the GPU, with different access patterns. It is often desirable for a subset of threads to share common information (such as input data) as it would be a waste of resources to have many threads perform the loading of the same data. Threads within blocks can share some parts of the memory. They also have the ability to wait so that each other has finished its tasks. Although this appears to be breaking the parallelism, this functionality can be useful and is common in parallel programming languages. As it obviously slows down the algorithm, it should be used only when strictly necessary. 15.2.3 Memory management Several types of memory co-exist on the GPU, as is illustrated in Figure ( 15.3). For the introductory purpose of this document, it is sufficient to mention three of them here: • Global memory: similar to the RAM memory for a CPU. It is not built right in the cores ("off-chip"), and accesses to it are slow, but it comes in large quantities (2GB for the GTX 750Ti). It is accessible by all threads. It is the one used most of the time for communication between the CPU and the GPU. The CPU typically loads the inputs in it, and retrieves the outputs from it. • Registers: local to each thread, and "on-chip", lying inside the core that calculates the thread. Their accesses are very fast but they come in small quantities (16KB per core). Since they are private to the thread, they tend to be used to define temporary local variables such as counters, accumulations for sums, etc... • Shared memory: on-chip and very fast, it can be accessed by all threads within a block, but is limited to 48KB per core. For optimum performance, the algorithm should be written so as to use the on-chip memory as much as possible. However, some interaction will appear with the number of simultaneous threads running on the device. Indeed, the cores will launch blocks and threads only so long as they do not use more than the available amount of memory in the core. Writing a code that uses more of the on-chip memory will result in less blocks/threads running simultaneously. This is a typical trade-off faced by the CUDA programmer. Profiling tools such as Nsight facilitate the task of optimising memory usage. 1 2 Up to rather technical intricacies that are beyond the scope of this document. Grids can be 1D or 2D, blocks can be 1D, 2D or 3D. 515 Quantitative Analytics Figure 15.2: Thread hierarchy (extract from CUDA programming guide, v6.5) 15.2.4 Syntax and connetion to C/C++ The CUDA programming model is heterogeneous. Only some portions of code run on the GPU (also called "device"), while others will keep running on the CPU as before. It is up to the programmer to decide what is best left on the CPU or migrated to the GPU, knowing that not all algorithms can benefit from GPU acceleration 3 . The sequential part of the code is typically written in C/C++. This part is executed by the CPU (also called "host") and could be the reading of input information as well as pre-processing algorithms that are sequential in nature or would not benefit from acceleration on the GPU for other reasons (such as small numbers of operations). The input information is then sent to the GPU that executes the parallel algorithm. The outputs (usually in the global memory) are retrieved back on the CPU which can process them, then launch a new GPU algorithm, and so on and so forth, as illustrated in Figure ( 15.4). There exist three types of functions in the C/CUDA language: • Host functions: identical to standard C/C++ in that they are launched by the host and run on the host. • Hybrid host-device functions: also called "kernels", launched by the host, run on the device. They are identified by the compiler thanks to the keyword __global__ • Device functions: launched by the device, run on the device. They are identified using the keyword 3 Since each node of a GPU is slower than that of a CPU, it is even conceivable that a very sequential algorithm may be slower on the GPU than on the CPU. 516 Quantitative Analytics Figure 15.3: Memory types (extract from CUDA programming guide, v6.5) __device__ We will be focusing on the kernels as these are the ones that involve most new concepts and syntax. Device functions can be used as helpers but are not mandatory, while kernels are crucial as the place where the CPU launches the GPU code. A kernel is launched with the syntax in Figure ( 15.5). This piece of code is written inside a standard C main() function. "dim3" is a new variable type that describes the grid and block configurations. The variable "threadsPerBlock" here is set so that each block is 2-dimensional, with 16 threads × 16 threads. The variable "numBlocks" contains the grid configuration. This grid is also 2-dimensional, with each dimension size determined as some integer N divided by the size of the block in that dimension. The sizes of the thread hierarchy are built-in member properties such as "threadsPerBlock.x" which represents the x-axis dimension of the variable threadsPerBlock. The kernel itself is called "MatAdd" and is launched by the CPU with the thread hierarchy configuration within the signs <<< , >>> as above, and with its arguments A, B, C as in any standard C function. The code for this kernel will be executed on the GPU and may look something like Figure ( 15.6) (schematically). This kernel performs a matrix addition. A and B are the inputs (loaded to the global memory of the device before launch) and C is the output (whose memory has been allocated before the kernel launch). This code describes what a single thread does. This is 517 Quantitative Analytics Figure 15.4: Heterogeneous programming (extract from CUDA programming guide, v6.5) why, although the matrix is N × N , there is no for loop over the rows and columns of C as one would have expected in a sequential code. Each thread represents one future entry of the matrix C and the role of the for loop is taken by the scheduler that launches the blocks on the cores, and the cores that launch the threads. As all these calculations are fully independent, there is no need to know in which order the blocks and threads are launched. A, B, C are in global memory, i and j are placed in registers (only usable by this thread). What thread is this code running on can be identified thanks to a number of built-in variables: • blockIdx represents the coordinates on the grid (x and y) of the block on which the thread resides. • blockDim represents the dimensions of the blocks (that is, how many threads they have). • threadIdx represents the coordinates on the block (x and y) of the thread. In particular, these are relative to the block (that is, they start at 0 on all blocks), not relative to the grid. 518 Quantitative Analytics Memory allocation and transfers are performed by the CUDA functions cudaM alloc() and cudaM emcpy() called by the CPU. A sample syntax for the allocation and transfers before the kernel launch would look like Figure ( 15.7) (for pointers). The meaning of the lines in Figure ( 15.7) is the following: • allocate memory to hold the host data (hA , hB ). The filling in of data is not shown, this step is standard C language. • allocate memory on the device for storage of the inputs (dA , dB ) and future writing of the outputs (dC ). This is done with the CUDA function cudaM alloc(). • transfer the data from the host (hA , hB ) to the device (dA , dB ), with the CUDA function cudaM emcpy(). Once the kernel finished its tasks, the result of the matrix operation is held in the device variable dC , which must be transferred to the CPU for further processing (such as display, or use in other algorithms). This step looks like Figure ( 15.8), where one recognises the CUDA function cudaM emcpy() used in reverse direction (from device to host) and the CUDA de-allocation operator (equivalent of delete in C++) for the device (global) memory. At this point, the results of the algorithm are in the CPU pointer hC and we are in a position to continue executing code on the CPU, or prepare for launching a new kernel. Figure 15.5: Kernel call from the CPU (extract from CUDA programming guide, v6.5) Figure 15.6: Example of Kernel (extract from CUDA programming guide, v6.5) 519 Quantitative Analytics Figure 15.7: Memory allocation and transfer to device (extract from CUDA programming guide, v6.5) Figure 15.8: Copy to host and de-allocation (extract from CUDA programming guide, v6.5) 15.2.5 Random number generation Before presenting our case studies, we would like to spend some time discussing the random number generation (RNG) process, which is the key to many financial applications that benefit from GPU acceleration. Let us imagine a very simple Monte-Carlo simulation where we would calculate the expectation of N normally distributed random draws. Without entering into subtleties of thread hierarchy and speed optimisation at this point, let us say that we decide to launch N threads numbered from 0 to N − 1. Most RNG algorithms are highly sequential in nature. The i-th draw is usually derived from the (i − 1)-th draw by some recurrence formula. If we want to run such an algorithm on our set of N threads, after initialising each thread to the first item in the random sequence, the thread i will then have to calculate all the draws in the sequence up to the i-th one before being able to proceed (that is, transform the uniform number into a Gaussian one). One can easily see that in principle there would be no significant speed gain from this, as the runtime of the simulation would be that of 520 Quantitative Analytics the single thread (N − 1) 4 . Research efforts have been spent on finding efficient "skip functions" that let us calculate a random draw farther in the sequence without having to calculate all the intermediate draws. Luckily for us, the Sobol sequence that we used in most of our Monte-Carlo simulations does have a particularly efficient one, based on the algorithm by Bromley [1995], provided that we skip 2n draws for some integer n. This property is implemented in the sample code "SobolQRNG" in the CUDA SDK. The skip functions are typically used in the following manner: • choose an integer "stride" s, that is, the number of draws that are skipped each time a threads needs a random number (this should be a power of 2 for Sobol). • choose the number of simulations N . • thread i calculates draws i, i + s, i + 2s, ... by using the skip function, and stops before going above N . The threads are then all independent and can be calculated in any order. In particular, not all of them need to be launched on the grid at the same time, which gives a lot of flexibility to configure the grid in an optimal way. We now consider two strategies to design RNGs on the GPU, using memory storage or inline calculation. 15.2.5.1 Memory storage This strategy assumes that the random numbers have been generated before the launch of the kernel and are stored in the global memory. They could be read from text files, calculated by the CPU and sent to the GPU memory, or calculated on the GPU in a previous kernel. From the point of view of the simulation kernel, they are inputs to be read from the global memory and to be dispatched to the threads. This has the advantage of being more elegant as a design in that the RNG code is separated from the Monte-Carlo code. Additionally, more types of RNGs may be implemented on the CPU that would then send the results to the GPU. But it has the disadvantage of requiring large numbers of global memory accesses, and this tends to be sub-optimal for speed improvement. Furthermore, straight forward memory requirement estimates show that there may not be enough memory on the GPU to hold all the random numbers. Indeed, assume that we want to run 100, 000 simulations to calculate basket options with 10 underlyings and with 500 time steps to account for skew. The random numbers are typically float type so require 4B of memory (in single precision). The total memory required for storing them would be 100, 000 × 10 × 500 × 4 = 2GB On the GTX 750Ti that we use as an example of mid-level device, this is already the limit of the available global memory. 15.2.5.2 Inline The other strategy is to let the GPU Monte-Carlo engine calculate the random numbers at the point where it needs them. This eliminates the need for so many memory accesses, which will tend to be faster while not suffering from the potential lack of memory on the device. However, the design loses in elegance as the RNG algorithm sits in the middle of the simulation and cannot be decoupled from it. 4 In more realistic applications one may still improve the speed because what happens after the generation of the uniform numbers will probably be truly parallel, and will often be the bottleneck of the simulation. 521 Quantitative Analytics 15.3 Case studies 15.3.1 Exotic swaps in Monte-Carlo 15.3.1.1 Product and model In this CUDA application, we consider Power Reverse Dual Currency swaps (PRDCs) with maturities up to 30Y . One leg of the swap is essentially a series of call options on an FX rate (say USD/JPY), exchanged against floating payments of the domestic rate plus spread (say JPY Libor). We consider a Target Redemption exercise (TARN) which makes the product path-dependent. The swap is cancelled when the accumulated coupon on the structured leg goes above a pre-defined limit. As a model we choose the Dupire local volatility for FX and Hull-White for both the domestic and foreign interest rates (IR). The long-dated nature of this product and its sensitivity to the FX skew imply that very complex hybrid models should be used, while the exotic exercise requires a numerical method. Although PDEs may be used with an additional intermediate variable to handle path-dependency (see Christara et al. ChristaraEtAl09), the most common method is Monte-Carlo, and this serves as a good example for our purpose of acceleration with CUDA. The work described here has been presented by Gurrieri [2012a] for two factors (deterministic foreign rate) and extended to three factors by Gurrieri [2012b]. The latter reference contains a detailed account of the model definition and its calibration. Here we only recall the main characteristics of the model. It has three stochastic factors in total, one for FX and one for each IR, and the FX volatility is local in the sense that it is represented by a function of time t and the FX underlying Xt , that is, σ(t, Xt ). The stochastic differential equation (SDE) of the FX underlying is given by dXt = (rd − rf )dt + σ(t, Xt )dWX (t) Xt while the domestic short-rate has the typical Hull-White dynamics drd = θd − ad rd dt + σd dWd (t) with mean-reversion ad , volatility σd , and deterministic curve shift θd . The foreign short-rate also follows Hull-White dynamics in the foreign measure, but is modified by a quanto term drf = θf − af rf − σf ρf X σ(t, Xt ) dt + σf dWf (t) The quanto term brings the foreign SDE to the domestic risk-neutral measure, and it is therefore expressed as a covariance between the foreign rate and the FX underlying. The three Brownian motions dWX (t), dWd (t), and dWf (t) are assumed correlated. See Gurrieri [2012b] for a full description of the model. In practice, the local volatility function is sampled on a set of discrete times tn and FX values Xi , which results in the matrix σni = σ(tn , Xi ) and is interpolated on the paths. Semi-analytical calibration methods exist for this model and were described by Bloch et al. [2008], while exact calibration through Monte-Carlo methods was proposed by Gurrieri [2012b] with implementation in CUDA and sample code. 15.3.1.2 Single-thread algorithm Before looking at the algorithm in parallel, it helps to take a brief look at the single thread version, focusing on the most important part on the FX. On each Monte-Carlo path j, at each time tn , we do the following: 1. Calculate next uniform random number 522 Quantitative Analytics 2. Transform to Gaussian, then Brownian motion increment dWj (n) 3. Read previous spot Xj (n) from memory 4. Calculate volatility σ by interpolating the volatility slice σ(tn , Xj (n)) at tn 5. Calculate the new spot 1 Xj (n + 1) = Xj (n)e(rd −rf − 2 σ 2 )(tn+1 −tn )+σdWj (n) 6. Calculate product(s) 7. Write new spot in memory And then we loop on the paths, and the times. 15.3.1.3 Multi-thread algorithm The most natural idea at first may be to let each thread calculate one path. This may be possible, but for memory management and performance reasons, it is not the best idea. Indeed, a general rule of thumb for achieving good performance is to maximise the amount of arithmetic operations compared to data transfers. Following this rule, it is often advantageous to let each thread calculate many paths to avoid multiple readings of the same inputs. We described this process in Section (15.2.5). Let us fix the thread hierarchy. We take a 1D grid of Nb blocks, and 1D blocks of Nt threads (in our runs, Nb = 128 = Nt ). We define the stride as s = N( b) × Nt , which represents the total number of threads. We run a number of simulations Nm c. Following the all threads from j = 1 to j = Nm c are calculated once and only once. This is achieved by letting Thread a calculate the paths a, a + s, a + 2s... until reaching Nm c. Thread a first calculates the path a, then skips over the paths a + 1, a + 2, ... using the RNG’s skip function as mentioned in Section (15.2.5), and the next path is calculates is a + s, then skipping a + s + 1, etc.. Let us take a simple example with a 1D grid of two 1D blocks with contain two threads, and let us run 14 simulations. The stride is 4 and we number the blocks and threads globally from 1 to 2 and 1 to 4 for simplicity. The Monte-Carlo algorithm follows this pattern • Block 1, Thread 1, calculates paths 1, 5, 9, 13 • Block 1, Thread 2, calculates paths 2, 6, 10, 14 • Block 2, Thread 3, calculates paths 3, 7, 11 • Block 2, Thread 4, calculates paths 4, 8, 12 On each path j that it must calculate, Thread a calculates P Vj and accumulates it in a sum variable Ta . For example, in the simple case above T1 = P V1 + P V5 + P V9 + P V13 . Then, in a given block, we wait for all threads to finish their sum and once this is done, we accumulate the sums of the threads in a given block. The sum in Block 1 above will be B1 = T1 + T2 , and the sum in Block 2 is B2 = T3 + T4 . Let us explain now how these partial sums can be performed in connection with memory types. Each thread can access its own registers, and this memory is accessible only by this thread. In the example above, P V1 is written in a register of Thread 1, P V6 is written in a register of Thread 2, P V3 is written in a register of Thread 3, and Thread 1 can access neither P V6 nor P V7 , even though Thread 1 and Thread 2 are located in the same Block 1. 523 Quantitative Analytics Thread 1 sums all its PVs in the variable T1 and Thread 2 in T2 . If we let T1 and T2 be on registers, we will not be able to sum them into the "block variable" B1 = T1 + T2 , because no thread will be able to access both. We thus need T1 and T2 to be in a memory type that is accessible by the thread that will sum them. There are two possibilities to achieve this. Either we use the global memory, accessible by all threads on the device, which is comparatively slow, or we use the shared memory, accessible by all threads within a block, in small quantities but very fast. For performance, we should always try to use the shared memory as much as possible. In this situation, there is more than enough of it so it will be our choice. Thread 1 and Thread 2 will write their own sums T1 and T2 in the shared memory of their block, Block 1. Once this is done, we use one of these threads to sum B1 = T1 + T2 and similarly for B2 on Block 2. The next question is where to store B1 and B2 . Ultimately we want to sum them and we will not be able to do so if we store them in the shared memories of their respective blocks as these cannot communicate. Therefore, we store them on the global memory. In each block i, the thread that is responsible for calculating the block-sum Bi will write it in the global memory. At this point, we no longer have many variables. Indeed, although there may be tens or hundreds of thousands of P Vj or Ta , in our pricing configuration there are only 128 blocks so 128 Bi . A sum of 128 variables is not very advantageously performed on the GPU so we send the Bi from the global memory to the CPU memory where we do the final sum. This ends the algorithm. The performance was reported by Gurrieri [2012a], with speed-ups above 100x on realistic pricing configurations and on a GTX 460, a model that in 2014 is at the low end of the range. Let us make a brief remark on the issue of single versus double precisions. Single precision can be a limitation in Monte-Carlo simulations when running in single thread because the more we add paths, the more we add small numbers to large numbers and the loss due to round-offs becomes more and more important with the number of simulations. Errors due to single precision can become significant at realistic numbers of simulations, while double precision prevents this problem. On the other hand, single precision can be significantly faster on GPUs, as is well illustrated by Figure ( 15.1). The parallel algorithm illustrated above does not suffer from this issue because the Monte-Carlo sums are always partial. Threads sum a few paths, then blocks sum a few of these "thread sums", and the final Monte-Carlo result is the sum of the "block sums". In essence, this is a nested bucketed sum, and this is typically a way of avoiding the single precision issue. Note that since double precision is available on modern GPU devices, the programmer can always choose to run with it, although at the cost of some performance since double precision is not as optimised on GPUs as it is on CPUs. Finally, note that this model can also benefit from GPU optimisation for its calibration. Gurrieri [2012a] took advantage of the fact that its FX calibration equation can be written explicitly as an expectation to propose a MonteCarlo calibration algorithm that allows for a more accurate calibration than semi-analytical approximation formulas. Furthermore, this algorithm can straight forwardly be extended to other short-rate models such as CIR. However, the half-sequential half-parallel nature of this process implies that the speed gains are less dramatic than for a purely Monte-Carlo process. Nevertheless, we could obtain gains of about ∼ 30x on retail devices. Gurrieri [2012a] provided a detailed account of this algorithm together with sample CUDA code. 15.3.1.4 Using the texture memory Finally, let us add a few words on the interpolation of the local volatility matrix. A typical size for it may be 200×200, which means about 40, 000 entries. When pricing in Monte-Carlo, it must be interpolated, mostly because X(t) is a stochastic quantity not known in advance (by opposition to a lattice where it is known on the nodes) and thus has no reason to be one of the matrix pillars. Note that the time grid on the other hand, the tn are known in advance, such that interpolation in the time direction is not necessary. 524 Quantitative Analytics GPUs were originally used for video games and in particular for handling 2D surfaces for which interpolations were required. The hardware was thus optimised for very fast interpolation of matrices. For this purpose, there exists a special type of memory called "texture memory" that has fast cache and a built-in linear interpolation at the hardware level. The extrapolation is constant, and this is precisely how we interpolate the local volatility matrix. It is therefore natural to think of storing the LV entries in the texture memory of the GPU. This was originally done by Bernemann et al. [2011], and we refined the idea by noticing that only interpolation in the FX direction is needed such that one can actually use a slightly different type of textures with more flexibility, the layered textures. See Gurrieri [2012a] for more details and performance tests of the texture memory. 15.3.2 Volatility calibration by differential evolution The results presented in this section have not been published yet, and we give only the main steps of the reasoning with preliminary performance reports. 15.3.2.1 Model and difficulties Here we consider an entirely different CUDA application, that of the calibration of an implied volatility surface to the market of vanilla option prices. Broadly speaking, the problem is the following: given a continuous parametric function θ(K, T ) where K is the strike and T is the maturity, what are the parameters defining θ(K, T ) that lead to the best fit to a series of implied volatility quotes that are available at discrete market pillars (Ka , Ta )? This is typically a problem of multi-dimensional constrained optimisation, as in general the model will have several parameters with potentially complex constraints. In this study we use the model described by Bloch [2010]. It is a mixture of normal densities whose parameters are time-dependent functions. For the three family model, there is a total of 19 parameters to optimise on. A common market configuration for equity indexes would lead to a fit to about 100 option prices. The optimisation of implied volatility surfaces is known to be a delicate issue as the objective functions and their constraints often exhibit local minima which poses problems for standard (deterministic) optimisation algorithms such as the Simplex or gradient methods. The global minimum may be missed, and a high dependence on the starting point can be observed. Bloch [2010] proposed the use of the Differential Evolution (DE) algorithm, a member of the family of Genetic Algorithms. We will not go into details on what makes the Differential Evolution different from the other Genetic Algorithms, as this is not the main purpose of this study. The main steps of the algorithm for us are common to all Evolution algorithms: 1. Generate a population of Np candidate parameter sets (parent population). 2. Cross-Over the parent population to produce an offspring population (stochastic). 3. Apply Mutations to the offspring population (stochastic). 4. Select the fittest elements between offspring and parents to generate the next parent population. 5. Iterate (that is, go to the next generation). The "fittest" candidates are those for which the θ(K, T ) function is the closest to the market quotes for some metric (we choose the L2 distance), possibly incorporating a penalty for non-satisfied constraints (we use the so called "death penalty", that is, infinite distance). While this algorithm is excellent at handling constraints and avoiding local minima, it does require large amounts of calculations as the objective function must be evaluated once for each member of the population and at each iteration. To avoid local minima, the algorithm will typically need more iterations than a standard deterministic algorithm, which tends to result in a much slower runtime. Happily, this algorithm can be naturally written in parallel (although not as "embarrassingly" as a Monte-Carlo simulation), and this is the subject of the remaining of this section. 525 Quantitative Analytics 15.3.2.2 Single-thread algorithm As for the previous application, before looking at the parallel algorithm we briefly describe the single thread algorithm. Assuming a population of Np candidate parameter sets (we will call them "individuals", 19-dimensional vectors here) already exist in memory with the value of their objective function calculated, the algorithm proceeds as 1. Choose Np parent sets to generate Np children (random process). 2. Let mutations modify these Np children (random process). 3. Calculate the objective function for each child (use this child’s parameters and calculate the option price by combining Black-Scholes functions). 4. Select the fittest individuals among parents and children. 5. Iterate. As often with such optimisations, the bottleneck of the algorithm tends to be step 3) above, that is, the estimation of the modelling function on all the instruments we fit to. In our applications, there will be about 100 option prices to calculate on each individual, and each option calculation requires the evaluation of a few simple algebraic functions together with the cumulative normal density. The size of the population can be chosen by the user, but a good rule of thumb seems to be to use about 5D where D is the dimension of the problem, here 19 (for 19 parameters in the model). This means that at each iteration, about 10, 000 options must be calculated, and a few hundreds of generations may be needed for sufficient convergence. This results in a very large number of calculations that we would like to accelerate using GPUs and CUDA. 15.3.2.3 Multi-thread algorithm An example of parallelisation of DE has been studied by Ramirez-Chavez et al. [2011] which adopted the strategy of parallelising on the population: since the evaluation of the objective function for each individual is independent, this step can be done in parallel with each thread calculating the objective for one of the population members. This is certainly valid and a very generic principle for this algorithm, but we propose to take advantage of an other source of parallelism to further speed-up the calculation: the option direction. Indeed, while calculating the objective function is independent for each individual, within one such evaluation of the function, the calculation of each option is also independent of the others. We thus have a 2-dimensional source of parallelism here, which can very naturally be taken advantage of using the CUDA thread hierarchy. We propose two algorithms with some trade-offs. The first algorithm leads to a minimum amount of CUDA code writing but less speed improvement. The second one is fully written on the GPU and faster by a factor of about 2x compared to the more simple algorithm. Simple algorithm We keep all the purely DE steps on the CPU and parallelise only the calculation of the objective functions on the population. We choose a grid configuration with Np blocks, that is, 1 block per individual. Each thread within a block calculates one option based on the parameters for the individual attached to this block. When all threads have calculated their assigned options, we reduce the calculation of the distance between market and model options, which is the objective function. This process is similar to that of the partial "block-sums" of our Monte-Carlo algorithm described in the previous section. The step-by-step description is as follow: • generate the child population on the CPU • configure a grid with Np blocks where Np is the size of the population 526 Quantitative Analytics • send this population to the GPU, that is, send the 19 parameters of each child to each block (in the shared memory) • each thread within a block calculates one option with the child parameters for this block, and loops until all options are calculated • the objective function is calculated on this block and written to the global memory • the CPU retrieves the objective functions on the population from the global memory, and uses these values to generate the next population according to the rules of DE • iterate This algorithm gave us only a moderate 6x gains on a GTX 460 over the single thread implementation on the CPU. The advantage of this algorithm is that, as DE is actually implemented on the CPU, only a small amount of CUDA code writing is required. The main disadvantage is in the number of memory transfers between the host and the device: at every generation, a population must be sent from host to device, and the objective functions must be sent from device to host. Another disadvantage, less significant in our opinion, is that we do not benefit from other possible gains on the DE algorithm itself. Improved algorithm We suggest a second algorithm that addresses these issues. This time, all the DE steps are implemented on the GPU in a similar fashion to Ramirez-Chavez et al. [2011]: cross-over, mutation, and selection. This second version has the same thread hierarchy, but requires intermediate kernels for the DE steps. Although it requires more CUDA code, it benefits from no longer requiring host-device-host transfers, and can achieve up to 14x speed-ups on our GTX 460. 15.4 Conclusion As of end of 2014, GPU programming and CUDA are more and more viewed as viable technologies for massive improvements of various calculations in financial applications, from pricing complex exotics and large portfolios of vanillas to risk calculations such as VaR and CVAs. Major banks and investment organisations report successful deployment of GPU solutions, and the number of software companies proposing GPU libraries has grown substantially since the launch of CUDA in 2007. These propose full solutions with closed code (such as Murex), libraries to link to or higher level languages (such as NAG, MATLAB), or wrappers around single thread code (Xcelerit). Companies that prefer keeping full control of their code up until the GPU execution, though, will still need to hire quants with a knowledge of CUDA programming. This may not be very easy as single thread C/C++ programming is a standard, and the learning curve to switch to CUDA can be rather steep. In our experience, most of the difficulty in using CUDA comes from the lack of experience in "thinking in parallel", and this is not specific to CUDA. The next difficulty in line is the understanding of the thread hierarchy and memory management, and how to use it to improve performance and scalability. We hope that this document will help other quants go through these steps with more ease. The results are worth the effort, with very large gains especially in Monte-Carlo implementations. The level of gains one can obtain from this technology is not simply improving the speed of current calculations, it also allows for new models or possibilities to be explored. Such "game changers" are intra-day risk, or Monte-Carlo calibrations of models without closed-forms, a process that was prohibitively expensive before, but that can now be considered realistically for production. 527 Appendices 528 Appendix A Review of some mathematical facts A.1 Some facts on convex and concave analysis Details can be found on text books on mathematics for economics (see Wilson [2012]) and on convex analysis (see Rockafellar [1995]). We use relint (S) to refer to the relative interior of a convex set S, which is the set S minus all of the points on the relative boundary. We use closure (S) to refer to the closure of S, the smallest closed set containing all of the limit points of S. We use ∇ to denote a differential operator that indicates taking gradient in vector calculus. In the Cartesian coordinate system Rn with coordinates (x1 , .., xn ) and standard basis (ê1 , .., ên ), del is defined in terms of partial derivative operators as n ∇= ∂ ∂ X ∂ , .., = êi ∂x1 ∂xn ∂xi i=1 The gradient product rule is given by ∇(f g) = f ∇g + g∇f and the rules for dot products satisfy ∇(u.v) = (u.∇)v + (v.∇)u + u × (∇ × v) + v × (∇ × u) where u and v are vectors. The directional derivative of a scalar field f (x, y, z) in the direction a(x, y, z) = ax x̂ + ay ŷ + az ẑ is defined as a. grad f = ax ∂f ∂f ∂f + ay + az = (a.∇)f ∂x ∂y ∂z which gives the change of a field f in the direction of a. The Laplace operator is a scalar operator that can be applied to either vector or scalar fields; for cartesian coordinate systems it is defined as ∆= ∂2 ∂2 ∂2 + + = ∇.∇ = ∇2 ∂x2 ∂y 2 ∂z 2 The tensor derivative of a vector field v can be denoted simply as ∇ ⊗ v where ⊗ represents the dyadic product. This quantity is equivalent to the transpose of the Jacobian matrix of the vector field with respect to space. 529 Quantitative Analytics A.1.1 Convex functions If x, y ∈ R and α ∈ (0, 1), then (1 − α)x + αy is a convex combination of x and y. Geometrically, a convex combination of x and y is a point somewhere between x and y. A set X ⊂ R is convex if x, y ∈ X implies (1 − α)x + αy ∈ X for all α ∈ [0, 1]. Definition A.1.1 A function f : Rn → R is convex if and only if any of the following conditions hold 1. for all x, y ∈ Rn , 1 x+y 1 f (x) + f (y) ≥ f ( ) 2 2 2 2. for all x, y ∈ Rn and α ∈ [0, 1], (1 − α)f (x) + αf (y) ≥ f ((1 − α)x + αy) 3. for all random variables X, Jensen’s inequality E[f (X)] ≥ f (E[X]) (A.1.1) is satisfied. If f is strictly convex then the equality implies that X = E[X] w.p. 1. Proposition 3 A sufficient condition for f to be convex is that ∇2 f 0 where 0 stands for positive semi-definitness, that is, ∇2 f has non-negative eigenvalues. Proposition 4 If f is convex and differentiable, then for all x0 , δ ∈ Rn , f (x0 + δ) ≥ f (x0 ) + δ.∇f (x0 ) Theorem A.1.1 If f has a second derivative which is non-negative (positive) everywhere, then f is convex (strictly convex). A.1.2 Concave functions Definition A.1.2 A function f : X → R is concave if for all x, y ∈ X and α ∈ [0, 1], (1 − α)f (x) + αf (y) ≤ f ((1 − α)x + αy) Definition A.1.3 A function f : X → R is strictly concave if for all x, y ∈ X with x 6= y and α ∈ [0, 1], (1 − α)f (x) + αf (y) < f ((1 − α)x + αy) Geometrically, a function f is concave if the cord between any two points on the function lies everywhere on or below the function itself. PnConsider a list of functions fi : X → R for i = 1, .., n and a list of numbers α1 , .., αn . The function f = i=1 αi fi is called a linear combination of f1 , .., fn . If each of the weights αi ≥ 0, then f is a non-negative linear combination of f1 , .., fn . 530 Quantitative Analytics Pn Theorem A.1.2 Suppose f1 , .., fn are concave functions and (α1 , .., αn ) ≥ 0. Then, f = i=1 αi fi is also a concave function. If at least one fj is also strictly concave and αj > 0, then f is strictly concave. Even though a concave function need not be differentiable everywhere, the right and left hand derivatives always exist on the interior of the domain and f − (x) ≥ f + (x). As a result, f is both right and left continuous and therefore continuous. However, concave functions need not be continuous at the boundary. For differentiable functions, the following theorem provides a simple necessary and sufficient conditions for concavity. Theorem A.1.3 Suppose f : X → R is differentiable. 1. f is concave if and only if for each x, y ∈ X we have 0 f (y) − f (x) ≤ f (x)(y − x) 2. f is strictly concave if and only if the inequality is strict for each x 6= y. Even if a function is not differentiable everywhere, it is concave if and only if for each x ∈ int(X), there is an a ∈ R such that f (y) − f (x) ≤ a(y − x) for all y ∈ X. This is an example of a supporting hyperplane for one dimension. Theorem (A.1.3) implies that the first derivative function of a concave function is non-increasing. Theorem A.1.4 Suppose f : X → R is differentiable. 0 1. f is concave if and only if f is non-increasing. 00 2. f is strictly concave if and only if f is strictly decreasing. Theorem A.1.5 Suppose f : X → R is twice differentiable. 00 1. f is concave if and only if f ≤ 0. 00 2. if f < 0, then f is strictly concave. 00 Note, f strictly concave does not imply that f (x) < 0 for all x. An example of strictly concave function f : R++ → R is 1. f (x) = xα α for α 6= 0, α < 1 2. f (x) = log x 3. f (x) = bx − ax2 where a > 0 The following lemma is an immediate consequence of the definition of concave and convex functions. Lemma A.1.1 f is a (strictly) convex function if and only if −f is a (strictly) concave function. 531 Quantitative Analytics A.1.3 Some approximations 1. Upper bound on the exponential function obtained by linearising ex in 0 ex ≥ 1 + x 2. Lower bound on the logarithm function, derived by using the log operator on log(1 + x) ≥ x 3. This inequality follows from the convexity of f (z) = eαz eαx ≤ 1 + (eα − 1)x for x ∈ [0, 1] 4. Another inequality 1 − log (1 − x) ≤ x + x2 for x ∈ [0, ] 2 A.1.4 Conjugate duality We are going to give a precise definition of the notion of duality as well as some useful results. We use the notation dom (f ) to refer to the domain of a function f , that is, where it is defined and finite valued. Definition A.1.4 A function f is said to be proper if f (x) > −∞ for all x and f (x) < ∞ for some x. Definition A.1.5 A convex function f : RK → [−∞, ∞] is said to be closed when the epigraph of f is a closed set, or equivalently, the set {x : f (x) ≤ α} is closed for all α ∈ R. Definition A.1.6 For any convex function f : RK → [−∞, ∞], the convex conjugate f ∗ of f is defined as f ∗ (z) = sup z.x − f (x) x∈RK For example, for f (z) = 21 ||z||2p we get f ∗ (z) = 12 ||z||q 2 where p1 + p1 = 1. On of the property of the convex conjugate is ∇f ∗ = (∇f )−1 . We are now going to cite two useful results. Theorem A.1.6 For any closed convex function f : RK → [−∞, ∞], the conjugate f ∗ is also closed and convex, and f ∗∗ = f . Furthermore, we can write f ∗ (y) = sup y.x − f (x) x∈ relint( dom (f )) It means that when taking the sup, we do not have to worry about what happens on the boundary. Further, it tells us that there is a one-to-one correspondence between every closed convex function and its dual. Hence, various properties of the function should translate when we go to the dual. For instance, the following result shows that differentiability is a dual property to strict convexity. Theorem A.1.7 Given a proper closed convex function f : RK → [−∞, ∞], f is finite and differentiable everywhere on RK if and only if its conjugate f ∗ is strictly convex on dom (f ∗ ). 532 Quantitative Analytics A.1.5 A note on Legendre transformation Given an arbitrary smooth convex function f , we can define the Legendre transformation which maps a point x ∈ dom (f ) via the rule x → ∇f (x). Under certain circumstances, we get that this map is the inverse of the Legendre transformation of the conjugate f ∗ , that is, ∇f ∗ (∇f (x)) = x and ∇f (∇f ∗ (y)) = y for every x ∈ dom (f ) and y ∈ dom (f ∗ ). However, the latter only holds when f is strictly convex and the interior of dom (f ) is non-empty (see Rockafellar [1995]). A.1.6 A note on the Bregman divergence Suppose f : Rn → R is strictly convex with continuous first order partial derivatives. Definition A.1.7 The Bregman divergence between x and y with respect to a convex function f is given by Df (x, y) = f (x) − f (y) − ∇f (y)(x − y) and due to convexity we get Df (x, y) ≥ 0 for all x and y. 1 1 2 2 The Bergman distance Pn is in general not symmetric. For example, for f (x) = 2 ||x|| we get Df (x, y) = 2 ||x − y|| . Also, for f (x) = i=1 (xi log xi − xi ) we get Df (x, y) = KL(x, y) − n X n xi log i=1 xi X + (yi − xi ) yi i=1 We now states some properties of the Bregman divergence Property A.1.1 1. Df +g (x, y) = Df (x, y) + Dg (x, y) 2. Df (x, v) + Df (v, w) = Df (u, v) + (u − v)(∆f (w) − ∆f (v)) 0 3. The Bergman projection into a convex set K exists and is unique. Let w be the Bergman projection of the point w into the convex set K. It follows 0 w = arg min Df (v, w) v∈K 4. Generalised Pythagorean Theorem: for all u ∈ K 0 0 Df (u, w) ≥ Df (u, w ) + Df (w , w) 5. Df (u, v) = Df ∗ (∇f (x), ∇f (u)) where f ∗ is the Legendre dual. 6. Df +g (x, y) = Df (x, y) if g(x) is linear. 7. ∇x Df (x, y) = ∇f (x) − ∇f (y). 8. If y minimise f (∇f (y) = 0), then Df (x, y) = f (x) − f (y) 533 Quantitative Analytics A.2 The logistic function The logistic function is used to study the relation to population growth and model the S-shaped curve of growth of some population P P (t) = 1 1 + e−t with the property that 1 − P (t) = P (−t). The initial stage of growth is approximately exponential, then as saturation begins, the growth slows and stops at maturity. The derivative of the function is d P (t) = P (t)(1 − P (t)) dt which is a simple first-order non-linear differential equation. The logistic equation is an example of an autonomous ordinary differential equation (ODE) since the RHS is independent of t. Hence, if P (t) solves the ODE, so does P (t − c) for any constant c. The derivative is 0 at P = 0 or P = 1 and the derivative is positive for P in the range [0, 1] and negative for P above 1 or less than 0. It yields an unstable equilibrium at 0, and a stable equilibrium at 1 and thus for any value of P greater than 0 and less than 1, P grows to 1. In general, the logistic equation is P (t) d P (t) = (b − aP (t))P (t) = b(1 − )P (t) dt Kab where b is the intrinsic growth rate and Kab = P = Kab . The solution to the ODE is b a is the environmental carrying capacity with critical points P = 0 and P (t) = Kab P (0)ebt Kab + P (0)(ebt − 1) so, that if 0 < P (0) < Kab then P → Kab as t grows. As a result lim P (t) = Kab t→∞ and Kab is the limiting value value of P , the highest value that the population can reach given infinite time. One should stress that the carrying capacity Kab is asymptotically reached independently of the initial value P (0) > 0, as it happens also in the case P (0) > Kab . The logistic equation is separable 1 (1 − P (t) Kab )P (t) dP (t) = bdt Since 1 (1 − PK(t) ) + PK(t) 1 1 Kab ab ab + = = P (t) P (t) P (t) P (t) (1 − (1 − Kab )P (t) (1 − Kab )P (t) Kab ) the partial fractions gives 1 1 Kab + dP (t) = bdt P (t) P (t) (1 − Kab ) which simplifies to 534 Quantitative Analytics 1 1 + dP (t) = bdt P (t) Kab − P (t) Integrating, we get ln |P | − ln |Kab − P | = bt + C 0 which gives ln | 0 P | = bt + C Kab − P Exponentiating, we get 0 0 P = ±ebt+C = ±ebt eC Kab − P which gives 0 P = Cebt with C = ±eC Kab − P Solving for P , we get P (t) = C(Kab − P (t))ebt = CKab ebt − CP (t)ebt which gives P (t) + CP (t)ebt = P (t)(1 + Cebt ) = CKab ebt with solution P (t) = CKab ebt (1 + Cebt ) where we determine the constant C from initial condition. For example, if the initial condition is P (0) = Kab CKab = 2 (1 + C) which implies 1=2 C 1+C which gives C = 1, and the solution is P (t) = Kab 1 ebt = Kab −bt with lim P (t) = Kab bt t→∞ (1 + e ) (e + 1) In the general case, with initial condition P (0) = x we get x= which gives C = x Kab −x . CKab (1 + C) Hence, the solution becomes P (t) = x bt Kab −x Kab e (1 + Kabx−x ebt ) = 535 xKab ebt ((Kab − x) + xebt ) Kab 2 then Quantitative Analytics and we recover P (t) = xKab ebt Kab P (0)ebt = bt Kab + x(e − 1) Kab + P (0)(ebt − 1) Similarly, with terminal condition P (T ) = x we get x= which gives C = x (Kab −x)ebT CKab ebT (1 + CebT ) . Hence, the solution becomes P (t) = x Kab ebt (Kab −x)ebT x bt (1 + (Kab −x)e bT e ) = xKab e−b(T −t) ((Kab − x) + xe−b(T −t) ) and we recover P (t) = A.3 xKab e−b(T −t) Kab P (T )e−b(T −t) = Kab + x(e−b(T −t) − 1) Kab + P (T )(e−b(T −t) − 1) The convergence of series For any sequence {an } of numbers (real, complex), the associated series is defined as ∞ X an = a0 + a1 + ... n=0 and the sequence of partial sums {Sk } associated to that series is defined for each k as the sum of the sequence {an } from a0 to ak Sk = k X an = a0 + a1 + ... + ak n=0 When summing a family {ai }, i ∈ I of non-negative numbers, one may define X X ai = sup { ai |A finite , A ⊂ I} ∈ [0, +∞] i∈I i∈A When the sum is finite, the set of i ∈ I such that ai > 0 is countable. For every n ≥ 1, the set An = {i ∈ I : ai > is finite since 1 n} X X 1 card(An ) ≤ ai ≤ ai < ∞ n i∈An i∈I Any sum over non-negative reals can be understood as the integral of a non-negative function with respect to the counting measure,which accounts for the many similarities between the two constructions. Theorem A.3.1 Convergence of series with positive terms An infinite series with positive terms either converges or diverges to ∞. The series converges if its partial sums are bounded and diverges if its partial sums are not bounded. 536 Quantitative Analytics Theorem A.3.2 The integral test for series with positive terms Suppose that the series ∞ X an n=n0 with positive terms is such that an = f (n) for integers n ≥ c with some c, where y = f (x) is continuous on [c, ∞) and decreasing for X ≥ c. Then, the infinite series above converges if and only if the improper integral Z ∞ f (x)dx c converges. Theorem A.3.3 Convergence of the p-series The infinite series ∞ X 1 1 1 = 1 + p + p + ... p n 2 3 n=1 converges if p > 1 and diverges if p ≤ 1. Theorem A.3.4 P∞The Comparison P∞ Test with positive terms Suppose that n=n0 an and n=n0 bn are series with positive terms. P∞ P∞ 1. if n=n0 bn converges and there are constants M and N such that an ≤ M bn for n ≥ N , then n=n0 an also converges. P∞ P∞ 2. if n=n0 bn diverges and there are constants M > 0 and N such that an ≥ M bn for n ≥ N , then n=n0 an also diverges. In computer science, the prefix sum, scan, or cumulative sum of a sequence of numbers x0 , x1 , x2 , ... is a second sequence of numbers y0 , y1 , y2 , ..., the sums of prefixes (running totals) of the input sequence y0 = x0 y1 = x1 + x2 y2 = x1 + x2 + x3 ... For instance, the prefix sum of the natural numbers are the triangular numbers input numbers prefix sums 1 1 2 3 3 6 4 10 5 15 6 21 ... ... Table A.1: prefix sums of the natural numbers Prefix sums are trivial to compute in sequential models of computation, by using the formula yi = yi−1 + xi to compute each output value in sequence order. 537 Quantitative Analytics A.4 The Dirac function If x ∈ R, then the Dirac function δx represents a notional function with the properties • δx (y) = 0 if y 6= x R∞ • −∞ g(y)δx (y)dy = g(x) for all integrable g : R → R It satisfies the scaling property for non-zero scalar α Z ∞ Z δ(αy)dy = −∞ so that δ(αy) = δ(y) |α| . ∞ δ(u) −∞ du 1 = |α| |α| The composition with a function is δx0 (g(y)) = δ(y − x0 ) |g 0 (x0 )| For a translation, the time-delayed Dirac function is Z ∞ f (t)δ(t − T )dt = f (T ) −∞ If X is a set, X0 ∈ X is a marked point and Σ is any sigma algebra of subsets of X, then the measure defined on sets A ∈ Σ is 1 if X0 ∈ A δx0 (A) = 0 otherwise A.5 Some linear algebra A vector space is a set V equipped with two operations • addition V × V 3 (x, y) → x + y ∈ V • and scalar multiplication R × V 3 (r, x) → rx ∈ V having the following properties Property A.5.1 1. a + b = b + a for all a, b ∈ V 2. (a + b) + c = a + (b + c) for all a, b, c ∈ V 3. there exists an element of V , called the zero vector, and denoted 0, such that a + 0 = 0 + a = a for all a ∈ V 4. for any a ∈ V there exists an element of V , denoted −a, such that a + (−a) = (−a) + a = 0 5. r(a + b) = ra + rb for all r ∈ R and a, b ∈ V 6. (r + s)a = ra + sa for all r, s ∈ R and a ∈ V 538 Quantitative Analytics 7. (rs)a = r(sa) for all r, s ∈ R and a ∈ V 8. 1a = a for all a ∈ V Definition A.5.1 A vector space V0 is a subspace of a vector V if V0 ⊂ V and the linear operations on V0 agree with the linear operations on V . Proposition 5 A subset S of a vector space V is a subspace of V if and only S is nonempty and closed under linear operations, that is, x, y ∈ S ⇒ x + y ∈ S x ∈ S ⇒ rx ∈ S for all r ∈ R Let V be a vector space and v1 , v2 , ..., vn ∈ V . Consider the set L of all linear combinations r1 v1 + r2 v2 + ... + rn vn where r1 , r2 , ..., rn ∈ R. Theorem A.5.1 L is a subspace of V . Let S be a subset of a vector space V . Definition A.5.2 The span of the subset S, denoted Span(S), is the smallest subset of V that contains S. That is, • SpanS is a subset of V. • for any subspace W ⊂ V one has S ⊂ W ⇒ Span(S) ⊂ W Let S be a subset of a vector space V . • If S = {v1 , v2 , .., vn } then Span(S) is the set of all linear combinations r1 v1 + r2 v2 + ... + rn vn where r1 , r2 , ..., rn ∈ R. • If S is an infinite set then Span(S) is the set of all linear combinations r1 u1 + r2 u2 + ... + rk uk where u1 , u2 , ..., uk ∈ S and r1 , r2 , ..., rk ∈ R for k ≥ 1. • If S is the empty set then Span(S) = {0}. Definition A.5.3 A subset S of a vector space V is called a spanning set for V if Span(S) = V . We say that the set S spans the subspace W or that S is a spanning set for W . If S1 is a spanning set for a vector space V and S1 ⊂ S2 ⊂ V , then S2 is also a spanning set for V . Definition A.5.4 Let V be a vector space. Vectors v1 , v2 , ..., vk ∈ V are called linearly dependent if they satisfy a relation r1 v1 + r2 v2 + ... + rk vk = 0 where the coefficients r1 , r2 , ..., rk ∈ R are not all equal to zero. Otherwise, vectors v1 , v2 , ..., vk are called linearly independent. That is, if r1 v1 + r2 v2 + ... + rk vk = 0 ⇒ r1 = .. = rk = 0 An infinite set S ⊂ V is linearly dependent if there are some linearly dependent vectors v1 , v2 , ..., vk ∈ S. Otherwise S is linearly independent. Theorem A.5.2 The following conditions are equivalent: 539 Quantitative Analytics 1. vectors v1 , v2 , ..., vk are linearly dependent. 2. one of vectors v1 , v2 , ..., vk is a linear combination of the other k − 1 vectors. Theorem A.5.3 Vectors v1 , v2 , ..., vm ∈ Rn are linearly dependent whenever m > n (the number of coordinates is less than the number of vectors). Definition A.5.5 Let V be a vector space. A linearly independent spanning set for V is called a basis. Assuming that a set S ⊂ V is a basis for V . Then, a spanning set means that any vector v ∈ V can be represented as a linear combination v = r1 v1 + r2 v2 + ... + rk vk where v1 , v2 , ..., vk are distinct vectors from S and r1 , r2 , ..., rk ∈ R. Linearly independent implies that the above representation is unique v = 0 0 0 r1 v1 + r2 v2 + ... + rk vk = r1 v1 + r2 v2 + ... + rk vk 0 0 0 ⇒ (r1 − r1 )v1 + (r2 − r2 )v2 + ... + (rk − rk )vk = 0 0 0 0 ⇒ (r1 − r1 ) = (r2 − r2 ) = ... = (rk − rk ) = 0 Let v1 , v2 , ..., vk be vectors in Rn . Theorem A.5.4 If k < n then the vectors v1 , v2 , ..., vk do not span Rn . Theorem A.5.5 If k > n then the vectors v1 , v2 , ..., vk are linearly dependent. Theorem A.5.6 If k = n then the following conditions are equivalent: 1. {v1 , v2 , ..., vn } is a basis for Rn . 2. {v1 , v2 , ..., vn } is a spanning set for Rn . 3. {v1 , v2 , ..., vn } is a linearly independent set. Theorem A.5.7 Any vector space has a basis. Theorem A.5.8 If a vector space V has a finite basis, then all bases for V are finite and have the same number of elements. Definition A.5.6 The dimension of a vector space V , denoted dim V , is the number of elements in any of its bases. Theorem A.5.9 Let S be a subset of a vector space V . then the following conditions are equivalent: 1. S is a linearly independent spanning set for V , that is, a basis. 2. S is a minimal spanning set for V . 3. S is a maximal linearly independent subset of V . 540 Quantitative Analytics Definition A.5.7 Given vector spaces V1 and V2 , a mapping L : V1 → V2 is linear if L(x + y) = L(x) + L(y) L(rx) = rL(x) for any x, y ∈ V1 and r ∈ R. A linear mapping l : V → R is called a linear functional on V . If V1 = V2 (or V1 and V2 are functional spaces), then a linear mapping L : V1 → V2 is called a linear operator. Some properties of linear mappings are • If a linear mapping L : V → W is invertible, then the inverse mapping L−1 : V → W is also linear. • If L : V → W and M : W → X are linear mappings, then the composition M oL : V → X is also linear. • If L1 : V → W and L2 : V → W are linear mappings, then the sum L1 + L2 is also linear. If {v1 , v2 , .., vn } is a basis for a vector space V , then any vector v ∈ V has a unique representation v = x1 v1 + x2 v2 + ... + xn vn where xi ∈ R. The coefficients x1 , x2 , .., xn are called the coordinates of v with respect to the ordered basis v1 , v2 , .., vn . This mapping is a linear transformation. Let V, W be vector spaces, and L : V → W be a linear mapping. Definition A.5.8 The range (or image) of L is the set of all vectors w ∈ W such that w = L(v) for some v ∈ V . The range of L is denoted L(v). The kernel of L, denoted Ker(L), is the set of all vectors v ∈ V such that L(v) = 0. Theorem A.5.10 1. The range of L is a subspace of W . 2. The kernel of L is a subspace of V . Definition A.5.9 Vectors x, y ∈ Rn are said to be orthogonal (denoted x ⊥ y) if x.y = 0. Definition A.5.10 A vector x ∈ Rn is said to be orthogonal to a nonempty set Y ⊂ Rn (denoted x ⊥ Y ) if x.y = 0 for any y ∈ Y . Definition A.5.11 Nonempty sets X, Y ∈ Rn are said to be orthogonal (denoted X ⊥ Y ) if x.y = 0 for any x ∈ X and y ∈ Y . Proposition 6 If X, Y ∈ Rn are orthogonal sets, then either they are disjoint or X ∩ Y = {0}. Proposition 7 Let V be a subspace of Rn and S be a spanning set for V . Then for any x ∈ Rn x⊥S⇒x⊥V Definition A.5.12 Let S ⊂ Rn . The orthogonal complement of S, denoted S ⊥ , is the set of all vectors x ∈ Rn that are orthogonal to S. That is, S ⊥ is the largest subset of Rn orthogonal to S. Theorem A.5.11 S ⊥ is a subspace of Rn . 541 Quantitative Analytics Note that S ⊂ (S ⊥ )⊥ , hence Span(S) ⊂ (S ⊥ )⊥ . Theorem A.5.12 (S ⊥ )⊥ = Span(S). In particular, for any subspace V we have (V ⊥ )⊥ = V . Theorem A.5.13 Let V be a subspace of Rn . Then any vector x ∈ Rn is uniquely represented as x = p + o, where p ∈ V and o ∈ V ⊥ . Note, p is called the ortogonal projection of the vector x onto the subspace V . Theorem A.5.14 ||x − v|| > ||x − p|| for any v 6= p in V . Thus, ||o|| = ||x − p|| = min ||x − v|| v∈V is the distance from the vector x to the subspace V . Theorem A.5.15 ||x||p is a norm on Rn for any p ≥ 1. We let V be an inner product space with an inner product < •, • > and the induced norm || • ||. Definition A.5.13 A nonempty set S ⊂ V of nonzero vectors is called an orthogonal set if all vectors in S are mutually orthogonal. That is, 0 ∈ / S and < x, y >= 0 for any x, y ∈ S, x 6= y. Definition A.5.14 An orthogonal set S ⊂ V is called orthonormal if ||x|| = 1 for any x ∈ S. For example, vectors v1 , v2 , .., vk ∈ V form an orthonormal set if and only if 1 if i = j < vi , vj >= 0 if i 6= j Let V be a vector space with an inner product. Given the set {v1 , v2 , ..., vn } of orthogonal basis for V , an orthonormal set is formed by normalised vectors wi = ||vvii || for i = 1, ..., n. Theorem A.5.16 Suppose v1 , v2 , .., vk are nonzero vectors that form an orthogonal set. Then, v1 , v2 , .., vk are linearly independent. Theorem A.5.17 Let V be an inner product space and V0 be a finite dimensional subspace of V . Then any vector x ∈ V is uniquely represented as x = p + o, where p ∈ V0 and o ⊥ V0 . Note, p is called the orthogonal projection of the vector x onto the subspace V0 . If V0 is a one-dimensional subspace spanned by a vector v, then p = v. A.6 Some facts on matrices We present a few facts on matrices that can be found in books, see for example Strang [1980]. We let A = [aij ]m×n and C = [cij ]p×q be two matrices with dimensions given in the subscript, and let b be a real number. The scalar Pwe n multiplication is defined as bA = [baij ]m×n and the multiplication as AC = [ k=1 aik ckj ]m×q provided that n = p. > > > > We let A> = [a> ij ] be the transpose of A such that aij = aji and (A ) = A. If A = A, then A is a symmetric > > > matrix. Further, (AC) = C A and AC 6= CA in general. A square matrix Am×m is non-singular or invertible if there exists a unique matrix Cm×m such that AC = CA = Im , the m × m identity matrix. The matrix C is called the inverse of A and is denoted by C = A−1 . The trace of Am×m is the sum of the diagonal elements, that is, Pmatrix m tr(A) = i=1 aii . It has the following properties 542 Quantitative Analytics • tr(A + C) = tr(A) + tr(C) • tr(A) = tr(A> ) • tr(AC) = tr(CA) provided that the two matrixes are conformable A number λ and a m × 1 vector e, possibly complex-valued, are a right eigenvalue and eigenvector pair of the matrix A if Ae = λe. There are m possible eigenvalues for the matrix A. For a real-valued matrix A, complex eigenvalues occur in conjugated pairs. The matrix A is non-singular Pm if and only if all of its eigenvalues are nonzero. If we denote theQeigenvalues by {λi }m i=1 , we get tr(A) = i=1 λi , and the determinant of the matrix A can m be defined as |A| = i=1 λi . Further, the rank of the matrix Am×n is the number of non-zero eigenvalues of the symmetric matrix AA> . For a non-singular matrix A, then (A−1 )> = (A> )−1 . A square matrix Am×m is a positive definite matrix if 1. A is symmetric, and 2. all eigenvalues of A are positive Alternatively, A is a positive definite matrix if for any non-zero m-dimensional vector b, we have b> Ab > 0. Some useful properties of a positive definite matrix A include 1. all eigenvalues of A are real and positive 2. the matrix can be decomposed as A = P ΛP > where Λ is a diagonal matrix consisting of all eigenvalues of A, and P is a m × m matrix consisting of the m right eigenfactors of A. We can write the eigenvalues as λ1 ≥ λ2 ≥ ... ≥ λm and the eigenvectors as e1 , ..., em such that Aei = λi ei and > e> i ei = 1. Further, these eigenvectors are orthogonal to each other, that is, ei ej = 0 if i 6= j, if the eigenvalues are distinct. The matrix P is orthogonal, and the decomposition is called the spectral decomposition of the matrix A. For a symmetric matrix A, there exists a lower triangular matrix L with diagonal elements being 1 and a diagonal matrix G such that A = LGL> . If A is positive definite, then the diagonal elements of G are positive. In this case √ √ √ √ A = L G GL> = (L G)(L G)> √ where L G is again a lower triangular matrix and the square root is taking element by element. This decomposition, called the Cholesky decomposition, shows that a positive definite matrix A can be diagonalised as L−1 A(L> )−1 = A(L−1 )> = G Since L is a lower triangular matrix with unit diagonal elements, L−1 is also lower triangular matrix with unit diagonal elements. Writing a m × n matrix A in its columns as A = [a1 , ..., an ] we define the stacking operation as vec(A) = > > (a> 1 , ...., am ) , which is a mn × 1 vector. For two matrices Am×n and Cp×q , the Kronecker product between A and C is 543 Quantitative Analytics A⊗C = a11 C a21 C . . am1 C a12 C a22 C . . am2 C ... a1n C ... a2n C ... . ... . ... amn C For example, asuume A is a 2 × 2 matrix and C is a 2 × 3 matrix 2 1 4 −1 A= , −1 3 −2 5 then vec(A) = (2, −1, 1, 3)> , vec(C) = (4, −2, −1, 5, 3, 2)> , and 8 −2 6 4 −4 10 4 −2 A⊗C = −4 1 −3 12 2 −5 −2 −6 3 2 mp×nq −1 1 5 2 −3 9 15 6 Some useful proprties for the two operators are • A ⊗ C 6= C ⊗ A in general • (A ⊗ C)> = A> ⊗ C > • A ⊗ (C + D) = A ⊗ C + A ⊗ D • (A ⊗ C)(F ⊗ G) = (AF ) ⊗ (CG) • if A and C are invertible, then (A ⊗ C)−1 = A−1 ⊗ C −1 • for square matrixes A and C, tr(A ⊗ C) = tr(A)tr(C) • vec(A + C) = vec(A) + vec(C) • vec(ABC) = (C > ⊗ A)vec(B) • tr(AC) = vec(C > )> vec(A) = vec(A> )> vec(C) When dealing with symmetric matrices, one can generalise the stacking operation to the half-stacking operation, consisting of elements on or below the main diagonal. For a symmetric square matrix A = [aij ]k×k , define > > > vech(A) = (a> 1. , a2∗ , ..., ak∗ ) > where a> 1. is the first column of A, and ai∗ = (aii , ai+1,i , ..., ak,i ) is a (k − i + 1)-dimensional vector. The dimension of vech(A) is k(k+1) . For example, for k = 3 we get vech(A) = (a11 , a21 , a3,1 , a22 , a3,2 , a33 )> . 2 A.7 Utility function A.7.1 Definition In economics and game theory, utility represents satisfaction experienced by the consumer of a good. In economics, utility is a representation of preferences over some set of goods and services. Preferences have a (continuous) utility representation so long as they are transitive, complete, and continuous. In finance, utility is applied to generate an individual’s price for an asset called the indifference price (see Appendix (E.5.4)). Utility functions are also related to 544 Quantitative Analytics risk measures, with the most common example being the entropic risk measure (see Appendix (B.1)). Since desires can not be measured directly, economists inferred relative utility in people’s willingness to pay. Let X be the consumption set, the set of all mutually-exclusive baskets the consumer could conceivably consume. The consumer’s utility function u : X → R ranks each package in the consumption set. If the consumer strictly prefers x to y or is indifferent between them, then u(x) ≥ u(y). There are usually a finite set of L commodities, and a consumer L may consume an arbitrary amount of each commodity. This gives a consumption set of RL + , and each package x ∈ R+ is a vector containing the amounts of each commodity. A utility function u : X → R represents a preference relation on X if and only if for every x, y ∈ X, then u(x) ≤ u(y) implies x y. If u represents , then it implies that is complete and transitive, and hence rational. In order to simplify calculations, various assumptions have been made on utility functions such as constant elasticity of substitution (CES) utility, exponential utility, quasilinear utility, homothetic preferences. Utility functions can be defined either over the positive real line or over the whole real line. One can show that a utility function is only unique up to an increasing affine transformation. As we can rescale utility with an affine transformation, the actual number we see is not an intuitive measurement scale for investments and only the ordering of the utilities is meaningful. We can always translate the expected utility into the certain equivalent of an uncertain investment x as the monetary value CE(x) that has the same utility as the expected utility as the investment. u(CE(x)) = E[u(x)] While both the certain equivalent and the expected utility are single numbers used to rank investments, the certain equivalent has a more intuitive interpretation than the expected utility. Note, in both cases the rankings they produce are preference ordering, and it coincides if the utility function is strictly monotonic increasing. A.7.2 Some properties Assuming more is better, the utility function is usually a strictly monotonic increasing function of wealth (W ), that 0 00 is, the marginal utility is always positive, u (W ) > 0 for all X. Note, u (X) determines the curvature of the utility function, and it can take either sign. We can characterise the risk preference as follow. 00 • if u (W ) > 0, the utility is a convex function of W , with an increasing marginal utility. The investor is risk loving. 00 • if u (W ) < 0, the utility is a concave function of W , with a diminishing marginal utility. The investor is risk averse. 00 • if u (W ) = 0, the utility is a linear function of W . The investor is risk neutral. An investment P may be described by a probability distribution over the utilities associated with all possible outcomes. We let µP and σP be the expectation and standard deviation of the distribution µP = E[u(P )] and σP2 = V ar(u(P )) Using a second order Taylor series expansion of u(P ) around µP , we get 0 1 00 u(P ) ≈ u(µP ) + u (µP )(P − µP ) + u (µP )(P − µP )2 2 Taking the expectation of the above equation and using the property E[u(µP )] = E[u(E[u(P )])] = µP and the property 545 Quantitative Analytics E[P − µP ] = E[P ] − µP = 0 we get the expected utility of an investment approximated as 00 1 E[u(P )] ≈ µP + σP2 u (µP ) 2 (A.7.2) and we can deduce that 00 • if u (µP ) > 0 then CE(P ) > µP and the investor puts a greater certain equivalent on an uncertain investment (gamble) than its expected value. 00 • if u (µP ) < 0 then CE(P ) < µP and the investor puts a lower certain equivalent on an uncertain investment (gamble) than its expected value. 00 • if u (µP ) = 0 then CE(P ) = µP and the investor has a certain equivalent equal to the expected value. As a diminishing marginal utility of wealth implies the investor is risk averse, the degree of risk aversion (the extent of the concavity of the utility function) is measured by the Coefficient of Absolute Risk Aversion (CARA) defined as 00 −u (W ) A(W ) = 0 u (W ) (A.7.3) or by the Coefficient of Relative Risk Aversion (CRRA) 00 −W u (W ) R(W ) = u0 (W ) As an example, the logarithmic utility function u(x) = ln (x) , x > 0 0 has derivatives u (x) = x −1 00 and u (x) = −x −2 and the CARA is A(W ) = W −1 0 so that A (W ) = −W −2 < 0 with an ARA decreasing with wealth, meaning that the absolute value of the investment in risky assets will increase as the investor becomes more wealthy. Similarly, the logarithmic utility function has a constant CRRA given by R(W ) = 1 so that the investor will hold the same proportion of his wealth in risky assets no matter how rich he becomes. In 0 general, investors with increasing ARA (A (W ) > 0) will hold less in risky assets in absolute terms as their wealth 0 increases. On the other hand, investors with increasing RRA (R (W ) > 0) will hold proportionally less in risky assets as their wealth increases. Investors may have increasing, constant, or decreasing absolute or relative risk aversion depending on the functional form assumed for the utility function. 546 Quantitative Analytics A.7.3 Some specific utility functions Following Henderson et al. [2004], we define a utility function u(x) as a twice continuously-differentiable function, strictly increasing to reflect that investors prefer more wealth to less, and strictly concave because investors are riskaverse. Considering the coefficient of absolute risk aversion (CARA) (see Appendix (D.2)), and defined above as 00 (x) Rα (x) = − uu0 (x) , a utility function is of the Hara class if Rα (x) satisfies 1 , x ∈ ID (A.7.4) A + Bx where ID is the interval on which u is defined and B is a non-negative constant. The constant A is such that A > 0 if A A B = 0, whereas A can take any value if B is positive. If B > 0 then u(x) = −∞ for x < − B and ID = (− B , ∞). If B > 0 and B 6= 1, then integration leads to Rα (x) = 1 A C (A + Bx)1− B + D , C > 0, D ∈ R, x > − B−1 B where C and D are constants of integration. This is called the extended power utility function. If A = 0, it becomes the well known narrow power utility function u(x) = 1 u(x) = It is more usually written with R = 1 B, 1 CB − B Bx1− B + D , C > 0, D ∈ R, x > 0 B−1 1 D = 0, C = B B , giving u(x) = x1−R , R 6= 1 1−R The narrow power utility has constant relative risk aversion (RRA) of R, where relative risk aversion Rr (x) is defined to be Rr (x) = xRα (x). Setting B = 1 to a utility functions in the Hara class, we get u(x) = C ln (A + x) + E , C > 0, E ∈ R, x > −A called the logarithmic utility function. Taking A = 0, E = 0, C = 1 gives the standard or narrow form. Investors with constant CRRA want the same percentage of their wealth in risky assets as their wealth increases. However, in general investment decisions will affect the wealth of the decision maker only marginally. In that case, many decision makers will adopt a constant CARA utility, where the absolute amount invested in risky assets is independent of their wealth. There are only two types of utility functions with the CARA property, the linear utility function u(x) = A + Bx , B > 0 which has CARA equal to 0, and the exponential utility function. In our setting, for B = 0, we get the exponential utility function u(x) = − F −x e A + G , F > 0, A > 0, G ∈ R, x ∈ R A It is usual to take G = 0, A = γ1 , F = γ12 so that the coefficient of absolute risk aversion (CARA) becomes Rα (x) = γ, a constant. The exponential utility is an appropriate choice for an investor who wants to hold the same dollar amount in risky assets as his wealth increases. As a result, the percentage of his wealth invested in risk assets will decrease as his wealth increases, and he will have decreasing RRA but constant ARA. Note, the CARA is not very intuitive as it is measured in $−1 units if the initial wealth is measured in $. It is easier to express the exponential utility in terms of the Coefficient of Absolute Risk Tolerance (CART) measured in the same units as wealth. In addition, risk 547 Quantitative Analytics tolerance has an intuitive meaning not shared by risk aversion. In that case, the implicit assumption is that the initial wealth is 1 unit. Among the utility functions that do not fit into the Hara class, is the quadratic utility function. If the percentage of wealth invested in risky assets increases with wealth, the investor can consider the quadratic utility function. Taking B = −1, A > 0 in Equation (A.7.4) we get u(x) = x − 1 2 x ,x∈R 2A (A.7.5) which only has increasing marginal utility when 0 u (x) = 1 − 1 x > 0 that is x < A A so that the domain for a quadratic utility is restricted. Writing a = R(W ) = 1 2A , the CRRA becomes 2aW 1 − 2aW and we get 0 R (W ) = 2a >0 (1 − 2aW )2 so that the quadratic utility function has increasing relative aversion, which implies the ARA must also be increasing. Therefore, a risk averse investor with a quadratic utility will increase the percentage of his wealth invested in risky assets as his wealth increases. Remark A.7.1 The quadratic utility function corresponds to the third strictly concave function in Appendix (A.1.2) 1 with b = 1 and a = 2A . This function decreases over part of the range, violating the assumption that investors desire more wealth (and so have an increasing utility function), but has excellent tractability properties. A.7.4 Mean-variance criterion A.7.4.1 Normal returns We assume that an investor has an exponential utility function with a CARA γ given by u(W ) = −e−γW , γ > 0 and we further assume that the returns on a portfolio are normally distributed with expectation µ and standard deviation σ. Hence, the certain equialent of the portfolio can be approximated as 1 CE ≈ µ − γσ 2 2 The expected portfolio return is µ = w> E[r] where w is the vector of portfolio weights and r is the vector of returns on the constituent assets, and the portfolio variance is σ 2 = w> Qw 548 Quantitative Analytics where Q is the covariance matrix of the asset returns. Since the best investment is the one giving the maximum certain equivalent, then for an investor with an exponential utility function investing in risky assets with normally distributed returns, the optimal allocation problem may be approximated by the simple optimisation 1 1 max µ − γσ 2 = max w> E[r] − γw> Qw w w 2 2 which is the mean-variance criterion. Note, when the utility is defined on the returns on the investment, we must multiply the utility function by the amount invested to find the utility of each investment. Similarly, to find the certain equivalent of a risky investment we multiply by the amount invested. However, we need to express the CRA γ as a proportion of the amount invested. A.7.4.2 Non-normal returns Assuming that investors borrow at zero interest rate, we consider the utility associated with an investment as being defined on the distribution of investment returns rather than on the distribution of the wealth arising from the investment. We further assume that the returns are non-normally distributed. Applying the expectation operator to a Taylor expansion of u(R) about u(µ), the utility associated with the mean return, we get 0 1 000 1 00 E[u(R)] = u(µ) + u (R)|R=µ E[R − µ] + u (R)|R=µ E[(R − µ)2 ] + u (R)|R=µ E[(R − µ)3 ] + ... 2 6 which is a simple approximation to the certain equivalent associated with any utility function since E[u(R)] = E[u(X)] = u(CE(X)). If we assume that the investor has an exponential utility function, then, the above equation to the fourth order becomes 1 1 1 e−γCE ≈ e−γµ 1 + γ 2 E[(R − µ)2 ] − γ 3 E[(R − µ)3 ] + γ 4 E[(R − µ)4 ] 2 6 24 Given the first four moments are σ 2 = E[(R − µ)2 ] , S = E[(R − µ)3 ] , K = E[(R − µ)4 ] where S is the skew and K is the kurtosis, we get the approximation S K −3 1 (γσ)4 e−γCE ≈ e−γµ 1 + (γσ)2 − (γσ)3 + 2 6 24 where K − 3 is the excess kurtosis (see Section (3.3.4.2)). Taking the logarithm and using the second order Taylor expansion, the approximated certain equivalent associated with the exponential utility function simplifies to 1 S K −3 3 4 CE ≈ µ − γσ 2 + γ 2 σ 3 − γ σ 2 6 24 The mean-variance criterion is a special case of the above equation with no skewnes and no kurtosis. In general, a risk averse investor having an exponential utility has aversion to risk associated with increasing variance, negative skewness, and increasing kurtosis. A.8 Optimisation Definition A.8.1 We call numerical function of n real variables an application f of a set E of Rn in R. The image of a point M , of coordinates x1 , x2 , .., xn is a real number, called f (M ) or f (x1 , x2 , .., xn ). 549 Quantitative Analytics We call open ball of Rn , of center A = (a1 , a2 , .., an ), (A ∈ Rn ), and of radius r, (r ∈ R∗+ ), the set Br (A) = {M |M ∈ Rn and ||M − A|| < r} p where ||M − A|| = (x1 − a1 )2 + ... + (xn − an )2 is the norm of M − A, also called the distance between M and A. We call neighbourhood of a point A all set V (A) containing an open ball of centre A. Br (A) is a neighbourhood of each of his points, and in particular A. We let f be a function of n real variables defined on the open set Ω of Rn . One say that f has a local extremum at the point M0 of Ω if there exists a neighbourhood V (M0 ) of M0 such that for all M ∈ V (M0 )∩Ω, then f (M )−f (M0 ) keep a constant sign. If f (M ) − f (M0 ) ≥ 0 (respectivly ≤ 0), it is a local minimum (respectivly maximum). If f (M ) − f (M0 ) keeps a constant sign for all M ∈ Ω, it is an absolute (or global) extremum. Theorem A.8.1 If f is continuously partially differentiable on Ω, for f to have an extremum at the point M0 of Ω, it is necessary, but not sufficient that all the partial derivatives cancel on that point 0 ∀i ∈ {1, 2, .., n} , fxi (M0 ) = 0 A point M0 where all the partial derivatives cancel is called a stationary point. For example, we consider a function f with n = 2 being continuously partially differentiable in the neibourhood of a stationary point M0 . From Taylor expansion, f (x0 + h, y0 + k) − f (x0 , y0 ) will be of the sign of 00 00 00 h2 fx2 (x0 , y0 ) + 2hkfxy (x0 , y0 ) + k 2 fy2 (x0 , y0 ) when h and k will be in the neighborhoud of 0. Using Monge notation 00 00 00 r0 = fx2 (x0 , y0 ) , s0 = fxy (x0 , y0 ) , t0 = fy2 (x0 , y0 ) we get the sufficient second order conditions 1. if r0 t0 − s20 > 0, there is an extremum in M0 which is a minimum if r0 > 0 (or t0 > 0), a maximum if r0 < 0 (or t0 < 0). 2. if r0 t0 − s20 < 0, there is no extremum in M0 , and one says that M0 is a col point. 3. if r0 t0 − s20 = 0, one can not conclude. One need to write the Taylor expension at a higher order, or directly study the sign of f (x0 + h, y0 + k) − f (x0 , y0 ) when h and k vary in the neighbourhood of 0. Assuming a function f with n variables being continuously partially differentiable on the open set Ω of mathbbRn , we now want to obtain the extremums of f , where the variables x1 , x2 , .., xn are linked by the constraint g(x1 , x2 , .., xn ) = 0 such that g is also continuously partially differentiable on Ω. We distinguish two special cases 1. if the constraint g allows for one variable to be expressed in terms of the other (n − 1) variables, we recover the problem of obtaining the extremum of a function f with (n − 1) variables. 2. if the constraint g can be parametrised, that is, we can express x1 , x2 , .., xn in terms of the same real parameter t, we recover the problem of obtaining the extremum of a function f with a single variable F (t) = f x1 (t), x2 (t), .., xn (t) 550 Quantitative Analytics In the general case, the previous problem is equivalent to that of finding the extremums of the function L, called the lagrangian L(x1 , x2 , .., xn , λ) = f (x1 , x2 , .., xn ) + λg(x1 , x2 , .., xn ) , λ ∈ R where λ is the Lagrange multiplicator. The necessary conditions of the first order will allow us to determine the stationary points M̂ (x̂1 , x̂2 , .., x̂n ) which will be the only points where there can be an extremum. In order to get the nature of these points we need to study the sign of f (x̂1 + h1 , x̂2 + h2 , .., x̂n + hn ) − f (x̂1 , x̂2 , .., x̂n ) where the variables (h1 , .., hn ) varies in the neighbourhood of 0, and are linked by the constraint g(x̂1 + h1 , x̂2 + h2 , .., x̂n + hn ) = 0 Note, if we use the Taylor expension to study the sign of the previous difference, then the terms of the first order in (h1 , .., hn ) will not be null, and the variables (h1 , .., hn ) are not independent. In the previous example of the function f with n = 2 we get the determinant 00 0 00 Lx2 Lxy gx 00 0 00 ∆3 = Lxy Ly2 gy 0 0 0 gy gx If M0 is a stationary point, then 1. ∆3 < 0, M0 is a minimum 2. ∆3 > 0, M0 is a maximum In the general case, if there are p, (p ≥ 2) constraints gj (x1 , x2 , .., xn ) = 0, j = 1, .., p, we introduce p Lagrange multiplicators λ1 , .., λp and we find the extremums of the Lagrangian L(x1 , x2 , .., xn , λ1 , λ2 , .., λp ) = f (x1 , x2 , .., xn ) + p X λj gj (x1 , x2 , .., xn ) j=1 A.9 Conjugate gradient method Given a single function f depending on one or more independent variables, we want to find the value of those variables where f takes on a maximum or a minimum. One approach consits in finding local extrema starting from a widely varying starting values of the independent variables, and then picking the most extreme of these. Another approach consists in perturbating a local extremum by taking a finite amplitute step away from it, and then see if the routine returns a better point, or always the same one. We are going to describe the conjugate gradient method which belongs to the latter (see Press et al. [1992]). Given a point P of dimension N as the origin of the coordinate system with coordinates X, then any function f can be approximated by its Taylor series f (X) X ∂f 1 X ∂2f xi + xi xj + ... ∂xi 2 i,j ∂xi ∂xj i = f (P ) + ≈ 1 c − b.X + X.A.X 2 where 551 Quantitative Analytics c = f (P ) , b = −∇f |P , [A]ij = ∂2f ∂xi ∂xj P The matrix A, whose components are the second partial derivative matrix of the function, is called the Hessian matrix of the function at point P . In the above approximation, the gradient of f is easily calculated as ∇f = A.X − b implying that the function is at an extremum at a value of X obtained by solving A.x = b The change of the gradient as we move along some direction is given by δ(∇f ) = A.(δX) If we have moved along some direction u to a minimum and want to move along a new direction v without spoiling the minimisation along u, then the change in the gradient must stay perpendicular to u, that is, 0 = u.δ(∇f ) = u.A.v In that case, the vectors u and v are said to be conjugate. Doing successive line minimisations of a function along a conjugate set of directions, then we do not need to redo any of those directions. Further, the number of unknown parameters in f is equal to the number of free parameters in A and B, that is, 21 N (N + 1), which is of order N 2 . Changing any one of these parameters can move the location of the minimum. A simple algorithm can be described as follow • start at point P0 • move from point Pi to the point Pi+1 by minimising along the line from Pi in the direction of the local downhill gradient −∇f (Pi ) • repeat until convergence This methods will perform many small steps in going down a long, narrow valley, even if the valley is a perfect quadratic form. Since the new gradient at the minimum point of any line minimisation is perpendicular to the direction just traversed, then with the steepest descent method we must make a right angle turn, which does not lead to the minimum. Hence, we want to follow a direction that is constructed to be conjugate to the old gradient, and if possible to all previous directions traversed. This method is called the conjugate gradient methods (CGM). We now introduce the Fletcher-reeves version of the CGM. Starting with an arbitrary initial vector g0 and letting h0 = g0 , the CGM constructs two sequences of vectors from the recurrence gi+1 = gi − λi A.hi , hi+1 = gi+1 + γi hi , i = 0, 1, ... and the vectors satisfy the orthogonality and conjugacy conditions gi .gj = 0 , hi .A.hj = 0 , gi .hj = 0 , j < i The scalars λi and γi are given by λi = γi = gi .gi hi .A.hi gi+1 .gi+1 gi .gi 552 Quantitative Analytics If we knew the Hessian matrix A we could find conjugate directions hi along which to line-minimise, and after N computations, arrive at the minimum of the quadratic form. But in practice we do not know the matrix A. A way around is to compute gi = −∇f (Pi ) for some point Pi . Then proceed from Pi along the direction hi to the local minimum of f located at some point Pi+1 , and then set gi+1 = −∇f (Pi+1 ). Then this gi+1 is the same vector as would have been constructed from the above equation if the matrix A was known. Hence, a sequence of directions hi is constructed by using line minimisations, evaluations of the gradient vector, and an auxiliary vector to store the latest in sequence of g’s. Polack and Ribiere introduced a significant change by modifying γi as follow γi = (gi+1 − gi ).gi+1 gi .gi 553 Appendix B Some probabilities For details see text books by Grimmett et al. [1992], Oksendal [1998] and Jacod et al. [2004]. B.1 Some definitions Definition B.1.1 The set of all possible outcomes of an experiment is called the sample space and is denoted Ω. Definition B.1.2 An event is a property which can be observed either to hold or not to hold after the experiment is done. In mathematical terms, an event is a subset of Ω. We think of the collection of events as a subcollection F of the set of all subsets of Ω such that 1. if A, B ∈ F then A ∪ B ∈ F and A ∩ B ∈ F 2. if A ∈ F then Ac ∈ F 3. the empty set belongs to F Any collection F of subsets of Ω which satisfies these three conditions is called a field. It follows from the properties of a field F that if A1 , A2 , .., An ∈ F then n [ Ai ∈ F i=1 so that F is closed under finite unions and hence under finite intersections also. Definition B.1.3 A collection F of subsets of Ω is called a σ-field if it satisfies the following conditions belongs to F S∞ 2. if A1 , A2 , ... ∈ F then i=1 Ai ∈ F 1. the empty set 3. if A ∈ F then Ac ∈ F We consider a set E in Rd and let the measure µ on E associate to some measurable subsets A ⊂ E be a positive number µ(A) ∈ [0, ∞] called the measure of A. The domain of definition of a measure on E is a collection of subsets of E called a σ -algebra which contains the empty set, P is stable under unions and contains the complementary of every element. We define the counting measure µX = i δxi on a countable set of points X = {xi , i = 0, 1, ...} ⊂ E 554 Quantitative Analytics where δx (A) = 1 if x ∈ A and δx (A) = 0 if x 6= A is a Dirac measure such that for any A ⊂ E, µX (A) counts the number of points xi in A X µ(A) = #{i , xi ∈ A} = Ixi ∈A i≥1 It is an integer valued measure. A finite measure with mass 1 is called a probability measure. Definition B.1.4 Let E ⊂ Rd . A Radon measure on (E, B) is a measure µ such that for every compact measurable set B ∈ B, µ(B) < ∞. A measure µ0 which gives zero mass to any point is said to be diffusive or atomless, that is ∀x ∈ E, µ0 ({x}) = 0. Any Radon measure can be decomposed into a diffusive part and a sum of Dirac measures Proposition 8 Any Radon measure µ can be decomposed into a diffusive part µ0 and a linear combination of Dirac measures X µ = µ0 + bj δxj xj ∈ E, bj > 0 j≥1 We can now look at measurable functions Definition B.1.5 We consider two measurable spaces (E, E) and (F, F), then a function f : E → F is called measurable if for any measurable set A ∈ F, the set f −1 (A) = {x ∈ E, f (x) ∈ A} is a measurable subset of E. If the measure µ can be decomposed as in Proposition (8) then the integral of µ with respect to f denoted by µ(f ) is Z X µ(f ) = f (x)µ0 (dx) + bj f (xj ) j≥1 We let Ω be the set of scenarios equipped with a σ-algebra F and consider a probability measure on (Ω, F) which is a positive finite measure P with total mass 1. Therefore, (Ω, F, P) is called a probability space and any measurable set A ∈ F called an event is a set of scenarios to which a probability can be assigned. The probability measure assigns value in [0, 1] to each event such that P: F A → [0, 1] → P(A) An event A with probability P(A) = 1 is said to occur almost surely and if P(A) = 0 the event is impossible. We will say that a property holds P-almost surely if the set of ω ∈ Ω for which the property does not hold is a null set (subset of an impossible event). Two probability measures P and Q on (Ω, F) are equivalent if they define the same impossible events P ∼ Q ⇐⇒ [∀A ∈ F, P(A) = 0 ⇐⇒ Q(A) = 0] A random variable X taking values in E is a measurable map X : Ω → E where (Ω, F, P) is a probability space. X(ω) represents the outcome of the random variable if the scenario ω happens and is called the realisation of X in the scenario ω. The law of X is the probability measure on E defined by µX (A) = P(X ∈ A). 555 Quantitative Analytics B.2 Random variables Definition B.2.1 A random variable is a function X : Ω → R with the property that {ω ∈ Ω : X(ω) ≤ x} ∈ F for each x ∈ R. Definition B.2.2 The distribution function of a random variable X is the function F : R → [0, 1] given by F (x) = P (X ≤ x) B.2.1 Discrete random variables Definition B.2.3 The random variable X is called discrete if it takes values in some countable subset {x1 , x1 , ..}, only, of R. Its distribution function F (x) = P (X ≤ x) is a jump function. Definition B.2.4 The probability mass function of a discrete random variable X is the function f : R → [0, 1] given by f (x) = P (X = x). The distribution and mass functions are related by F (x) = X f (xi ) i:xi ≤x Lemma B.2.1 The probability mass function f : R → [0, 1] satisfies 1. f (x) 6= 0 if and only if x belongs to some countable set {x1 , x2 , ..} P 2. i f (xi ) = 1 Let x1 , x2 , .., xN be the numerical outcomes of N repetitions of some experiment. The average of these outcomes is m= 1 X xi N i In advance of performing these experiments we can represent their outcomes by a sequence X1 , X2 , .., XN of random variables, and assume that these variables are discrete with a common mass function f . Then, roughly speaking, for each possible value x, about N f (x) of the Xi will take that value x. So, the average m is about m≈ X 1 X xN f (x) = xf (x) N x x where the summation is over all possible values of the Xi . This average is the expectation or mean value of the underlying distribution with mass function f . Definition B.2.5 The mean value or expectation of X with mass function f is defined to be X E[X] = xf (x) x:f (x)>0 whenever this sum is absolutely convergent. 556 Quantitative Analytics Definition B.2.6 If k is a positive integer, then the kth moment mk of X is mk = E[X k ] The kth central moment σk is σk = E[(X − m1 )k ] The two moments of most use are m1 = E[X] and σ2 = E[(X − E(X))2 ] called the mean and variance of X. B.2.2 Continuous random variables Definition B.2.7 The random variable X is called continuous if its distribution function can be expressed as Z x F (x) = f (u)du , x ∈ R −∞ for some integrable function f : R → [0, ∞). P The expectation of a discrete variable X is E[X] = x xP (X = x) which is an average of the possible values of X, each value being weighted by its probability. For continuous variables, expectations are defined as integrals. Definition B.2.8 The expectation of a continuous random variable X with density function f is Z ∞ E[X] = xf (x)dx −∞ whenever this integral exists. R R We shall allow the existence of g(x)dx only if |g(x)|dx < ∞. Note, the definition of the kth moment mk in Appendix (B.2.1) applies to continuous random variables, but the moments of X may not exist since the integral Z k E[X ] = xk f (x)dx may not converge. B.3 Introducing stochastic processes A martingale process is defined on the basis of semi-martingales. Definition B.3.1 A random process (Xt )t>0 is called a submartingale if E[|Xt |] < ∞ and E[Xt |Fs ] ≥ Xs , s < t a supermartingale if, instead E[Xt |Fs ] ≤ Xs , s < t and it is a martingale if the process is both a submartingale and a supermartingale. 557 Quantitative Analytics We now provide the definitions of a Markov process and that of an independent process. Definition B.3.2 A random process (Xt )t>0 is called a a Markov process if, for each n and every i0 , .., in , then P (Xn+1 = j|X0 = i0 , ..., Xn = in ) = P (Xn+1 = j|Xn = in ) where P (•|•) denotes conditional probability. Definition B.3.3 We let {Xt ; t = 1, 2, ...} be a sequence of random variables on a given probability space (Ω, F, P) with E[Xt = 0] and {Ft ; t = 1, 2, ...} a current of σ-algebras on the measurable space (Ω, F), where Ω is the complete universe of all possible events. Then {Xt } is a sequence of independent random variables with respect to {Ft } if Xt is measurable with respect to Ft and is independent of Ft−1 for all t = 1, 2, ... We can now define a random walk (RW) process and geometric Brownian motion (GBM). Definition B.3.4 A random walk is a Markov process with independent innovations Xt − Xt−1 = t where t ≈ IID, standing for independent and identically distributed process. Definition B.3.5 A geometric Brownian motion is a random walk of natural logarithm of the original process Xt , where Lt = ln (Xt ), so that ∆Lt = Lt − Lt−1 = t where t ≈ IID. Note, martingale is more general than random walk since semi-martingales allow for dependence in the process. Thus, random walk implies martingale but martingale does not imply random walk in the process. B.4 The characteristic function and moments B.4.1 Definitions We start by recalling some definitions together with the properties of the characteristic functions. The characteristic function of a random variable is the Fourier transform of its distribution Definition B.4.1 The characteristic function of a Rd random variable X is the function ΦX : Rd → C defined by Z ΦX (z) = E[eiz.X ] = eiz.x dµX (x) for z ∈ Rd Rd where µX is the measure of X. The characteristic function of a random variable completely characterises its law. Smoothness properties of ΦX depend on the existence of moments of the random variable X which is related on how fast the distribution µX decays at infinity. If it exists, the n-th moment mn of a random variable X on R is mn = E[X n ] The first moment of X called the mean or expectation measures the central location of the distribution. Denoting the mean of X by µX , the nth central moment of X, if it exists, is defined as 558 Quantitative Analytics mcn = E[(X − µX )n ] 2 The second central moment σX called the variance of X measures the variability of X. The third central moment measures the symmetry of X with respect to its mean, and the fourth central moment measures the tail behaviour of X. In statistics, skewness and kurtosis, respectively the normalised third and fourth central moments of X are used to summarise the extent of asymmetry and tail thickness. The are defined as S= mc3 (mc2 ) 3 2 = E[ (X − µX )4 (X − µX )3 mc4 = E[ ] , K = ] 3 4 σX (mc2 )2 σX Since K = 3 for a normal distribution, the quantity K − 3 is called the excess kurtosis. The moments of a random variable are related to the derivatives at 0 of its characteristic function. Proposition 9 If E[|X|n ] < ∞ then ΦX has n continuous derivatives at z = 0 and mk = E[X k ] = 1 ∂ k ΦX (0) ik ∂z k Proposition 10 X possesses finite moments of all orders iff z → ΦX (z) is C ∞ at z = 0. Then the moments of X are related to the derivatives of ΦX by 1 ∂ n ΦX mn = E[X n ] = n (0) i ∂z n If Xi with i = 1, .., n are independent random variables, the characteristic function of Sn = X1 + ... + Xn is the product of characteristic functions of individual variables Xi ΦSn (z) = n Y ΦXi (z) (B.4.1) i=1 We see that ΦX (0) = 1 and that the characteristic function ΦX is continuous at z = 0 and ΦX (z) 6= 0 in the neighborhood of z = 0. It leads to the definition of the cumulant generating function or log characteristic function of X. Definition B.4.2 There exists a unique continuous function ΨX called the cumulant generating function defined around zero such that ΨX (0) = 0 and ΦX (z) = eΨX (z) B.4.2 The first two moments We consider the probability space (Ω, F, P) and let X and Y be two discrete random variables. Given the definition of the kth moment mk and the kth central moment σk in Appendix (B.2.1) we get = E[XY ] − E[X]E[Y ] = E (X − E[X])(Y − E[Y ]) X E[XY ] = xyfXY (x, y) Cov(X, Y ) x,y V ar(X) = Cov(X, X) = E[X 2 ] − (E[X])2 = E (X − E[X])2 ρ(X, Y ) = Cov(X, Y ) 1 V ar(X)V ar(Y ) 2 For ρ(X, Y ) = 0 we must have Cov(X, Y ) = 0 which leads to 559 Quantitative Analytics E[XY ] = E[X]E[Y ] Moreover, if X and Y are independent, we get V ar(X + Y ) = V ar(X) + V ar(Y ) Otherwise, if they are correlated, that is ρ(X, Y ) 6= 0 we set Z = X + Y and plug it back into the variance equation V ar(Z) = = E[Z 2 ] − (E[Z])2 = E[(X + Y )2 ] − (E[X + Y ])2 2 E[X 2 + Y 2 + 2XY ] − E[X] + E[Y ] E[X 2 ] + E[Y 2 ] + E[2XY ] − (E[X])2 − (E[Y ])2 − 2E[X]E[Y ] = E[X 2 ] − (E[X])2 + E[Y 2 ] − (E[Y ])2 + 2 E[XY ] − E[X]E[Y ] = = V ar(X) + V ar(Y ) + 2Cov(X, Y ) B.4.3 Trading correlation We are going to briefly explain the difference between the correlation obtained from the dispersion trades and the correlation obtained from the correlation swap. We consider a basket made of n-underlying Xi for i = 1, .., n with volatility given by σi . In the dispersion trades, the correlation comes from the composition of the basket, that is V ar(Indice) = = n X i=1 n X wi2 V ar(Xi ) + 2 XX j wi2 σi2 + 2 XX i=1 j wi wj Cov(Xi , Xj ) i 0 then the conditional probability that A occurs given that B occurs is P (A/B) = P (A ∩ B) P (B) A family B1 , B2 , ..., Bn of events is called a partition of Ω if Bi ∩ Bj = when i 6= j and n [ Bi = Ω i=1 Lemma B.5.1 (Partition Equation) For any events A and B P (A) = P (A|B)P (B) + P (A|B c )P (B c ) More generally, let B1 , B2 , ..., Bn be a (finite or countable) partition of Ω. Then P (A) = n X P (A|Bi )P (Bi ) i=1 This may be set in the more general context of the conditional distribution of one variable Y given the value of another variable X (Discrete Case). Let X and Y be two random variables with Y taking values in R and with X taking only countably many values. Remark B.5.1 Suppose we know that the event {X = j} for some value j has occurred. The expectation of Y may change given this knowledge. Indeed, if Q(Λ) = P (Λ|X = j), it makes more sense to calculate E Q [Y ] than it does to calculate E P [Y ]. Definition B.5.2 Let X have values in (x1 , x2 , ..., xn , ..) and Y be a random variable. Then if P (X = xj ) > 0 the conditional expectation of Y given {X = xj } is defined to be E[Y |X = xj ] = E Q [Y ] where Q is the probability given by Q(Λ) = P (Λ|X = j), provided E Q [|Y |] < ∞. Theorem B.5.1 In the previous setting, and if further Y is countably valued with values (y1 , y2 , ..., yn , ..) and if P (X = xj ) > 0, then E[Y |X = xj ] = ∞ X yk P (Y = yk |X = xj ) k=1 provided the series is absolutely convergent. 561 Quantitative Analytics Proof: E[Y |X = xj ] = E Q [Y ] = ∞ X yk Q(Y = yk ) = k=1 Recall, P (Y = yk |X = xj ) = ∞ X yk P (Y = yk |X = xj ) k=1 P (Y =yk ,X=xj ) . P (X=xj ) Definition B.5.3 The conditional distribution function of Y given X = x, written FY |X (.|x) is defined by FY |X (y|x) = P (Y ≤ y|X = x) for any x such that P (X = x) > 0. The conditional mass function of Y given X = x, written fY |X (.|x) is defined by fY |X (y|x) = P (Y = y|X = x) Next, still with X having at most a countable number of values, we wish to define the conditional expectation of any real valued r.v. Y given knowledge of the random variable X, rather than given only the event {X = xj }. To this end we consider the function E[Y |X = x] if P (X = x) > 0 f (x) = any arbitrary value if P (X = x) = 0 Definition B.5.4 Let X be countably valued and let Y be a real valued random variable. The conditional expectation of Y given X is defined to be E[Y |X] = f (X) where f is given above and provided that it is well defined. Definition B.5.5 Let ψ(x) = E[Y |X = x]. Then ψ(x) is called the conditional expectation of Y given X, written E[Y |X]. Remark B.5.2 Note, a conditional expectation is actually a random variable. Theorem B.5.2 The conditional expectation ψ(X) = E[Y |X] satisfies E[ψ(X)] = E[Y ] Using this theorem, we can compute the marginal mean E[Y ] as X E[Y ] = E[Y |X = x]P (X = x) (B.5.2) x Thus, the marginal mean is the weighted average of the conditional means, with weights equal to the probability of being in the subgroup determined by the corresponding value of the conditioning variable. We can express the variance of the random variable Y in terms of conditional variance as V ar(Y ) = E[V ar(Y |X)] + V ar(E[Y |X]) In the continuous case, we can compute E[Y ] as Z ∞ E[Y |X = x]fX (x)dx E[Y ] = −∞ Theorem B.5.3 Let X and Y be random variables, and suppose that E[Y 2 ] < ∞. The best predictor of Y given X is the conditional expectation E[Y |X]. 562 Quantitative Analytics B.5.2 Conditional variance Consider E[Y |X] as a new random variable U as follows: Randomly pick an x from the distribution X so that the new r.v. U has the value E[Y |X = x]. For example, Y = height and X = sex. Randomly pick a person from the population in question E[Y |X = f emale] if the person is female U= E[Y |X = male] if the person is male If U is a discrete r.v. the expected value of this new random variable is X E[U ] = P (u)u u and we get E[E[Y |X]] = weighted average of conditional means = E[Y ] The definition of the (population) (marginal) variance of a random variable Y is V ar(Y ) = E[(Y − E[Y ])2 ] Letting Y = E[Y ] and expending the above term, we can rewrite the variance as V ar(Y ) = E[Y 2 + (Y )2 − 2Y Y ] = E[Y 2 ] + (Y )2 − 2Y E[Y ] = E[Y 2 ] − (Y )2 Similarly, if we are considering a conditional distribution Y |X, we define the conditional variance V ar(Y |X) = E (Y − E[Y |X])2 |X Alternatively, we can write the conditional variance as V ar(Y |X) = E[Y 2 |X] − (E[Y |X])2 (B.5.3) Proof: Letting ψ(X) = E[Y |X] we can rewrite the conditional variance as V ar(Y |X) = E[Y 2 |X] + (ψ(X))2 − 2ψ(X)E[Y |X] = E[Y 2 |X] − (ψ(X))2 As with E[Y |X], we can consider V ar(Y |X) as a random variable. Hence, we can compute the expected value of the conditional variance as E[V ar(Y |X)] = E[E[Y 2 |X]] − E[(E[Y |X])2 ] Since the expected value of the conditional expectation of a random variable is the expected value of the original random variable the above equation simplifies to E[V ar(Y |X)] = E[Y 2 ] − E[(E[Y |X])2 ] (B.5.4) We can also compute the variance of the conditional expectation as V ar(E[Y |X]) = E[(E[Y |X])2 ] − (E[E[Y |X]])2 and since E[E[Y |X]] = E[Y ] it simplifies to V ar(E[Y |X]) = E[(E[Y |X])2 ] − (E[Y ])2 563 (B.5.5) Quantitative Analytics Combining Equation (B.5.4) with Equation (B.5.5) we get E[V ar(Y |X)] + V ar(E[Y |X]) = E[Y 2 ] − (E[Y ])2 which is the marginal variance V ar(Y ). That is, the marginal variance is V ar(Y ) = E[V ar(Y |X)] + V ar(E[Y |X]) (B.5.6) The marginal (overall) variance is the sum of the expected value of the conditional variance and the variance of the conditional means. Since variances are always non-negative, we get V ar(Y ) ≥ E[V ar(Y |X)] Further, since V ar(Y |X) ≥ 0 and E[V ar(Y |X)] must also be positive then V ar(Y ) ≥ V ar(E[Y |X]) Note, E[V ar(Y |X)] is a weighted average of V ar(Y |X). We can also write the variance of the conditional expectation as V ar(E[Y |X]) = E (E[Y |X] − E[Y ])2 which is a weighted average of (E[Y |X] − E[Y ])2 . B.5.3 More details on conditional expectation B.5.3.1 Some discrete results We consider the probability space (Ω, F, P) and let X be a discrete random variable taking values in the countable set {x1 , x2 , ..}. Its distribution function F (x) = P (X ≤ x) is a jump function with pdf f (x) = P (X = x). We have X F (x) = f (xi ) xi ≤x The expected value of X is X E[X] = xf (x) x:f (x)>0 A discrete random variable Xn can be defined as Xn (ω) = n X xi IAi (ω) i=1 where Ai is a partition of Ω. The conditional expectation of Xn given event B with P(B) > 0 is Z E[Xn |B] = Xn (ω)dP(ω|B) = Ω = 1 P(B) n X i=1 xi P(Ai ∩ B) P(B) Z Xn (ω)IB (ω)dP(ω) = Ω E[Xn IB ] P(B) Letting n goes to infinity, that is partitioning finer and finer we get the continuous case 564 Quantitative Analytics E[X|B] = lim E[Xn |B] = n→∞ E[XIB ] P(B) The Cauchy-Schwarz inequality states that for any X and Y we have E[(XY )]2 ≤ E[X 2 ]E[Y 2 ] (B.5.7) with equality if and only if P (aX = bY ) = 1. We let ψ(x) = E[Y |X = x] and call ψ(X) = E[Y |X] the conditional expectation of Y given X. It satisfies E[ψ(X)] = E[Y ] As a result, another way of computing E[Y ] is E[Y ] = X E[Y |X = x]P (X = x) (B.5.8) x B.5.3.2 Some continuous results Generally, if B is a sufficiently nice subset of R then, for the variable X we get Z P (X ∈ B) = fX (x)dx B where fX (x) is the probability density function of X. We can then think of the pdf fX (x)dx as the element of the probability P (X ∈ dx) since P (X ∈ dx) ≈ fX (x)dx A random variable X is continuous if its distribution function F (x) = P (X ≤ x) is Z x F (x) = fX (u)du −∞ where fX (.) is the probability density function of X. If X and g(X) are continuous random variables, then Z ∞ E[g(X)] = g(x)fX (x)dx −∞ Therefore, if we let h(x) = g(x)fX (x) we can use the properties of the Dirac function in Appendix (A.4) to get Z E[g(X)δx (X)] ∞ = h(y)δx (y)dy = h(x) = g(x)fX (x) −∞ = g(x)P (X = x) In the special case where g(X) = 1 we get E[δx (X)] = P (X = x). We can relate it to the definition of the conditional expectation in Equation (B.5.1) when G(XT ) = XT − x Z ∞ E[F (XT )δ0 (XT − x)] = F (y)δ0 (y − x)fX (y)dy = F (x)fX (x) −∞ and the conditional expectation becomes E[F (XT )|(XT − x) = 0] = F (x)P (XT = x) = F (x) P (XT = x) 565 Quantitative Analytics B.6 About fractal analysis B.6.1 The fractional Brownian motion We define the line-to-line Brownian function B(t) as a random function such that for all t and ∆t P [B(t + ∆t) − B(t)] < x = erf (x) H |∆t| where x is a real number, erf (.) is the error function, and H = 12 . The function B(t) is continuous but it is not differentiable. Each assumption can be generalised and every process obtained is significantly different from B(t). The variation of the Brown line-to-line function B(t) between t = 0 and t = 2π decomposes into 1. the trend defined by B ∗ (t) = B(0) + t [B(2π) − B(0)] 2π 2. and an oscillatory remainder BB (t). To define the fractional Brown line-to-line function BH (t) we consider B(t) and change the exponent from H = 21 to any real number satisfying 0 < H < 1. Cases where H 6= 12 are properly fractional. All the BH (t) are continuous and nondifferentiable. Clearly < [BH (t + ∆t) − BH (t)]2 >= |∆t|2H and the spectral density of BH (t) is f −2H−1 . The discrete fractional Gaussian noise is the sequence of increments of BH (t) over successive unit time spans. Its correlation is 2−1 |d + 1|2H − 2|d|2H + |d − 1|2H We now set BH (0) = 0 and define the past increment as −BH (−t) and the future increment as BH (t). We get the correlation of past and future as < −BH (−t)BH (t) >= 2−1 < [BH (t) − BH (−t)]2 > −2 < [BH (t)]2 > = 2−1 (2t)2H − t2H Dividing by < [BH (t)]2 >= t2H we obtain the correlation which is independent of t and given by 22H−1 − 1. In the classical case where H = 21 the correlation vanishes as expected. For H > 21 the correlation is positive, expressing persistence, and it becomes 1 when H = 1. On the other hand, for H < 12 the correlation is negative, expressing anti-persistence, and it becomes − 12 when H = 0. While classical algorithm for generating random function between t = 0 and t = T is independent of T , it is no-longer the case when generating fractional Brownian functions. The levy stable line-to-line functions are random functions having stationary independent increments and such that the incremental random variable X(t) − X(0) is Levy stable. The scaling factor a(t) making [X(t) − X(0)]a(t) 1 independent of t must take the form a(t) = t− D . This process generalises the ordinary Brownian motion to D 6= 2. The process X(t) is discontinuous and includes jumps. When D < 1, the process X(t) includes only jumps. The number of jumps occurring between t and t + ∆t and having an absolute value exceeding u is a Poisson random variable of expectation equal to |∆t|u−D . The relative numbers of positive and negative jumps are 21 (1 + β) and 1 2 (1 − β). The case β = 1 involves only positive jumps, which is called stable subordinator and serves to define the Levy staircases. Note, since u−D → ∞ as u → 0, the total expected number of jumps is infinite no matter how small is ∆t. However, the jumps for which u < 1 add to a finite cumulative total. That is, the expected length of small jumps is finite. It is proportional to 566 Quantitative Analytics Z 1 −D−1 Du Z 1 udu = D 0 u−D du < ∞ 0 In the case 1 < D < 2 the above integral diverges, hence the total contribution of small jump’s expected length is infinite. As a result, X(t) includes a continuous term and a jump term. Both are infinite, but they have a finite sum. Mandelbrot defined a fractal set as a set in a metric space for which Hausdorff Besicovitch dimension D > Topological dimension DT A fractal can be defined alternatively as a set for which Frostman capacitary dimension > Topological dimension While standard assumptions in time series analysis state 1. that < X 2 >< ∞, and 2. that X is weakly (short-run) depenent B.6.2 The R/S analysis Mandelbrot showed that long-tailed records are often best interpreted by accepting < X 2 >= ∞. To tackle the question of weather a record is weakly or strongly dependent he disregarded the distribution of X(t) by considering rescaled range analysis (R/S analysis) which is a statistical technique concerned with the distinction between the short and the very long run. Introducing the Hurst Coefficient J, such that 0 ≤ J ≤ 1, J = 12 is characteristic of independent, Markov and other short-run dependent random functions. The intensity of very long-run dependence is measured by J − 12 , and can be estimated from the data. The Hurst Coefficient J is robust with respect to the marginal distribution and continues to be effective even when X(t) is so far from Gaussian that < X 2 (t) > diverges Rt and all second order techniques are invalid. In continuous time t, we let X ∗ (t) = 0 X(u)du be the cumulative R t value of the process X, and we further define X 2∗ (t) = 0 X 2 (u)du and X ∗2 = (X ∗ ). In discrete time i we get P [t] X ∗ (t) = i=1 X(i) with X ∗ (0) = 0 and where [t] is the integer part of t. For every lag d > 0 the adjusted range of ∗ X (t) in the time interval 0 to d is given by R(d) = max {X ∗ (u) − 0≤u≤d u u ∗ X (d)} − min {X ∗ (u) − X ∗ (d)} 0≤u≤d d d We then estimate the sample standard deviation of X(t) as S 2 (d) = 1 2∗ 1 X (d) − 2 X ∗2 (d) d d The expression Q(d) = R(d) S(d) is the R/S statistics, or self-rescaled self-adjusted range of X ∗ (t). Assuming that there exists a real number J such that, as d → ∞, d1J R(d) S(d) converges in distribution to a nondegenerate limit random variable, then Mandelbrot proved that 0 ≤ J ≤ 1. The function X is then said to have the R/S exponent H with a constant R/S prefactor. R(d) 1 More generally, the ratio dJ L(d) S(d) converges in distribution to a nondegenerate limit random variable, where L(d) 567 Quantitative Analytics denotes a slowly varying function at infinity 1 . For L(d) = log d, the function X is said to have the R/S exponent J 1 and the prefactor L(d). Note, J = 21 whenever S(d) →< X 2 > and the rescaled a− 2 X ∗ (at) converges weakly to B(t) as a → ∞. In order to obtain J = H 6= 12 with a constant prefactor, it suffices that S(d) →< X 2 > and that X ∗ (t) be attracted by BH (t) with < X ∗ (t) > t̃2H . More generally, J = H 6= 21 with the prefactor L(d) prevails if S(d) →< X 2 >, and X ∗ (t) is attracted by BH (t) and satisfies < (X ∗ (t))2 > t̃2H L(t). Also, J 6= 21 when S(d) →< X 2 >, and X ∗ (t) is attracted by a non-Gaussian scaling random function of exponent H = J. When X is a white Levy stable noise, then < X 2 >= ∞, and we get J = 12 . B.7 Some continuous variables and their distributions For details see text book by Grimmett et al. [1992]. B.7.1 Some popular distributions B.7.1.1 Uniform distribution X is uniform on [a, b] if 0 if x ≤ a (x−a) if a < x ≤ b F (x) = (b−a) 1 if x > b Roughly speaking, X takes any value between a and b with equal probability. B.7.1.2 Exponential distribution X is exponential with parameter λ(> 0) if F (x) = 1 − e−λx , x ≥ 0 which is the continuous limit of the waiting time distribution. The mean is given by Z ∞ 1 E[X] = [1 − F (x)]dx = λ 0 B.7.1.3 Normal distribution Given the two parameters µ and σ 2 the density function is f (x) = √ 1 2πσ 2 e− (x−µ)2 2σ 2 , −∞ 0 and let Y = (X − µ) σ For the distribution of Y we get 1 a function satisfying L(td) → 1 as d → ∞ , ∀t > 0 L(d) 568 Quantitative Analytics 1 P (Y ≤ y) = P (X ≤ yσ + µ) = √ 2π Z y 1 2 e− 2 v dv −∞ Thus Y is N (0, 1). B.7.1.4 Gamma distribution X has the gamma distribution with parameters λ, t > 0, denoted by Γ(λ, t) if it has density f (x) = 1 t t−1 −λx λx e ,x≥0 Γ(t) where Γ(t) is the gamma function Z Γ(t) = ∞ xt−1 e−x dx 0 If t = 1 then X is Exponentially distributed with parameter λ. B.7.1.5 Chi-square distribution Given the Gamma distribution, when λ = 21 and t = 21 d for some integer d, then X is said to have the Chi-squared distribution χ2 (d) with d degrees of freedom with density f (x) = 1 1 1 1 1 ( ) 2 d x 2 d−1 e− 2 x , x ≥ 0 Γ( 12 d) 2 Definition B.7.1 If Z is a standard normal random variable, the distribution of U = Z 2 is called the chi-square distribution with 1 degree of freedom. Note, if X ∼ N (µ, σ 2 ) then U = (X−µ) σ ∼ N (0, 1) and therefore [ (X−µ) ]2 ∼ χ21 . σ Definition B.7.2 If U1 , U2 , .., Un are independent chi-square random variables with 1 degree of freedom, the distribution of V = U1 + U2 + .. + Un is called the chi-square distribution with n degrees of freedom denoted by χ2n . Note, if U and V are independent and U ∼ χ2n and V ∼ χ2m then U + V ∼ χ2m+n . B.7.1.6 Weibull distribution X is Weibull, parameters α, β > 0 if β F (x) = 1 − e−αx , x ≥ 0 Differentiating, we get β f (x) = αβxβ−1 e−αx , x ≥ 0 Setting β = 1, we recover the Exponential distribution. 569 Quantitative Analytics B.7.2 Normal and Lognormal distributions 2 Given a random variable X normally distributed with mean µX and variance σX , its probability distribution function is 1 √ fX (x) = σX 2π e − 21 (x−µX )2 σ2 X 2 Assuming the random variables X and Y are jointly Gaussian with X ∼ N (µX , σX ), Y ∼ N (µY , σY2 ) and correlation ρ, the bivariate normal distribution function is (x−µX )(y−µY ) (y−µY )2 (x−µX )2 1 −2ρ + − 2(1−ρ 1 2) σX σY σ2 σ2 X Y p fX,Y (x, y) = e 2πσX σY 1 − ρ2 2 If X is lognormally distributed variable X ∼ LN (µX , σX ) then the variable Y = log X is normally distributed with ≤y) dy mean µY and standard deviation σY , and the pdf of X satisfies φX (x) = dP (X≤x) = dP (Y dx dy dx , that is φX (x; µY , σY ) = 1 fY (log (x)) , x ∈ (0, ∞) x The expected value and variance of the variable X are 1 2 µX = E[X] = eµY + 2 σY 2 2 2 σX = V ar(X) = (eσY − 1)e2µY +σY Alternatively, if we know the expected value and variance of X we can recover the parameter µY and σY with V ar(X) 1 log (1 + ) 2 (E[X])2 V ar(X) ) σY2 = log (1 + (E[X])2 µY = log E[X] − We consider the variables Xi for i = 1, 2 such that Yi = log Xi are rormally distributed Yi ∼ N (µYi , σYi ) and assume their joint distribution is bivariate normal with correlation coefficient ρY . Hence, X1 and X2 are bivariate lognormally distributed LN (µY1 , µY2 , σY1 , σY2 , ρY ) with joint distribution φX1 ,X2 (x1 , x2 ) = 1 fY ,Y (log (x1 ), log (x2 )) x1 x2 1 2 Johnson et al give the correlation coefficient ρX = q B.7.3 eρY σY1 σY2 − 1 2 2 (eσY1 − 1)(eσY2 − 1) Multivariate Normal distributions Given X1 , X2 , .., Xn , the multivariate normal distribution is obtained by rescaling the exponential of a quadratic form. A quadratic form is a function Q : Rn → R of the form X Q(x) = aij xi xj = xAx> 1≤i,j≤n 570 Quantitative Analytics where x = (x1 , ..., xn ), x> is the transpose of x, and A = (aij ) is a real symmetric matrix with non-zero determinant. A well known theorem about diagonalizing matrices states that there exists an orthogonal matrix B such that A = BΛB > where Λ is the diagonal matrix with eigenvalues λ1 , .., λn of A on its diagonal. So, the quadratic form becomes X Q(x) = yΛy > = λi y 2 i where y = xB. Q is called a positive definite quadratic form if Q(x) > 0 for all vectors x with some non-zero coordinate. From matrix theory, Q > 0 if and only if λi > 0 for all i. Definition B.7.3 X = (X1 , .., Xn ) has the multivariate normal distribution written N (µ, V ), if its joint density function is 1 1 f (x) = [(2π)n |V |]− 2 e− 2 (x−µ)V −1 (x−µ)> where V is a positive definite symmetric matrix. Theorem B.7.1 If X is N (µ, V ) then 1. E[X] = µ, which is to say that E[Xi ] = µi for all i 2. V = (vij ) is called the covariance matrix because vij = Cov(Xi , Xj ) We often write V = E[(X − µ)> (X − µ)] where (X − µ)> (X − µ) is a matrix with (i, j)th entry (Xi − µi )(Xj − µj ). A very important property of this distribution is its invariance of type under linear changes of variables. Theorem B.7.2 If X = (X1 , .., Xn ) is N (0, V ) and Y = (Y1 , .., Ym ) is given by Y = XD for some matrix D of rank m ≤ n, then Y is N (0, D> V D). A similar result holds for linear transformations of N (µ, V ) variables. We now present another way of defining the multivariate normal distribution. Definition B.7.4 The vector X = (X1 , .., Xn ) of random variables is said to have the multivariate normal distribution whenever, for all a ∈ Rn , xa> = a1 X1 + a2 X2 + ... + an Xn has a normal distribution. That is, X is multivariate normal if and only if every linear combination of the Xi is univariate normal. B.7.4 Distributions arising from the Normal distribution B.7.4.1 Presenting the problem Statisticians are frequently faced with a collection X1 , X2 , .., Xn of random variables arising from a sequence of experiments. They might assume that they are independent N (µ, σ 2 ) variables for some fixed but unknown values for µ and σ 2 . This assumption is often a very close approximation to reality. They proceed to estimate the values of µ and σ 2 by using functions of X1 , .., Xn . They commonly use the sample mean n X= 1X Xi n i=1 571 Quantitative Analytics as a guess at the value of µ and the sample variance n S2 = 1 X (Xi − X)2 n − 1 i=1 2 as a guess at the value of σ 2 . From the Definition (B.7.2) we see that (n − 1) Sσ2 is a sum of independent chi-square random variables, and we obtain the following Definition: Theorem B.7.3 If X1 , X2 , .. are independent N (µ, σ 2 ) variables then X and S 2 are independent. Further X ∼ N (µ, σ2 S2 ) and (n − 1) 2 ∼ χ2 (n − 1) n σ Note, σ is only a scaling factor for X and S. As a preliminary to showing that X and S 2 are independently distributed, we get the theorem Theorem B.7.4 The random variable X and the vector of random variables X1 − X, ..., Xn − X are independent. Corollary 5 Given X and S 2 defined as above, then X −µ √S n B.7.4.2 ∼ tn−1 The t-distribution Given the remark in the previous Appendix, we consider two random variables U= (n − 1) 2 S ∼ χ2 (n − 1) σ2 which does not depend on σ, and √ n (X − µ) ∼ N (0, 1) σ which does not depend on σ. Hence the random variable √ V n T =q = (X − µ) S U V = n−1 has a distribution which does not depend on σ. T is the ratio of two independent random variables, and it is said to have a t-distribution with (n − 1) degrees of freedom written t(n − 1). It is also called Student’s t distribution. Definition B.7.5 If V ∼ N (0, 1) and U ∼ χ2 (n) and U and V are independent, then the distribution of √VU is called n the t distribution with n degrees of freedom. The joint density of U and V is 1 f (u, v) = 1 ( 12 )r e− 2 u u 2 r−1 1 − 1 v2 √ e 2 Γ( 12 r) 2π where r = n − 1. See Appendix (B.7.1.4) for a description of the χ2 (d) density. Then map (u, v) onto (s, t) by 572 Quantitative Analytics u 1 s = u , t = v( )− 2 r and use the Corollary Corollary 6 If X1 and X2 have joint density function f , then the pair Y1 , Y2 given by (Y1 , Y2 ) = T (X1 , X2 ) has joint density function f (x1 (y1 , y2 ), x2 (y1 , y2 ))|J(y1 , y2 )| if (y1 , y2 ) is in the range of T fY1 ,Y2 (y1 , y2 ) = 0 otherwise to get s 1 s 1 fU,T (s, t) = ( ) 2 f (s, t( ) 2 ) r r Integrating over s we obtain Γ( 1 (r + 1)) t2 − 1 (r+1) fT (t) = √2 (1 + ) 2 , −∞ 0 1 2 (r+s) sΓ( 12 r)Γ( 12 s) (1 + ( rx s )) 573 Quantitative Analytics B.8 B.8.1 Some results on Normal sampling Estimating the mean and variance Given [R , N (µ, σ 2 )⊗n ] with µ ∈ R and σ 2 ∈ R+ unknown, we set θ = (µ, σ 2 )> . The likelihood of the model is n 1 − 12 n e 2σ − 2 2 (2πσ ) ln (θ) = Pn 2 i=1 (yi −µ) Setting Ln (θ) = log ln (θ), the score vector is ∂θ Ln (θ) = 1 σ2 − 2σn2 + Pn i=1 P(yni − µ) 1 4 i=1 (yi − 2σ µ)2 We can then obtain the maximum likelihood estimator for µ and σ 2 as n µ̂ = Y , σ̂ 2 = where Y = 1 n Pn i=1 1X (Yi − Y )2 n i=1 Yi . Note, µ̂ is a non-biased estimator but σ̂ 2 is a biased estimator. We must consider n 1 X s = (Yi − Y )2 n − 1 i=1 2 to get a non-biased estimator since E[s2 ] = σ 2 . Theorem B.8.1 (Theorem of Fisher) Y and s2 are two independent statistics and we get Y ∼ N (µ, B.8.2 σ2 s2 ) and (n − 1) 2 ∼ χ2 (n − 1) n σ Estimating the mean with known variance Given [Rn , N (θ, σ02 )⊗n ] with θ ∈ R and σ0 known, we look for the confidence interval of θ. Note, the function √ n(Y −θ) is pivotal since its law N (0, 1) is fixed. We let Zp = Z1− α2 be the (1 − α2 ) percentile point of the N (0, 1) σ0 distribution, we get √ n(Y − θ) ∀θ , Pθ (−Zp ≤ ≤ Zp ) = 1 − α σ0 which we rearrange as σ0 σ0 ∀θ , Pθ (Y − Zp √ ≤ θ ≤ Y + Zp √ ) = 1 − α n n σ0 The interval Y ± Zp √ is the confidence interval of level 1 − α. n 574 Quantitative Analytics B.8.3 Estimating the mean with unknown variance Given [Rn , N (µ, σ 2 )⊗n ] with µ ∈ R and σ 2 ∈ R+ unknown, we look for the confidence interval of µ. We have n independent observations√of the same law N (µ, σ 2 ). We let θ = (µ, σ 2 )> , then the function g is the first coordinate g(θ) = µ. The function n(Yσ −µ) is no-longer pivotal for µ as it does not depend on θ only through µ. However, the √ function n(Y −µ) s with n s2 = 1 X (Yi − Y )2 n − 1 i=1 also has a fixed law, which is the Student law with (n − 1) degrees of freedom. This is therefore a pivotal function. We can therefore deduce a confidence interval of level (1 − α) symmetric around Y with bounds given by s Y ± √ tp n with tp being the quantile of order (1 − α2 ) of the Student law with (n − 1) degrees of freedom. Note, in this case the length of the interval 2 √sn tp is random. B.8.4 Estimating the parameters of a linear model Given the linear model Y = Xb + where ∼ N (0, σ 2 I) and X is an (n × K) matrix of rank K, we consider bi the ith element of b. We let b̂i be the ith component of the least square estimate b̂ of b. Hence, b̂i follow the law N (bi , σ 2 aii ) where aii is the ith diagonal element of 10 . Moreover X X (n − K)σ̃ 2 = ||Y − X b̂||2 ∼ χ2 (n − K) is independent from b̂i . As a result b̂i√ −bi σ̃ aii follows the Student law with (n − K) degrees of freedom. Therefore, it is a pivotal function for bi . We can deduce a confidence interval of level (1 − α) for bi symmetric around b̂i with bounds b̂i + σ̂i tp where tp is the quantile of order (1 − B.8.5 α 2) √ of the Student law with (n − K) degrees of freedom and σ̂i = σ̃ aii . Asymptotic confidence interval We consider a semi-parametric sample model and do not make any assumption on the law of the variables Yi for i = 1, .., n, .. We only assume that the Yi are independent from the same law, and that the mean m and the variance σ 2 of Y exist. We are looking for an asymptotic confidence interval of level α for the mean m. The least square estimate of m is Y , and using the law of the large numbers Y is asymptotically normal (central limit theorem) √ n(Y − m) L > N (0, σ 2 ) n→∞ As a result, an asymptotic pivotal function is √ n n(Y − m) 1X with σ̂ 2 = (Yi − Y )2 σ̂ n i=1 because 575 Quantitative Analytics √ L n(Y − m) > > N (0, 1) σ̂ n→∞ We can then deduce the asymptotic confidence interval of level α for the mean m as σ̂ σ̂ Y − √ Z1− α2 ≤ m ≤ Y + √ Z1− α2 n n where Z1− α2 is the quantile of order (1 − α2 ) of the distribution N (0, 1). B.8.6 The setup of the Monte Carlo engine Given a continuous process (Xt )t≥0 , we want to estimate θ = E[f (XT )] for a fixed maturity T . We take a discrete process X̂t given by {X̂h , X̂2h , ..., X̂mh } such that mh = T . To simplify notation we define fj = f (X̂) and consider the estimated value of θ̂ = E[f (X̂T )] to be n θ̂n = 1X fj n j=1 From the strong law of large numbers we get θ̂n → θ as n → ∞ Also, if we consider Z ∼ N (0, 1) and let Z1− α2 be the (1 − α2 ) percentile point of the N (0, 1) distribution so that P (−Z1− α2 ≤ Z ≤ Z1− α2 ) = 1 − α we can recover a confidence interval. Setting α = 5% we get Z97.5 = 1.96 which is the approximate value of the (1 − α2 ) = 97.5 percentile point of the normal distribution used in probability and statistics. That is, 1−α = 95% of the area under a normal curve lies within roughly 1.96 standard deviations of the mean, and due to the central limit theorem, this number is therefore used in the construction of approximate 95% confidence intervals. Hence, P (Z > 1.96) = 0.025 and P (Z < 1.96) = 0.975 and as the normal distribution is symmetric we get P(-1.96 < Z < 1.96) = 0.95. The approximate 100(1 − α2 )% confidence interval for θ when n is large is σ̂n σ̂n [L(Y ), U (Y )] = [θ̂n − Z1− α2 √ , θ̂n + Z1− α2 √ ] n n where σ̂n is an estimated standard deviation of the process X̂t . Remark B.8.1 θ̂n is an unbiased estimate of θ̂ but it can be a very biased estimate of θ. In order to measure that bias we consider the discretisation error D given by D = |E[f (XT )] − E[f (X̂T )]| It leads to two types of error, the discretisation error and the statistical error. • small value of m → greater discretisation error • small value of n → greater statistical error 576 Quantitative Analytics The values m and n must be chosen judiciously to control the convergence of the estimated θ̂n to the true value θ at the minimum computational cost. From the confidence interval, we see that the accuracy of the Monte Carlo pricer is governed by the relation σ̂ √n n so that we can • multiply n by 4 to decrease the confidence interval by a factor of 2 • reduce the variance B.9 Some random sampling For details see text book by Rice [1995]. We assume that the population is of size N and that associated with each member of the population is a numerical value of interest denoted by x1 , x2 , .., xN . The variable xi may be a numerical variable such as age or weight, or it may take on the value 1 or 0 to denote the presence or absence of some characteristic. The latter is called the dichotomous case. B.9.1 The sample moments In general, the population variance of a finite population of size N is given by σ2 = N N 1 X 1 X (xi − µ)2 with µ = xi N i=1 N i=1 where µ is the population mean. In the dichotomous case µ equals the proportion p of individuals in the population having the particular characteristic. The population total is τ= N X xi = N µ i=1 In many practical situations, the true variance of a population is not known a priori and must be computed somehow. When dealing with extremely large populations, it is not possible to count every object in the population and one must estimate the variance of a population from a sample. We take a sample with replacement of n values X1 , ..., Xn from the population, where n < N and such that Xi is a random variable. Xi is the value of the ith member of the sample, and xi is that of the ith member of the population. The joint distribution of the Xi is determined by that of the xi . We let ξ1 , .., ξm be the elements of a vector corresponding to the possible values of xi . Since each member of the population is equally likely to be in the sample, we get P (Xi = ξj ) = nj N The sample mean is n X= 1X Xi n i=1 Theorem B.9.1 With simple random sampling E[X] = µ 577 Quantitative Analytics We say that an estimate is unbiased if its expectation equals the quantity we wish to estimate. Mean squared error = variance + (biased)2 Since X is unbiased, its mean square error is equal to its variance. Lemma B.9.1 With simple random sampling ( Cov(Xi , Xj ) = σ 2 if i = j 2 − (Nσ−1) if i 6= j It shows that Xi and Xj are not independent of each other for i 6= j, but that the covariance is very small for large values of N . Theorem B.9.2 With simple random sampling V ar(X) = Note, the ratio n N σ2 n−1 1− n N −1 is called the sampling fraction and n−1 N −1 is the finite population correction. If the sampling fraction is very small we get the approximation pc = 1 − σ σX ≈ √ n We estimate the variance on the basis of this sample as n σ̂ 2 = σn2 = n 1X 1X (Xi − X)2 with X = Xi n i=1 n i=1 This is the biased sample variance. The unbiased sample variance is n σ 2n = n 1 X 1X (Xi − X)2 with X = Xi n − 1 i=1 n i=1 While the first one may be seen as the variance of the sample considered as a population (over n), the second one is the unbiased estimator of the population variance (over N) where (n − 1) is the Bessel’s correction. Put another way, we get E[σn2 ] = n−1 N σ 2 and E[σ 2n ] = σ 2 n N −1 n N −1 That is, the unbiased estimate of σ 2 may be obtained by multiplying σn2 by the factor n−1 N . If the population is n−1 large relative to n, the dominant bias is due to the term n . In general one set n between 50 and 180 days. Being a function of random variables, the sample variance is itself a random variable, and it is natural to study its distribution. In the case that yi are independent observations from a normal distribution, Cochran’s theorem shows that σ 2n follows a scaled chi-squared distribution (n − 1) σ 2n ≈ χ2n−1 σ2 578 Quantitative Analytics If the conditions of the law of large numbers hold for the squared observations, σ 2n is a consistent estimator of σ 2 and the variance of the estimator tends asymptotically to zero. The obtained standard deviation σ̃N is an estimator of σ called the historical volatility. Corollary 7 An unbiased estimate of V ar(X) is s2X = s2 n σ̂ 2 n N − 1 N − n = (1 − ) n n−1 N N −1 n N where n s2 = B.9.2 1 X (Xi − X)2 n − 1 i=1 Estimation of a ratio We consider the estimation of a ratio, and assume that for each member of a population, two values, x and y, may be measured. The ratio of interest is PN µy i=1 yi r = PN = µ x x i=1 i Y . Since R is Assuming that a sample is drawn consisting of the pairs (Xi , Yi ), the natural estimate of r is R = X a nonlinear function of the random variables X and Y , there is no closed form for E[R] and V ar(R) and we must approximate them by using V ar(X), V ar(Y ), and Cov(X, Y ). We define the the population covariance of x and y as σxy = N 1 X (xi − µx )(yi − µy ) N i=1 One can show that Cov(X, Y ) = σxy pc n Theorem B.9.3 With simple random sampling, the approximate variance of R = V ar(R) ≈ Y X is 1 1 2 2 1 (r σX + σY2 − 2rσXY ) = pc 2 (r2 σx2 + σy2 − 2rσxy ) µ2x n µx The population correlation coefficient given by ρ= σxy σx σy is a measure of the strength of the linear relationship between the x and the y values in the population. We can express the variance in the above theorem in terms of ρ as V ar(R) ≈ 1 1 pc 2 (r2 σx2 + σy2 − 2rρσx σy ) n µx so that strong correlation of the same sign as r decreases the variance. Further, for small µx we get large variance, Y since small values of X in the ratio R = X cause R to fluctuate wildly. 579 Quantitative Analytics Theorem B.9.4 With simple random sampling, the expectation of R is given approximately by E[R] ≈ r + 1 1 pc 2 (r2 σx2 − ρσx σy ) n µx so that strong correlation of the same sign as r decreases the bias, and the bias is large if µx is small. In addition, the bias is of the order n1 , so its contribution to the mean squared error is of the order n12 while the contribution of the variance is of order n1 . Hence, for large sample, the bias is negligible compared to the standard error of the estimate. For large samples, truncating the Taylor Series after the linear term provides a good approximation, since the deviations X − µx and Y − µy are likely to be small. To this order of approximation, R is expressed as a linear combination of X and Y , and an argument based on the central limit theorem can be used to show that R is approximately normally distributed, and confidence intervals can be formed for r by using the normal distribution. In order to estimate the standard error of R, we substitute R for r in the formula of the above theorem where the x and y population variances are estimated by s2x and s2y . The population covariance is estimated by sxy = n n 1 X 1 X (Xi − X)(Yi − Y ) = Xi Yi − nXY n − 1 i=1 n − 1 i=1 and the population correlation is estimated by ρ̂ = sxy sx sy The estimated variance of R is thus s2R = 1 1 (R2 s2x + s2y − 2Rsxy ) pc n X2 and the approximate 100(1 − α)% confidence interval for r is R ± z( α2 )sR . B.9.3 Stratified random sampling The population is partitioned into subpopulations, or strata, which are then independently sampled. We are interested in obtaining information about each of a number of natural subpopulations in addition to information about the population as a whole. It guarantees a prescribed number of observations from each subpopulation, whereas the use of a simple random sample can result in underrepresentation of some subpopulations. Further, the stratified sample mean can be considerably more precise than the mean of a simple random sample, especially if there is considerable variation between strata. We will denote by Nl , where l = 1, .., L the population sizes in the L strata such that N1 + N2 + .. + NL = N the total population size. The population mean and variance of the lth stratum are denoted by µl and σl2 (unknown). The overall population mean can be expressed in terms of the µl as follows L Nl L L X 1 XX 1 X µ= xil = Nl µl = Wl µl N N i=1 l=1 l=1 where xil denotes the ith population value in the lth stratum and Wl = in the lth stratum. l=1 Nl N is the fraction of the population contained Within each stratum a simple random sample of size nl is taken. The sample mean in stratum l is denoted by Xl = nl 1 X Xil nl i=1 580 Quantitative Analytics where Xil denotes the ith observation in the lth stratum. By analogy with the previous calculation we get Xs = L X Nl X l l=1 N = L X Wl X l l=1 Theorem B.9.5 The stratisfied estimate, X s of the population mean is unbiased. That is, E[X s ] = µ. Since we assume that the samples from different strata are independent of one another and that within each stratum a simple random sample is taken, the variance of X s can easily be calculate. Theorem B.9.6 The variance of the stratisfied sample mean is given by V ar(X s ) = L X Wl2 l=1 1 nl − 1 2 (1 − )σ nl Nl − 1 l (B.9.9) nl −1 nl −1 represents the finite population corrections. If the sampling fractions within all strata are small ( N << Note, N l −1 l −1 1), we get the approximation V ar(X s ) ≈ L X W2 l l=1 nl σl2 (B.9.10) The estimate of σl2 is given by n Sl2 = l 1 X (Xil − X l )2 nl − 1 i=1 and V ar(X s ) is estimated by 2 SX = s L X l=1 Wl2 1 nl − 1 2 )S (1 − nl Nl − 1 l The question that naturally arises is how to choose n1 , .., nL to minimise V ar(X s ) subject to the constraint n1 + .. + nL = n. Ignoring the finite population correction within each stratum we get the Neyman allocation. Theorem B.9.7 The sample sizes n1 , .., nL that minimise V ar(X s ) subject to the constraint n1 + .. + nL = n are given by Wl σl nl = n PL k=1 Wk σk where l = 1, .., L. This theorem shows that those strata for which Wl σl is large should be sampled heavily. If Wl is large, the stratum contains a large fraction of the population. If σl is large, the population values in the stratum are quite variable, and a relatively large sample size must be used. Substituting the optimal values of nl into the Equation (B.9.9) we get the following corollary. Corollary 8 Denoting by X so the stratified estimate using the optimal Neyman allocation and neglecting the finite population correction, we get 581 Quantitative Analytics V ar(X so ) = L 2 1 X Wl σl n l=1 The optimal allocations depend on the individual variances of the strata, which generally will not be known. A simple alternative method of allocation is to use the same sampling fraction in each stratum n1 n2 nL = = ... = N1 N2 NL which holds if NL = nWl (B.9.11) N l = 1, .., L. This method is called the Proportional allocation. The estimate of the population mean based on proportional allocation is nl = n X sp = L X L Wl X l = l=1 l=1 since Wl nl = 1 n. n l 1 XX Xil n i=1 This estimate is simply the unweighted mean of the sample values. Theorem B.9.8 With stratified sampling based on proportional allocation, ignoring the finite population correction, we get L V ar(X sp ) = 1X Wl σl2 n l=1 We can compare V ar(X so ) and V ar(X sp ) to define when optimal allocation is substantially better than proportional allocation. Theorem B.9.9 With stratified random sampling, the difference between the variance of the estimate of the population mean based on proportional allocation and the variance of that estimate based on optimal allocation is, ignoring the finite population correction, L V ar(X sp ) − V ar(X so ) = 1X Wl (σl − σ)2 n l=1 where σ= L X Wl σl l=1 As a result, if the variances of the strata are all the same, proportional allocation yields the same results as optimal allocation. The more variable these variances are, the better it is to use optimal allocation. We can also compare the variance under simple random sampling with the variance under proportional allocation. 2 Neglecting the finite population correction, the variance under simple random sampling is V ar(X) = σn . We first need a relationship between the overall population variance σ 2 and the strata variances σl2 . The overall population variance may be expressed as 582 Quantitative Analytics σ2 = L NL 1 XX (xil − µ)2 N i=1 l=1 Further, using the relation (xil − µ)2 = (xil − µl )2 + 2(xil − µl )(µl − µ) + (µl − µ)2 and realising that when both sides are summed over l, the middle term on the right-hand side becomes zero, we have NL NL X X (xil − µ)2 = (xil − µl )2 + NL (µl − µ)2 = NL σl2 + NL (µl − µ)2 i=1 i=1 Dividing both sides by N and summing over l, we have σ2 = L X Wl σl2 + l=1 L X Wl (µl − µ)2 l=1 2 Substituting this expression for σ into V ar(X) and using the formula for V ar(X sp ) completes the proof of the following theorem. Theorem B.9.10 The difference between the variance of the mean of a simple random sample and the variance of the mean of a stratified random sample based on proportional allocation is, neglecting the finite population correction, L V ar(X) − V ar(X sp ) = 1X Wl (µl − µ)2 n l=1 Thus, stratified random sampling with proportional allocation always gives a smaller variance than does simple random sampling, providing that the finite population correction is ignored. Typically, stratified random sampling can result in substantial increases in precision for populations containing values that vary greatly in size. In order to construct the optimal number of strata, the population values themselves (which are unknown) would have to be used. Stratification must therefore be done on the basis of some related variable that is known or on the results of earlier samples. According to the Neyman-Pearson Paradigm, a decision as to weather or not to reject H0 in favour of HA is made on the basis of T (X), where X denotes the sample values and T (X) is a statistic. The statistical properties of the methods are relevant if it is reasonable to model the data stochastically. There exists methods that are sample analogues of the cumulative distribution function of a random variable. It is useful in displaying the distribution of sample values. Given x1 , .., xn a batch of numbers, the empirical cumulative distribution function (ecdf) is defined as Fn (x) = 1 (noxi ≤ x) n where Fn (x) gives the proportion of the data less than or equal to x. It is a step function with a jump of height n1 at each point xi . The ecdf is to a sample what the cumulative distribution is to a random variable. We now consider some of the elementary statistical properties of the ecdf when X1 , .., Xn is a random sample from a continuous distribution function F . We choose to express Fn as 583 Quantitative Analytics n Fn (x) = 1X I(−∞,x] (Xi ) n i=1 The random variables I(−∞,x] (Xi ) are independent Bernoulli random variables 1 with probability F (x) I(−∞,x] (Xi ) = 0 with probability 1 − F (x) Thus, nFn (x) is a binomial random variable with the first two moments being E[Fn (x)] = F (x) 1 V ar(Fn (x)) = F (x)[1 − F (x)] n B.9.4 Geometric mean The use of a geometric mean normalises the ranges being averaged, so that no range dominates the weighting, and a given percentage change in any of the properties has the same effect on the geometric mean. The geometric mean applies only to positive numbers. It is also often used for a set of numbers whose values are meant to be multiplied together or are exponential in nature, such as data on the growth of the human population or interest rates of a financial investment. The geometric mean of a data set {a1 , a2 , .., an } is given by ( n Y 1 ai ) n i=1 The geometric mean of a data set is less than the data set’s arithmetic mean unless all members of the data set are equal, in which case the geometric and arithmetic means are equal. By using logarithmic identities to transform the formula, the multiplications can be expressed as a sum and the power as a multiplication ( n Y 1 1 ai ) n = e n Pn i=1 ln ai i=1 This is sometimes called the log-average. It is simply computing the arithmetic mean of the logarithm-transformed values of ai (i.e., the arithmetic mean on the log scale) and then using the exponentiation to return the computation to the original scale. 584 Appendix C Stochastic processes and Time Series C.1 Introducing time series C.1.1 Definitions Following Brockwell et al. [1991], a time series is a set of observations xt , each one being recorded at a specified time t. A discrete time series is one in which the set T0 of times at which observations are made is a discrete set, as it is the case when observations are made at fixed time intervals. Continuous time series are obtained when observations are recorded continuously over some time interval. We assume that each observation xt is a realised value of a certain random variable Xt . The time series {xt , t ∈ T0 } is a realisation of the family of random variables {Xt , t ∈ T0 }. Hence, we can model the data as a realisation of a stochastic process {Xt , t ∈ T } where T ⊇ T0 . Definition C.1.1 A stochastic process is a family of random variables {Xt , t ∈ T } defined on a probability space (Ω, F, P). When dealing with a finite number of random variables, we need to compute the covariance matrix to gain insight into the dependence between them. For a time series {Xt , t ∈ T } we extend that concept to deal with an infinite collections of random variables which is called the Autocovariance function. Definition C.1.2 If {Xt , t ∈ T } is a process such that V ar(Xt ) < ∞ for each t ∈ T , then the Autocovariance function γX (., .) of Xt is defined by γX (r, s) = Cov(Xr , Xs ) = E[(Xr − EXr )(Xs − EXs )] , r, s ∈ T Definition C.1.3 (Weak Stationarity) The time series {Xt , t ∈ Z} with index set Z = {0, ±1, ±2, ...} is said to be Stationary if 1. E|Xt2 | < ∞ for all t ∈ Z 2. E[Xt ] = m for all t ∈ Z 3. γX (r, s) = γX (r + t, s + t) for all r, s, t ∈ Z If {Xt , t ∈ Z} is stationary then γX (r, s) = γX (r − s, 0) for all r, s, ∈ Z. Hence, we can redefine the Autocovariance function of a stationary process as the function of just one variable γX (h) = γX (h, 0) = Cov(Xt+h , Xt ) for all t, h ∈ Z The Autocorrelation function of Xt is defined analogously as the function whose value at lag h is 585 (C.1.1) Quantitative Analytics γX (h) = Corr(Xt+h , Xt ) for all t, h ∈ Z γX (0) ρX (h) = Definition C.1.4 (Gaussian Time Series) The process Xt is a Gaussian time series if and only if the distribution functions of Xt are all multivariate normal. For example, given an independent and identically distributed (iid) sequence of zero-mean random variables Zt with 2 finite variance σZ , we let Xt = Zt + θZt−1 . Then the Autocovariance function of Xt is 2 if h = 0 (1 + θ2 )σZ 2 θσZ if h = ±1 γX (t + h, t) = Cov(Zt+h + Zt+h−1 , Zt + Zt−1 ) = 0 if |h| > 1 and Xt is stationary. C.1.2 Estimation of trend and seasonality In general, when analysing time series we check if the data is a realisation of the process Xt = mt + st + Yt (C.1.2) where mt is a slowly changing function called the trend, st is a function with known period d called the seasonal component, and Yt is a random noise component which is stationary. If the seasonal and noise fluctuations appear to increase with the level of the process, then a preliminary transformation of the data is often used to make the transformed data compatible with the model in Equation (C.1.2). One can obtain smoothing by means of a Moving Average. Assuming no seasonality term st in Equation (C.1.2) and discrete time t = 1, .., n, we let q be a non-negative integer and consider the two-sided moving average q X 1 Xt+j Wt = 2q + 1 j=−q of the process {Xt } in Equation (C.1.2). Then for q + 1 ≤ t ≤ n − q we get Wt = q q X X 1 1 mt+j + Yt+j 2q + 1 j=−q 2q + 1 j=−q ≈ mt assuming that mt is approximately linear over the interval [t − q, t + q] and that the average of the error terms over this interval is close to zero. The moving average provides us with the estimates m̂t = q X 1 Xt+j for q + 1 ≤ t ≤ n − q 2q + 1 j=−q Note, as Xt is not observed for t ≤ 0 or t > n, we can not use this equation for t ≤ q or t > n − q and one can define Xt = X1 for t < 1 and Xt = Xn for t > n. It is useful to think of {m̂t } in the above equation as a process obtained from {Xt } by application of a linear operator or linear filter m̂t = ∞ X j=−∞ 586 aj Xt+j Quantitative Analytics with weights aj = 1 2q+1 for −q ≤ j ≤ q and aj = 0 for |j| > q. This filter is a low-pass filter since it takes the data {xt } and removes from it the rapidly fluctuating (or high frequency) component {Ŷt } to leave the slowly varying Pq 1 estimated trend term {m̂t }. For q large enough, provided 2q+1 Y j=−q t+j ≈ 0, it will not only attenuate noise, but it will allow linear trend functions mt = at + b to pass without distortion. But q can not be too large since if mt is not linear, the filtered process will not be a good estimate of mt . Clever choice of the weights {aj } will allow for larger class of trend functions. Suppose the mean level of a series drifts slowly over time, then a naive one-step-ahead forecast is Xt (1) = Xt . Letting all past observations play a part in the forecast, but giving greater weights to those that are more recent we choose weights to decrease exponentially 1−w Xt + wXt−1 + w2 Xt−2 + ... + +wt−1 X1 1 − wt where 0 < w < 1. Defining St as the right hand side of the above as t → ∞ Xt (1) = St = (1 − w) ∞ X ws Xt−s s=0 St can serve as a one-step-ahead forecast Xt (1). For any fixed a ∈ [0, 1], the one sided moving averages m̂t with t = 1, .., n defined by the recursions m̂t = aXt + (1 − a)m̂t−1 , t = 2, ..., n with m̂1 = X1 can also be used to smooth data. This equation is referred to as Exponential smoothing since it follows from these recursions that, for t ≥ 2 then m̂t = t−2 X a(1 − a)j Xt−j + (1 − a)t−1 X1 j=0 is a weighted moving average of Xt , Xt−1 , .., with weights decreasing exponentially (apart from the last one). Simple algebra gives St = aXt + (1 − a)St−1 Xt (1) = Xt−1 (1) + a(Xt − Xt−1 (1)) To get things started we might set S0 equal to the average of the first few data points. We can play around with α choosing it to minimise the mean square forecasting error. In practice, α is in the range [0.25, 0.5]. C.1.3 Some sample statistics From the observations {x1 , x2 , .., xn } of a stationary time series Xt we wish to estimate the Autocovariance function γ(.) of the underlying process Xt in order to gain information on its dependence structure. To do so we use the sample Autocovariance function. Definition C.1.5 The sample Autocovariance function of {x1 , x2 , .., xn } is defined by n−h 1 X (xj+h − x)(xj − x) , 0 ≤ h < n γ̂(h) = n j=1 where γ̂(h) = γ̂(−h), −n < h ≤ 0, where x is the sample mean x = 587 1 n Pn j=1 xj . Quantitative Analytics Notice that in defining γ̂(h) we divide by n rather than by (n − h). When n is large relative to h it does not much matter which divisor we use. However, for mathematical simplicity and other reasons there are advantages in dividing by n. The sample Autocorrelation function is defined in terms of the sample Autocovariance function as ρ̂(h) = γ̂(h) , |h| < n γ̂(0) The sample Autocovariance and Autocorrelation functions can be computed from any data set {x1 , x2 , .., xn } and are not restricted to realisations of a stationary process. The plot of ρ̂(h) against h is known as the correlogram. For data containing a trend, |ρ̂(h)| will exhibit slow decay as h increases, and for data with a substantial deterministic periodic component, ρ̂(h) will exhibit similar behaviour with the same periodicity. Thus ρ̂(.) can be useful as an indicator of non-stationarity. C.2 The ARMA model The simplest kind of time series {Xt } is one in which the random variables Xt for t = 0, ±1, ±2, .. are independently and identically distributed with zero mean and variance σ 2 . From a second order point of view, that is ignoring all properties of the joint distribution of {Xt } except those which can be deduced from the moments E[Xt ] and E[Xs Xt ], such processes are identified with the class of all stationary process having mean zero and autocovariance function (see Equation (C.1.1)) 2 σ if h = 0 γ(h) = (C.2.3) 0 if h 6= 0 Definition C.2.1 The process {Zt } is said to be a white noise with mean 0 and variance σ 2 , written {Zt } ∼ W N (0, σ 2 ) if and only if {Zt } has zero mean and covariance function in Equation (C.2.3) If the random variable Zt are independently and identically distributed with mean 0 and variance σ 2 then we shall write {Zt } ∼ IDD(0, σ 2 ) Remark C.2.1 The difference between a white noise and an i.i.d. variable lies in the fact that the white noise is a process. Increasing in complexity, we consider the class of time series {Xt , t = 0, ±1, ±2, ..} defined in terms of linear difference equations with constant coefficients called the autoregressive moving average or ARMA processes. For any autocovariance function γ(.) such that limh→∞ γ(h) = 0, and for any integer k > 0, it is possible to find an ARMA process with autocovariance function γX (.) such that γX (h) = γ(h) for h = 0, 1, .., k. The linear structure of ARMA processes leads to a simple theory of linear prediction. Definition C.2.2 (The ARM A(p, q) process) The process {Xt , t = 0, ±1, ±2, ..} is said to be an ARM A(p, q) process if {Xt } is stationary and if for every t Xt − φ1 Xt−1 − ... − φp Xt−p = Zt + θ1 Zt−1 + ... + θq Zt−q 2 (C.2.4) where {Zt } ∼ W N (0, σ ). We say that {Xt } is an ARM A(p, q) process with mean µ if {Xt −µ} is an ARM A(p, q) process. 588 Quantitative Analytics The Equation (C.2.4) can be written symbolically in the more compact form φ(B)Xt = θ(B)Zt , t = 0, ±1, ±2, .. (C.2.5) where φ and θ are the pth and qth degree polynomials φ(z) = 1 − φ1 z − ... − φp z p and θ(z) = 1 + θ1 z + ... + θq z q and B is the backward shift operator defined by B j Xt = Xt−j , t = 0, ±1, ±2, .. • If φ(z) = 1, then Xt = θ(B)Zt and the process is said to be a moving average process of order q (or M A(q)). The difference equation have the unique solution {Xt } which is a stationary process since for θ0 = 1 and θj = 0 for j > q we have E[Xt ] = q X θj E[Zt−j ] = 0 j=0 and γX (t + h, t) = Cov(Xt+h , Xt ) = Pq−|h| σ 2 j=0 θj θj+|h| if |h| ≤ q 0 if |h| > q • If θ(z) = 1 then φ(B)Xt = Zt and the process is said to be an autoregressive process of order p (or AR(p)) and the existence and uniqueness of a stationary solution to the above equation needs closer investigation. For example, in the case φ(z) = 1 − φ1 z we get Xt = Zt + φ1 Xt−1 and by successive recursion we get Xt = Zt + φ1 Zt−1 + ... + φk1 Zt−k + φk+1 Xt−k−1 1 If |φ1 | < 1 and {Xt } is stationary then ||Xt ||2 = E[Xt2 ] is constant so that ||Xt − k X ||Xt−k−1 ||2 → 0 as k → ∞ φj1 Zt−j ||2 = φ2k+2 1 j=0 and since P∞ j j=0 φ1 Zt−j is mean-square convergent (by the Cauchy criterion), we conclude that Xt = ∞ X φj1 Zt−j j=0 589 Quantitative Analytics which is only valid in the mean-square sense. Further, {Xt } is stationary since E[Xt ] = ∞ X φj1 E[Zt−j ] = 0 j=0 and Cov(Xt+h , Xt ) = n n X X lim E[( φj1 Zt+h−j )( φk1 Zt−k )] n→∞ j=0 |h| = σ 2 φ1 ∞ X φ2j 1 = j=0 k=0 |h| σ 2 φ1 (1 − φ21 ) and it is the unique stationary solution. An easier way to obtain these results is to multiply the AR(1) equation above by Xt−h and take the expected value, getting E[Xt Xt−h ] = E[Zt Xt−h ] + φ1 E[Xt−1 Xt−h ] thus γh = φ1 γh−1 , h = 1, 2, .. Similarly, squaring the AR(1) equation and taking the expected value, we get 2 2 E[Xt2 ] = E[Zt2 ] + φ21 E[Xt−1 ] + 2E[Zt φ1 Xt−1 ] = σ 2 + φ21 E[Xt−1 ] and so γ0 = σ2 . (1−φ21 ) In the case when |φ1 | > 1 the series does not converge in L2 , but we can rewrite it in the form −1 Xt = −φ−1 1 Zt+1 + φ1 Xt+1 which becomes −k−1 Xt = −φ−1 Zt+k+1 + φ1−k−1 Xt+k+1 1 Zt+1 − ... − φ1 and we get Xt = − ∞ X φ−j i Zt+j j=1 which is the unique stationary solution. However, it is regarded as unnatural since Xt is correlated with {Zs , s > t} which is not the case when |φ1 | < 1. If |φ1 | = 1 there is no stationary solution. Restricting attention to AR(1) processes with |φ1 | < 1, such processes are called causal or future-independent autoregressive processes. Given the causal AR(p) process defined as Xt = φ1 Xt−1 + ... + φp Xt−p + Zt the autocorrelation function can be found by multiplying the above equation by Xt−h taking the expected value and dividing by γ0 thus producing the Yule-Walker equations ρh = φ1 Xh−1 + ... + φp Xh−p + Zt , h = 1, 2, .. are linear recurrence relations, with general solution of the form 590 Quantitative Analytics |h| ρh = C1 w1 + ... + Cp wp|h| where w1 , ..., wp are the roots of wp − φ1 wp−1 − φ2 wp−2 − .. − φp = 0 and C1 , .., Cp are determined by ρ0 = 1 and the equations for h = 1, .., p − 1. It is natural to require γh → 0 as h → ∞, in which case the roots must lie inside the unit circle, that is |wi | < 1 restricting the chosen values φ1 , .., φp . Definition C.2.3 An ARM A(p, q) process defined P∞ by the equations φ(B)Xt = θ(B)Zt is said to be causal if there exists a sequence of constants {ψj } such that j=0 |ψj | < ∞ and Xt = ∞ X ψj Zt−j , t = 0, ±1, ... (C.2.6) j=0 Proposition 11 If {Xt } is any sequence of random variables such that supt E[|Xt |] < ∞ and if then the series ∞ X ψ(B)Xt = ψj B j Xt = j=−∞ ∞ X ψj Xt−j P∞ j=−∞ |ψj | < ∞ (C.2.7) j=−∞ converges absolutely with probability one. If in addition supt E[|Xt |2 ] < ∞ then the series converges in mean-square to the same limit. P∞ Proposition 12 If {Xt } is a stationary process with autocovariance function γ(.) and if j=−∞ |ψj | < ∞, then for each t ∈ Z the series in Equation (C.2.7) converges absolutely with probability one and in mean-square to the same limit. If Yt = ψ(B)Xt then the process {Yt } is stationary with autocovariance function γY (h) = ∞ X ψj ψk γ(h − j + k) j,k=−∞ P∞ P∞ j Note, operators such as ψ(B) = |ψj | < ∞, when applied to stationary processes j=−∞ ψj B with j=−∞ P P∞ ∞ inherit the algebriac properties of power series. In particular if j=−∞ |αj | < ∞, j=−∞ |βj | < ∞, α(z) = P∞ P∞ j j j=−∞ αj z < ∞, β(z) = j=−∞ βj z < ∞ and α(z)β(z) = ψ(z) , |z| ≤ 1 then α(z)β(z)Xt is well defined and α(z)β(z)Xt = β(B)α(B)Xt = ψ(B)Xt Definition C.2.4 Let {Xt } be an ARM A(p, q) process for which the polynomials φ(.) and θ(.) have no common zeroes. Then {Xt } is causal if and only if φ(z) 6= 0 for all z ∈ C such that |z| ≤ 1. The coefficients {ψj } in Equation (C.2.6) are determined by the relation ψ(z) = ∞ X ψj z j = j=0 591 θ(z) , |z| < 1 φ(z) Quantitative Analytics Note, ARM A process for which φ(.) and θ(.) have common zeroes are rarely considered. Further, if φ(.) and θ(.) have no common zeroes and if φ(z) = 0 for some z ∈ C with |z| = 1, then there is no stationary solution of φ(B)Xt = θ(B)Zt . Definition C.2.5 An ARM A(p, q) process defined P∞ by the equation φ(B)Xt = θ(B)Zt is said to be invertible if there exists a sequence of constants {πj } such that j=0 |πj | < ∞ and Zt = ∞ X πj Xt−j , t = 0, ±1, .. j=0 Theorem C.2.1 Let {Xt } be an ARM A(p, q) process for which the polynomials φ(.) and θ(.) have no common zeroes. Then {Xt } is invertible if and only if θ(z) 6= 0 for all z ∈ C such that |z| ≤ 1. The coefficients {πj } are determined by the relation π(z) = ∞ X πj z j = j=0 φ(z) , |z| ≤ 1 θ(z) Put simply, if {Xt } is a stationary solution of the equations φ(B)Xt = θ(B)Zt , {Zt } ∼ W N (0, σ 2 ) and if φ(z)θ(z) 6= 0 for |z| ≤ 1, then the power series coefficients of C(z) = give an expression for Xt as Xt = ∞ X θ(z) φ(z) = ψ(z) = P∞ j=0 ψj z j for |z| ≤ 1 ψj Zt−j j=0 But also, Zt = D(B)Xt where D(z) = unit circle and thus φ(z) θ(z) = P∞ j=0 πj z j for |z| ≤ 1 as long as the zeros of θ lie strictly outside the Zt = ∞ X πj Xt−j j=0 Hence, we will concentrate on causal invertible ARM A processes. The advantage of the representation above is that given (..., Xt−1 , Xt ) we can calculate values for (..., Zt−1 , Zt ) and so can forecast Xt+1 . In general, if we want to forecast Xt+h from (..., Xt−1 , Xt ) we use X̂t,h = ∞ X ψh+j Zt−j j=0 which has the least mean squared error over all linear combinations of (..., Zt−1 , Zt ). In fact, E[(X̂t,h − Xt+h )2 ] = σ 2 h−1 X ψj2 j=0 In practice, there is an alternative recursive approach. Define Xt+h if − (t − 1) ≤ h ≤ 0 X̂t,h = optimal predictor of Xt+h given X1 , .., Xt for 1 ≤ h then we have the recursive relation 592 Quantitative Analytics X̂t,h = p X φi X̂t,h−i + Ẑt+h + i=1 q X θj Ẑt+h−j j=1 For h = −(t − 1), −(t − 2), .., 0 it gives estimates of Ẑt for t = 1, .., n. For h > 0 it gives a forecast X̂t,h for Xt+h , and we take Ẑt = 0 for t > n. To start the recursion process, we need to know (Xt , t ≤ 0) and Zt for t ≤ 0. There are two standard approaches 1. Conditional approach: take Xt = Zt = 0 for t ≤ 0 2. Backcasting: we forecast the series in the reverse direction to determine estimators of X0 , X−1 , .. and Z0 , Z−1 , .. There are several ways to compute the autocovariance function of an ARMA process. The autocovariance function γ of the causal ARM A(p, q) process φ(B)Xt = θ(B)Zt satisfy γ(k) = σ 2 ∞ X ψj ψj+|k| j=0 where φ(z) = ∞ X ψj z j = j=0 θ(z) φ(z) and we want to determine the coefficients ψj . One way is based on the difference equations for γ(k) for k = 0, 1, 2, .. which are obtained by multiplying equation (C.2.5) by Xt−k and taking expectations X γ(k) − φ1 γ(k − 1) − ... − φp γ(k − p) = σ 2 θj ψj−k , 0 ≤ k < max (p, q + 1) (C.2.8) k≤j≤q and γ(k) − φ1 γ(k − 1) − ... − φp γ(k − p) = 0 , k ≥ max (p, q + 1) with general solution γ(h) = k rX i −1 X βij hj ξi−h , h ≥ max (p, q + 1) − p i=1 j=0 where the p constants βij and the covariance γ(j) for 0 ≤ j < max (p, q + 1) − p are uniquely determined from the boundary conditions above after first computing ψ0 , ψ1 , .., ψq . The autocovariance function of an M A(q) process Xt = q X θj Zt−j , {Zt } ∼ W N (0, σ 2 ) j=0 has the extremely simple form γ(k) = Pq σ 2 j=0 θj θj+|k| if |k| ≤ q 0 if |k| > q where θ0 is defined to be 1 and θj for j > q is defined to be zero. The autocovariance function of an AR(p) process 593 Quantitative Analytics φ(B)Xt = Zt has an autocovariance function of the form γ(h) = k rX i −1 X βij hj ξi−h , h ≥ 0 i=1 j=0 where ξi for i = 1, .., k are the zeroes (possibly complex) of φ(z), and ri is the multiplicity of ξi . The constants βij are found from Equation (C.2.8). Note, the numerical determination of the autocovariance function γ(.) from Equation (C.2.8) can be carried out by first finding γ(0), .., γ(p) from the equations with k = 0, 1, .., p and then using the subsequent equations to determine γ(p + 1), γ(p + 2), .. recursively. The partial autocorrelation function, like the autocorrelation function, conveys vital information regarding the dependence structure of a stationary process. Both functions depends only on the second order properties of the process. The partial autocorrelation α(k) at lag k may be regarded as the correlation between X1 and Xk+1 adjusted for the intervening observations X2 , .., Xk . Definition C.2.6 The partial autocorrelation function (pacf) α(.) of a stationary time series is defined by α(1) = Corr(X2 , X1 ) = ρ(1) and α(k) = Corr Xk+1 − Psp{1,X2 ,..,Xk } Xk+1 , X1 − Psp{1,X2 ,..,Xk } X1 , k ≥ 2 where Psp{1,X2 ,..,Xk } Xk+1 and Psp{1,X2 ,..,Xk } X1 are projections. The value α(k) is known as the partial autocorrelation at lag k. Note, the projection satisfies X̂k = E[Xk |X1 , ..., Xk−1 ] = Psp{X1 ,..,Xk−1 } Xk , k ≥ 2 It is thus the correlation of the two residuals obtained after regressing Xk+1 and X1 on the intermediate observations X2 , .., Xk . One can give an equivalent definition of partial autocorrelation function. Let {Xt } be a zero-mean stationary process with autocovariance function γ(.) such that γ(h) → 0 as h → ∞ and suppose that φj,k for j = 1, .., k and k = 1, 2, .. are the coefficients in the representation Psp{X1 ,..,Xk } Xk+1 = k X φj,k Xk+1−j j=1 together with the equations < Xk+1 − Psp{X1 ,..,Xk } Xk+1 , Xj >= 0 , j = k, .., 1 Identifying an AR(p) process Since the AR(p) process has ρ(h) decaying exponentially, it can be difficult to recognise in the correlogram. Suppose we have a process Xt which we believe is AR(k) with Xt = k X φj,k Xt−j + Zt j=1 594 Quantitative Analytics with Zt independent from X1 , .., Xt−1 . Given the data X1 , .., Xn , the least squares estimates of (φ1,k , .., φ1,k ) are obtained by minimising n k X 2 1 X Xt − φj,k Xt−j n j=1 t=k+1 which is approximately equivalent to solving equations similar to the Yule-Walker equations γ̂j = k X φ̂l,k γ̂|j−l| , j = 1, .., k l=1 It can be solved by the Levinson-Durbin recursion: 1. σ02 = γ̂0 , φ̂1,1 = γ̂1 γ̂0 , k=0 2. Repeat until φ̂k,k near 0 k =k+1 φ̂k,k = 1 2 σk−1 γ̂k − k−1 X φ̂j,k−1 γ̂k−j j=1 φ̂j,k = φ̂j,k−1 − φ̂k,k φ̂k−j,k−1 for j = 1, .., k − 1 2 σk2 = σk−1 (1 − φ̂2k,k ) The statistic φ̂k,k is called the kth sample partial autocorrelation coefficient (PACF). If the process Xt is genuinely AR(p) then the population PACF φ̂k,k is exactly zero for all k > p. Thus a diagnostic for AR(p) is that the sample PACFs are close to zero for k > p. Both the sample ACF and PACF are approximately normally distributed about their population values, and have standard deviation of about √1n where n is the length of the series. A rule of thumb is that ρ(h) (and similarly φk,k ) is negligible if ρ̂(h) (similarly φ̂k,k ) lies between ± √2n (2 is an approximation to 1.96). Care is needed in applying this rule of thumb as it is important to realise that the sample autocorrelations ρ̂(1), ρ̂(2), .. (and sample partial autocorrelations φ̂1,1 , φ̂1,1 , ..) are not independently distributed. The probability that any one ρ̂(h) should lie outside ± √2n depends on the values of the other ρ̂(h). If {Xt } is a stationary process with autocovariance function γ(.), then its autocovariance generating function is defined by G(z) = ∞ X γ(k)z k k=−∞ provided the series converges for all z in some annulus r−1 < |z| < r with r > 1. When the generating function is easy to calculate, the autocovariance at lag k may be determined by identifying the coefficient of either z k or z −k . Clearly {Xt } is white noise if and only if the autocovariance generating function G(z) is constant for all z. If Xt = ∞ X ψj Zt−j , {Zt } ∼ W N (0, σ 2 ) j=−∞ and there exists r > 1 such that 595 (C.2.9) Quantitative Analytics ∞ X |ψj |z j < ∞ , r−1 < |z| < r j=−∞ the generating function G(.) takes a simple form. We get γ(k) = Cov(Xt+k , Xt ) = σ 2 ∞ X ψj ψj+|k| j=−∞ so that the generating function becomes G(z) = σ2 = = ∞ X ∞ X ψj ψj+|k| z k k=−∞ j=−∞ ∞ ∞ X ∞ X X σ2 ψj2 + ψj ψj+k (z k j=−∞ k=1 j=−∞ ∞ ∞ X X σ2 ψj z j ψk z −k j=−∞ k=−∞ + z −k ) Defining ψ(z) = ∞ X ψj z j , |z| < r j=−∞ we can rewrite the generating function as G(z) = σ 2 ψ(z)ψ(z −1 ) , r−1 < |z| < r For example, given an ARM A(p, q) process φ(B)Xt = θ(B)Zt for which φ(z) 6= 0 when |z| = 1 can be written in the form in Equation (C.2.9) with ψ(z) = θ(z) −1 , r < |z| < r φ(z) for some r > 1. Hence, we get G(z) = σ 2 θ(z)θ(z −1 ) −1 , r < |z| < r φ(z)φ(z −1 ) When determining the appropriate ARM A(p, q) model to represent an observed stationary time series one must consider the choice of p and q, and estimate the remaining parameters like the mean, the coefficients {φi , θj : i = 1, .., p; j = 1, .., q} and the white noise variance σ 2 for given values of p and q. Goodness of fit of the model must also be checked and the estimation procedure repeated with different values of p and q. Final selection of the most appropriate model depends on a variety of goodness of fit tests such as the AICC statistic. We now assume that the data has been adjusted by subtraction of the mean, so that the problem becomes that of fitting a zero-mean ARMA model to the adjusted data x1 , .., xn . If the model fitted to the adjusted data is Xt − φ1 Xt−1 − ... − φp Xt−p = Zt + θ1 Zt−1 + .. + θq Zt−q , {Zt } ∼ W N (0, σ 2 ) then the corresponding model the original stationary series {Yt } is found by substituting Yj − y for Xj with Pfor n j = t, ..., t − p where y = n1 j=1 yj is the sample mean of the original data. 596 Quantitative Analytics In the case q = 0 a good estimate of φ can be obtained by the simple device of equating the sample and theoretical autocovariances at lags 0, 1, .., p called the Yule-Walker estimator. When q > 0 the corresponding procedure is neither simple nor efficient. One can use least squares or maximum likelihood estimators for solving non-linear optimisation problems. We assume that {Xt } is a Gaussian process with mean zero and covariance function κ(i, j) = E[Xi Xj ]. We consider Xn = (X1 , .., Xn )> and X̂n = (X̂1 , .., X̂n )> where X̂1 = 0 and X̂j = E[Xj |X1 , ..., Xj−1 ] = Psp{X1 ,..,Xj−1 } Xj , j ≥ 2 We let Γn be the covariance matrix Γn = E[Xn Xn> ] and assume that it is non-singular. The likelihood of Xn is 1 n > 1 −1 L(Γn ) = (2π)− 2 (detΓn )− 2 e− 2 Xn Γn Xn Note, the direct calculation of (detΓn ) and Γ−1 n can be avoided by re-expressing them in terms of the one-step predictors X̂j and their mean-squared errors vj−1 for j = 1, ..., n which are computed recursively from the innovations algorithm. We let θij for j = 1, .., i and i = 1, 2, .. denote the coefficients obtained when applying the innovations algorithm to the covariance function κ of {Xt } with θi0 = 1, θij = 0 for j < 0 and i = 0, 1, 2, ... We define the (n × n) lower triangular matrix C = [θi,i−j ]n−1 i,j=0 and the (n × n) diagonal matrix D = diag(v0 , v1 , .., vn−1 ) so that the innovations representation of X̂j for j = 1, ..., n can be written in the form X̂n = (C − I)(Xn − X̂n ) where I is the (n × n) identity matrix. Hence, we get Xn = Xn − X̂n + X̂n = C(Xn − X̂n ) Since D is the covariance matrix of (Xn − X̂n ) we get Γn = CDC > from which the Cholesky factorisation Γn = U U > with U lower triangular can be deduced. Hence, combining the above terms we get > −1 Xn> Γ−1 (Xn − X̂n ) = n Xn = (Xn − X̂n ) D n X 1 j=1 vj−1 (Xj − X̂j )2 and detΓn = (detC)2 (detD) = v0 v1 ..vn−1 so that the likelihood of the vector Xn simplifies to 1 n L(Γn ) = (2π)− 2 (v0 v1 ..vn−1 )− 2 e − 21 Pn 1 j=1 vj−1 (Xj −X̂j )2 (C.2.10) where from the covariance κ we get X̂1 , X̂2 , .., v0 , v1 , ... and hence L(Γn ). If Γn can be expressed in terms of a finite number of unknown parameters β1 , .., βr as it is the case when {Xt } is an ARM A(p, q) process and r = p+q +1, it is necessary to estimate the parameters from the data Xn . In this situation, one maximise the likelihood L(β1 , .., βr ) with respect to β1 , .., βr . Hence, a natural estimation procedure for Gaussian processes is to maximise the above likelihood with respect to β1 , .., βr . Even if {Xt } is not Gaussian we can still regard the above likelihood as a measure of the 597 Quantitative Analytics goodness of fit of the covariance matrix Γn (β1 , .., βr ) to the data and choose β1 , .., βr to maximise the likelihood. As a result, the estimators β̂1 , .., β̂r are called the maximum likelihood estimators. We consider that {Xt } is a causal ARM A(p, q) process with Equation (C.2.4) where θ0 = 1 and assume that the coefficients θi and white noise variance σ 2 have been adjusted to ensure that θ(z) = 1 + θ1 z + ... + θq z q 6= 0 for |z| < 1. We know that the one-step predictors X̂i+1 and their mean-squared errors are given by X̂i+1 = i X θij (Xi+1−j − X̂i+1−j ) , 1 ≤ i < m = max (p, q) j=1 X̂i+1 = φ1 Xi + .. + φp Xi+1−p + q X θij (Xi+1−j − X̂i+1−j ) , i ≥ m j=1 and E[(Xi+1 − X̂i+1 )2 ] = σ 2 ri where θij and ri are estimated from the covariance function and are independent of σ 2 . Plugging back in Equation (C.2.10) the Gaussian likelihood of the vector Xn is 1 n L(φ, θ, σ 2 ) = (2πσ 2 )− 2 (r0 r1 ..rn−1 )− 2 e − 2σ12 Pn 1 j=1 rj−1 (Xj −X̂j )2 (C.2.11) Differentiating ln L(φ, θ, σ 2 ) partially with respect to σ 2 and noting that X̂j and rj are independent of σ 2 we deduce that the maximum likelihood estimators φ̂, θ̂ and σ̂ 2 satisfy σ̂ 2 = 1 S(φ̂, θ̂) n where S(φ̂, θ̂) = n X 1 (Xj − X̂j )2 r j−1 j=1 and φ̂, θ̂ are the values of φ, θ minimising n l(φ, θ) = ln 1X 1 S(φ, θ) + ln rj−1 n n j=1 where l(φ, θ) is the reduced likelihood. One can use a non-linear minimisation program in conjunction with the innovations algorithm to search for the value of φ and θ minimising l(φ, θ). The search procedure can be greatly accelerated by choosing initial values φ0 and θ0 close to the minimum of l. Further, it is essential to start the search with a causal parameter φ0 as the causality is assumed in the computation of l(φ, θ). An alternative estimation procedure is to minimise the weighted sum of squares S(φ, θ) = n X 1 (Xj − X̂j )2 r j−1 j=1 with respect to φ and θ. The estimators φ̃ and θ̃ of φ and θ are called the least-squares estimators. For the minimisation of S(φ, θ) it is necessary to restrict φ to be causal, but also to restrict θ to be invertible as otherwise there will be no 2 finite (φ, θ) at which S achieves its minimum value. The least-squares estimator σ̃LS is given by 598 Quantitative Analytics 2 σ̃LS = where (n − p − q) is used since freedom. C.3 1 σ 2 S(φ̃, θ̃) 1 S(φ̃, θ̃) n−p−q is distributed approximately as chi-square with (n − p − q) degrees of Fitting ARIMA models When selecting an appropriate model for a given set of observations {Xt , t = 1, .., n} if the data 1. exhibits no apparent deviations from stationarity 2. has a rapidly decreasing autocorrelation function we shall seek a suitable ARMA process to represent the mean-corrected data. If not, we shall first look for a transformation of the data which generates a new series with the above properties. This can be achieved by differencing and hence considering the class of ARIMA (autoregressive integrated moving average) processes. Once the data has been suitably transformed, the problem becomes one of finding a satisfactory ARM A(p, q) model and choosing p and q. Among the various criterions for model selection, a general criterion for model selection is the information criterion of Akaike [1973] known as the AIC. It was designed to be an approximately unbiased estimate of the Kullback-Leibler index of the fitted model relative to the true model. Later, Hurvich and Tsai [1989] proposed a bias-corrected version of the AIC called AICC. According to this criterion we compute maximum likelihood estimators of φ, θ and σ 2 for a variety of competing p and q values and choose the fitted model with smallest AICC values. If the fitted model is satisfactory, the residuals should resemble white noise. The ARIMA models incorporate a wide range of non-stationary series which after differencing finitely many times reduce to ARMA processes. For instance, if the original process {Xt } is not stationary, we can look at the first order difference process Yt = ∇Xt = Xt − Xt−1 or the second order differences Yt = ∇2 Xt = ∇(∇X)t = Xt − 2Xt−1 + Xt−2 and so on. When the differenced process is a stationary process we can look for a ARMA model. The process {Xt } is said to be an autoregressive integrated moving average process ARIM A(p, d, q) if Yt = ∇d Xt is ARM A(p, q) process. Definition C.3.1 (The ARIM A(p, d, q) process) If d is a non-negative integer, then {Xt } is said to be an ARIM A(p, d, q) process if Yt = (1 − B)d Xt is a causal ARM A(p, q) process. This means that {Xt } satisfies a difference equation of the form φ(B)∇(B)d Xt = θ(B)Zt , {Zt } ∼ W N (0, σ 2 ) where ∇B = I − B, or alternatively φ∗ (B)Xt = φ(B)(1 − B)d Xt = θ(B)Zt , {Zt } ∼ W N (0, σ 2 ) where φ(z) and θ(z) are polynomials of degrees p and q respectively and φ(z) 6= 0 for |z| ≤ 1. The polynomial φ∗ (z) has a zero of order d at z = 1. The process {Xt } is stationary if and only if d = 0. Note, if d ≥ 1 we can add an 599 Quantitative Analytics arbitrary polynomial trend of degree (d − 1) to {Xt } without violating the above equation so that ARIMA can be used to represent data with trend. For example, {Xt } is an ARIM A(1, 1, 0) process if for some φ ∈ (−1, 1) (1 − φB)(1 − B)Xt = Zt , {Zt } ∼ W N (0, σ 2 ) we can write Xt = X0 + t X Yj , t ≥ 1 j=1 where Yt = (1 − B)Xt = ∞ X φj Zt−j j=0 The Box-Jenkins procedure is concerned with fitting an ARIMA model to data. It has three parts: identification, estimation, and verification. As part of the identification process, the data may require pre-processing to make it stationary. To achieve stationarity we may do any of the following • Re-scale it (for instance, by a logarithmic or exponential transform.) • Remove deterministic components. • Difference it, by taking ∇(B)d X until stationary. In practice d = 1, 2 should suffice. We recognise stationarity by the observation that the autocorrelations decay to zero exponentially fast. Once the series is stationary, we can try to fit an ARM A(p, q) model. An ARM A(p, q) process has kth order sample ACF and PACF decaying geometrically for k > max (p, q). We assume that the ARIMA models have been differenced finitely many times and reduce to ARMA processes. Let {Xt } denote the mean-corrected transformed series, we want to find the most satisfactory ARM A(p, q) model to represent {Xt } by identifying appropriate values for p and q. Even though it might appear that the higher the values of p and q chosen, the better the fitted model will be, we must be aware of the danger of overfitting (tailoring the fit too closely to the particular numbers observed). Akaike’s AIC criterion and Parzen’s CAT criterion attempt to prevent overfitting by effectively assigning a cost to the introduction of each additional parameter. We consider a bias-corrected form of the AIC defined for an ARM A(p, q) model with coefficient vectors φ and θ, by AICC(φ, θ) = −2 ln L(φ, θ, 2(p + q + 1)n 1 S(φ, θ)) + n (n − p − q − 2) 2(p+q+1)n as a penalty and the model selected is the one which minimises the value of the AICC. One can think of (n−p−q−2) term to discourage over-parametrisation. Once a model has been found which minimises the AICC value, it must then be checked for goodness of fit by checking that the residuals are like white noise. Note, the search for a model minimising the AICC can be very lengthy without some idea of the class of models to be explored. A variety of techniques can be used to accelerate the search by considering preliminary estimates of p and q based on sample autocorrelation and partial autocorrelation functions. The identification of a pure autoregressive or moving average process is reasonably straightforward using the sample autocorrelation and partial autocorrelation functions and the AICC. However, for ARM A(p, q) processes with p and q both non-zero, the sample ACF and PACF are much more difficult to interpret. We can directly search for values p and q such that the AICC is minimum. The search can be carried out in a variety of ways: by trying all (p, q) values such that p + q = 1, then p + q = 2 etc., or by using the following steps 600 Quantitative Analytics 1. use maximum likelihood estimation to fit ARMA processes of orders (1, 1), (2, 2), .., to the data, selecting the model which gives smallest value of the AICC. 2. starting from the minimum AICC ARM A(p, q) model, eliminate one or more coefficients (guided by the standard errors of the estimated coefficients), maximise the likelihood for each reduced model and compute the AICC value. 3. select the model with smallest AICC value (subject to its passing the goodness of fit tests) When an ARMA model is fitted to a given series, an essential part of the procedure is to examine the residuals, which should resemble white noise for the model to be satisfactory. If the autocorrelations and partial autocorrelations of the residuals suggest that they come from some other identifiable process, then this more complicated model for the residuals can be used to suggest a more appropriate model for the original data. For instance, if the residuals appear to come from an ARMA process with coefficient vectors φZ and θZ it indicates that {Zt } in our fitted model should satisfy φZ (B)Zt = θZ (B)Wt where {Wt } is white noise. Applying the operator φZ (B) to each side of the equation defining {Xt } we obtain φZ (B)φ(B)Xt = φZ (B)θ(B)Zt = θZ (B)θ(B)Wt where {Wt } is white noise. The modified model for {Xt } is thus an ARMA process with autoregressive and moving operators φZ (B)φ(B) and θZ (B)θ(B) respectively. The Akaike Information Criterion, AIC (Akaike [1973]), and a bias-corrected version, AICC (Sugiura, 1978; Hurvich and Tsai [1989]) are two methods for selection of regression and autoregressive models. Both criteria may be viewed as estimators of the expected Kullback-Leibler information. The main idea is that we want to fit a model with parametrised likelihood function f (X|θ) for θ ∈ Θ, and this includes the true model for some θ0 ∈ Θ. Let X = (X1 , .., Xn ) be a vector of n independent samples and let θ̂(X) be the maximum likelihood estimator of θ. Suppose Y is a further independent sample. Then 1 −2nEY EX [log f (Y |θ̂(X))] = −2EX [log f (X|θ̂(X))] + 2k + o( √ ) n where k = |Θ|. The left hand side is 2n times the conditional entropy of Y given θ̂(X), that is, the average number of bits required to specify Y given θ̂(X). The right hand side is approximately the AIC and this is to be minimised over a set of models, say (f1 , Θ1 ), .., (fm , Θm ). Generally, we use the maximum likelihood estimators, or least squares numerical approximations to the MLEs. The essential idea is prediction error decomposition. We can factorise the joint density of (X1 , .., Xn ) as f (X1 , .., Xn ) = f (X1 ) n Y f (Xt |X1 , .., Xt−1 ) t=2 Suppose f (Xt |X1 , .., Xt−1 ) the conditional distribution of Xt given (X1 , .., Xt−1 ) is normal with mean X̂t and variance Pt−1 , and suppose also that X1 is normal N (X̂1 , P0 ). Here X̂t and Pt−1 are functions of the unknown parameters φ1 , .., φp , θ1 , .., θq and the data. The log likelihood is −2 log L = −2 log f = n X log 2π + log Pt−1 + t=1 601 (Xt − X̂t )2 Pt−1 Quantitative Analytics We can minimise this equation with respect to φ1 , .., φp , θ1 , .., θq to fit the ARM A(p, q) model. Additionally, the second derivative matrix of − log L (at the MLE) is the observed information matrix, whose inverse is an approximation to the variance-covariance matrix of the estimators. More formally, if X is an n-dimensional random vector whose probability density belongs to the family {f (.; ψ), ψ ∈ Ψ}, the Kullback-Leibler discrepancy between f (.; ψ) and f (.; θ) is defined as d(ψ|θ) = ∆(ψ|θ) − ∆(θ|θ) where ∆(ψ|θ) = E θ [−2 ln f (X; ψ)] = Z −2 ln (f (x; ψ))f (x; θ)dx Rn is the Kullback-Leibler index of f (.; ψ) relative to f (.; θ). Applying Jensen’s inequality, we get Z d(ψ|θ) f (x; ψ) )f (x; θ)dx −2 ln ( f (x; θ) Z f (x; ψ) −2 ln f (x; θ)dx f (x; θ) n ZR −2 ln f (x; ψ)dx = 0 = Rn ≥ = Rn with equality holding if and only if f (x; ψ) = f (x; θ) a.e.. Given observations X1 , .., Xn of an ARMA process with unknown parameters θ = (β, σ 2 ) one could identify the true model if it were possible to compute the KullbackLeibler discrepancy between all candidate models and the true model. Instead, one must estimate the Kullback-Leibler discrepancies and choose the model whose estimated discrepancy is minimum. To do so, we can assume that the true model and the alternatives are all Gaussian. Then, for any given θ = (β, σ 2 ), f (x; θ) is the probability density of (Y1 , .., Yn )> where {Yt } is a Gaussian ARM A(p, q) process with coefficient vector β and white noise variance σ 2 . Assume that our observations X1 , .., Xn are from a Gaussian ARMA process with parameter vector θ = (β, σ 2 ) and assume that the true order is (p, q). Let θ̂ = (β̂, σ̂ 2 ) be the maximum likelihood estimator of θ based on X1 , .., Xn and let Y1 , .., Yn be an independent realisation of the true process (with parameter θ), then −2 ln LY (β̂, σ̂ 2 ) = −2 ln LX (β̂, σ̂ 2 ) + 1 SY (β̂) − n σ̂ 2 so that E θ [∆(θ̂|θ)] 2 = E β,σ [−2 ln LY (β̂, σ̂ 2 )] 2 2 = E β,σ [−2 ln LX (β̂, σ̂ 2 )] + E β,σ [ 1 SY (β̂)] − n σ̂ 2 Making some local linearity approximation, we get 2 E β,σ [ 1 2(p + q + 1)n SY (β̂)] − n ≈ σ̂ 2 (n − p − q − 2) Thus the quantity −2 ln LX (β̂, σ̂ 2 ) + 2(p + q + 1)n (n − p − q − 2) 602 Quantitative Analytics is an approximately unbiased estimate of the expected Kullback-Leibler index E θ [∆(θ̂|θ)]. Since these calculations are based on the assumption that the true order is (p, q), we select the values of p and q for the fitted model to be those minimising AICC(β̂) where AICC(β) = −2 ln LX (β, 1 2(p + q + 1)n SX (β)) + n (n − p − q − 2) The AIC statistic, defined as AIC(β) = −2 ln LX (β, 1 SX (β)) + 2(p + q + 1) n can be used in the same way. Note, both statistics are minimised for any given β by setting σ 2 = n1 SX (β). Further, 2(p+q+1)n the penalty factors (n−p−q−2) and 2(p + q + 1) are asymptotically equivalent as n → ∞. However, the AICC statistic has a more extreme penalty for large-order models which counteracts the overfitting tendency of the AIC. Hurvich and Tsai [1991] considered both normal linear regression and autoregressive candidate models. They showed that the bias of AICC is typically smaller, often dramatically smaller, than that of AIC. A simulation study in which the true model is an infinite-order autoregression shows that, even in moderate sample sizes, AICC provides substantially better model selections than AIC. The third stage in the Box-Jenkins algorithm is to check whether the model fits the data. There are several tools we may use • Overfitting. Add extra parameters to the model and use likelihood ratio test or t-test to check that they are not significant. • Residuals analysis. Calculate the residuals from the model and plot them. The autocorrelation functions, ACFs, PACFs, spectral densities, estimates, etc., and confirm that they are consistent with white noise. The goodness of fit of a statistical model to a set of data is judged by comparing the observed values with the corresponding predicted values obtained from the fitted model. If the fitted model is appropriate, then the residuals should behave in a consistent manner with the model. In the case of an ARM A(p, q) model with estimators φ̂, θ̂, and σ̂ 2 we let the predicted values X̂t (φ̂, θ̂) of Xt based on X1 , .., Xt−1 be computed for the fitted model. The residuals are given by Ŵt = (Xt − X̂t (φ̂, θ̂)) q , t = 1, .., n rt−1 (φ̂, θ̂) In the case where the maximum likelihood ARM A(p, q) model is the true process generating {Xt }, then {Ŵt } ∼ W N (0, σ̂ 2 ). But, since we assume that X1 , .., Xn is generated by an ARM A(p, q) process with unknown parameters φ, θ, and σ 2 with maximum likelihood estimators φ̂, θ̂, and σ̂ 2 then {Ŵt } is not a true white noise process. Nonetheless, Ŵt for t = 1, .., n should have properties similar to those of the white noise sequence Wt (φ, θ) = (Xt − X̂t (φ, θ)) p , t = 1, .., n rt−1 (φ, θ) As E[(Wt (φ, θ) − Zt )2 ] is small for large t, so that the properties of the residuals {Ŵt } should reflect those of the white noise sequence {Zt } generating the underlying ARM A(p, q) process. The next step is to check that the sample autocorrelation function of Ŵ1 , .., Ŵn behaves as it should under the assumption that the fitted model is appropriate. The sample autocorrelation function of an iid sequence Z1 , .., Zn with E[Zt2 ] < ∞ are for large n approximately iid with distribution N (0, n1 ). Therefore, assuming that we have fitted an 603 Quantitative Analytics appropriate ARMA model to our data and that the ARMA model is generated by an iid white noise sequence, the same approximation should be valid for the sample autocorrelation function of Ŵt for t = 1, .., n defined by Pn−h ρ̂W (h) = t=1 (Ŵt − W )(Ŵt+h − W ) , h = 1, 2, .. Pn 2 t=1 (Ŵt − W ) Pn where W = n1 t=1 Ŵt . However, since each Ŵt is a function of the maximum likelihood estimator (hatφ, θ̂) then Ŵ1 , .., Ŵn is not an iid sequence and the distribution of ρ̂W (h) is not the same as in the iid case. In fact ρ̂W (h) has an asymptotic variance which for small lags is less than n1 and which for large lags is close to n1 . If {Xt } is a causal invertible ARMA process, assuming h ≥ p + q we set Th = [ai−j ]1≤i≤h,1≤j≤p+q and Γ̃p+q = [ ∞ X ak ak+|i−j| ]p+q i,j=1 k=0 and Q = Th 1 Th> = [qij ]hi,j=1 Γ̃p+q The matrix Γ̃p+q is the covariance matrix of (Y1 , .., Yp+q ) where {Yt } is an AR(p + q) process. It can be shown that 1 (Ih − Q)) n where Ih is the h × h identity matrix. The asymptotic variance of ρ̂W (i) is thus ρ̂W is AN (0, 1 (1 − qii ) n Instead of checking to see if each ρ̂W (i) falls within the confidence bounds 1 p 1 − qii ±1.96 √ n it is possible to consider a single statistic which depends on ρ̂W (i) for 1 ≤ i ≤ h. To do so, we assume that h depends on the sample size n in such way that • hn → ∞ as n → ∞ • ψj = o( √1n ) for j ≥ hn where ψj for j = 0, 1, .. are the coefficients in the expansion Xt = P∞ j=0 ψj Zt−j √ • hn = o( n) Then as hn → ∞ the matrix Γ̃p+q may be approximated by Th> Th and the matrix Q may be approximated by the projection matrix Th 1 T> Th> Th h which has rank p + q. Hence the distribution of 604 Quantitative Analytics QW = nρ̂> W ρ̂W = n h X ρ̂2W (j) j=1 is approximately chi-squared with h − (p + q) degrees of freedom. The adequacy of the model is therefore rejected at level α if QW > χ21−α (h − p − q) Examination of the squared residuals may often suggest departures of the data from the fitted model which could not otherwise be detected from the residuals themselves. We can test the squared residuals for correlation by letting 2 Pn−h 2 2 −W ) (Ŵt2 − W )(Ŵt+h ,h≥1 ρ̂W W (h) = Pn 2 2 t=1 (Ŵt − W ) Pn 2 be the sample autocorrelation function of the squared residuals where W = n1 t=1 Ŵt2 . Then McLeod and Li (1983) showed that t=1 Q̃W W = n(n + 2) h X j=1 1 ρ̂2 (j) n − j WW 2 has an approximate χ (h) distribution under the assumption of model adequacy. As a result, the adequacy of the model is rejected at level α if Q̃W W > χ21−α (h) In practice, portmanteau tests are more useful for disqualifying unsatisfactory models from consideration than for selecting the best-fitting model among closely competing candidates. There are a number of other tests available for checking the hypothesis of randomness of {Ŵt }, that is, the hypothesis that it is an iid sequence. One can consider a test based on turning points, the difference-sign test, or the rank test (see Kendall and Stuart [1976]). Checking for normality If it can be assumed that the white noise process {Zt } generating an ARM A(p, q) process is Gaussian, then stronger conclusion can be drawn from the fitted model. One can specify an estimated mean squared error for predicted values, and asymptotic prediction confidence bounds can also be computed. So, let Y(1) < Y(2) < ... < Y(n) be the order statistics of a random sample Y1 , .., Yn from the distribution N (µ, σ 2 ). If X(1) < X(2) < ... < X(n) are the order statistics from a N (0, 1) sample size n, then E[Y(j) ] = µ + σmj where mj = E[X(j) ] for j = 1, .., n. Thus, a plot of the points (m1 , Y(1) ), .., (mn , Y(n) ) should be approximately linear. This is not the case if the sample values Yi are not normally distributed. As a result, the squared correlation of the points (mi , Y(i) ) for i = 1, .., n should be near one if the normal assumption is correct. The assumption of normality is therefore rejected if the squared correlation R2 is sufficiently small. If we approximate mi by Φ−1 ( i−0.5 n ) then R2 reduces to 2 − Y )Φ−1 ( i−0.5 n ) R = Pn Pn 2 −1 ( i−0.5 ))2 i=1 (Y(i) − Y ) i=1 (Φ n 2 where Y = 1 n Pn i=1 Pn i=1 (Y(i) Yi . 605 Quantitative Analytics C.4 State space models A state space model is defined by a measurement equation postulating the relationship between an observable vector and a state vector, and a transition equation describing the generating process of the state variables. State space models are an alternative formulation of time series with a number of advantages for forecasting. 1. All ARMA models can be written as state space models. 2. Nonstationary models (e.g., ARMA with time varying coefficients) are also state space models. 3. Multivariate time series can be handled more easily. 4. State space models are consistent with Bayesian methods. In general, the model consists of Xt = Ft St + vt observed data (C.4.12) St = Gt St−1 + wt unobserved state vt ∼ N (0, Vt ) observation noise wt ∼ N (0, Wt ) state noise where Xt is a (n, 1) vector of time series, and the state vector St is made of (m, 1) state variables. Further, vt , wt are independent and Ft , Gt are known matrices, often time dependent because of seasonality, of dimension (n, m) and (m, m). Example 1 Xt = St + vt St = φSt−1 + wt Define Yt = Xt − φXt−1 = (St + vt ) − φ(St−1 + vt−1 ) = wt + vt − φvt−1 The autocorrelations of {yt } are zero at all lags greater than 1. So, {Yt } is M A(1) and thus {Xt } is ARM A(1, 1). Example 2 The general ARM A(p, q) model Xt = p X φr Xt−r + r=1 q X θs t−s s=1 is a state space model. We write Xt = Ft St where Ft = (φ1 , .., φp , 1, θ1 , .., θq ) and St = (Xt−1 , .., Xt−p , t , ..., t−q )> ∈ Rp+q+1 with vt = 0, Vt = 0. 606 Quantitative Analytics The Kalman filter (see Kalman [1960]) Given observed data X1 , ..., Xt we want to find the conditional distribution of St and a forecast of Xt+1 . Recall the following multivariate normal fact: If Y1 µ1 A11 A12 Y = ∼N , Y2 µ2 A21 A22 then −1 (Y1 |Y2 ) = N µ1 + A12 A−1 22 (Y2 − µ2 ), A11 − A12 A22 A21 Conversely, if (Y1 |Y2 ) satisfies the above equation, and Y2 ∼ N (µ2 , A22 ) then the joint distribution is as above. Now let Ft−1 = (X1 , .., Xt−1 ) and suppose we know that (St−1 |Ft−1 ) ∼ N (Ŝt−1 , Pt−1 ). That is, Ŝt−1 = Et−1 [St−1 ] and Pt−1 = Et−1 [(Ŝt−1 − St−1 )(Ŝt−1 − St−1 )> ] is the covariance matrix. Then, given the dynamics of the state vector St = Gt St−1 + wt we get (St |Ft−1 ) ∼ N (Gt Ŝt−1 , Gt Pt−1 G> t + Wt ) where Ŝt|t−1 = Et−1 [St ] = Gt Ŝt−1 and Pt|t−1 = Et−1 [(Ŝt|t−1 − St )(Ŝt|t−1 − St )> ] = Gt Pt−1 G> t + Wt is the covariance matrix. See the invariance of the covariance of multivariate normal distribution under linear changes of variables in Theorem (B.7.2). Note, we also have (Xt |St , Ft−1 ) ∼ N (Ft St , Vt ). We put Y1 = Xt and Y2 = St and let Rt = Pt|t−1 = Gt Pt−1 G> t + Wt be the covariance matrix of (St |Ft−1 ). Taking all variables conditional on Ft−1 we can use the converse of the multivariate normal fact and identify µ2 = Gt Ŝt−1 and A22 = Rt Since St is a random variable, we get µ1 + A12 A−1 22 (St − µ2 ) = Ft St → A12 = Ft Rt and µ1 = Ft µ2 Also, −1 > > > A11 − A12 A−1 22 A21 = Vt → A11 = Vt + Ft Rt Rt Rt Ft = Vt + Ft Rt Ft which says that Xt St |Ft−1 = N Ft Gt Ŝt−1 Gt Ŝt−1 , Vt + Ft Rt Ft> Rt> Ft> Ft Rt Rt Since Xt|t−1 = Et−1 [Xt ] = Ft Gt Ŝt−1 , we can define It = Xt − Xt|t−1 to be the innovation process representing the observed error in forecasting Xt with covariance matrix Itc = (Vt + Ft Rt Ft> ). Now we can apply the multivariate normal fact directly to get (St |Xt , Ft−1 ) = (St |Ft ) ∼ N (Ŝt , Pt ) where Ŝt = Gt Ŝt−1 + Rt Ft> (Vt + Ft Rt Ft> )−1 (Xt − Ft Gt Ŝt−1 ) = Ŝt|t−1 + Rt Ft> (Itc )−1 It Pt = Rt − Rt Ft> (Vt + Ft Rt Ft> )−1 Ft Rt = Im − Rt Ft> (Itc )−1 Ft Rt with Pt = Et [(Ŝt − St )(Ŝt − St )> ] is the covariance matrix of (St |Ft ). This system of equation is the Kalman filter updating equations or the innovation representation (see Harvey [1989]). The form of the right hand side of the expression for Ŝt contains the term Gt Ŝt−1 , which is simply what we would predict if it were known that St−1 = Ŝt−1 607 Quantitative Analytics plus a term that depends on the observed error in forecasting Xt , that is, the innovation process It . This is similar to the forecast updating expression for simple exponential smoothing (). All we need to start updating the estimates are the initial values Ŝ0 and P0 . Three ways are commonly used 1. Use a Bayesian prior distribution. 2. If F,G, V,W are independent of t the process is stationary. We could use the stationary distribution of S to start. 3. Choosing S0 = 0, P0 = kI (k large) reflects prior ignorance. Prediction Suppose we want to predict the term XT +k = XT +k|T given (X1 , .., XT ). We already have (XT +1 |X1 , .., XT ) ∼ N (FT +1 GT +1 St , VT +1 + FT +1 RT +1 FT>+1 ) which solves the problem for the case k = 1. By induction, Harvey [1989] showed that ST +k = ST +k|T satisfies (ST +k |X1 , .., XT ) ∼ N (ŜT +k , PT +k ) where ŜT,0 = ŜT PT,0 = PT ŜT,k = GT +k ŜT,k−1 PT,k = GT +k PT,k−1 G> T +k + WT +k and hence we obtain (XT +k |X1 , .., XT ) ∼ N (FT +k ŜT,k , VT +k + FT +k PT,k FT>+k ) C.5 ARCH and GARCH models C.5.1 The ARCH process Volatility clustering has long been a salient feature of series generated from financial data. However, only recently did researchers in finance recognise the importance of explicitly modelling time varying second-order moments. One of the most important and widely used approach is that of the Autoregressive Conditional Heteroskedastic (ARCH) model introduced by Engle [1982]. Following his seminal paper we define a zero mean ARCH(p) process {Xt } by 1 Xt = t ht2 , t ∼ N (0, 1) and ht = α0 + p X 2 αi Xt−i i=1 The above equations imply that Xt ∼ N (0, ht ) and that Xt = α0 + p X i=1 608 2 αi Xt−i 21 t Quantitative Analytics A logic extension is to replace Xt by Xt − µ for all time t to get an ARCH(p) process having a constant mean E[Xt ] = µ. That is Xt − µ = α0 + p X 2 αi Xt−i 12 t i=1 The attractiveness of the ARCH model for financial data is that it captures the tendency for volatility clustering. That is, large (small) changes tend to be followed by large (small) changes but of unpredictable sign. For instance, consider the non-zero mean ARCH(1) process Xt − µ = α0 + α1 (Xt−1 − µ)2 12 t with t ∼ N (0, 1). Then V ar(Xt |Xt−1 ) = α0 + α1 (Xt−1 − µ)2 Hence, large deviation of Xt−1 from the mean µ cause a large variance for the next time period. Conditioning on the immediate past, the process becomes heteroskedastic. Providing α1 < 1, the process is stationary with finite α0 unconditional variance given by 1−α . If 3α12 < 1 then the fourth moment is finite and the kurtosis kx is given by 1 kx = 3(1 − α12 ) 1 − 3α12 Hence, we see that the kurtosis for an ARCH(1) process exceed 3 for all α1 > 0 which is consistent with financial data. C.5.2 The GARCH process In empirical applications of the ARCH model, a relatively long lag in the conditional variance equation is often called for. In light of this, Bollerslev extended the ARCH class of models to allow for a longer memory and flexible lag structure. The Generalised Autoregressive Conditional Heteroskedastic (GARCH) model is defined as 1 Xt = ht2 t where ht = α0 + p X i=1 and p ≥ 0 , q > 0 , α0 > 0 , αi ≥ 0 , βj ≥ 0 In the ARCH(p) process the conditional variance is specified as a linear function of past sample variances only, whereas the GARCH(p, q) process allows lagged conditional variances to enter as well. Bollerslev [1986] states that it corresponds to some sort of adaptive learning mechanism. For the GARCH(1, 1) model, under second order stationarity, the unconditional variance is equal to 1−(αα10+β1 ) . It can be shown that for the GARCH(1, 1) model, the {Xt } are uncorrelated and the squared process is correlated, making it particularly attractive to the closing price series. 609 Quantitative Analytics C.5.3 Estimating model parameters We are now considering the method used to estimate the model parameters and limit our analysis to the ARCH(p) process. The development of estimation methods for the GARCH(p, q) model being similar. In order to estimate the parameters of the ARCH(p) model we employ maximum likelihood estimation seeking the parameter values which maximise the log-likelihood function. For the zero-mean ARCH(p) process we let L be the overall likelihood, Li be the conditional log-likelihood of the i-th observation and N be the sample size. Then we get L= N X Lti i=1 and X2 1 Lti = − log hti − ti 2 2hti ignoring constants. The log-likelihood function is nonlinear and Fisher scoring is used to obtain the maximum likelihood estimates (see Engle [1982]). In general the maximum likelihood estimation is performed with several constraints imposed upon the parameters to protect against numerical problems from negative, zero, or infinite variances. For instance, in the GARCH(1, 1) model, under second order stationarity, it has unconditional variance equal to α0 1−(α1 +β1 ) so that we require α1 + β1 < 1. Estimating parameters by maximising the Gaussian likelihood yields consistent estimates when the errors are not Gaussian distributed, provided that they are i.i.d.. C.6 The linear equation C.6.1 Solving linear equation Following Karatzas & Shreve [1997], we consider the linear SDE dXt = K0 (t) + K1 (t)Xt dt + ΣX (t)dWt with X0 = ξ where Xt ∈ Rn , K0 ∈ Rn and K1 ∈ Rn×n with the corresponding deterministic differential equation Q̇(t) = K0 (t) + K1 (t)Q(t) with Q0 = Q n where Qt ∈ R . It has the associated homogeneous equation Q̇(t) = K1 (t)Q(t) where standard calculus guarantee a unique, absolutely continuous solution to this initial value problem. In the special case where the matrix K1 (t) is constant, the solution to the linear system is Q(t) = eK1 t Q(0) Moler et al. [2003] showed that there are many different ways to compute the exponential of a matrix and tried to classify them according to some criterions such as accuracy and efficiency. We are now going to use Qt as an integrating factor to solve for Xt . We first take its inverse Q−1 (t) and differentiate it with respect to time t, getting dQ−1 (t) dQ(t) −1 = −Q−1 (t) Q (t) dt dt 610 Quantitative Analytics We then apply Ito’s lemma to get the dynamic of the product of the multi-factor Ornstein-Uhlenbeck process with the matrix Q−1 (t) T dQ−1 (t)Xt = Q−1 (t)K0 (t)dt + Q−1 (t)ΣX dWX (t) Integrating between [t, T ], we get the solution XT = Q−1 (t)Xt + T Z Q−1 (s)K0 (s, T )ds + Z T T Q−1 (s)ΣX (s)dWX (s) (C.6.13) t t RT where t Q−1 (s)ΣX (s)dWX (s) is a (n, 1) stochastic integral. In that case, the conditional mean vector M (t, T ) and variance matrix V (t, T ) of the process Xt are M (t, T ) Q−1 (t)Xt − = Z T Q−1 (s)K0 (s)ds t T Z V (t, T ) −1 Q−1 (s)ΣX Σ> (s))> ds X (s)(Q = t C.6.2 A simple example We consider a multivariate Ornstein-Uhlenbeck process X = (Xt ∈ R2 )t∈[0,T ] with initial value X0 ∈ R2 defined by the SDE dXt = (K0 (t) − K1 Xt )dt + Σ(t)dWt with K0 (t) ∈ R2×2 , Σ(t) ∈ R2×2 and Wt ∈ R2 . The solution given in Equation (C.6.13) can be rewritten as Z t Z t Xt = e−(t−s)K1 Xs + e−(t−u)K1 K0 (u)du + e−(t−u)K1 Σ(u)dWu s C.6.2.1 s Covariance matrix We have −(t−s)K1 V ar(Xt |Xs ) = V ar(e Z Xs + t e −(t−u)K1 Z K0 (u)du + s t e−(t−u)K1 Σ(u)dWu ) s and then V ar(Xt |Xs ) = V ar(e−(t−s)K1 Xs + Z t Z t e−(t−u)K1 K0 (u)du) + V ar( e−(t−u)K1 Σ(u)dWu ) s s which simplifies to Z t V ar(Xt |Xs ) = V ar( e−(t−u)K1 Σ(u)dWu ) s From the definition of the variance we get Z t Z t V ar(Xt |Xs ) = E[( e−(t−u)K1 Σ(u)dWu )( e−(t−u)K1 Σ(u)dWu )> ] s s From Itô’s isometry we get 611 Quantitative Analytics Z t V ar(Xt |Xs ) = E[ (e−(t−u)K1 Σ(u))(e−(t−u)K1 Σ(u))> du] s which becomes t Z (e−(t−u)K1 Σ(u))(e−(t−u)K1 Σ(u))> du V ar(Xt |Xs ) = s C.6.2.2 Expectation From the Equation (C.6.13) we have the conditional expectation Z t Z t E[Xt |Xs ] = E[e−(t−s)K1 Xs + e−(t−u)K1 K0 (u)du + e−(t−u)K1 Σ(u)dWu ] s s which we split as E[Xt |Xs ] = E[e −(t−s)K1 Z t e Xs + −(t−u)K1 Z K0 (u)du] + E[ s t e−(t−u)K1 Σ(u)dWu ] s The conditional expectation becomes E[Xt |Xs ] = e −(t−s)K1 Z Xs + t e−(t−u)K1 K0 (u)du s C.6.2.3 Distribution and probability We have proven that Xt is a normal multivariate random variable with mean Mt = E[Xt |X0 ] ∈ R2 and variance Vt = V ar(Xt |X0 ) ∈ R2 (We can write Xt ∼ N (Mt , Vt )). In order to compute the probability of the first element, we assume that Vt is diagonalisable. We can then decompose it as Vt = U ΛU −1 , with U ∈ R2×2 being the unit eigenvectors and Λ ∈ R2×2 the diagonal matrix of the eigenvalues. Since Xt ∼ N (Mt , Vt ), we have: 1 Xt = Mt + U Λ 2 Y with Y ∼ N (0, I). Let’s have the following matrix representation: 1 X Xt = , A = U Λ 2 = {Aij }i=1,2,j=1,2 , Mt = {Mi }i=1,2 and Y = {yi }i=1,2 , then: X̄ X M1 A11 A12 Y1 = + X̄ M2 A21 A22 Y2 Then we have the first element of our process corresponding to: X = M1 + A11 Y1 + A12 Y2 Let us have Ȳ ∼ N (0, 1), then from the independence of Y1 and Y2 , we get q X = M1 + A211 + A212 Ȳ p 2 Let us define mXt = M1 and σX = A211 + A212 , then we have Xt ∼ N (mXt , σX ) and we can then compute the probability: a − mXt P (Xt < a) = P (mXt + σX Ȳ < a) = P Ȳ < σX 612 Quantitative Analytics P (Xt < a) = Φ a − mXt σX where Φ being the cumulative distribution function of a standard normal random variable. As a result, the probability becomes mXt − a a − mXt =Φ P (Xt ≥ a) = 1 − P (Xt < a) = 1 − Φ σX σX C.6.3 From OU to AR(1) process ARMA models are mathematical models of the persistence or autocorrelation in a time series. One subset of ARMA models are the autoregressive (AR) models and express a time series as a linear function of its past values. The order of the AR model tells how many lagged past values are included. Discretising an Ornstein-Uhlenbeck process, we recover the AR(1) model. C.6.3.1 The Ornstein-Uhlenbeck process Assuming (Xt )t≥0 is an Ornstein-Uhlenbeck process with positive constant parameters ρ and σ, the dynamics of the model are dXt = ρ(X − Xt )dt + σdWt (C.6.14) In that model, the distribution of future values depends on the current value. The solution of the SDE is Xt = X0 e−ρt + ρ t Z Xe−ρ(t−s) ds + ZX (0, t) 0 = X0 e−ρt + X(1 − e−ρt ) + ZX (0, t) Rt where ZX (0, t) = 0 σe−ρ(t−s) dW (s) is normally distributed with mean equal to zero and variance VZX (0, t) = R t 2 −ρ(t−s) 2 2 σ (e ) ds = σ2ρ (1 − e−2ρt ). The stationary (or unconditional) mean and variance are computed in the limit 0 by letting the time to infinity E[Xt ] = X V ar(Xt ) = σ2 2ρ Without loss of generality, we set X = 0 since for any α ∈ R the process (Xt − α) is also an OU process. Hence, if X0 = x with probability 1, then Xt has the distribution (Xt |X0 = x) ∼ N xe−ρt , σ2 (1 − e−2ρt ) 2ρ and we recover our Gaussian distribution with α(0, t) = xe−ρt and variance VZX (0, t). The covariance functions are given by Cov(Xt , Xs |X0 = x) = σ 2 −ρ|t−s| e − e−ρ(t+s) 2ρ 613 Quantitative Analytics C.6.3.2 Deriving the discrete model Given the dynamics of the OU process in Equation (C.6.14), we let T = N ∆t and assume that historical data satisfies the discretised dynamics √ Xn = ρ0 X∆t + (1 − ρ0 ∆t)Xn−1 + σ0 ∆ty , n = 1, .., N where y ∼ N (0, 1), that is, the distribution of y is time independent. Given X0 , the parameters ρ0 and σ0 are unknown and must be estimated. We consider a parametric model where the conditional mean and variance of Xn given Xn−1 = xn−1 belong to the families {ρX∆t + (1 − ρ∆t)xn−1 , ρ ∈ R} Setting K1 = e−ρ∆t {σ 2 ∆t, σ 2 ∈ R+ } √ ≈ (1 − ρ∆t) and σ = σ ∆t, we rewrite the process as Xn = C + K1 Xn−1 + σyn for C = (1 − K1 )X. The sequence X0 , ..., XN is a first order autoregressive sequence with lag-one correlation coefficient K1 . Positive autocorrelation might be considered a specific form of persistence, a tendency for a system to remain in the same state from one observation to the next. Interpolating linearly the values Xn = X(n∆t) for n ∈ [1, N ] we recover the desired path. The equation for Xn is the recursive representation of the AR(1) with conditional mean and variance E[Xn |Xn−1 ] = C + K1 Xn−1 V ar(Xn |Xn−1 ) = σ 2 If we lag that equation by p periods where p = 1 is the original equation and substitute each time the result back in the first equation, we get Xn = C p−1 X K1j + K1p Xn−p + σ j=0 p−1 X K1j yn−j j=0 where C p−1 X K1j = (1 − K1 )X j=0 p−1 X j=0 K1j = X p−1 X K1j − K1 X j=0 p−1 X K1j = X j=0 Assuming stationarity, that is |K1 | < 1, and taking the limit p → ∞ then geometric series 1 , we get Xn = X + σ ∞ X p−1 X j=0 K1p K1j − X p−1 X K1j+1 j=0 will approach zero and from the infinite K1j yn−j j=0 C since 1−K = X, which is an infinite order moving average. Therefore, the variable Xn can be written as an 1 infinite sum of past shocks where most distant shocks get smaller and smaller weights. In fact, the coefficients are geometrically declining since |K1 | < 1. Hence, when K1 = 1 we get the unit root case and Xn has infinite memory, 1 1 1−x = P∞ n=0 xn for |x| < 1 614 Quantitative Analytics that is past shocks never dies out. As a result, the distant past matters more the closer K1 is from unity. Since each yn−j is an i.d.d standard normal and since |K1 | < 1 we compute the unconditional mean and variance as E[Xn ] = X V ar(Xn ) = σ 2 ∞ X K12j V ar(yn−j ) = j=0 σ2 1 − K12 where the unconditional variance is larger than the conditional one when K1 6= 0. The further we look into the future the larger the number of shocks which come into play so that the set of possibilities or variance grows as a function of K1 . C.6.4 Some facts about AR series C.6.4.1 Persistence Autocorrelation refers to the correlation of a time series with its own past and future values. Positively autocorrelated series are referred to as persistent implying a positive dependence on the past and show up in a time series plot as unusually long runs or stretches of several consecutive observations above or below the mean. In the AR(1) model, the higher K1 , the more persistence and the longer the series stay above or below the mean. When K1 = 1 we get a random walk and the speed of mean reversion ρ in the continuous counterpart is zero. But as K1 decreases to zero, the time series mean revert faster and ρ increases. Because the departures for computing autocorrelation are computed relative to the mean, a horizontal line plotted at the sample mean is useful in evaluating autocorrelation with the time series plot. Hence, the equations on the process Xt are somewhat simpler if the time series is first reduced to zeromean by subtracting the sample mean, that is Vn = Xn − X for n = 1, .., N where Xn is the original time series, X is its sample mean and Vn is the mean-adjusted series. In that case, the AR(1) model for the mean-adjusted series in year n becomes Vn = K1 Vn−1 + σyn (C.6.15) We can deduce the e-folding time constant τ of the AR(1) model at lag ∆t from the relation K1 = e−ρ∆t = e− ∆t τ such that ρ = τ1 . C.6.4.2 Prewhitening and detrending Prewhitening refers to the removal of autocorrelation from a time series prior to using the time series in some application. For a series with positive autocorrelation, prewhitening acts to damp those time series features that are characteristic of persistence. In general, a trend is a long term change in the mean but can also refer to change in other statistical properties. Detrending is the statistical operation of removing trend from the series. It can be applied to remove a feature thought to distort the relationships of interest or can be used as a preprocessing step to prepare time series for analysis by methods that assume stationarity. The variance at low frequencies is diminished relative to the variance of high frequencies resulting in lower spectrum (at lowest frequencies) of the detrended series compared with the spectrum of the original data. Simple linear trend in mean can be removed by subtracting a least-square fit straight line. 615 Quantitative Analytics C.6.4.3 Simulation and prediction Simulation is the generation of synthetic time series with the same persistence properties as the observed series. In our example, it effectively mimics the low-frequency behaviour of the observed series. That is, given Equation (C.6.15) we estimate the autoregressive parameter by modelling the time series as an AR(1) process. Then we generate a time series of random noise ω by sampling from an appropriate distribution. Assuming some starting values for Vn−1 , we recursively generate a time series of Vn . Usually, we assume that the noise is normally distributed with mean zero and variance equal to the variance of the residuals from fitting the AR(1) model to the data. We can use simulation to generate empirical confidence intervals of the relationship between the observed time series and the climate variable. Prediction is the extension of the observed series into the future based on past and present values. It differs from simulation in that the objective of prediction is to estimate the future value of the time series as accurately as possible from the current and past values. A prediction form of the AR(1) model in Equation (C.6.15) is V̂n = K̂1 Vn−1 where the hat indicates an estimate. The equation can be applied one step ahead to get estimate V̂n from the observed Vn−1 while k-step ahead prediction can be made by applying recursively the above equation. Note, because the modelling of Vn assume a departure from the mean, the convergence in terms of the original time series is a convergence toward the mean. Therefore, in the limit for large enough k, the predictions will eventually converge to zero. Besides the randomness of the residuals, we are concerned with the statistical significance of the model coefficients. Significance of the AR(p) coefficients can be evaluated by comparing the estimated parameters with the standard deviation. In the AR(1) model, the estimated first order autoregressive coefficient K̂1 , is normally distributed with variance V ar(K̂1 ) = (1 − K̂12 ) N (C.6.16) Therefore, the 95% confidence interval for K̂1 is two standard deviations around K̂1 , that is q 95% CI = K̂1 ± 2 V ar(K̂1 ) C.6.5 Estimating the model parameters For simplicity of exposition we change notations and denote the regression model with autocorrelated disturbances as follows Xt = ax + bx Xt−1 + εxt where εxt is an error process. At this point we would need to estimate the model parameters. A first and common method would consist in computing the ordinary least squares (OLS) i.e. minimising the L2 (R) norm of residuals. But, using the OLS method implicitly assume that the process εxt is a white noise and then that an hexogen perturbation of the temperature has no consequence on the future sea-level values. To test the hypothesis for white noise, we perform the generalized Durbin-Watson tests on the data. If the test is rejected, it is not desirable to use ordinary regression analysis for the data we are dealing with since the assumptions on which the classical linear regression model is based will be obviously violated. Violation of the independent errors assumption has three important consequences for ordinary regression. First, statistical tests of the significance of the parameters and the confidence limits for the predicted values are not correct. Second, the estimates of the regression coefficients are not as efficient as they would be if the autocorrelation were taken into account. Third, since the ordinary regression residuals are not independent, they contain information that can be used to improve the prediction of future values. In that case, we need to introduce a dynamics on the errors in order to capture this effect. For instance, we can consider the model 616 Quantitative Analytics Xt εx tx ut = = ax + bx Xt−1 + εxt , ρx1 εxt−1 + · · · + ρxp εxt−px + uxt WN (0, ξx2 ) (C.6.17) where the notation ut WN (0, ξ 2 ) indicates that ut are uncorrelated with mean 0 and variance ξ 2 . To estimate the parameters of the model we initially fit a high-order model with many autoregressive lags and then sequentially remove autoregressive parameters until all remaining autoregressive parameters have significant t-tests. To fit the model an exact maximum likelihood method is used. This method is based on the hypothesis that the white noises are normally distributed, which is in accordance with the Kolmogoroff test for normality 2 . 2 if tests for normality are ex post rejected the Yule-Walker estimation or the unconditional least squares can be used 617 Appendix D Defining market equilibrirum and asset prices The theory of general equilibrium started with Walras [1874-7] who considered demand and supply to explain the prices of economical goods, and was formalised by Arrow-Debreu [1954] and McKenzie [1959]. In parallel Arrow [1953] and then Debreu [1953] generalised the theory, which was static and deterministic, to the case of uncertain future by introducing contingent prices. Arrow [1953] proposed to create financial markets and was at the origin of the modern theory of financial markets equilibrium. Radner [1976] improved Arrow’s model by considering more general assets, and introduced the concept of rational anticipation. In view of presenting some well known approches to value asset prices and define market equilibrium, we follow Dana and Jeanblanc-Picque [1994] and consider models in discrete time with one or two time periods with a finite number of states of the world. D.1 Introducing the theory of general equilibrium D.1.1 1 period, (d + 1) assets, k states of the world We consider a market with one period of time, (d + 1) assets and k states of the world. We let S i be the price at time 0 of the ith asset (i = 0, 1, .., d) with value at time 1 and in the state of the world j being vji . We let the portfolio Pd Pd (θ0 , θ1 , .., θd ) have value i=0 θi S i at time 0, and value i=0 θi vji at time 1 in the jth state of the world. Hence, S is a column vector with element S i , θ is a column vector with element θi , and V is the (k × (d + 1)) gain matrix with Pd element (vji , 1 ≤ j ≤ k). In matricial notation θ.S = i=0 θi S i is the scalar product of vectors θ and S, and V θ is a Pd vector in Rk with element (V θ)j = i=0 θi vji . Since a riskless asset has a value of 1 in all states of the world, we let 1 be its value at time 0 where r is the risk-free rate. Given Rk+ the set of vectors in Rk with positive elements S = 1+r and Rk++ the set of vectors in Rk with strictly positive elements, we let ∆k−1 be the unit simplex of Rk ∆ k−1 = {λ ∈ Rk+ | k X λi = 1} i=1 0 0 0 Further, given z and z two vectors in Rk , we let z ≥ z denote zi ≥ zi for all i. Following Ross [1976] [1978], we are going to define the notion of arbitrage opportunity. Definition D.1.1 There is an arbitrage opportunity if one of the following conditions is satisfied Pd • there exists a portfolio θ = (θ0 , θ1 , .., θd ) such that the initial value θ.S = i=0 θi S i is strictly negative and Pd the value at time 1 is positive in all the states of the world, that is, i=0 θi vji ≥ 0 for j ∈ {1, .., k}. 618 Quantitative Analytics • there exists a portfolio θ = (θ0 , θ1 , .., θd ) such that the initial value θ.S is negative or null, and the value at Pd time 1 is positive in all the states of the world and strictly positive in at least one state, that is, i=0 θi vji ≥ 0 Pd for j ∈ {1, .., k} and there exists j0 such that i=0 θi vji0 > 0. Hypotheses 1 No-Arbitrage Opportunity (NAO) There is no-arbitrage opportunity. Theorem D.1.1 The hypothesis of NAO is equivalent to the existence of a series (βj )kj=1 of strictly positive numbers called state prices, such that Si = k X vji βj , i ∈ {0, .., d} (D.1.1) j=1 Note, β is a vector of state prices with elements βj corresponding to the price at time 0 of an asset with value being 1 at the time 1 in the state of the world j and 0 in the other states. For the riskless asset we have vj0 = 1 , j ∈ {1, .., k} such that using Equation (D.1.1) we get k X 1 = βj 1+r j=1 S0 = (D.1.2) Pk Hence, setting πj = (1 + r)βj we get positive numbers such that j=1 πj = 1, and we can consider them as probabilities on the state of the world. As a result, the price at time 0 of the ith asset becomes Si = k 1 X πj vji 1 + r j=1 where the price S i of the ith asset is the expected value of its price at time 1 discounted by the risk-free rate. Building the portfolio θ = (θ0 , θ1 , .., θd ), we get (1 + r) d X θi S i = k X j=1 i=0 πj d X θi vii i=0 where π is a risk-neutral probability. By definition, the return of the ith asset in the state of the world j is expected return under the probability π is k X πj j=1 vji Si , and its vji = (1 + r) Si which is the return of the riskless asset. Property D.1.1 Given the hypothesis of NAO and a riskless asset 0, there exists a probability π on the states of the world such that the price of the ith asset at time 0 equal the expected value of its price at time 1 discounted by the risk-free rate Si = k 1 X πj vji 1 + r j=1 619 (D.1.3) Quantitative Analytics D.1.2 Complete market Definition D.1.2 A market is complete if, for all vector w of Rk , we can find a portfolio θ such that V θ = w, that is, θ such that (V θ)j = d X θi vji = wj , j ∈ {1, .., k} i=0 Proposition 13 A market is complete if and only if the matrix V has rank k. In a complete market, for all j ∈ {1, .., k}, there exists a portfolio θj such that V θj = (δ1,j , .., δk,j )> with δi,j = 0 if i 6= j and δj,j = 1 and we get an Arrow-Debreu asset. Further, if there is no-arbitrage, the initial value of the portfolio is S.θj = β > V θj = βj . To conclude, if there exists β such that V > β = S, then β is unique. If there exists a probability π satisfying V > π = (1 + r)S then it is unique and we call it the risk-neutral probability. We can then use the NAO to value assets in a complete market. Given z a vector in Rk and assuming NAO, if there exists a portfolio θ = (θ0 , θ1 , .., θd ) taking the value z at time 1 d X θi vji = zj i=0 then z is replicable. The value of the portfolio at time 0 is z0 = solution. Such a portfolio is called a hedging portfolio. Si i−0 θi , Pd and it does not depend on the chosen Proposition 14 In a complete market with no-arbitrage, the value of z ∈ Rk is given by k k X 1 X πj zj = βj zj 1 + r j=1 j=1 Note, the value of z is linear in z. Hence, the price at time 0 of the replicating portfolio (zj , j = 1, .., k) is the expected value under π of its discounted value at time 1. For instance, for a call option on the ith asset, we have zj = (vji − K)+ and the arbitrage price becomes k 1 X πj (vji − K)+ 1 + r j=1 D.1.3 Optimisation with consumption We consider a simple economy with one consumer good taken as numeraire and a single economical agent. This agent has a known wealth W 0 at time 0 and a wealth W j at time 1 in the state of the world j. The objective being to maximise wealth over time. In view of modifying his future income, he can buy at time 0 a portfolio of assets, but he can not have debts. He can further consume c0 at time 0 and get the amount of consumption cj at time 1 in the jth state of the world. Given the portfolio θ, the agent must satisfies the constraints 1. W 0 ≥ c0 + Pd 2. W j ≥ cj − Pd i=0 θi S i i i=0 θi vj , j ∈ {1, .., k} income from portfolio at time 1 620 Quantitative Analytics The second constraint states that consumption at time 1 comes from wealth together with the value of the portfolio. The set of consumption compatible with the agent’s income is d+1 B(S) = {c ∈ Rk+1 satisfying the above constraints } + ;∃ θ ∈ R For details see text book by Demange et al. [1992]. The agent has preferences on Rk+1 + , or complete pre-order notted . More generally, given the finite dimensional space vector C made with (cj , j = 1, .., k), we provide C with the scalar product < c, c> >= E[cc> ] with associated norm ||c||2 . In particular we get < 1, c >= E[c] which we also denote < c >. Agents or investors have some preferences over the elements of C characterised by utility functions Ui : C → R for (i = 1, .., m) with the property of aversion for variance or risk. That is, for all pair (c, c> ) ∈ C 2 the inequality V ar(c) < V ar(c> ) implies Ui (c) > Ui (c> ) which is equivalent to c c> . We assume that the utility functions Ui are strictly increasing with respect to each variables, strictly concave and differentiable, and that agents or investors maximise their utilities under budget constraints. In general, we make the assumption that the utility functions only depends on the first two moments of the random variables, that is, it can be written Ũi (E[c], V ar(c)) where Ũi is increasing with respect to the first coordinate and decreasing with respect to the second coordinate. Put another way, there is an equilibrium if the utility functions are concave functions of the mean and variance of the variables, such that they are increasing with respect to the first coordinate and decreasing with respect to the second coordinate. Back to our settings, our objective being to maximise wealth over time, we say that c∗ ∈ B(S) is an optimal consumption if u(c∗ ) = max {u(c); c ∈ B(S)} (D.1.4) Proposition 15 There is an optimal solution if and only if S satisfies the hypothesis of NAO. The optimal solution is strictly positive. Since c∗ is strictly positive, using the Lagrange’s multiplier, one can deduce that one sufficient and necessary condition k+1 for c∗ to be optimal is that θ∗ ∈ Rd+1 and λ∗ ∈ R+ such that some constraints are satisfied. Given βj = λ∗j = λ∗0 ∂u ∂cj ∂u ∂c0 (c∗ ) (D.1.5) the βj are strictly positive and we get Si = k X βj vji j=1 and one get a formula to value the price of assets. Simplification to the optimisation problem can be made in a complete market with no-arbitrage. In such a market there exists a unique β such that S = V > β, and one get the budget’s constraint (agent can not have debts) c0 + k X βj cj ≤ W 0 + j=1 k X βj W j j=1 where an agent buys consumption goods cj at price βj . Similarly, if the market is complete, we get B(S) = {c ∈ Rk+1 + | satisfying the above constraint } 621 (D.1.6) Quantitative Analytics and there exists θ such that cj − d X θi vji − W j = 0 for all j ∈ {1, .., k} i=0 Hence the problem of optimisation has now the single budget’s constraint given in Equation (D.1.6). If there is a πj so that letting asset 0 be the riskless asset, Equation riskless asset, we get the risk-neutral probabilities βj = (1+r) (D.1.6) rewrite c0 + k X j=1 πj k X cj Wj ≤ W0 + πj (1 + r) (1 + r) j=1 Note, we can use this equation in continuous time to transform a trajectorial constraint into a constraint on average. D.2 An introduction to the model of Von Neumann Morgenstern We are now going to specialise the utility function in the optimisation with consumption. For details see text book by Kreps [1990]. D.2.1 Part I We consider one period of time with a single good of consumption. We let P be the set of probabilities on (R+ , B(R+ )), and assume a finite number of states of the world such that the state j happens with the probability µj . We let the consumption C at time 1 be a random variable taking the values cj and assume that the law µC of C with Pk µC = j=1 µj δcj is an element of P. Further, assuming the agent has a complete pre-order on P, we say 0 0 that u : P → R is a utility function with pre-order of preference if u(µ) ≥ u(µ ) is equivalent to µ µ . To get a Von-Neumann Morgenstern (VNM) utility (see Von Neumann et al. [1944]), there must exist v : R+ → R such that Z ∞ u(µ) = v(x)dµ(x) 0 In the special case where µC is the discrete sum defined above, the VNM utility simplifies to u(µ) = k X µj v(cj ) j=1 Our objective of maximising wealth over time is realised via the optimal consumption in Equation (D.1.4). Note, µj is Pk a probability mass function (see Definition (B.2.4)) such that j=1 µj = 1 (see Lemma (B.2.1)), and from Definition (B.2.5) we get the first two moments E[C] = k X µj cj , V ar(C) = j=1 E[v(C)] = k X k X µj (cj − E[C])2 j=1 µj v(cj ) , V ar(v(C)) = j=1 k X µj (v(cj ) − E[v(C)])2 j=1 Hence, the criterion becomes that of maximising the expected value of the utility of consumption where u(µ) = E[v(C)] =< v(C) > 622 (D.2.7) Quantitative Analytics Given Jensen’s inequality, when v is concave, the agent is risk-averse since v(E[C]) ≥ E[v(C)] and the investor prefers the certain future consumption E[C] to the consumption cj with probability µj for all j. The investor is risk-neutral if v is affine, and we get v(E[C]) = E[v(C)]. Therefore, we can let λ be the market price of risk linked to the random consumption C and defined by v(E[C] − λ) = E[v(C)] 2 (D.2.8) j such that E[C] − λ is the certain equivalent to C. Assuming v to be C and (c − E[C]) to be small, we use the Taylor expansion around E[C] to get 0 00 1 v(cj ) ≈ v(E[C]) + (cj − E[C])v (E[C]) + (cj − E[C])2 v (E[C]) 2 Taking expectation (see Equation (D.2.7)) we get E[v(C)] = k X 00 1 µj v(cj ) ≈ v(E[C]) + V ar(C)v (E[C]) 2 j=1 Again, doing a Taylor expansion to v(E[C] − λ) in Equation (D.2.8), we get 0 v(E[C] − λ) ≈ v(E[C]) − λv (E[C]) so that putting terms together, the market price of risk becomes 00 1 1 v (E[C]) V ar(C) = αV ar(C) λ≈− 0 2 v (E[C]) 2 00 (E[C]) where the coefficient α = − vv0 (E[C]) is called the absolute aversion index for the risk in E[C]. It is also called the coefficient of absolute risk aversion (see Pratt [1964] and Arrow [1971]). D.2.2 Part II Following from the previous Appendix, we now consider two periods of time and assume that at time 1 the state of the world happens with probability µ = (µj )kj=1 . We also assume complete market and the existence of a riskless asset. We further assume that the utility functions are additively separable with respect to time u(c0 , C) = v 0 (c0 ) + k 1 X 1 E[v(C)] = v 0 (c0 ) + µj v(cj ) 1+r 1 + r j=1 0 where v 0 and v are strictly concave functions, strictly increasing functions in C 2 satisfying ∂v ∂c (c) → ∞ and ∞ as c → 0. Assuming strictly positive optimal consumption, from Equation (D.1.5) we get the state prices 0 βj = µj v (cj∗ ) (1 + r) v 00 (c0∗ ) and given the riskless asset, we have 1= k X βj (1 + r) j=1 623 ∂v ∂c (c) → Quantitative Analytics so that 0 0 v 0 (c0∗ ) = E[v (C ∗ )] We can then express the risk-neutral probability as 0 πj = (1 + r)βj = µj v (cj∗ ) E[v 0 (C ∗ )] As in Appendix (D.2.1), we use Taylor expansion around E[C ∗ ], to get 0 0 00 v (cj∗ ) ≈ v (E[C ∗ ]) + (cj∗ − E[C ∗ ])v (E[C ∗ ]) and taking the expectation (see Equation (D.2.7)) we get 0 0 E[v (C ∗ )] ≈ v (E[C ∗ ]) so that 00 πj (cj∗ − E[C ∗ ])v (E[C ∗ ]) = 1 + α(E[C ∗ ] − cj∗ ) ≈1+ µj v 0 (E[C ∗ ]) The probability gets larger as the absolute aversion index α gets larger or the spread between the mean consumption and the consumption in state j gets larger. From the price formula in Equation (D.1.3), the ith asset at time 0 becomes Si = 0 k 1 X v (cj∗ ) i µj v 1 + r j=1 E[v 0 (C ∗ )] j 00 0 Remark D.2.1 For the investor to be risk-neutral (λ = 0) then v (.) = 0 and v (.) = cst so that he would pay 0 at time 0 to get $1 at time 1 in the state of the world j. If he is risk averse, he would pay get $1 at time 1 in the state of the world j. D.3 j∗ v (c ) 1 1+r µj E[v 0 (C ∗ )] 1 1+r µj at time 0 to Simple equilibrium model D.3.1 m agents, (d + 1) assets We assume complete market and the existence of a riskless asset. We consider an economy with a single good of consumption and m economical agents with (d + 1) assets. The agent h has e0h unit of wealth at time 0 and ejh unit of wealth at time 1 in the jth state of the world. He can buy at time 0 a portfolio θh = (θh0 , .., θhd ) without incurring debts. Given a vector of price S, the set of consumption compatible with the agent’s income is d+1 0 Bh (S) = {c ∈ Rk+1 , eh ≥ c0 + θ.S; ejh ≥ cj − (V θ)j , j ∈ {1, .., k}} + |∃ θ ∈ R The agent h has some preferences represented by the VNM utility function k u(c0 , C) = vh0 (c0 ) + X 1 µj vh (cj ) (1 + r) j=1 Definition D.3.1 We say that {S, (ch , θh ); h = 1, .., m} is a market equilibrium if, given S 1. ch maximise uh (c0h , Ch ) under the constraint ch (c0h , Ch ) ∈ Bh (S) 624 Quantitative Analytics 2. Pm = 3. Pm θh = 0 j h=1 ch h=1 Pm j h=1 eh = ej , j ∈ {1, .., k} Assuming that there exists an equilibrium, and given the results in Appendix (D.2.2), the price at time 0 for all h is Si = 0 0 k k vh (cjh ) i 1 X vh (cjh ) i 1 X µj 00 0 vj = µj v 1 + r j=1 vh (ch ) 1 + r j=1 E[vh0 (C h )] j 0 Since in a complete market the equation S = V T β has a unique solution, the quantity and one can consider a dummy agent with VNM utility function vh (cjh ) 00 (c0 ) vh h is independent from h, k u(c0 , C) = v 0 (c0 ) + X 1 µj v(cj ) (1 + r) j=1 where 0 v (c) = m m X vh0 (ch ) X max { ; ch = c} 0 v 0 (c0h ) h=1 h=1 h v(c) = max { m m X vh (ch ) X ch = c} ; 0 v 0 (c0h ) h=1 h=1 h One can check that we get u(e0 , e) = m k X m X X vh (cjh ) vh0 (ch ) 1 + µj 0 0 v 0 (c0h ) (1 + r) j=1 h=1 vh0 (c0h ) h=1 h where e is a random variable taking the value ej with probability µj . One can show that v 0 and v are differentiable, and that 0 0 vh (cjh ) v (cj ) for all h = 1, .., m and j = 1, .., k v (e ) = 0h0 h0 = 0 vh (ch ) E[vh (C h )] 0 j and 0 0 v 0 (e0 ) = E[v (e)] = 1 As a result, the price becomes 0 k k 0 v (ej ) i 1 X 1 X µj v = µj v (ej )vji S = 1 + r j=1 E[v 0 (e)] j 1 + r j=1 i D.3.2 (D.3.9) The consumption based asset pricing model 0 In the special case where v is linearly decreasing 0 v (c) = −ac + b , a > 0 corresponding to the quadratic utility function in Equation (A.7.5) or the third concave funvtion v described in Appendix (A.1.2), we get 625 Quantitative Analytics 0 0 v (ej ) = E[v (e)] + a E[e] − ej = 1 + a E[e] − ej In that setting, the equilibrium price in Equation (D.3.9) becomes Si = k X 1 µj 1 − a(ej − E[e]) vji (1 + r) j=1 = 1 E[V i ] − aCov(e, V i ) (1 + r) (D.3.10) where V i is a random variable taking values vji with probability µj with the first two moments being E[V i ] = k X µj vji , V ar(V i ) = j=1 k X µj (vji − E[V i ])2 j=1 This equilibrium price correspond to the Consumption based Capital Asset Pricing Model (CCAPM) (see Dana i [1993]). Let Ri = VS i be the return of the ith asset, and let the vector M be the market portfolio such that e = V M . Dividing Equation (D.3.10) by S i , we get E[Ri ] − (1 + r) = aCov(e, Ri ) and setting RM = e S.M we get E[RM ] − (1 + r) = aCov(e, RM ) = (aS.M )V ar(RM ) since (S.M )RM = e. Combining the two equations, we get E[Ri ] − (1 + r) = Cov(Ri , RM ) E[RM ] − (1 + r) V ar(RM ) (D.3.11) which is related to the beta formula in the Capital Asset Pricing Model (CAPM) where βi = Cov(Ri , RM ) V ar(RM ) In that model, the risk premium of the ith asset E[Ri ] − (1 + r) is a linear function of its covariance with the return of the market portfolio called the Security Market Line (SML) (see Huang et al. [1988]). More generally, relaxing the 0 constraint on v , but assuming that ej is close to E[e], one can approximate the CCAPM formula since 0 v (ej ) ≈ 1 + α(E[e] − ej ) E[v 0 (e)] so that the equilibrium price in Equation (D.3.10) becomes Si ≈ 1 1 E[V i ] − αCov(e, V i ) (1 + r) (1 + r) 626 Quantitative Analytics D.4 The n-dates model We consider a model with one state of the world at time 0, and kn states of the world at time n where M (n) is the set of states of the world at time n. Given j ∈ M (n), we let ∆n (j) be the states of the world at time (n + 1) coming from j. Further, we let Sni (j) be the price of the ith asset at time n in the jth state of the world, and we let Sn be a vector with elements Sni , i ∈ {0, .., d}. Letting the asset 0 be the riskless element, we get ∀n, ∀j ∈ M (n), ∀l ∈ ∆n (j) , Sn+1 (l) = (1 + r(j))Sn0 (j) At last, θn is the vector (θn0 , .., θnd ) being the quantity of assets hold at time n and the value of the portfolio θn .Sn depends on the state of the world where we stand. Definition D.4.1 There is NAO if, for all n and for all j ∈ M (n), there is NAO between j and ∆n (j). As a result, for all n, for all j ∈ M (n), there exists a family of reals πn (j, l), l ∈ ∆n (j) such that 1. πn (j, l) ≥ 0 P 2. l∈∆n (j) πn (j, l) = 1 P 1 i 3. Sni (j) = 1+r(j) l∈∆n (j) πn (j, l)Sn+1 (l) corresponding to some probabilities. It is the probability of being at time (n + 1) in the lth state of the world, when at time n we were in the jth state. Put another way, they are transition probabilities between time periods n and (n + 1), and from one state of the world to another. We can normalise the third equation with the riskless asset, getting Sni (j) = Sn0 (j) X πn (j, l) l∈∆n (j) i Sn+1 (l) 0 Sn+1 (l) and calling Pni (.) the price at time n of the ith asset discounted by the riskless asset Pni (j) = Sni (j) Sn0 (j) the equation rewrites X Pni (j) = i πn (j, l)Pn+1 (l) l∈∆n (j) i (.) under the probability πn (j, .) noted Hence, the price Pni (j) is the expected value of the price Pn+1 i Pni (j) = E πn (j,.) [Pn+1 (.)] (D.4.12) As a result, P.i is a martingale for the probability π. Proposition 16 Assuming NAO, there exists a probability π on the tree of events such that the price of assets discounted by the riskless asset are martingales. Note, if there exists a probability such that discounted prices are martingales, there is no-arbitrage. In a complete market, this probability is unique (see Harrison et al. [1981]). 627 Quantitative Analytics D.5 Discrete option valuation We consider a simple financial market with two dates, the date 0 and the date 1, and two states of the world at the date 1. The market contains one risky asset and one riskless asset (for details see Cox et al. [1985b]). The value of the risky asset at date 0 is S, and it becomes Su or Sd if its price goes up or down. We consider a call option with strike K such that Sd ≤ K ≤ Su . We can build a portfolio with weights (α, β) where α is invested in the riskless asset and β is invested in the risky asset. At date 0 the value of the portfolio is α + βS, and at date 1 the value becomes α(1 + r) + βSu if the asset price goes up and α(1 + r) + βSd if it is down. The portfolio duplicates the option when its value at date 1 is equal to the gain realised by the option whatever the state of the world α(1 + r) + βSu = Su − K α(1 + r) + βSd = 0 Solving this system we obtain the weights (α∗ , β ∗ ) α∗ = − (Su − K) Sd (Su − K) , β∗ = (Su − Sd )(1 + r) (Su − Sd ) The option price being the value of this portfolio at time 0 q = α∗ + β ∗ S = Sd (Su − K) (S − ) (Su − Sd ) 1+r If we relax the constraint on the strike, we get α∗ (1 + r) + β ∗ Su = (Su − K)+ = Cu α∗ (1 + r) + β ∗ Sd = (Sd − K)+ = Cd and the price becomes q = α∗ + β ∗ S = 1 (πCu + (1 − π)Cd ) 1+r where π= 1 ((1 + r)S − Sb ) (Su − Sd ) If Sd ≤ (1 + r)S ≤ Su , then π ∈ [0, 1] and the pricing equation above can be interpreted in terms of risk-neutral probabilities where (1 + r)S = πSu + (1 − π)Sd Property D.5.1 The option price is the expectation of the discounted gain under the risk-neutral probability. In that setting, if the asset can take more than two values at date 1, we can no-longer replicate the option. Further, there exists several risk-neutral probability measures. We therefore get a range of prices. Let’s assume that the asset price at date 1 is the random variable S1 taking values in [Sd , Su ], and that Sd ≤ (1 + r)S ≤ Su . Let P be the set of risk-neutral probabilities, that is, the probabilities P such that EP [ S1 ]=S (1 + r) 628 Quantitative Analytics Property D.5.2 For all convex function h (for example h(x) = (x − K)+ ), we get sup E P [ P ∈P h(S1 ) h(Su ) S(1 + r) − Sd h(Sd ) Su − S(1 + r) ]= + (1 + r) (1 + r) (Su − Sd ) (1 + r) (Su − Sd ) The supremum is reached when S1 only takes the values Su and Sd . If h is of class C 1 , we get inf E P [ P ∈P h(S1 ) h((1 + r)S) ]= (1 + r) (1 + r) The inf is reached when S1 is equal to (1 + r)S. We define the price to sell an option as the smallest price allowing for the seller to hedge himself. It is the smallest wealth to invest into the portfolio (α, β) such that its final value gets bigger than the option value h(S1 ). Therefore, the selling price is inf (α + βS) (α,β)∈A where A = {(α, β)|α(1 + r) + βx ≥ h(x) , ∀x ∈ [Sd , Su ]}. We get inf (α + βS) = sup E P [ (α,β)∈A P ∈P h(S1 ) ] (1 + r) One say that the two problems sup E P [ P ∈P h(S1 ) ] and (1 + r) inf (α + βS) (α,β)∈A are dual problems. The buying price of the option is sup (α + βS) (α,β)∈C where C = {(α, β)|α(1 + r) + βx ≤ h(x) , ∀x ∈ [Sd , Su ]}, and we get sup (α + βS) = inf E P [ (α,β)∈C D.6 Valuation in financial markets D.6.1 Pricing securities P ∈P h(S1 ) ] (1 + r) Following Dybvig et al. [2003], we extend the results on optimisation with consumption, presented in Appendix (D.1.3) in the case of the simple models, to financial markets price securities with payoffs extending out in time. In a discrete time world with asset payoffs h(X) at time T , contingent on the realisation of a state of nature X ∈ Ω, absence of arbitrage opportunity (AAO) (from the Fundamental Theorem of asset pricing (see Dybvig et al.)) implies the existence of positive state space prices, that is, the Arrow-Debreu contingent claims prices p(X) paying $1 in state X and nothing in any other states (see Theorem (D.1.1)). If the market is complete, then these state prices are unique. The current value Ch of an asset paying h(X) in one period is given by Z Ch = h(X)dP (X) where P (X) is a price distribution function (dP (X) = p(X)dX). Letting r(X 0 ) be the riskless rate as a function of R 0 the current state X 0 , such that p(X)dX = e−r(X )T (see Equation (D.1.2)), we can rewrite the price as 629 Quantitative Analytics Z Ch = Z h(X)dP (X) = ( = e−r(X 0 )T Z dP (X)) 0 dP (X) h(X) R = e−r(X )T dP (X) Z h(X)dπ ∗ (X) E ∗ [h(x)] = E[h(X)ξ(X)] where the asterisk denotes the expectation in the martingale measure and where the pricing kernel, that is, the stateprice density ξ(X) is the Radon-Nikodym derivative of P (X) with respect to the natural (historical) measure denoted F (X). With continuous distribution, we get ξ(X) = fp(X) (X) where f (X) is the natural probability, that is, the relevant subjective probability distribution, and the risk-neutral probabilities are given by π ∗ (X) = R 0 p(X) = er(X )T p(X) p(X)dX (see Appendix (D.1.1) for details). We let Xi denote the current state, and Xj be a state one period ahead, and we assume that it fully describes the state of nature so that the stock price can be written S(Xi ). From the forward equation for the martingale probabilities Z Q(Xi , Xj , T ) = Q(Xi , X, t)Q(dX, Xj , T − t) X where Q(Xi , Xj , T ) is the forward martingale probability transition function for going from state Xi to state Xj in T periods, and where the integration is over the intermediate state X at time t. This is a very general framework allowing for many interpretations. To avoid dealing with interest rates, one can use state prices rather than martingales, defined as P (Xi , Xj , t, T ) = e−r(Xi )(T −t) Q(Xi , Xj , T − t) and assuming a time homogeneous process where calendar time is irrelevant, for the transition from any time t to t+1, we have P (Xi , Xj ) = e−r(Xi ) Q(Xi , Xj ) We let f be the natural (time homogeneous) transition density, and define the kernel as the price per unit of probability in continuous state spaces ξ(Xi , Xj ) = p(Xi , Xj ) f (Xi , Xj ) (D.6.13) An equivalent statement of no arbitrage is that a positive kernel exists. As an example, Dybvig et al. [2003] considered an intertemporal model with a representative agent having additively time separable preferences and a constant discount factor δ. It correspond to the Von Neumann Morgenstern utility function described in Appendix (D.2). Letting c(X) be the consumption at time t as a function of the state, over any two periods the agent want to maximise Z max u(c(Xi )) + δ u(c(X))f (Xi , X)dX c(Xi ),{c(X)}X∈Ω subject to the constraint Z c(Xi ) + c(X)p(Xi , X)dX = w where w is the wealth of the agent. Note, the simplified version of this optimisation with consumption was discussed in Appendix (D.1.3). One can use the Lagrange’s multiplier to solve for the optimum and obtain the Arrow-Debreu 630 Quantitative Analytics price given in Equation (D.1.5). Following the same approach, considering the first order condition for the optimum, one can interpret the kernel as 0 p(Xi , Xj ) δu (c(Xj )) ξ(Xi , Xj ) = = 0 f (Xi , Xj ) u (c(Xi )) (D.6.14) This equation is the equilibrium solution for an economy with complete market, in which consumption is exogenous and prices are defined by the first order condition for the optimum. In a multiperiod mode with complete markets and state independent, intertemporally additive separable utility, there is a unique representative agent utility function satisfying the above optimum condition. The kernel is the agent’s marginal rate of substitution (MRS) as a function of aggregate consumption. The marginal rate of substitution (MRS) across time for an agent with an intertemporally additively separable utility function is a function of the final state and depend only on the current state as a normalisation. Note the path independence, since the pricing kernel only depends on the MRS between future and current consumption, is a key element in the recovery theorem. Definition D.6.1 A kernel is transition independent if there is a positive function of the states g, and a positive constant δ such that for any transition from Xi to Xj , the kernel has the form ξ(Xi , Xj ) = δ g(Xj ) g(Xi ) Note, the intertemporally additive utility function is one among others generating a transition independent kernel. Using transition independence we can rewrite Equation (D.6.13) as p(Xi , Xj ) = ξ(Xi , Xj )f (Xi , Xj ) = δ g(Xj ) f (Xi , Xj ) g(Xi ) (D.6.15) 0 where g(X) = u (c(X)) in the representative model. D.6.2 Introducing the recovery theorem In a recent article, Ross [2013] assumed that the state-price transition function p(Xi , Xj ) is observable and solved the system in Equation (D.6.15) to recover the three unknowns, the natural probability transition function f (Xi , Xj ), the pricing kernel ξ(Xi , Xj ), and the discount rate δ. Note, the notion of transition independence was necessary to separately determine the kernel and the natural probability distribution. This is because in the Equation (D.6.13) there are more unknowns than equations. Other approaches used the historical distribution of returns to estimate the unknown kernel and thereby link the historical estimate of the natural distribution to the risk-neutral distribution. Alternatively, one can assume a functional form for the kernel. Ross [2013] showed that the equilibrium system in Equation (D.6.15) could be solved without the need of historical data or any further assumptions than a transition independent kernel. From the definition of the kernel in Equation (D.6.14) Ross induced some properties to the market and natural densities. Since ξ is decreasing with respect to c(Xj ), fixing Xi , since both densities integrate to one and since ξ 0 0 exceeds δ for c(Xj ) < c(Xi ), then defining v by δu (v) = u (c(Xi )), it follows that p > f for c < v and p < f for c > v. This is the single crossing property and verifies that f stochastically dominates p. In a single period model, terminal wealth and consumption are the same. Hence the following theorem. Theorem D.6.1 The risk-neutral density for consumption and the natural density for consumption have the single crossing property, and the natural density stochastically dominates the risk-neutral density. Equivalently, in a one period world, the natural density stochastically dominates the risk-neutral density. 631 Quantitative Analytics The following proof of the existence of a risk premium is interesting for our understanding of market’s return. Since in a one period world, consumption coincides with the value of the market, from stochastic dominance at any future date T , the return in the risk-neutral measure satisfies R∗ ∼ R − Z + where R is the natural return, Z is strictly non-negative, and is mean zero conditional on R − Z. Taking expectation, we get E[R] = r + E[Z] > r We now introduce the recovery theorem on discrete state spaces (bounded state space). Theorem D.6.2 Recovery Theorem If there is no arbitrage, if the pricing matrix is irreducible, and if it is generated by a transition independent kernel, then there exists a unique (positive) solution to the problem of finding the natural probability transition matrix F , the discount rate δ, and the pricing kernel ξ. For any given set of state prices, there is a unique compatible natural measure and a unique pricing kernel. Hence, under some assumptions, using the recovery theorem, one can disentangled the kernel from the natural probabilities. D.6.3 Using implied volatilities Implied volatilities are a function of the risk-neutral probabilities, the product of the natural probabilities and the pricing kernel (risk aversion and time discounting), and as such, they embody all of the information needed to determine state prices. From the volatility surface and the formula for the value of a call option, one can derive the state-price distribution p(S, T ) at any tenor T Z ∞ C(K, T ) = (S − K)+ p(S, T )dS 0 where C(K, T ) is the price of the call option. Differentiating twice with respect to the strike, we obtain the Breeden and Litzenberger result (see Breeden et al. [1978]) p(S, T ) = ∂KK C(K, T ) To apply the recovery theorem, we need the m × m state-price transition matrix P = [p(i, j)], but it is not directly observed in the market. One can estimate it from the state price distributions at different tenors. Assuming that we are currently in state c and observe prices of options across strikes and tenors, then we can extract the state prices at each future date T pT (c) =< p(1, T ), .., p(m, T ) > The vector of one period ahead state prices with T = 1 corresponds to the row of the state price transition matrix P . To solve for the remaining elements of P we can apply the forward equation recursively to create the sequence of (m − 1) equations pt+1 = pt P , t = 1, .., m where m is the number of states. In each of these equations, the current state-price for a security paying off in state j at time T + 1 is the state-price for a payment at time T in some intermediate state k multiplied by the transition price of going from state k to state j, that is, p(k, j) and then added up over all the possible intermediate states k. Hence, 632 Quantitative Analytics by looking at m time periods, we have m2 equations to solve for the m2 unknown transition prices p(i, j). We can then use the recovery theorem to the transition pricing matrix P to recover the pricing kernel and the resulting natural probability transition matrix. D.6.4 Bounding the pricing kernel In view of testing efficient market hypothesis, Ross [2005] proposed to find an upper bound to the volatility of the pricing kernel corresponding to a simple byproduct of recovery. Assuming that µ is an unobservable stochastic process, Hansen et al. [1991] found the lower bound µ σ where µ is the absolute value of the excess return and σ is the standard deviation of any asset. It implies that σ(ξ) is bounded from below by the largest observed discounted Sharpe ratio. Equivalently, σ(ξ) is also an upper bound on the Sharpe ratio for any investment (strategy) to be consistent with efficient markets. That is, if the Sharpe ratio is above σ(ξ), then the deal is too good (see Cochrane [2000] and Bernardo et al. [2000]). Alvarez et al. [2005] derived and estimated a lower bound for the volatility of the permanent component of asset pricing kernels, based on return properties of long-term zero-coupon bonds, risk-free bonds, and other risky securities. They found that the permanent component of pricing kernels was very volatile, at least as large as the volatility of the stochastic discount factor. Alternatively, Ross proposed to decompose excess returns Rt on an asset or portfolio strategy as σ(ξ) ≥ e−rT Rt = µ(It ) + t where the mean depends on the information set I, and the residual term is not correlated with I. The variance satisfies σ 2 (Rt ) = σ 2 (µ(It )) + σ 2 (t ) ≤ E[µ2 (It )] + σ 2 (t ) Rearranging, we get an upper bound on the R2 of the regression R2 = E[µ2 (It )] σ 2 (µ(It )) ≤ ≤ e2rT σ 2 (ξ) 2 σ (Rt ) σ 2 (Rt ) and R2 is bounded above by the volatility of the pricing kernel. Note, to avoid arbitrarily high volatility from the kernel, the proper maximum to be used is the volatility of the projection of the kernel on the stock market. Hence, the above tests must be done on strategies based on stock returns and the filtration they generate. Note also that the results of the tests are subject to the assumptions of the recovery theorem, and that any strategy must overcome transaction costs to be an implementable violation. 633 Appendix E Pricing and hedging options E.1 Valuing options on multi-underlyings In Appendix (D), following Dana and Jeanblanc-Picque [1994], we presented simple models in discrete time with one or two time periods and with a finite number of states of the world to value asset prices and define market equilibrium. We are now going to consider more complex models in continuous time. To do so, one can either take the results obtained in discrete time and consider the limit case, or one can consider a probabilist approach and define a probability under which the price of assets discounted by the riskless asset are martingales. We consider the latter, and follow the text book by Dana and Jeanblanc-Picque [1994] and the lecture notes by El Karoui [1997]. E.1.1 Self-financing portfolios Assumption E.1.1 A simplified world • there is no transaction costs when buying or selling assets • illimited short-selling is allowed • assets do not pay dividends • one can buy and sell assets at all time We let TH be the market horizon, and assume (d + 1) assets S = (S 0 , S 1 , .., S d ) traded between 0 and TH . We let Sti be the price of the ith asset at time t with price process continuous in time. The uncertainties in the economy (Ω, F, P) are given by a k-dimensional Brownian motion (Ŵt )t∈R+ with components Ŵtj being independent Brownian motions. We let S 0 be the riskless asset with return rdt over the time interval [t, t + dt]. The risky-assets S i ; 1 ≤ i ≤ d are Ito’s random functions satisfying the dynamics dSti = Sti bit dt + k X σji (t)Ŵtj j=1 d bit where bt is an adapted vector in R with components corresponding to the rate of return of the assets. The matrix σt of dimension d × k is the adapted matrix of volatility of the assets. The risk-free asset S 0 satisfies the dynamics dSt0 = rt St0 dt 634 Quantitative Analytics Given an investor with initial capital x, at time t, his portfolio is made of δ i (t) parts of the asset i for i = 0, 1, .., d which can be positive or negative. A portfolio strategy is given by the process (δi (t))0≤i≤d corresponding to the quantity invested in each asset. We consider simple strategies where the composition of the portfolio changes on a finite set of dates called trading dates. In discrete time, any strategy is a simple strategy. Definition E.1.1 A simple strategy written on assets is given by a finite set of trading dates Θ = {(ti )0≤i≤n ; 0 = t0 < t1 < t2 < ... < tn = T } and (d + 1) process (δi (t))0≤i≤d giving the allocation of the assets in the portfolio over time δ i (t) = ni0 I[0,t1 ] (t) + nik I]tk ,tk+1 ] (t) + ... + +niN −1 I]tN −1 ,tN ] (t) where the variables nik are Ftk -mesurable. The financial value of the portfolio δ is given by V (δ). At time t, that value is given by Vt (δ) =< δ(t), St >= d X δ i (t)Sti i=0 i i i Not, for all t in the interval ]tk , tk+1 ] then δ (t) = δ (tk+1 ) = n (k). That is, the part invested in the ith asset is Ftk measurable and only depends on the information available at the previous trading date. Hence, the process δ i (t) is predictable and the process Vt (δ) is adapted. In continuous time, as the simple strategies are processes left-continuous so is the value of a simple portfolio. Between the dates tk and tk+1 an investor following the strategy δ put nik units in asset S i . Just before the trading date tk+1 the portfolio value is < nk , Stk+1 >. At time tk+1 , the investor build a new portfolio, that is, reallocate the weights of the portfolio from the information at time tk+1 . Assuming no cash is added or removed from the portfolio, then at time tk+1 the self-financing condition can be expressed as < nk , Stk+1 >=< nk+1 , Stk+1 > or when considering the assets’ variation between two dates Vtk (δ)+ < nk , Stk+1 − Stk >=< nk , Stk+1 >= Vtk+1 (δ) and the variations of a self-financing portfolio are only due to the variations of the assets. A self-financing portfolio is a strategy to buy or sell assets whose value is not modified by adding or removing cash. Further, the self-financing condition implies that the value of the portfolio does not jump at trading dates. The self-financing condition is a necessary and sufficient condition for the continuity process of the value of the portfolio. Definition E.1.2 Given (Θ, δ) a simple self-financing trading strategy, the value of the portfolio is characterised by Vt (δ) =< δ(t), St > Z t Vt (δ) − V0 (δ) = < δ(u), dSu > 0 635 Quantitative Analytics If the portfolio is not self-financing, Follmer-Schweitzer defined the cost process Z t Ct (δ) = Vt (δ) − V0 (δ) − < δ(u), dSu > 0 We are going to express the dynamics of the self-financing portfolio in terms of the rate of return and volatility of each asset. dVt (δ) = d X δ i (t)dSti =δ 0 (t)dSt0 i=0 + d X δ i (t)dSti i=1 = δ 0 (t)St0 rt dt + d X δ i (t)Sti bit dt + i=1 = δ 0 (t)St0 rt dt+ d X k X δ i (t)Sti σji (t)dŴtj i=1 j=1 < (δS)t , bt > dt+ < (δS)t , σt dŴt > We can get rid off δ 0 (t) by using the self-financing condition, to get the dynamics dVt (δ) = rt Vt dt+ < (δS)t , bt − rt I > dt+ < (δS)t , σt dŴt > i (E.1.1) (t)Sti )1≤i≤d describing the amount to be invested in where (δS)t = πt correspond to the vector with component (δ each stock. The linear Equation (E.1.1) having a unique solution, knowing the initial investment and the weights of the portfolio is enough to characterise the value of the portfolio. Remark E.1.1 A process Vt solution to the Equation (E.1.1) is the financial value of a self-financing portfolio corPd responding to investing the quantity (δ i (t))1≤i≤d in risky assets and the quantity S10 (Vt (δ) − i=1 δ i (t)Sti ) in the t risk-free asset. Vt (δ) = δ 0 (t)St0 + d X δ i (t)Sti where δ 0 (t) = i=1 d X 1 δ i (t)Sti ) (V (δ) − t St0 i=1 Some examples: • Fixed time strategy The trader decides to maintain the amount invested in the risky asset at 50% of the portfolio value, that is δt St = 21 Vt . Given Equation (E.1.1), the portfolio value is solution to the SDE 1 dSt dVt (δ) = rt Vt dt + Vt ( − rdt) 2 St t for dS St = bt dt + σt dŴt . In the special case where the trader maintains 100% of the amount invested in the risky asset, we get δt St = Vt and the equation becomes dVt (δ) = rt Vt dt + Vt ( dSt − rdt) St • Random time strategy The trader decides to rebalance his portfolio as soon as the stock price varies more than 2%. Regarding the choice of the weights, he can keep the same rule as in the previous example. The trading dates are therefore random dates being stopping time characterised by the first time the asset crosses a 2% barrier level. 636 Quantitative Analytics Note, one can add options in his portfolio provided that they are very liquid and easily tradable on the market. In that case, letting (Cti )di=1 be option prices, and δti be the quantity of these claims, then the self-financing equation becomes dVt = δt dSt + d X δ i (t)dCti + Vt − δt St − i=1 d X δ i (t)Cti rt dt i=1 where the portfolio is Vt = δt St + d X i=1 δ i (t)Cti + d X 1 V − δ S − δ i (t)Cti St0 t t t St0 i=1 We can rewrite the SDE as dVt = rt Vt dt + δt (dSt − rt St dt) + d X δ i (t)(dCti − rt Cti dt) i=1 E.1.2 Absence of arbitrage opportunity and rate of returns Assumption E.1.2 We assume that there is no arbitrage opportunity between admissible portfolio strategies, in which case the market is viable. As a result of the absence of arbitrage opportunity, there is a constraint on the rate of return of financial assets. The riskier the asset, the higher the return, to justify its presence in the portfolio. Theorem E.1.1 Given a viable Ito market 1. two admissible and non-risky portfolios have the same rate of return rt 2. there exists an adapted random vector λt taking values in Rk , called the market price of risk, such that k X dSti = Sti rt dt + σji (t)(dŴtj + λjt dt) j=1 The instantaneous rate of returns of the risky assets satisfy bt = rt I + σt λt , dP × dt a.s. (E.1.2) A process Vt is the financial value of an adapted strategy δ if and only if it satisfies dVt = rt Vt dt+ < (δS)t , σt (dŴt + λt dt) > RT together with the integrability condition E[ 0 Vt2 dt + |(δS)t |2 dt] < +∞. (E.1.3) Note, one assumes that the rate of returns of risky assets are greater than the one from the risk-free assets. The equilibrium prices of risky assets exhibit a risk premium which is the spread between the instantaneous rate of return bt of the risky assets and the rate of return rt of the risk-free asset. However, in a risk-neutral economy, all assets have the same rate of return equal to the market interest rate. 637 Quantitative Analytics E.1.3 Numeraire Definition E.1.3 A numeraire is a monetary reference with value in Euros which is an adapted and strictly positive random function of Ito. Proposition 17 1. a simple self-financing strategy is invariant under change of numeraire 2. a portfolio strategy which is an arbitrage in a given numeraire is an arbitrage in all numeraire Rt 3. if the asset S 0 is chosen as numeraire, all stochastic integral Sx0 + 0 < δ(u), d SSu0 > with simple process δ is u 0 the financial value of a self-financing portfolio We let Xt be the value in Euros of a numeraire. The price at time t of the ith asset expressed in that numeraire is Sti Vt (δ) Xt and the financial value of a portfolio is Xt . Given a self-financing portfolio Vt (δ) =< δt , St > with variation dVt (δ) =< δt , dSt >, we get Vt (δ) St Vt (δ) St =< δt , > and d =< δt , d > Xt Xt Xt Xt Given (Xt ) a numeraire with dynamics dXt = rt dt − rtX dt+ < γtX , dŴt + λt dt > Xt we let γtX be a volatility vector belonging to the image of (σt )> , that is, there exists a vector πtX such that γtX = St be the price process under the numeraire Xt . (σt )> πtX . In the X-market, we let StX = X t Theorem E.1.2 Given a viable initial market 1. the parameters in the X-market are X X X λX t = λt − γt , rt = µt 2. we let (Zt ) be an admissible price process with volatility vector σtZ and dynamics dZt = rt dt+ < σtZ , dŴt + λt dt > Zt The volatility vector of Z X is given by σ Z X = σtZ − γtX and the dynamics are dZtX = rtX dt+ < σtZ − γtX , dŴt + (λt − γtX )dt > ZtX We consider the M-numeraire called the market numeraire and introduced by Long [1990] in reference to the market portfolio described by Markowitz [1952]. Long showed that if any set of assets is arbitrage-free, then there always exists a numeraire portfolio comprised of just these assets. The prices expressed in that numeraire have no specific return over time. They are white noise under the historical probability as the interest rates and risk premiums are null. As a result, the M-market prices are local martingales and risk-neutral under the historical probability. We let λt be a volatility vector belonging to the image of (σt )> , that is, there exists a vector αt such that λt = (σt )> αt . This condition is not restrictive and we can always decompose λt as (λ1t , λ2t ) where λ1t belongs to the seed of σt and λ2t belongs to the orthogonal space Ker(σt ) = Image(σt> ). The market price of risk (λt ) and (λ2t ) have 638 Quantitative Analytics the same impact on the dynamics of the price as they are linked to the volatility through σt λt = σt λ2t . Hence, we αit d consider a self-financing strategy where the weights in the risky assets are φM t = ( Sti )i=1 corresponding to an initial investment of $1, and we assume that this strategy is admissible. The value of this strategy noted Mt is called market numeraire. Theorem E.1.3 1. Given the M-market numeraire, a process with initial value equal to 1 and volatility (λt ), the dynamics are dMt = rt dt + (λt )> (dŴt + λt dt) = rt dt + |λt |2 dt + λ> t dŴt , M0 = 1 Mt • in the M-market the investors are risk-neutral • the M-price ZtM = Zt Mt of an asset or a portfolio is a local martingale 2. Arbitrage Pricing Theory In the initial market, the expected return of an asset Z is given by the risk-free rate plus the infinitesimal covariance between the return of the risky asset and that of the market numeraire µZ t = rt + σZ,M (t) , σZ,M (t) = Covt ( dMt dZt , ) Mt Z t In the APT, the excess return with respect to cash is measured by the beta of the portfolio return with respect to the market numeraire µZ t − rt = σZ,M (t) M (µ − rt ) σM,M (t) t t where σM,M (t) = V art ( dM Mt ). Proof Using no-arbitrage arguments we can show Z µZ t − rt =< σt , λt > where σtZ is the volatility of Z and λt is the vector of market price of risk. As λt is also the volatility of the market numeraire, we get dMt dZt , ) =< σtZ , λt > dt Mt Z t dMt dMt , ) = |λt |2 dt = (µM Covt ( t − rt )dt Mt M t Covt ( E.1.4 Evaluation and hedging We can then compute the price of contingent claims as they are replicable with an admissible portfolio. Proposition 18 We let BT = {ΦT = VT (δ); δ admissible self-financing strategy } be the set of simulable flux which are square integrable. 639 Quantitative Analytics • assuming absence of arbitrage opportunity, two strategies replicating ΦT have the same value at all intermediary dates, which is the price Ct (ΦT ) of ΦT satisfying the equation dCt (ΦT ) = Ct (ΦT )rt dt+ < (δS)t , σt (dŴt + λt dt) > CT (ΦT ) = ΦT where δ is a hedging portfolio of the contingent claim Φ. • assuming absence of arbitrage opportunity, the application which at ΦT = VT (δ) ∈ BT associates its price at time t given by Vt (δ) = Ct (ΦT ) is a positive linear function. The price of a simulable asset is the unique solution to a linear SDE with known terminal value. The hedging portfolio δ is unknown, just like is unknown the price Ct (ΦT ). Hence, the pair (Ct (ΦT ), δt ) is solution to a backward SDE (see Peng and Pardoux (1987)). Remark E.1.2 When the interest rates and the market price of risk are null, one can easily compute the price of a contingent claim as the expected value of the terminal flux. These conditions are satisfied in the M-market. Proposition 19 Evaluation in the M-market 1 to belongs to H2+ which is the case when rt , σt and λt We assume that the numeraire M is regular enough for M are bounded. Given ΦT ∈ Bt the terminal flux of a simulable contingent claim which is square integrable, its price M Ct (ΦT ) is given by CtM (ΦM T ) = E[ΦT |Ft ] which is written in the usual numeraire as Ct (Φ) = E[ΦT Mt |Ft ] MT In the M-market the prices of contingent claims are the expected value of their terminal flux. One is then left to compute the weights of the hedging portfolio when the terminal flux is unknown. In the simple Markowian case of the Black-Scholes formula the weights are expressed in terms of the gradients of the price which is the expectation of the derivative of the random variable ΦM with respect to the Markowian variables. In the general case, we need to compute the weights representing the random variable XT as a stochastic integral with respect to the Brownian motions. We need to characterise the set of replicable derivatives. Hence, we need to characterise the complete markets in which the derivatives are replicable. We use the probability result that says that all random variable XT in L1 (P) and measurable with respect to the sigma-algebra generated by the vectorial Brownian motion Ŵ can be expressed in terms of a stochastic integral Z XT = E[XT ] + T Z < zs , dŴs > , 0 T |zs |2 ds < ∞ 0 In a financial market, one need to express the prices on the basis of the asset variations and not on the basis of Brownian motions. One must therefore assume that there is enough assets to cover all the noises. Assumption E.1.3 The matrix inferred from the volatility matrix σt σt> is invertible and bounded as well as the inverse matrix. Proposition 20 Assuming a financial market with no interest rates, and no risk premium such as the M-market. All random variable ΦT which is measurable with respect to the Brownian filtration Ŵ belonging to L1+ , is replicable with a portfolio which is a uniformly integrable martingale Z ΦT = E[ΦT ] + T Z < αt , dŴt >= E[ΦT ] + 0 δt St = < δt St , 0 (σt σt> )−1 σt αt 640 T dSt > St Quantitative Analytics Theorem E.1.4 Complete market We let the matrix σt satisfies the assumptions above, and assume that the M-numeraire is regular enough such that sup0≤t≤T (Mt ) and sup0≤t≤T (Mt−1 ) belongs to L1+ . Given ΦT ∈ L2 (FTŴ , P), the terminal flux of a simulable contingent claim, square integrable, and measurable with respect to the Brownian filtration. The market is complete in the sense where ΦT is replicable with an admissible portfolio. In practice, we can not observe the M-numeraire, and we need to find an observable numeraire with similar properties to value and hedge contingent claims. For the price to be the expected value of the terminal flux expressed in the new numeraire, we need to make the market risk-neutral which is possible after a change of probability. Theorem E.1.5 Risk-neutral probability We assume that the vectors λt and rt are bounded 1 , and we choose the cash S 0 as numeraire. 1. there exists a probability Q equivalent to P such that Rt • Wt = 0 dŴs + λs ds is a Q-Brownian motion • the prices processes written in that numeraire (the discounted values of self-financing portfolios) are local Q-martingale satisfying for Zta = SZ0t the dynamics t dZta = σtZ dWt Zta and Q is called the risk-neutral probability. 2. we further assume that the negative part of the interest rate (rt )− is bounded. If ΦT ∈ BT is the terminal flux of a contingent claim, we get Ct (ΦT ) ΦT = E Q [ 0 |Ft ] St0 ST or Ct (ΦT ) = E Q [e− RT t rs ds ΦT |Ft ] 3. when the market is complete, there exists a unique risk-neutral probability, and the risk-neutral rule of valuation can be applied to all contingent claims which are square integrable. The same argument can be applied to all numeraire provided that we consider the appropriate risk-neutral probability. In the M-market, the M-prices are local martingales with respect to the historical probability P, which is called a M-martingale measure. Remark E.1.3 The historical probability is the risk-neutral probability when the market numeraire is taken as a reference. Xt Theorem E.1.6 Given (Xt ) a portfolio numeraire such that XtM = M is a uniformly integrable P-martingale, there t X exists a probability Q defined by its Radon-Nikodym derivative with respect to P = QM such that dQX XT M0 XM = = TM dP MT X0 X0 The X-prices are local QX -martingales, that is, QX are X-martingale measures. 1 1 it is enough that the Novikov condition E[e 2 RT 0 |λs |2 ds ] < +∞ be satisfied. 641 Quantitative Analytics To conclude, we introduce the Ross [2013] recovery theorem which gives sufficient conditions under which the probability measure P can be obtained from the measure Q. The theorem states that in a complete market, if the utility function of the representative investor is state independent and intertemporally additively separable, and if the state variable is a time homogeneous Markov process X with a finite discrete state space, then one can recover the real-world transition probability matrix from the assumed known matrix of Arrow-Debreu state prices. Considering the restrictions on preferences made by Ross impossible to test, Carr et al. replaced that concept with restrictions on beliefs. E.2 The dynamics of financial assets We consider the probability space (Ω, F, P) where Ft is a right continuous filtration including all P negligible sets in F. For simplicity, we let the market be complete and assume that there exist an equivalent martingales measure as defined in a mixed diffusion model by Bellamy and Jeanblanc in [2000]. E.2.1 The Black-Scholes world In the special case where we assume that the stock prices are lognormally distributed we can derive most of the contract market values in closed form solution. In the risk-neutral pricing theory we introduce a new probability measure Q such that the discounted value process V t = e−rt Vt of the replicating portfolio is a martingale under Q. By the fundamental theorem of asset pricing (see Harrison et al. [1981]), such a measure exists if and only if the market is arbitrage-free. We let the stock price St under the historical measure P takes values in R with dynamics dSt = µdt + σdW̃S (t) St where µ is the drift, σ is the volatility and W̃S (t) is a standard Brownian motion. Note, µ is the annualised expected rate of return of the stock by unit time. The parameter of reference is µ − r. Given S0 = x we get 1 St = f (t, W̃S (t)) = xeµt− 2 σ 2 t+σ W̃S (t) The first two moments are E[St ] = xeµt , E[St2 ] = x2 e(2µ+σ 2 )t 2 V ar(St ) = x2 e2µt (eσ t − 1) and the Sharpe ratio of the stock price is (eµt − 1) E[St ] − x p 2 = M=p V ar(St ) eµt (eσ t − 1) which is independent from the initial value x. We can also compute the Sharpe ratio by unit time of excess returns with respect to cash which is 1 dt λ= q t E[ dS St ] − r 1 dt V t ar( dS St ) = µ−r σ It corresponds to the market price of risk λ associated to the Brownian motion W̃ . Hence, the dynamics of the stock price becomes dSt = rdt + σ dW̃S (t) + λdt St 642 Quantitative Analytics In the risk-neutral measure the portfolio replicates the derivative such that at maturity we have VT = h(ST ) where h(.) is a sufficiently smooth payoff function. As a result, the price of a European call option C(t, x) on [0, T ] × [0, +∞[ is C(t, St ) = e−r(T −t) E Q [h(ST )|Ft ] and the price of the derivative is a linear function. The change of measure is achieved by using the Girsanov’s Theorem which states that there exists a measure Q equivalent to P such that the discounted stock price is a martingale under Q. By Girsanov’s Theorem the new measure is computed via the Radon-Nikodym derivative dQ dP 1 FT = e− 2 RT 0 R λ2s ds+ 0T λs dW̃ (s) where the market price of risk λt follows λt = 1 and such that E[e− 2 RT 0 λ2s ds µ−r σ (E.2.4) ] < ∞. Since the Brownian motion Z t W (t) = W̃ (t) + λs ds 0 is a Brownian motion on the space (Ω, F, Q) the SDE of the asset price becomes dSt = rdt + σdWS (t) St E.2.2 The dynamics of the bond price We consider the underlying process to be the zero-coupon bond price of maturity T where P (t, T ) is the price at time t of 1$ paid at maturity T . However, practitioners would rather work with the forward instantaneous rate which is related to the bond price by fP (t, T ) = −∂T ln P (t, T ) We assume that zero-coupon bonds of all maturities are continuously traded in the market and follow Ito processes. Then, each asset has an instantaneous return and a vector of volatility under the historical probability measure P. We > let ŴP (t) = WP,1 (t), ..., WP,n (t) be a column vector with dimension (n, 1) and Γ(t, T ) be a matrix of dimension (1, n) with element Γj (t, T ). The absence of arbitrage opportunities implies that there exist a vector of market price of risk λt 2 such that the dynamic of the bond price is dP (t, T ) = rt dt+ < Γ(t, T ), λt dt > ± < Γ(t, T ), dŴP (t) > , P (T, T ) = 1 P (t, T ) where we use the notation ± to indicate when we consider the bond price or the instantaneous forward rate as the underlying process. Given Kt an adapted process, the volatility must satisfies |∂T Γ(t, T ) = γ(t, T )| ≤ Kt Moreover, the AAO implies that all asset prices depend on the Brownian motion Wt such that dWt = dŴt ± λt dt 2 < x, y > is the scalar product of two vectors. 643 Quantitative Analytics The market price of risk λt is cancelled out by introducing the probability Q where Wt is a centred Brownian motion, that is, there exists a risk-neutral probability Q equivalent to P such that P (t, T ) = E Q [e− RT t rs ds |Ft ] As a result, to model the bond price we can characterise a dynamic of the short rate rt . However, the AAO allows us to describe the dynamic of the bond price from its initial value and the knowledge of its volatility function. Therefore, assuming further hypothesis, the shape taken by the volatility function fully characterise the dynamic of the bond price and some specific functions gave their names to popular models commonly used in practice. Hence, the dynamic of the zero-coupon bond price is dP (t, T ) = rt dt ± ΓP (t, T )dWP (t) with P (T, T ) = 1 P (t, T ) (E.2.5) where (WP (t))t≥0 is valued in Rn and ΓP (t, T ) 3 is a family of local volatilities parameterised by their maturities T . Market uncertainty is expressed via the presence of noises and in general the market introduces as many noises as there are traded maturities. We therefore need to assume something about how all these noises are correlated. So far, that structure of correlation is modelled with a finite number of independent Brownian motions and a vector of volatility Γ(t, T ). Using the properties of the stochastic integral and the Brownian motion, we can reduce the diffusion term to the volatility vol(t, T ) and a unidimentional Brownian motion ZT (t) as Γ(t, T )dW (t) = vol(t, T )dZT () (E.2.6) In that setting, the link between the vector of local volatilities and the zero-coupon bond volatility is vol2 (t, T ) = k X Γ2j (t, T ) j=1 Using vectorial notation, the instantaneous volatility is vol(t, T ) = |Γ(t, T )|. We can therefore calculate the instantaneous correlations between zero-coupon bond of different maturities Cov( dP (t, T + θ) dP (t, T ) , ) = Γ(t, T + θ)Γ(t, T )> dt P (t, T + θ) P (t, T ) (E.2.7) The relationship between the bond price and the rates in general was found by Heath et al. [1992],and following their approach the forward instantaneous rate is Z t Z t fP (t, T ) = fP (0, T ) ∓ γP (s, T )dWP (s) + γP (s, T )ΓP (s, T )T ds 0 0 where γP (s, T ) = ∂T ΓP (t, T ). The spot rate rt = fP (t, t) is therefore Z t Z t rt = fP (0, t) ∓ γP (s, t)dWP (s) + γP (s, t)ΓP (s, t)T ds 0 0 Similarly to the bond price, the short rate is characterised by the initial yield curve and a family of bond price volatility functions. 3 ΓP (t, T )dW (t) = Pn j=1 ΓP,j (t, T )dWj (t) 644 Quantitative Analytics E.3 From market prices to implied volatility E.3.1 The Black-Scholes formula In the special case where we assume that the stock prices (Stx )t≥0 are lognormally distributed and pay a continuous dividend we can derive most of the contract market values in closed form solution. For example, Black and Scholes [1973] derived the price of a call option seen at time t with strike K and maturity T as CBS (t, x, K, T ) = xe−q(T −t) N (d1 (T − t, F (t, T ), K)) − Ke−r(T −t) N (d2 (T − t, F (t, T ), K)) (E.3.8) where F (t, T ) = xe(r−q)(T −t) and d2 (t, x, y) = √ x 1 √ 1 √ log − σ t and d1 (t, x, y) = d2 (t, x, y) + σ t y 2 σ t K For notational purpose, we let P (t, T ) be the discount factor, Re(t, T ) be the repo factor and we define η = F (t,T ) = √ KP (t,T ) 1 xRe(t,T ) to be the forward moneyness of the option. It leads to the limit case limη→1 d2 (.) = − 2 σ t and limη→1 d1 (.) = √ 1 2 σ t. It is well known that when the spot rate, repo rate and volatility are time-dependent, we can still use the BlackScholes formula (E.3.8) with the model parameters expressed as 1 r= T −t Z T t 1 r(s)ds , q = T −t Z T t 1 q(s)ds , σ = T −t 2 Z T σ 2 (s)ds t Further, we let the Black-Scholes total variance be given by ω(t) = σ 2 t, and rewrite the BS-formula in terms of the total variance, denoted CT V (t, x, K, T ), where d2 (t, x, y) = p 1 ω(t) log p x 1p ω(t) and d1 (t, x, y) = d2 (t, x, y) + ω(t) − y 2 (E.3.9) Expressing the strike in terms of the forward price K = ηF (t, T ), the call price in Equation (E.3.8) becomes CT V (t, x, K, T ) K=ηF (t,T ) = xe−q(T −t) N (d1 (η, ω(T − t)) − ηN (d2 (η, ω(T − t))) where p 1 1p d2 (η, ω(t)) = − p log η − ω(t) and d1 (η, ω(t)) = d2 (η, ω(t)) + ω(t) 2 ω(t) (E.3.10) which only depends on the forward moneyness and the total variance. This is the scaled Black-Scholes function discussed by Durrleman [2003]. In the special case where the spot price x is exactly at-the-money forward K = F (t, T ) with η = 1, the call price can be approximated with p 1p 1p ω(T − t)) − N (− ω(T − t)) = 0.4xe−q(T −t) ω(T − t) 2 2 (E.3.11) which is linear in the spot price and the square root of the total variance. CT V (t, x, K, T ) E.3.2 K=F (t,T ) ≈ xe−q(T −t) N ( The implied volatility in the Black-Scholes formula A call price surface parametrised by s is a function 645 Quantitative Analytics C : [0, ∞) × [0, ∞) → R (K, T ) → C(K, T ) along with a real number s > 0. However, market practise is to use the implied volatility when calculating the Greeks of European options. We let the implied volatility (IV) be a mapping from time, spot prices, strike prices and expiry days to R+ Σ : (t, St , K, T ) → Σ(t, St ; K, T ) Hence, given the option price C(t, St , K, T ) at time t for a strike K and a maturity T , the market implied volatility Σ(t, St ; K, T ) satisfies C(t, St , K, T ) = CBS (t, St , K, T ; Σ(K, T )) (E.3.12) where CBS (t, St , K, T ; σ) is the Black-Scholes formula for a call option with volatility σ. Consequently, we refer to the two-dimensional map (K, T ) → Σ(K, T ) as the implied volatility surface. Note, we will some time denote ΣBS (K, T ) the Black-Scholes implied volatility. When visualising the IVS, it makes more sense to consider the two-dimensional map (η, T ) → Σ(η, T ) where η is the forward moneyness (corresponding to the strike K = ηF (t, T )). Further, we let the total variance be given by ω(η, T ) = ν 2 (η, T ) = Σ2 (η, T )T and let the implied total variance satisfies C(t, St , K, T ) = CT V (t, St , ηF (t, T ), T ; ω(η, T )) (E.3.13) p where the two-dimensional map (η, T ) → ω(η, T ) is the total variance surface. Note, ω(η, T ) corresponds to the time-scaled implied volatility in log-moneyness form discussed by Roper [2010]. E.3.3 The robustness of the Black-Scholes formula El Karoui et al. [1998] provided conditions under which the Black-Scholes formula was robust with respect to a misspecification of volatility, that is, when the underlying assets do not satisfy the Black-Scholes hypothesis of deterministic volatility. To do so, they assumed that the contingent claims have convex payoffs, and the only source of randomness in misspecified volatility is a dependence on the current price of stock. Note, these assumptions ensure that they are working in a complete market. They found that when the misspecified volatility dominates (or is dominated by) the true volatility, then the contingent claim price corresponding to the misspecified volatility dominates (is dominated by) the true contingent claim. More formally, for both European and American contingent claims with convex payoffs, when interest rates are deterministic and the volatility depends only on time and the current stock price, then the price of the contingent claim is a convex function of the price of the stock. While Bergman et al. [1996] obtained this result by analysing the parabolic partial differential equation satisfied by the contingent claim price, El Karoui et al. used the theory of stochastic flows and the Girsanov theorem. They also showed that if the misspecified volatility dominates (is dominated by) the true volatility, then the self-financing value of the misspecified hedging portfolio exceeds (is exceeded by) the payoff of the contingent claim at expiration. Further, when the volatility of the underlying stock is allowed to be random in a path-dependent way, the price of a European can can fail to be convex in the stock price. Similarly, Bergman et al. considered an example where the volatility is decreasing with increasing initial stock price, and showed that dependence of the volatility on a second Brownian motion or jumps in the stock price can lead to nonincreasing, non-convex European call prices. This is to relate to the long-range dependence observed on volatility and the fact that financial markets are not complete. The convexity of market is strongly related to market completeness. Lyons [1995] considered non-convex options in a model with uncertain volatility. 646 Quantitative Analytics E.4 Some properties satisfied by market prices E.4.1 The no-arbitrage conditions Market prices must satisfy strong constraints for the no-arbitrage conditions to apply. We refer the readers to Harrison and Pliska [1981] for detailed proof. Moreover, in the presence of discrete dividends the stock price can not fall bellow a floor value, imposing stronger constraints of no-arbitrage. For instance, call prices may not always be increasing in time. In fact, the classical no-arbitrage conditions still hold but for the pure diffusion process. For simplicity, we ) only assume dividend yield D(t, T ) from time t to maturity T . Further, we let C(t, T ) = Re(t,T P (t,T ) be the capitalisation factor from time t to maturity T . The necessary no-arbitrage conditions are Theorem E.4.1 Under the diffusion model framework, a market has no arbitrage if the prices of the calls at time t0 = 0 satisfy 1. the prices are decreasing and convex in the strike price K 2. ∀K ≥ 0, T ≥ 0 + P (t0 , T ) C(t0 , T )St0 − D(t0 , T ) ≥ C(K, T ) ≥ P (t0 , T ) C(t0 , T )St0 − (D(t0 , T ) + K) 3. ∀θ ≥ 0 +θ) C(K, T + θ) ≥ C( K+D(T,T C(T,T +θ) , T ) while the sufficient no-arbitrage conditions are Theorem E.4.2 If there exists a system of option prices twice differentiable in the strike that satisfies the conditions of Theorem (E.4.1) then the corresponding prices are arbitrage-free. E.4.2 Pricing two special market products E.4.2.1 The digital option Given the stock price (St )t≥0 , a Digital option D(K, T ) for strike K and maturity T pays $1 when the stock price ST is greater than the strike K, and zero otherwise. The price of the Digital option is D(K, T ) = lim ∆K→0 ∂ C(K, T ) − C(K + ∆K, T ) =− C(K, T ) ∆K ∂K Given C(K, T ) = CT V (K, T ; ωBS (K, T )) where ωBS (K, T ) = Σ2BS (K, T )T is the BS implied total variance for strike K and maturity T , and using the chain rule, the Digital option becomes D(K, T ) = − ∂ ∂ ∂ ∂ CT V (K, T ; ωBS (K, T )) = − CT V (K, T ; ωBS ) − CT V (K, T ; ω(K, T )) ω(K, T ) ∂K ∂K ∂ω ∂K We can express the Digital option in terms of the total variance Vega and the total variance Skew as ∂ CT V (K, T ; ωBS ) − V egaT V (K, T )SkewT V (K, T ) (E.4.14) ∂K where V egaT V (K, T ; ωBS (K, T )) is the Black-Scholes total variance vega for the strike K and maturity T , and ∂K CT V (K, T ; ωBS ) is the BS digital price for the total variance ωBS (K, T ). D(K, T ) = − 647 Quantitative Analytics E.4.2.2 The butterfly option Assuming that the volatility surface has been constructed from European option prices, we consider a butterfly strategy centred at K where we are long a call option with strike K − ∆K, long a call option with strike K + ∆K, and short two call options with strike K. The value of the butterfly for strike K and maturity T is B(t0 , K, T ) = C(K − ∆K, T ) − 2C(K, T ) + C(K + ∆K, T ) ≈ P (t0 , T )φ(t0 ; K, T )(∆K)2 where φ(t0 ; K, T ) is the probability density function (PDF) of ST evaluated at strike K. As a result, we have φ(t0 ; K, T ) ≈ C(K − ∆K, T ) − 2C(K, T ) + C(K + ∆K, T ) 1 P (t0 , T ) (∆K)2 and letting ∆K → 0, the density becomes φ(t0 ; T, K) = 1 ∂2 C(K, T ) P (t0 , T ) ∂K 2 (E.4.15) Hence, for any time T one can recover the marginal risk-neutral distribution of the stock price from the volatility surface. E.5 Introduction to indifference pricing theory E.5.1 Martingale measures and state-price densities We saw in Appendix (E.1) that option pricing in complete markets consists in fixing a measure Q under which the discounted traded assets are martingales, and to calculate option prices via expectation under this measure. This is related to the notion of a state-price-density from economics. The advantage of using a state-price-density ξT is that prices π can be calculated as expectations under the physical measure, that is, π = E[ξT CT ]. In an incomplete market there is more than one martingale measure, or equivalently, there are infinitely many state-price-densities. For example, we consider a model on a stochastic basis (Ω, (Ft )0≤t≤T , P) with a single traded asset with price process St and a second auxiliary process Yt , which may correspond to a related but non-traded stock. The dynamics of the system is given by dSt St dYt = (rt + σt λt )dt + σt dWS (t) = bt dt + at dŴY (t) where < dWS , dŴY >t = ρt dt and λt is the Sharpe ratio (market price of risk) of the traded asset S. We assume that even though the asset Yt is not directly traded, its value is an observable quantity. We can write the Brownian motion ŴY as a composition of two independent Brownian motions WS and WY such that dŴY (t) = ρt dWS (t)+ρt dWY (t) p where ρt = 1 − ρ2t . A natural choice for Y to be an asset is to take at = ηYt and bt = Yt (r + ηχ) where χ is the Sharpe ratio of the non-traded asset. In that setting, the equivalent martingale measures are given by dQ = ZT dP FT where Z is a uniformly integrable martingale of the form 1 Zt = e− 2 Rt 0 λ2s ds− Rt 0 λs dWS (s)− 12 Rt 0 R χ2s ds− 0t χs dWY (s) with χt undetermined. For Q to be a true probability measure it is necessary to have E[ZT ] = 1. Note, Zt can be seen S0 as the value of St0 in the market numeraire, that is, Zt = Mtt . An example of a candidate martingale Zt is given by the 648 Quantitative Analytics choice χt = 0 leading to the minimal martingale measure Q0 of Follmer et al. [1990]. The state-price-densities ξT take the form ξt = e− Rt 0 rs ds Zt with the property that ξt St is a P-local martingale. In the case where interest rates are deterministic, then the stateprice density and the density of the martingale measure differ only by a positive constant, otherwise they differ by a stochastic discount factor. The martingale measures Qχ , the associated martingales Z χ , and state-price densities ξTχ can all be parametrised by the process χt governing the change of drift on the non-traded Brownian motion WY . In a complete market, the fair price does not depend on the choice of numeraire, and the definition of martingale measure does depend on the choice of numeraire ξT = 1 dQN NT dP FT where Nt is the numeraire, and QN is a martingale measure for this numeraire. In an incomplete market there is risk, and an agent needs to specify the units in which these risks are to be measured, as well as the concave utility function to be used. Some authors consider cash at time T as the units in which utility is measured. E.5.2 An overview E.5.2.1 Describing the optimisation problem We let πb be the price at which the investor is indifferent (in the sense that his expected utility under optimal trading is unchanged) between paying nothing and not having the claim CT , and paying πb now to receive the claim (payoff) CT at time T . We consider the problem with k > 0 units of the claim, and assume the investor initially has wealth x and zero endowment of the claim. We define V (x, k) = sup E[u(XT + kCT )] (E.5.16) XT ∈A(x) where the supremum is taken over all wealth XT which can be generated from initial fortune x. When the wealth is build over time by investing in the financial market, we let XTx,θ denotes the terminal fortune of an investor with initial wealth x who follows a trading strategy consisting of holding θt units of the traded asset. In that case, the primal approach of the value function becomes V (x, k) = sup E[u(XTx,θ + kCT )] (E.5.17) θ The utility indifference buy (or bid) price πb (k) is the solution to V (x − πb (k), k) = V (x, 0) (E.5.18) with rate r = XT +kCXTT−πb (k) , where the investor is willing to pay at most the amount πb (k) today for k units of the claim CT at time T . Similarly, the utility indifference sell (or ask) price πs (k) is the smallest amount the investor is willing to accept in order to sell k units of CT satisfying V (x + πs (k), −k) = V (x, 0) Note,the proposed price is for an individual with particular risk preferences (see Detemple et al. [1999]). In contrast to the Black and Scholes price, utility indifference prices are non-linear in the number k of options. The investor is not willing to pay twice as much for twice as many options, but requires a reduction in this price to take on the additional risk. If the market is complete or if the claim CT is replicable, the utility indifference price π(k) is equivalent to the complete market price for k units. 649 Quantitative Analytics Let πi be the utility indifference price for one unit of payoff CTi and let CT1 ≤ CT2 , then π1 ≤ π2 (Monotonicity). Let πλ be the utility indifference price for the claim λCT1 + (1 − λ)CT2 where λ ∈ [0, 1], then πλ ≥ λπ1 + (1 − λ)π2 (Concavity). Note, if we consider sell prices rather than buy prices then πλ is convex rather than concave. In order to compute the utility indifference price of a claim from Equation (E.5.18), two stochastic control problems must be solved. The first is the optimal investment problem when the investor has a zero position in the claim (see Merton [1969] [1971]). Merton used dynamic programming to solve for an investor’s optimal portfolio in a complete market where asset prices follow Markovian diffusions, leading to Hamilton Jacobi Bellman (HJB) equations and a PDE for the value function representing the investor’s maximum utility. The second is the optimal investment problem when the investor has bought or sold the claim (LHS of Equation (E.5.18)). This optimisation involves the option payoff, and problems are usually formulated as one of stochastic optimal control and again solved in the Markovian case using HJB equations. An alternative solution approach is to convert this primal problem into the dual problem which involves minimising over state-price densities or martingale measures (see Karatzas et al. [1991] and Cvitanic et al. [2001]). Under this approach, the problems are no longer restricted to be Markovian in nature. E.5.2.2 The dual problem While in a complete market it is possible to write the set of attainable terminal wealth generated from an initial fortune x and a self-financing strategy as the set of random variables satisfying E[ξT XT ] ≤ x, in an incomplete market this condition becomes that E[ξT XT ] ≤ x for all state-price-densities. One can therefore take a Lagrangian approach for solving Equation (E.5.17). For all state-price-densities ξT , terminal wealth XT satisfying the budget constraint and non-negative Lagrange multipliers µ, then E[u(XT + kCT ) − µ(ξT XT − x)] ≤ µx + µkE[ξT CT ] + E[ũ(µξT )] where ũ is the Legendre-Frenchel transform of −u. Optimising over wealth on one hand, and Lagrange multipliers and state-price-densities on the other hand, we get sup E[u(XT + kCT )] ≤ inf inf µx + µkE[ξT CT ] + E[ũ(µξT )] µ ξT XT (E.5.19) corresponding to the dual problem. If we can find suitable random variables XTk,∗ and ξTk,∗ , and a constant µk,∗ such 0 that u (XTk,∗ + kCT ) = µk,∗ ξTk,∗ , then there should be equality in the above equation, and XTk,∗ should be the optimal primal variable, and µk,∗ and ξTk,∗ should be the optimal dual variables. In the special case of deterministic interest rates and exponential utility function, the minimisation over ξT , or equivalently ZT , in Equation (E.5.19), simplifies to inf E[ZT ln ZT ] + γkE[ZT CT ] ZT In addition, given the simple dependence of exponential utility function on initial wealth, one can deduce an expression for the form of the UIP given by π(k) = e−rT inf E[ZT ln ZT ] + γkE[ZT CT ] − inf E[ZT ln ZT ] ZT ZT γ (see Frittelli [2000] and Rouge et al. [2000]). Remark E.5.1 A consequence of the dual problem is that the Sharpe ratio (market price of risk) plays a fundamental role in the characterisation of the solution to the utility indifference pricing problem. Moreover, it is the Sharpe ratio which determines whether an investment is a good deal. As a special case of the UIP theory, one can interpret super-replication pricing via a degenerate utility function. El Karoui et al. [1995] characterised the super-replication price as 650 Quantitative Analytics sup E[ξT CT ] ξT where the supremum is taken over the set of state-price densities, so that the price is the sell price under the worst case state-price density. E.5.3 The non-traded assets model E.5.3.1 Discrete time As an example, we consider the pricing of European options on non-traded assets in a simple one-period binomial model where current time is denoted 0 and the terminal date is time 1 (see Smith et al. [1995]). The market consists of a riskless asset, a traded asset with price P0 today and a non-traded asset with price Y0 today. The traded price P0 may move up to P1 = P0 ψ u or down to P1 = P0 ψ d where 0 < ψ d < 1 < ψ u , and the non-traded price satisfies Y1 = Y0 φ where φ = φd , φd and φd < φu . Wealth X1 at time 1 is given by X1 = β + αP1 = x + α(P1 − P0 ) where α is the number of shares of stock held, β is the money in the riskless asset, and x is the initial wealth. The investor is pricing k units of a claim with payoff C1 and has exponential utility described in Appendix (A.7). The value function in Equation (E.5.17) becomes 1 V (x, k) = sup E[− e−γ(X1 +kC1 ) ] γ α The utility indifference buy price satisfies Equation (E.5.18) and becomes 0 πb (k) = E Q 1 0 log E Q [eγkC1 |P1 ] γ where Q0 is the measure under which the traded asset P is a martingale, and the conditional distribution of the nontraded asset given the traded one is preserved with respect to the real world measure P. It corresponds to the minimal martingale measure of Follmer et al. [1990]. In this setting, the price can be written as a new non-linear, risk adjusted payoff, and then expectations are taken with respect to Q0 of this new payoff. Remark E.5.2 Exponential utility and the non-traded assets model is one of the few examples for which an explicit form for the utility indifference price is known. E.5.3.2 Continuous time The theory of UIP has been extended to continuous time, and the canonical situation of a security which is not traded has been studied by Davis [1999]. We now consider the value function in Equation (E.5.17) with a trading strategy consisting of holding θt units of the traded asset, and assume the self-financing condition dXtx,θ = θt dSt + rt (Xtx,θ − θt St )dt and sufficient regularity conditions to exclude doubling strategies. In the primal approach, we consider the dynamic version of the optimisation problem at an intermediate time t where V (x, 0) = V (x, s, y, t) = sup Et [u(XTx,θ )|Xt = x, St = s, Yt = y] θ Using the observation that V (x, s, y, t) is a martingale under the optimal strategy θ, and a supermartingale otherwise, we have that V solves an equation of the form sup Lθ V = 0 , V (x, s, y, T ) = u(x) θ 651 Quantitative Analytics where Lθ is an operator. Given that Lθ is quadratic in θ, the minimisation in θ is trivial and the problem can be reduced to solving a non-linear Hamilton-Jacobi-Bellman equation in four variables. In the special case of exponential utility function, wealth factors out of the problem and it is possible to consider V = − γ1 e−γx V (s, y, t) where V (s, y, T ) = 1. Assuming constant interest rates, and letting Yt follows an exponential Brownian motion with dynamics dYt = (r + ηχ)dt + ηdWY (t) Yt it follows that with exponential utility we get r(T −t) 1 − 12 λ2 (T −t) V (x, s, y, t) = − e−γxe γ We are left with evaluating the left-hand side of Equation (E.5.18) under the assumption that CT = C(YT ). The only change from the previous analysis is that the boundary condition becomes V (x, s, y, T ) = u(x + kC(y)), but it is not possible to remove the dependence on y. Assuming exponential utility function, then the non-linear HJB equation can be linearised using the Hopf-Cole transformation, and the value function at t = 0 becomes 1 rT 0 2 1 2 1 V (x, k) = − e−γxe − 2 λ T E Q [e−kγ(1−ρ )C(YT ) ] 1−ρ2 γ where Q0 is the minimal martingale measure (see Henderson et al. [2002]). It follows that the price can be expressed as π(k) = − 0 2 e−rT E Q [e−kγ(1−ρ )C(YT ) ] 2 γ(1 − ρ ) where the price is independent of the initial wealth of the agent, and such that it is a non-linear concave function of k. Note, when k > 0, and C is non-negative, the bid price is well defined, but for k < 0 it may be that the price is infinite. Thus one of the disadvantages of exponential utility is that the ask price for many important examples of contingent claims is infinite. E.5.4 The pricing method We let (Xt )t≥0 be the underlying asset under the historical measure P taking values in R. When it is not possible to hold the underlying asset, we have to price the contingent claim in an incomplete market. Defining the risk premium λ, we can then price the option under the risk-neutral measure Qλ . Hence, the price at time t of the contingent claim under the probability measure Qλ is C(t, T ) = P (t, T )Etλ [h(XT )] where h(•) is a sufficiently smooth payoff function, and P (t, T ) is a zero-coupon bond. However, to compute this price, we need to know the values of existing prices to infer the risk premium. When existing prices are seldom, or when there is not yet a developed market, one can not use this approach to price options on the underlying asset. Nonetheless, we can use the indifference pricing theory (IPT) to find a range a possible agreement prices for the contingent claim corresponding to the minimum price for the seller and the maximum price for the buyer (see Davis et al. [2010]). The idea being that the buyer of the option wants the net present value (NPV) of his investment to be greater or equal to his initial wealth utility. Doing so, he will not loose money by entering into the transaction (similarly for the seller with the NPV being less or equal to his initial wealth utility). We identify the increasing concave functions ub : R → R ∪ {−∞} and us : R → R ∪ {−∞} as respectively the buyer and the seller utility functions. We also define wb ≥ 0 and ws ≥ 0 as their respective initial wealth. Moreover, given the payoff C(X) and assuming k = 1 unit of claim, we define πb (C) ≥ 0 and πs (C) ≥ 0 as indifference buyer or seller price that we will try to estimate. We can then solve the equations 652 Quantitative Analytics EP [ub (wb )] = EP [ub wb + C(X) − πb (X) ] EP [us (ws )] = EP [us ws + C(X) − πs (X) ] where wl + C(X) − πl (X) for l = b, s is the wealth after the event. Note, we can define the rate rl as rl = wl + C(X) − πl (X) , l = b, s wl We can then find analytically, or numerically, the two prices πb (c) and πs (C) giving us the range of prices that can be settled between the two counterparts (see Carmona et al. [2009]). Further, given utility functions for the two parties, we apply Marginal Utility theory to estimate the optimum quantity traded. E.5.4.1 Computing indifference prices We define the processes Xs and Xb corresponding to the view of the seller and buyer, respectively, and get the indifference prices EP [ub (wb )] = EP [ub wb + C(Xb ) − πb (Xb ) ] EP [us (ws )] = EP [us ws + C(Xs ) − πs (Xb ) ] We consider the exponential utility: u(x) = 1 − e−λx , ∀x ∈ R where λ > 0 is the coefficient of risk aversion representing the counterpart vision of risk. This utility function is widely used in the literature and has no constraint on the sign of the cash-flow. Further, the indifference prices over this utility function are independent of the initial wealth, simplifying the number of parameters to include in the computation of the prices. Buyer indifference price Using the exponential utility function with the coefficient of risk aversion λb , we have: EP [1 − e−λb wb ] = EP [1 − e−λb (wb +C(Xb )−πb (Xb )) ] which becomes EP [e−λb wb ] = EP [e−λb wb ]EP [e−λb (C(Xb )−πb (Xb )) ] 1 = EP [e−λb (C(Xb )−πb (Xb )) ] Expending, we get e−λb πb (Xb ) = EP [e−λb C(Xb ) ] The buyer indifference price becomes πb (Xb ) = − 1 log EP [e−λb C(Xb ) ] λb 653 Quantitative Analytics Seller indifference price Similarly, for the seller with an exponential utility function with a coefficient of risk aversion λs we have: EP [1 − e−λs ws ] = EP [1 − e−λs (ws −C(Xs )+πs (Xs )) ] which becomes EP [e−λs ws ] = EP [e−λs ws ]EP [e−λs (πs (Xs )−C(Xs )) ] 1 = EP [e−λs (πs (Xs )−C(Xs )) ] Expending, we get eλs πs (Xs ) = EP [eλs C(Xs ) ] The seller indifference price becomes πs (Xs ) = E.5.4.2 1 log EP [eλs C(Xs ) ] λs Computing option prices We consider a call option price with maturity T , strike K, and discounted payoff C = PT (XT − K)+ where PT = P (0, T ) is the discount factor and Xt is the underlying price at time t. Buyer indifference price Given the indifference price of the buyer πb (Xb ) defined in the previous section, we need to compute the expectation of the right hand side. To simplify notations, we use X = Xb and E[X] = EP [X]. We can then write + E[e−λb C(X) ] = E[e−λb PT (XT −K) ] E[e−λb C(X) ] = E[e−λb PT (XT −K)1I{XT ≥K} ] Expending we get, E[e−λb C(X) ] = E[1I{XT > 1. We can then re-write the Fourier transform as Z N 2 αN 2 H(u) ≈ e iux −1 X h(x)dx ≈ −α N 2 eiuxp h(xp )∆ p=− N 2 so that xp goes from µ to N ∆. Since the function h(.) is sampled over N points, the output transform H(.) must also 2π( N −q) be sampled over N points. Therefore, we will discretise the Fourier transform in uq = N2∆ for q = 0, .., N − 1 1 1 such that uq goes from 2π 2∆ to 2π(− 2∆ + N1∆ ) where N1∆ is the step of the frequency. Note, we could as well have considered the discretisation xp = (p − N 2 )∆ and uq = iuq xp = πi( 2π(q− N 2 ) N∆ for p, q = 0, .., N − 1. Then, given N 2πi − p) − iπq + pq 2 N the Fourier transform becomes N 2 H(uq ) = −1 X N 2 e iuq xp h(xp )∆ = e −iπq p=− N 2 −1 X p=− N 2 663 e 2πi N pq N h(xp )eπi( 2 −p) ∆ Quantitative Analytics N 2πi So, if we define Ap = h(xp )eiπ( 2 −p) ∆, Hq = eiπq H(uq ) and WNpq = e N pq we get the system of equations A0 WN0,0 ... ... WN0,N −1 H0 ... ... ... ... ... 0 = ... ... ... ... ... ... AN −1 HN −1 WNN −1,0 ... ... WNN −1,N −1 and we see that the calculation with this method is of order 0(N 2 ). However, we can reduce the order of computation by using the FFT algorithm, getting the Fourier transform as (Hq )(0≤q≤N −1) = F F T (N, (Ap )(0≤p≤N −1) ) (0≤q≤N −1) The main idea behind the FFT is to write this sum of length N as the sum of two Fourier transforms each of them 2πi 2πi p(q+N ) pq being of length N2 (see Danielson and Lanczos). So we get WN2pq = e N pq = e N/2 pq = W N and also WN = e 2πi N p(q+N ) =e 2πi N pq+2πip p(q+ N 2 ) = WNpq so that WN Hq = N −1 X WNpq Ap = N −1 X p=0 = N −1 X = WN2pq A2p + p=0 N −1 X 2 (2p+1)q WN A2p+1 WN2pq A2p+1 p=0 pq WN A2p + WNq N −1 X 2 p=0 N −1 X p=0 pq WN A2p + WNq p=0 N −1 X 2 = −WNpq . Therefore, the Fourier transform becomes pq WN A2p+1 2 p=0 Let’s now define (Bp )(0≤p≤N −1) ) and (Cp )(0≤p≤N −1) ) such that Bp = A2p and Cp = A2p+1 . Then, if 0 ≤ q ≤ N 2 − 1, the Fourier transform re-write N 2 Hq = −1 X N 2 W N Bp + p=0 = while if N 2 pq 2 WNq −1 X pq WN Cp p=0 2 N N F F T ( , (Bp ) q + WNq F F T ( , (Cp ) q 2 2 ≤q ≤N −1 N 2 Hq = Hk+ N = −1 X 2 p=0 = N 2 pk W N Bp + 2 WNq −1 X p=0 pk WN Cp 2 N N F F T ( , (Bp ) q− N + WNq F F T ( , (Cp ) q− N 2 2 2 2 which can then be computed recursively using the symmetry in the calculation of the factors WNpq . Note, F F T ( N2 , (Bp ) is the Fourier transform of length N2 from the even components, and F F T ( N2 , (Cp ) is the corresponding transform of length N2 formed from the odd components. This solution is recursive, as we can reduce F F T ( N2 , (Bp ) by computing the transform of its N4 even-numbered input data and N4 odd-numbered data, hence the necessity for N to be an integer power of 2. This process is repeated until we have subdivided the data all the way down to transforms of length one. Hence, there is a one-point transform that is just one of the input numbers uq , and using bit reversal one can find out the q corresponding to the right equation. 664 Quantitative Analytics F.2 From spline analysis to wavelet analysis The need for a continuous signal representation comes up every time we need to implement numerically an operator initially defined in the continuous domain. The sampling theory introduced by Shannon [1949] provide a solution to this problem. It describes an equivalence between a band-limited function and its equidistant samples taken at a frequency that is superior or equal to the Nyquist rate. However, this approaches faces a lot of problems. An alternative approach is to use splines introduced by Schoenberg [1946], which offer many practical advantages. One of the main advantage of using splines is that we can always obtain a continuous representation of a discrete signal by fitting it with a spline in one or more dimensions. The fit may be exact (interpolation) or approximate (least-squares or smoothing splines). While splines developed in various field (computer science), there was little crossover to signal processing until the development of wavelet theory (see Mallat [1989]). Since we have extensively discussed wavelet analysis to filter and forecast time series, we are now going to introduce splines in view of relating the two methods. We will follow Unser [1999] who provided a clear tutorial on splines. F.2.1 An introduction to splines Splines are piecewise polynomials with pieces that are smoothly connected together, where joining points are called knots. For a spline of degree n, each segment is a polynomial of degree n, but imposing the continuity of the spline and its derivatives up to the order (n − 1) at the knots, there is only one degree of freedom per segment. Considering only splines with uniform knots and unit spacing, they are uniquely characterised in terms of B-spline expansion X s(x) = c(k)β n (x − k) (F.2.4) k∈Z which involves the integer shifts of the central B-spline of degree n denoted by β n (x). We can construct symmetrical, bell-shaped functions B-spline from the (n + 1)-fold convolution of a rectangular pulse β 0 given by 1 if − 21 < x < 12 0 1 if |x| = 12 β (x) = 2 0 otherwise with β n = β 0 ∗ β 0 ∗ ... ∗ β 0 (x) , (n + 1) times Since the B-spline in Equation (F.2.4) is linear, we can easily study the properties of the basic atoms. Further, each spline is characterised by its sequence of coefficients c(k), giving the spline the convenient structure of a discrete signal, even though the underlying model is continuous. Using β 0 we can construct the cubic B-spline as |x|3 32 − |x|2 + 2 if 0 < |x| < 1 3 (2−|x|) β 3 (x) = if 1 ≤ |x| < 2 6 0 if 2 ≤ |x| which is used for performing high-quality interpolation. The interpolation problem consists in determining the Bspline model of a given input signal s(k), where the coefficients are determined such that the function goes through the data points exactly. For degrees n = 0 and n = 1 the coefficients are identical to the signal samples, c(k) = s(k), but it is not the case for higher degrees. One can solve the problem by using digital filtering techniques. We consider the B-spline kernel bnm obtained by sampling the B-spline of degree n expanded by a factor m, that is, X x n bnm = β n ( ) x=k ↔ Bm (z) = bnm (k)z −k m k∈Z 665 Quantitative Analytics Then, given the signal samples s(k), we want to estimate the coefficients c(k) from Equation (F.2.4) such that we have a perfect fit at the integers. That is, we want to solve X c(l)β n (x − l) x=k = s(k) l∈Z Using the discrete B-splines, we can rewrite this constraint in terms of a convolution s(k) = (bn1 ∗ c)(k) and defining the inverse convolution operator (bn1 )−1 (k) ↔ 1 B1n (z) the solution is found by inverse filtering c(k) = (bn1 )−1 ∗ s(k) We are now going to define the cardinal spline basis functions that are the spline analogs of the sinc function in the approach for band-limited functions. We have X s(x) = s(k)η n (x − k) k∈Z where the cardinal spline of degree n is η n (x) = X (bn1 )−1 (k)β n (x − k) k∈Z which provides a spline interpolation formula using the signal values coefficients. In order to introduce spline sampling theory, we first define a general spline generating function X φ(x) = p(k)β n (x − k) (F.2.5) k∈Z with the restriction that the sequence p is such that the integer translations of φ form a basis of the basic spline space. Two important special cases are the B-spline with p(k) = δ(k), and the cardinal spline with p = (bn1 )−1 . Since we want to vary the sampling step, we define the spline space of degree n with step size T by rescaling the model in Equation (F.2.4) as X x STn = {sT (x) = c(k)φ( − k); c(k) ∈ l2 } T k∈Z That is, we take linear combinations (with finite energy) of the spline basis functions φ rescaled by a factor T and spaced accordingly. We now want to approximate an arbitrary signal s(x) with a spline sT ∈ STn using the L2 -norm ||s − ST ||2 induced by the L2 inner product 3 . According to this criterion, the minimum error approximation of s(x) ∈ L2 in STn is given by its orthogonal projection onto STn . As a result, the coefficients of the best approximation (least-squares solution) are given by cT (k) = x 1 < s(x), φ̇( − k) > T T where φ̇(x) ∈ S1n is the dual of φ(x), in the sense that 3 < f, g >= R∞ −∞ 1 f ∗ (x)g(x)dx and ||f ||2 =< f, f > 2 666 (F.2.6) Quantitative Analytics < φ̇(x − k), φ(x − l) >= δ(k − l) (bi-orthogonality condition). Note, the process of performing a least-square spline approximation of a signal is linked to that of obtaining its band-limited representation using the standard sampling procedure. The only difference being in the choice of the appropriate analog pre-filter. Since we are performing an orthogonal projection, the approximation error will be non-zero unless the signal is already included in the approximation space. The error can be controlled by choosing a sufficiently small sampling step T . In approximation theory, a fundamental result states that the rate of decay L of the error as a function of T depends on the ability of the representation to produce polynomials of degree n = L − 1. The approximation error also depends on the bandwidth of the signal. The relevant measure is Z ∞ 1 1 ω 2L |ŝ(ω)|2 dω 2 ||s(L) || = 2π −∞ where ŝ(ω) is the Fourier transform of s. Hence, it is the norm of the L-th derivative of s. The key result from the Strang-Fix theory of approximation is the following error bound (see Strang et al. [1971]) ∀s ∈ W2L , ||s − PT s|| ≤ CL T L ||s(L) || where PT s is the least-squares spline approximation of s at sampling step T , CL is a known constant, and W2L denotes the space of functions being L-times differentiable in the L2 space. Hence, the error will decay like O(T L ), where the order L = n + 1 is one more than the degree n. That is, spline interpolation gives the same rate of decay as the least-squares approximation in Equation (F.2.6), but with a larger leading constant. F.2.2 Multiresolution spline processing If we dilate a spline by a factor m with knots at the integers, the resulting function is also a spline with respect to the initial integer grid. That is, for scale-invariance to hold, we need the spline knots to be positioned on the integers. This observation is the key to the multiresolution properties of splines, making them perfect candidates for the construction of wavelets and pyramids. Hence, we consider the shifted causal B-splines n+1 ) 2 having the required property. Similarly to the centred B-spline β n (x), we can construct φn (x) from the (n + 1)-fold x convolution of φ0 , the indicator function in the unit interval. That is, φ0 ( m ) which is 1 for x ∈ [0, m) and 0 otherwise, can be written as φn (x) = β n (x − φ0 ( m−1 X X x )= φ0 (x − k) = h0m (k)φ0 (x − k) m k=0 k∈Z Pm−1 where is the filter whose z-transform is = k=0 z −k (discrete pulse of size m). By convolving this equation with itself (n + 1)-times and performing the appropriate normalisation, we get X x φn ( ) = hnm (k)φn (x − k) (F.2.7) m h0m (k) 0 Hm (z) k∈Z where n Hm (z) = m−1 n+1 1 1 X −k n+1 0 H (0) = z mn m mn k=0 This is a two-scale equation, indicating that a B-spline of degree n dilated by m can be expressed as a linear combination of B-splines. Note, the two-scale Equation (F.2.7) holds for any integer m, and the refinement filter is the 667 Quantitative Analytics (n + 1)-fold convolution of the discrete rectangular impulse of width m. In the standard case where m = 2, H2n (z) is the binomial filter playing a central role in the wavelet transform theory (see Strang et al. [1996]). The filter coefficients appear in the Pascal triangle, and in the case of the B-spline of degree 1 we get the third line of Pascal’s triangle. When constructing multiscale representations of signals, or pyramids, we consider scaling factors that are n powers of two. The implication of the two-scale relation for m = 2 is that the spline subspaces Sm , with m = 2i , n n n are nested S1 ⊃ S2 ⊃ ... ⊃ S2i .... If we let P2i s = si be the minimum error approximation of some continuously defined signal s(x) ∈ L2 at the scale m = 2i , we get X x P2i s = c2i (k)φ( i − k) 2 k∈Z where φ( 2xi − k) are the spline basis functions at the scale m = 2i . Note, one implication of the nested property is that the coefficients c2i (k), formally computed from Equation (F.2.6), can be computed iteratively using a combination of discrete pre-filtering and down-sampling operations. Remark F.2.1 The key observation is that we can obtain P2i s = si if we simply re-approximate si−1 at the next finer scale, P2i s = P2i si−1 . Thus, we may compute the expansion coefficients as c2i (k) = X 1 x x < c2i−1 φ( i−1 − l), φ̇( i − k) > i 2 2 2 l∈Z Using the two-scale relation to precompute the sequence of inner products ḣ(k) = 1 x x x < φ( i−1 + k), φ̇( i − k) >=< φ(x + k), φ̇( ) > 2i 2 2 2 one can show that c2i (k) are evaluated by pre-filtering with ḣ and down-sampling by a factor of 2 c2i (k) = (ḣ ∗ c2i−1 )(2k) Note, rather than minimising the continuous L2 error, we can also construct spline pyramids that are optimal in the discrete l2 norm by performing a small modification of the reduction filter ĥ. This technique is known as spline regression in statistics. Most of the spline pyramids use symmetric filters centred on the origin. The L2 spline pyramid described above has all the required properties for a multiresolution analysis of L2 in the sense defined by Mallat [1989]. In the wavelet theory, the multiresolution analysis is dense in L2, so that we can construct the associated wavelet bases of L2 with no difficulty, and obtain an efficient, non-redundant, way of representing the difference images. Since image reduction is achieved by repeated projection, the difference between two successive signal approximations P2i−1 f and P2i f belong to the subspace W2ni . It is the complement of S2ni with respect to S2ni−1 , that is, S2ni−1 = S2ni ⊕ W2ni with S2ni ∩ W2ni = {0}. Then, the wavelet ψ(x) generate the basis functions of the residual spaces x − k))k∈Z 2i For some applications, it is more concise to express the residues W2ni = Span(ψ( P2i−1 f − P2i f ∈ W2ni 668 Quantitative Analytics using wavelets rather than the basis functions of V2ni−1 . In wavelet theory, splines constitute a case apart because they give rise to the only wavelets having a closed-form formula (piecewise polynomial). All other wavelet bases are defined indirectly by an infinite recursion. This is why most of the earlier wavelet constructions were based on splines. For instance, the Haar wavelet transform (n = 0) (see Haar [1910]), the Franklin system (n = 1), Stromberg’s onesided orthogonal splines, the Battle-Lemarie wavelets (see Battle [1987]). There are now several other sub-classes of spline wavelets available differing in the type of projection used and in their orthogonality properties. For instance, the class of semi-orthogonal wavelets, which are orthogonal with respect to dilation (see Unser et al. [1993]). They span the same space as the Battle-Lemarie splines, but they are not constrained to be orthogonal. Of particular interest are the B-spline wavelets, which are compactly supported and optimally localised in time and frequency (see Unser et al. [1992]). The only downside of semi-orthogonal wavelets is that some of the corresponding wavelet filters are IIR. While it is not a serious problem in practice due to fast recursive algorithms, researchers have also designed spline wavelets such that the corresponding wavelet filters are FIR. These bi-orthogonal wavelets are constructed using two multiresolutions instead of one, with the spline spaces on the synthesis side. The major difference with the semiorthogonal case being that the underlying projection operators are oblique rather than orthogonal. Bi-orthogonal spline wavelets are short, symmetrical, easy to implement (FIR filter bank), and very regular. Further, in that subclass, we can still orthogonalise the wavelets with respect to shifts, leading to the shift-orthogonal wavelets. F.3 A short introduction to wavelet transform methods F.3.1 The continuous wavelet transform Following Addison [2002], we give an overview of the theory of wavelet transform methods focusing on continuous and discrete wavelet transforms of continuous signal. For further details and applications the readers should refer to the book. The wavelet transform is a method for converting a function (or signal) into another form either making certain features of the original signal more amenable to study, or enabling the original data set to be described more succinctly. In any case, we need a wavelet, which is a function ψ(t) with certain properties, undergoing translation (movements along the time axis) (see Figure ( F.1(a))) and dilation (spreading out of the wavelet) (see Figure ( F.1(b))) to transform the signal into another form which unfolds it in time and scale. There are a large number of wavelets to choose from depending on both the nature of the signal and what we require from the analysis (see Figure ( F.2)). For instance, all derivatives of the Gaussian function may be employed as a wavelet. As an example, the second derivative t2 of the Gaussian distribution function e− 2 with unit variance but without the normalisation factor √12π is called the Mexican hat wavelet defined as t2 ψ(t) = (1 − t2 )e− 2 669 Quantitative Analytics 1000 1500 2000 2500 3000 3500 Time (a) Wavelet translation (b) Wavelet rescaling Figure F.1: The two properties that allow wavelet to capture signal features (a) Haar (b) Daubechies 4 (c) Daubechies 8 (d) Daubechies 20 Figure F.2: Some examples of wavelets A function must satisfy certain mathematical criteria to be classified as a wavelet 1. it must have finite energy Z ∞ |ψ(t)|2 dt < ∞ E= −∞ where E is the energy. 2. if ψ̂(f ) is the Fourier transform of ψ(t), then the following condition must hold Z ∞ |ψ̂(f )|2 Cg = df < ∞ f 0 implying that the wavelet ψ(t) must have a zero mean. This is the admissibility condition and Cg is the admissibility constant. 3. in case of complex wavelets, the Fourier transform must both be real and vanish for negative frequencies. Wavelets satisfying the admissibility condition are bandpass filters, letting through only signal components within a finite range of frequencies (passband) and in proportion characterised by the energy spectrum of the wavelet. A plot 670 Quantitative Analytics of the squared magnitude of the Fourier transform against frequency for the wavelet gives its energy spectrum. The √ 2 peak of the energy spectrum occurs at a dominant frequency of fp = ± 2π . The second moment of area of the energy spectrum is used to define the passband centre of the energy spectrum v uR ∞ u f 2 |ψ̂(f )|2 df fc = t 0R ∞ |ψ̂(f )|2 df 0 where fc is the standard deviation of the energy spectrum about the vertical axis. The energy of a function is also given by the area under its energy spectrum Z ∞ E= |ψ̂(f )|2 df −∞ so that Z ∞ |ψ(t)|2 dt = Z −∞ ∞ |ψ̂(f )|2 df −∞ In practice, the wavelet function is normalised to get unit energy. To make the wavelet more flexible we can either stretch and squeeze it (dilation) with a parameter a, or we can move it (translation) with a parameter b. The shifted and dilated versions of the mother wavelet are denoted ψ( t−b a ). The wavelet transform of a continuous signal with respect to the wavelet function is defined as Z ∞ t−b T (a, b) = w(a) x(t)ψ ∗ ( )dt a −∞ where w(a) is a weighting function. The asterisk indicates that the complex conjugate of the wavelet function is used in the transform. The wavelet transform can be considered as the cross-correlation of a signal with a set of wavelets of various widths. For instance, for reasons of energy conservation, one set w(a) = √1a leading to the continuous wavelet transform (CWT). The normalised wavelet function is often written as t−b 1 ) ψa,b (t) = √ ψ( a a (F.3.8) so that the transform integral becomes Z ∞ ∗ x(t)ψa,b (t)dt T (a, b) = (F.3.9) −∞ corresponding to the convolution of the wavelet and the signal. Using the inner product, we get T (a, b) =< x, ψa,b > The wavelet transform is sometime called a mathematical microscope, where b is the location on the time series and a is associated with the magnification at location b. Continuous wavelet transforms are computed over a continuous range of a and b leading to a wavelet transform plot presented in a contour plot or as a surface plot. Another useful property of the wavelet transform is its ability to identify abrupt discontinuities (edges) in the signal. As the wavelet traverses the discontinuity there are first positive then negative values returned by the transform integral (located in the vicinity of the discontinuity). The inverse wavelet transform is defined as Z ∞Z ∞ 1 1 x(t) = T (a, b)ψa,b (t) 2 dadb (F.3.10) Cg −∞ 0 a 671 Quantitative Analytics to recover the original signal from its wavelet transform. Note, the original wavelet function is used rather than its conjugate which is used in the forward transformation. By limiting the integration range over a range of a scales, we can perform a basic filtering of the original signal. We are reconstructing the signal using Z ∞Z ∞ 1 1 T (a, b)ψa,b (t) 2 dadb x(t) = Cg −∞ a∗ a over the range of scales a∗ < a < ∞ where a∗ is the cutt-off scale. Since high frequency corresponds to small a scale, we are in effect reducing the high frequency noise, known as scale-dependent thesholding. This way of reconstructing the signal allows for denoising applied locally. A better way to separate pertinent signal features from unwanted noise, using the continuous wavelet transform, is by using a wavelet transform modulus maxima method. The modulus maxima lines are the loci of the local maxima and minima of the transform plot with respect to b, traced over wavelet scales. Following maxima lines down from large to small a scales allows the high frequency information corresponding to large features within the signal to be differentiated from high frequency noise components. It can be used as methods for filtering out noise from coherent signal features. We are now presenting some signal energy such as wavelet-based energy and power spectra. The total energy contained in a signal x(t) is defined as its integrated squared magnitude Z ∞ E= |x(t)|2 dt = ||x(t)||2 −∞ so that the signal must contain finite energy. The relative contribution of the signal energy contained at a specific a scale and b location is given by the two dimensional wavelet energy density function E(a, b) = |T (a, b)|2 and the plot of E(a, b) is the scalogram. It can be integrated across a and b to recover the total energy in the signal using the admissibility constant Z ∞Z ∞ 1 1 |T (a, b)|2 2 dadb E= Cg −∞ 0 a The scalogram surface highlights the location and scale of dominant energetic features within the signal. The relative contribution to the total energy contained within the signal at a specific a scale is given by the scale dependent energy distribution Z ∞ 1 E(a) = |T (a, b)|2 db Cg −∞ and peaks in E(a) highlight the dominant energetic scales within the signal. We can convert the scale dependent wavelet energy spectrum of the signal, E(a), to a frequency dependent wavelet energy spectrum EW (f ) to compare with the Fourier energy spectrum of the signal EF (f ). We must convert from the wavelet a scale to a characteristic frequency of the wavelet. One can use the passband centre of the wavelet’s power spectrum or another representative frequency of the mother wavelet such as the spectral peak frequency fp or the central frequency f0 . Since the spectral components are inversely proportional to the dilation f ∝ a1 and for a = 1 we get fc , using this passband frequency, the characteristic frequency associated with a wavelet of arbitrary a scale is fc a where fc becomes a scaling constant, and f is the representative or characteristic frequency for the wavelet at scale a. We can now associate the scale dependent energy E(a) to the passband frequency of the wavelet. The total energy in the signal is given by f= 672 Quantitative Analytics ∞ Z E= E(a) 0 1 da a2 Making the change of variable f = fac , we can rewrite the equation in terms of the passband frequency. The derivative df in the integral becomes da a2 = − fc , and swapping the integral limits to get rid of the negative sign, we get Z ∞ E= EW (f )df 0 E(a) fc and the subscripts W corresponds to wavelet to differentiate it from its Fourier counterpart. where EW (f ) = The wavelet energy spectrum, which is the plot of the wavelet energy EW (f ) against f , has an area underneath it equal to the total signal energy and may be compared with the Fourier energy spectrum EF (f ) of the signal. The total energy in the signal becomes Z ∞Z ∞ 1 |T (f, b)|2 df db E= Cg fc −∞ 0 where T (f, b) = T (a, b) for f = E(f, b) = 2 |T (f,b)| Cg fc fc a . Further, the energy density surface in the time-frequency plane, defined by , contains a volume equal to the total energy of the signal Z ∞Z ∞ E= E(f, b)df db −∞ 0 which can be compared to the energy density surface of the short time Fourier transform (the spectrogram). Since the peaks in E(a, b) and E(a) correspond to the most energetic parts of the signal as do the peaks in E(f, b) and E(f ), we can use both the scalogram and the scale dependent energy distribution to determine the energy distribution relative to the wavelet scale. Scalograms are normally plotted with a logarithmic a scale axis. The power spectrum is the energy spectrum divided by the time period of the signal, and the area under the power spectrum gives the average energy per unit time (the power) of the signal. For a signal of length τ , the Fourier and wavelet power spectra are, respectively, PF (f ) = PW (f ) = 1 EF (f ) τ Z τ 1 1 EW (f ) = |T (f, b)|2 db τ τ f c Cg 0 The wavelet spectrum is more than simply a smeared version of the Fourier spectrum as the shape of the wavelet itself is an important parameter in the analysis of the signal. Also, the resulting wavelet power spectrum of the signal is dependent on the characteristic frequency of the wavelet (fc in this study). At last, the wavelet variance, defined in the continuous time as Z 1 τ σ 2 (a) = |T (a, b)|2 db τ 0 is used in practice to determine dominant scales in the signal (τ must be of sufficient length). Note, it differs from the scale dependent energy distribution and the power spectral density function only by constant multiplicative factors. We can use the convolution theorem to express the wavelet transform in terms of products of the Fourier transform of the signal x̂(f ) and wavelet ψ̂a,b (f ) Z ∞ ∗ T (a, b) = x̂(f )ψ̂a,b (f )df −∞ 673 Quantitative Analytics where the conjugate of the wavelet function is used. The Fourier transform of the dilated and translated wavelet is Z ∞ 1 t − b −i(2πf )t √ ψ( ψ̂a,b (f ) = )e dt a a −∞ 0 Making the substitution t = t−b a 0 (dt = adt ) we get Z ∞ 0 0 0 1 √ ψ(t )e−i(2πf )(at +b) adt ψ̂a,b (f ) = a −∞ 0 Separating out the constant part of the exponential function and dropping the prime from t we get Z √ −i(2πf )b ∞ ψ(t)e−i(2πaf )t dt ψ̂a,b (f ) = ae −∞ which is the Fourier transform of the wavelet at rescaled frequency af . Hence, we get the relation ψ̂a,b (f ) = √ aψ̂(af )e−i(2πf )b Adding the asterisk to the wavelet in the above equation and changing the sign in front of the imaginary term, we obtain the Fourier transform of the wavelet conjugate. At last, the wavelet transform can be written in expanded form as Z ∞ √ T (a, b) = a x̂(f )ψ̂ ∗ (af )ei(2πf )b df −∞ which has the form of an inverse Fourier transform. It is very useful when using the discretised approximation of the continuous wavelet transform with large signal data set as we can use the fast Fourier transform (FFT) algorithm to speed up computation time. Further, the Fourier transform of the wavelet function ψ̂a,b (f ) is usually known in analytic form, and need not be computed using an FFT. Only an FFT of the original signal x̂(f ) is required, then, to get T (a, b) we take the inverse FFT of the product of √ the signal Fourier transform and the wavelet Fourier transform for each required a scale and multiply the result by a. One property of wavelet is that it can localise itself in time for short duration (high frequency) fluctuations. But, in that time frame, there is an associated spreading of the frequency distribution associated with wavelets. Conversely, there is a spreading in temporal resolution at low frequencies. The spread of |ψa,b (t)|2 and |ψ̂a,b (f )|2 can be quantified using σt and σf respectively (standard deviations around their respective means). The spread of the wavelets in the time-frequency plane can be represented by drawing boxes of side lengths 2σt by 2σf , called the Heisenberg boxes after the Heisenberg uncertainty principle which address the problem of the simultaneous resolution in time and frequency that can be attained when measuring a signal. The more accurate the temporal measurement (smaller σt ) the less accurate the spectral measurement (larger σf ) and vice versa. One solution is to consider the short-time Fourier transform (STFT) which employs a window function to localise the complex sinusoid Z ∞ F (f, b) = x(t)h(t − b)e−i2πf t dt −∞ where h(t − b) is the window function which confines the complex sinusoid e−i2πf t . There are many shapes of window available such as Hanning, Hamming, cosine, Kaiser and Gaussian. The combined window plus the complex sinusoid is known as the window Fourier atom or time-frequency atom given by hf,b (t) = h(t − b)ei2πf t We obtain the time-frequency decomposition by convolving the complex conjugate of this atom with the signal x(t). Assuming a Gaussian window, we get the Gabor STFT having a very similar form to the Morlet wavelet transform. 674 Quantitative Analytics While the Morlet wavelet has a form very similar to the analysing function used for the STFT within a Gaussian window, in the former we scale the window and enclosed sinusoid together, whereas in the later we keep the window length constant and scale only the enclosed sinusoid. F.3.2 The discrete wavelet transform F.3.2.1 An infinite summations of discrete wavelet coefficients When certain criteria are met it is possible to completely reconstruct the original signal using infinite summations of discrete wavelet coefficients rather than continuous integrals. One can sample the parameters a and b by using a logarithmic discretisation of the a scale and link it to the size of steps taken between b locations. To do so, we move in discrete steps to each location b which are proportional to the scale a, getting the wavelet form t − nb0 am 1 0 ) ψm,n (t) = p m ψ( am a0 0 where the integers m and n control the wavelet dilation and translation respectively. Also, a0 > 1 is a fixed dilation step parameter, and b0 > 0 is the location parameter. Hence, the step of the translation steps ∆b = b0 am 0 is directly proportional to the wavelet scale am 0 . In that setting, the wavelet transformation becomes Z ∞ 1 Tm,n = x(t) 1 ψ(a−m 0 t − nb0 )dt −∞ a02 written with the inner product as Tm,n =< x, ψm,n > where Tm,n is the discrete wavelet transform with values known as wavelet coefficients (detail coefficients). The wavelet frames, providing a general framework, are constructed by discretely sampling the time and scale parameters of a continuous wavelet transform as detailed above. Within that framework, the energy of the resulting wavelet coefficients must lies with a certain bounded range of the energy, E, of the original signal AE ≤ ∞ X ∞ X |Tm,n |2 ≤ BE m=−∞ n=−∞ where the bounds A and B depend on the parameters a0 and b0 chosen. In the special case where A = B the frame is tight, and the formula becomes x(t) = ∞ ∞ 1 X X Tm,n ψm,n (t) A m=−∞ n=−∞ and • when A = B = 1 the frame forms an orthonormal basis, • if A = B > 1 the frame is redundant, • and for A 6= B the constant in the above equation is modified to 2 A+B . For a0 = 2 and b0 = 1 we get the dyadic grid arrangement (power of two logarithmic scaling of the dilation and translation steps), and the wavelet becomes 1 t − n2m 1 t ψm,n (t) = √ ψ( ) = √ ψ( m − n) m m m 2 2 2 2 (F.3.11) Assuming A = B = 1, the wavelets are both orthogonal to each other and normalised to have unit energy. That is, 675 Quantitative Analytics Z ∞ −∞ ψm,n (t)ψm0 ,n0 (t)dt = 0 1 if m = m and n = n 0 otherwise 0 so that the information stored in the wavelet coefficient Tm,n is not repeated elsewhere, avoiding redundancy. Given the discrete wavelet transform (DWT) Z ∞ x(t)ψm,n (t)dt Tm,n =< x, ψm,n >= −∞ if ψm,n (t) is an orthonormal basis (A = B = 1), we can reconstruct the original signal in terms of Tm,n using the inverse discrete wavelet transform (IDWT) x(t) = ∞ X ∞ X Tm,n ψm,n (t) m=−∞ n=−∞ So, on one hand we have the DWT where the transform integral remains continuous but determined only on a discretised grid of a and b, and on the other hand the discretised approximations of the CWT (discrete approximation of the transform integral computed on a discrete grid of a and b). F.3.2.2 The scaling function The scaling function is associated with the smoothing of the signal and has the form of the wavelet m φm,n (t) = 2− 2 φ(2−m t − n) (F.3.12) with the property Z ∞ φ0,0 (t)dt = 1 −∞ where φ0,0 (t) = φ(t) is the father scaling function or father wavelet. The scaling function is orthogonal to translation of itself, but not to dilations of itself, and it can be convolved with the signal to produce approximation coefficients Z ∞ Sm,n =< x, φm,n >= x(t)φm,n (t)dt (F.3.13) −∞ m which are simply weighted averages of the continuous signal factored by 2 2 . These approximations at a specific scale m are the discrete approximation of the signal at that scale and can be combined to generate the continuous approximation at scale m xm (t) = ∞ X Sm,n φm,n (t) n=−∞ where xm (t) is a smooth, scaling function dependent, version of the signal x(t) at scale m. It approaches x(t) at small scales, as m → −∞. We can represent a signal x(t) using a combined series expansion using both the approximation coefficients and the wavelet coefficients x(t) = ∞ X Sm0,n φm0,n (t) + n=−∞ m0 X ∞ X m=−∞ n=−∞ The signal detail at scale m is defined as 676 Tm,n φm,n (t) Quantitative Analytics ∞ X dm (t) = Tm,n φm,n (t) (F.3.14) n=−∞ so that the signal becomes x(t) = xm0 (t) + m0 X dm (t) (F.3.15) m=−∞ which is a linear combination of the details. Hence, one can show that xm−1 (t) = xm (t) + dm (t) (F.3.16) stating that adding the signal detail at an arbitrary scale (index m) to the approximation at that scale, we get the signal approximation at an increased resolution (index m − 1), which is called the multiresolution representation. The scaling equation (or dilation equation) describes the scaling function φ(t) in terms of contracted and shifted versions of itself X φ(t) = ck φ(2t − k) (F.3.17) k where φ(2t − k) is a contracted version of φ(t) shifted along the time axis by an integer step k and factored by an associated scaling coefficient ck . That is, we can build a scaling function at one scale from a number of scaling equations at the previous scale. Note, wavelets of compact support have sequences of nonzero scaling coefficients of finite length. The scaling coefficients must satisfy the constraint X ck = 2 k so that to create an orthogonal system we must have X ck ck+2k = 0 k 0 2 if k = 0 0 otherwise and the sum of the squares of the scaling coefficients is equal to 2. Similarly, the differencing of the associated wavelet equation satisfies X ψ(t) = (−1)k c1−k φ(2t − k) (F.3.18) k ensuring orthogonality between the wavelets and the scaling functions. In the case of wavelets of compact support the equation becomes X ψ(t) = (−1)k cNk −1−k φ(2t − k) k over the interval [0, Nk − 1]. Given the coefficient bk = (−1)k cNk −1−k where the sum of all bk is zero, the equation becomes ψ(t) = X bk φ(2t − k) k 677 Quantitative Analytics Plugging the scaling equation (F.3.17) into the scaling function in Equation (F.3.12), we get X m φm,n (t) = ck 2− 2 φ(2−m+1 t − (2n + k)) k As a result, for a wavelet at scale index m + 1, we get X 1 X φm+1,n (t) = √ ck φm,2n+k (t) = hk φm,2n+k (t) 2 k k ck , stating that the scaling function at an arbitrary scale is made of a sequence of shifted scaling functions where hk = √ 2 at the next smaller scale each factored by their respective scaling coefficients. Similarly, for the wavelet function we get X 1 X ψm+1,n (t) = √ bk φm,2n+k (t) = gk φm,2n+k (t) 2 k k The vectors containing the sequences √12 ck and √12 bk represent the filters hk and gk , respectively. That is, hk = √12 ck is a low-pass filter, and gk = √12 bk is a high-pass filter in the associated analysis filter bank. The former is the lowpass filter letting through low signal frequencies (a smoothed version of the signal), and the latter is the highpass filter letting through the high frequencies corresponding to the signal details. These filters defined the Quadrature Mirror Filters (QMF) (see Vaidyanathan [1992]). F.3.2.3 The FWT algorithm We can now express the approximation coefficients and the wavelet coefficients in term of the scaling function at a specific scale. The approximation coefficients at scale index m + 1 are given by Z ∞ Sm+1,n =< x, φm+1,n >= x(t)φm+1,n (t)dt −∞ Replacing φm+1,n (t) with its expression above, we get Z ∞ 1 X ck φm,2n+k (t) dt Sm+1,n = x(t) √ 2 k −∞ which we rewrite as Sm+1,n 1 X =√ ck 2 k Z ∞ x(t)φm,2n+k (t)dt −∞ where the integral gives the approximation coefficients Sm,2n+k for each k. Hence, the approximation coefficients become X 1 X 1 X ck Sm,2n+k = √ ck−2n Sm,k = hk−2n Sm,k Sm+1,n = √ 2 k 2 k k (F.3.19) We can therefore generate the approximation coefficients S•,n , at scale index m + 1, by using the scaling coefficients at the previous scale. Similarly, the wavelet coefficients, T•,n , can be found from the approximation coefficients at the previous scale by using the reordered scaling coefficients bk X 1 X 1 X Tm+1,n = √ bk Sm,2n+k = √ bk−2n Sm,k = gk−2n Sm,k 2 k 2 k k 678 (F.3.20) Quantitative Analytics Hence, knowing the approximation coefficients Sm0 ,n at a specific scale m0 , and then using the above equations repeatedly, we can generate the approximation and detail wavelet coefficients at all scales larger than m0 . Note, we do not need to know exactly the continuous signal x(t) but only Sm0 ,n . Equations (F.3.19) and (F.3.20) represent the multiresolution decomposition algorithm, which is the first half of the fast wavelet transform (FWT). These iterating equations perform respectively a highpass and lowpass filtering of the input where the vectors containing the sequences hk and gk represent the filters. Expanding Equation (F.3.16), we get X X xm−1 (t) = Sm,n φm,n (t) + Tm,n ψm,n (t) n n which we can expand in terms of the scaling function at the previous scale as xm−1 (t) = X n X 1 X 1 X ck φm−1,2n+k (t) + Tm,n √ bk φm−1,2n+k (t) Sm,n √ 2 k 2 k n Rearranging the summation indices, we get xm−1 (t) = X n X 1 X 1 X Sm,n √ Tm,n √ ck−2n φm−1,k (t) + bk−2n φm−1,k (t) 2 k 2 k n or equivalently xm−1 (t) = X n Sm,n X hk−2n φm−1,k (t) + X n k Tm,n X gk−2n φm−1,k (t) k We can also expand xm−1 (t) in terms of the approximation coefficients at scale m − 1 X xm−1 (t) = Sm−1,n φm−1,n (t) n Equating the coefficients in these two equations we see that the index k at scale index m relates to the location index n at scale index m − 1. Further, the location index n in the first equation above corresponds to scale index m with associated location spacings 2m , while the index n in the second equation corresponds to scale index m − 1 with discrete location spacings 2m−1 making this n indices twice as dense as the first one. We can therefore swap the indices k and n in the first equation before equating the two expressions, getting the reconstruction algorithm X X 1 X 1 X Sm−1,n = √ cn−2k Sm,k + √ bn−2k Tm,k = hn−2k Sm,k + gn−2k Tm,k 2 k 2 k k k (F.3.21) where k is reused as the location index of the transform coefficients at scale index m to differentiate it from n, the location index at scale m − 1. The reconstruction algorithm is the second half of the fast wavelet transform corresponding to the synthesis filter bank. Remark F.3.1 In general, when discretising the continuous wavelet transform, the FWT, DWT, decomposition/reconstruction algorithms, fast orthogonal wavelet transform, multiresolution algorithm, are all used to mean the same thing. F.3.3 Discrete input signals of finite length F.3.3.1 Discribing the algorithm We now consider the wavelet multiresolution framework in the case of discrete input signals specified at integer spacings. The signal approximation coefficients at scale index m = 0 is defined by Z ∞ S0,n = x(t)φ(t − n)dt −∞ 679 Quantitative Analytics and will allow us to generate all subsequent approximation and detail coefficients, Sm,n and Tm,n , at scale indices greater than m = 0. We assume that the given discrete input signal S0,n is of finite length N , which is an integer power of 2, that is, N = 2M so that the range of scale we can investigate is 0 < m < M . Substituting m = 0 and m = M in Equation (F.3.15), and noting that we have a finite range of n halving at each scale, the signal approximation scale m = 0 (input signal) can be written as the smooth signal at scale M plus a combination of detailed signals −m 2MX −1 S0,n φ0,n (t) = SM,n φM,n (t) + n=0 M X −m 2MX −1 m=1 n=0 Tm,n ψm,n (t) We can rewrite this equation as x0 (t) = xM (t) + M X dm (t) (F.3.22) m=1 where the mean signal approximation at scale M is xM (t) = SM,n φM,n The indexing is such that m = 1 corresponds to the finest scale (high frequencies). The detail signal approximation corresponding to scale index m is defined for a finite length signal as dm (t) = −m 2MX −1 Tm,n ψm,n (t) (F.3.23) n=0 Hence, adding the approximation of the signal at scale index M to the sum of all detail signal components across scales 0 < m < M gives the approximation of the original signal at scale index 0. We can rewrite Equation (F.3.16) as xm (t) = xm−1 (t) − dm (t) and starting with the input signal at scale m − 1 = 0,we see that at scale index m = 1, the signal approximation is given by x1 (t) = x0 (t) − d1 (t) At the next scale (m = 2) the signal approximation is given by x2 (t) = x0 (t) − d1 (t) − d2 (t) and so on, corresponding to the successive stripping of high frequency information from the original signal. Once we have the discrete input signal S0,n , we can compute Sm,n and Tm,n using the decomposition algorithm given by Equations (F.3.19) and (F.3.20). At scale index M we have performed a full decomposition of the finite length, discrete input signal. We are left with an array of coefficients: a single approximation coefficient value, SM,0 , plus the detail coefficients Tm,n corresponding to discrete wavelets of scale a = 2m and location b = 2m n. The finite time series is of length N = 2M giving the ranges of m and n for the detail coefficients as respectively 1 < m < M M and 0 < n < 2M −m − 1. At the smallest wavelet scale, index m = 1, 221 = N2 coefficients are computed, at the M next scale, index m = 2, 222 = N4 coefficients are computed, and so on until the largest scale m = M where one M coefficient 22M is computed. The total number of detail coefficients, Tm,n , for a discrete time series of length N = 2M PM −1 is then 1 + 2 + 4 + ... + 2M −1 , or m=1 2m = 2M − 1 = N − 1. Note, the single approximation coefficient SM,0 remains to fully represent the discrete signal. Thus, a discrete input signal of length N can be broken down into exactly N components without any loss of information using discrete orthogonal wavelets. Further, no signal information is 680 Quantitative Analytics repeated in the coefficient representation, which is known as zero redundancy. After a full decomposition, the energy contained within the coefficients at each scale is Em = −m 2MX −1 (Tm,n )2 n=0 PN −1 The total energy of the discrete input signal E = n=0 (S0,n )2 is equal to the sum of the squared detail coefficients over all scales plus the square of the remaining coefficient SM,0 , that is, 2 E = (SM,0 ) + M X −m 2MX −1 m=1 n=0 (Tm,n )2 Since the energy contained within the transform vector at all stages of the multiresolution decomposition remains constant, we can write the conservation of energy more generally as E= N −1 X (Wim )2 i=0 Wim where are the individual components of the transform vector W m . The wavelet transform vector after the full decomposition has the form W M = SM , TM , TM −1 , .., Tm , ..., T2 , T1 (F.3.24) where Tm = {Tm,n : n ∈ Z} represents the sub-vector containing the coefficients Tm,n at scale index m (with n in the range 0 to 2M −m − 1). If we halt the transformation process before the full decomposition at arbitrary level m0 , the transform vector has the form W m0 = Sm0 , Tm0 , Tm0 −1 , ..., T2 , T1 where m0 can take the range 1 ≤ m0 ≤ M − 1. The transform vector always contains N = 2M components. Also, we can express the original input signal as the transform vector at scale index zero, that is, W 0 . F.3.3.2 Presenting thresholding Once we have performed the full decomposition, we can manipulate the coefficients in the transform vector in a variety of ways by setting groups of components to zero, setting selected individuals components to zero, or reducing the magnitudes of some components. Since the transform vector contains both small and large values, we can throw away the smallest valued coefficients in turn and perform the inverse transforms. The least significant components have been first smoothed out, leaving intact the more significant fluctuating parts of the signal. We have threshold the wavelet coefficients at increasing magnitudes. We can define the scale-dependent smoothing of the wavelet coefficients as 0 if m ≥ m∗ scale Tm,n = Tm,n if m < m∗ where m∗ is the index of the threshold scale, or the transform vector. Considering sequentially indexed coefficients Wi , and assuming a full decomposition, the thresholding criterion becomes ∗ 0 if i ≥ 2M −m ∗ Wiscale = Wi if i < 2M −m where the range of the sequential index i is from 0 to N − 1, and N is the length of the original signal. Hence, ∗ i = 2M −m is the first location index within the transform vector where the coefficients are set to zero. Magnitude 681 Quantitative Analytics thresholding is carried out to remove noise from a signal, to partition signals into two or more components, or simply to smooth the data. The two most popular methods for selecting and modifying the coefficients are hard and soft thresholding. While scale-dependent smoothing removes all small scale coefficients below the scale index m∗ regardless of amplitude, hard and soft thresholding remove or reduce the smallest amplitude coefficients regardless of scale. To hard threshold the coefficients, one must define the threshold λ in relation with some mean value of the wavelet coefficients at each scale such as the standard deviation or the mean absolute deviation. The coefficients above the threshold correspond to the coherent part of the signal, and those below the threshold correspond to the random or noisy part of the signal. It is defined as 0 if |Wi | < λ Wihard = Wi if |Wi | ≥ λ where one makes the decision to keep or remove the coefficients. The soft version recognises that the coefficients contain both signal and noise, and attempts to isolate the signal by removing the noisy part from all coefficients. It is defined as 0 if |Wi | < λ sof t = Wi sign(Wi )(|Wi | − λ) if |Wi | ≥ λ where all the coefficients below λ are set to zero and the ones above are shrunk towards zero by an amount λ. One commonly used measure of the optimum reconstruction is the mean square error between the reconstructed signal and the original one. In the case where the exact form of either the underlying signal or the corruption noise is not known, we can use the universal threshold defined as 1 λU = (2 ln N ) 2 σ 1 where (2 ln N ) 2 is the expected maximum value of a white noise sequence of length N and unit standard deviation, and σ is the standard deviation of the noise in the signal. However, in practice the universal threshold tends to oversmooth. Further, since we do not know σ for our signal we need to use robust estimate σ̂, typically set to the median of absolute deviation (MAD) of the wavelet coefficients at the smallest scale divided by 0.6745 to calibrate with the standard deviation of a Gaussian distribution. Hence, the universal threshold becomes 1 M AD = (2 ln N ) 2 σ̂ 0.6745 Other thresholding methods exist such as the minimax method, the SURE method, the HYBRID method, crossvalidation methods, the Lorentz method and various Bayesian approaches. 1 λU = (2 ln N ) 2 F.3.4 Wavelet-based statistical measures While turbulent statistical measures have been calculated in the Fourier space, the non-local nature of the Fourier modes lead to important temporal information losses. On the other hand, the local properties of wavelets make it ideal to quantify the temporal and spectral distribution of the energy in statistical terms such as wavelet variance, skewness, flatness, etc. These statistics enable both scale and location dependent behaviour to be quantified. For simplicity, we consider only discrete transform coefficients Tm,n generated from full decompositions using real-valued, discrete orthonormal wavelet transforms. We further assume that the mean has been removed from the signal, and that it contains N = 2M data points. The pth order statistical moment of the wavelet coefficients Tm,n at scale index m is given by < p Tm,n >m = 1 2M −m 682 −m 2MX −1 n=0 (Tm,n )p Quantitative Analytics where <>m denotes the average taken over the number of coefficients at scale m. The variance at scale index m is obtained by setting p = 2 in the above formula. It corresponds to the average energy wrapped up per coefficient at each scale m. A general dimensionless moment function can be defined as p Fm = p < Tm,n >m p p (< Tm,n >m ) 2 where the pth order moment is normalised by dividing it by the rescaled variance. For example, the scale-dependent coefficient skewness factor is defined as the normalised third moment with p = 3, and the scale-dependent coefficient flatness factor is obtained with p = 4. The later gives a measure of the peakedness (or flatness) of the probability distribution of the coefficients at each level. In the case of a Gaussian distribution the flatness factor is 3. The waveletbased scale-dependent energy is defined as Em = −m 2MX −1 (Tm,n )2 ∆t n=0 where ∆t is the sampling time. The scale-dependent energy per unit time, or scale-dependent power, is Pm = where τ is the total time period of the signal. In the case where τ = 2M ∆t we get Pm 1 = M 2 −m 2MX −1 Em τ (Tm,n )2 n=0 so that as long as the signal has zero mean, both the total energy and total power of the signal can be found by summing Em and Pm respectively over all scale indices m. We can then construct a wavelet power spectrum for direct comparison with the Fourier spectrum 1 2m ∆t PW (fm ) = τ ln 2 −m 2MX −1 (Tm,n )2 ∆t = n=0 1 2m ∆t Em τ ln 2 m where 2ln∆t 2 stems from the dyadic spacing of the grid. The temporal scale of the wavelet at scale index m is equal to 2m ∆t. Another common statistical measure of the energy distribution across scales is the normalised variance of the wavelet energy. It is called the fluctuation intensity (FI) (or the coefficient of variation (CV)), given by F Im 4 2 < Tm,n >m −(< Tm,n >m )2 = 2 < Tm,n >m 12 and measures the standard deviation of the variance in coefficient energies at scale index m. The intermittency at each scale can be viewed directly by using the intermittency index Im,n given by Im,n = (Tm,n )2 2 < Tm,n >m The index Im,n is the ratio of local energy to the mean energy at temporal scale 2m ∆t. It allows the investigator to visualise the uneven distribution of energy through time at a given wavelet scale. The correlation between the scales p can be measured using the pth moment scale correlation Rm given by p Rm M −m =2 2M −(m−1) X −1 p p Bm,[ n Bm−1,n ] 2 n=0 p p where Bm,n is the pth order moment function, and [ n2 ] requires that the integer part only be used. Bm,n is the pth order moment function defined as 683 Quantitative Analytics (Tm,n )p p Bm,n = P2M −m −1 (Tm,n )p n=0 p It has form to the intermittency index when p = 2, except that Bm,n has a normalised sum at each scale, that P a similar p is, n Bm,n = 1, whereas the sum of the intermittency indices at scale m is equal to the number of coefficients at P that scale, that is, n Im,n = 2M −m . F.4 The problem of shift-invariance There is a large literature on redundant transforms, using different notations. We are going to review some of these transforms, trying to be consistent with the notation introduced in the continuous and discrete wavelet transform. F.4.1 A brief overview F.4.1.1 Describing the problem The DWT is an (bi-) orthogonal transform and provides a sparse time-frequency representation of the original signal, making it computationally efficient. However, the use of critical sub-sampling in the DWT, where every second wavelet coefficient at each decomposition level is discarded, forces it to be shift variant. This critical sub-sampling results in wavelet coefficients that are highly dependent on their location in the sub-sampling lattice, leading to small shifts in the input waveform which causes large changes in the wavelet coefficients, large variations in the distribution of energy at different scales, and possibly large changes in reconstructed waveforms. Alternatively, considering the frequency response of the mother wavelets, when the WT sub-bands are sub-sampled by a factor of two, the Nyquist criteria is strictly violated and frequency components above (or below) the cut-off frequency of the filter will be aliased into the wrong sub-band. Note, the aliasing introduced by the DWT cancels out when the inverse DWT (IDWT) is performed using all of the wavelet coefficients (when the original signal is reconstructed). As soon as the coefficients are not included in the IDWT, or they are quantised, the aliasing no-longer cancels out and the output is no-longer shift-invariant. All the techniques attempting to eliminate or minimise the amount of aliasing consider relaxing the critical subsampling criteria and/or reducing the transition bandwidth of the mother wavelets. One way forward is to use the a trous algorithm which do not perform any sub-sampling at all. Since in that algorithm the mother wavelet has to be dilated (by inserting zeros) at each level of the transform, it requires additional computation and memory. Note, it is only strictly shift-invariant under circular convolution (periodic boundary extension). Alternatively, the power shiftable discrete wavelet transform (PSDWT) achieves approximate shift-invariance by limiting the sub-band subsampling . One can also build two wavelet decomposition trees (with alternate phase sub-sampling), one for a mother wavelet with even symmetry and the other for the same mother wavelet, but with odd symmetry. In this way, the dual tree complex wavelet transform (DTCWT) measures both the real (even) and the imaginary (odd) components of the input signal. However, since we must perform two decompositions, the computation and memory requirements are twice that of the Mallat DWT. Another method is to use the wavelet transform modulus maxima (WTMM), which is a fully sampled dyadic WT, using a mother wavelet with one or two vanishing moments, applied to estimate the multi-resolution gradient of the signal. Since the dyadic WT has the same properties as the CWT, it is shift-invariant. Further, if the coefficients can be adaptively sub-sampled to keep only the coefficients being locally maximum or locally minimum (the modulus maxima) at each scale, this sub-sampled representation is also shift-invariant. However, using a pseudo inverse transform, exact reconstruction from the wavelet modulus maxima is not possible. Since Shensa [1992] showed that the Mallat and a trous algorithms are special cases of the same filter bank structure, it is possible to combine them to benefit from both approaches. Bradley [2003] proposed a generalisation of the Mallat and a trous discrete wavelet transform called the over complete discrete wavelet transform (OCDWT) 684 Quantitative Analytics which achieves various levels of shift-invariance by controlling the amount of sub-sampling applied at each level of the transform. He applied the Mallat algorithm to the first M levels of an L-level decomposition and then applied the a trous algorithm to the remaining (L − M ) levels. This method can be seen as an initial down-sampling of the signal prior to a fully sampled a trous decomposition. F.4.1.2 The a trous algorithm We saw in Appendix (F.3.2.1) that the DWT is still computationally intensive, and that one way forward is to use the fast wavelet transform (FWT). Alternatively, we can apply the a trous algorithm proposed by Holschneider et al. [1989] which can be described as a modification of the FWT algorithm. Given (x(t))t∈Z a discrete time process and (gk , hk )k∈Z the filter banks with Tm,n =< x, ψm,n > and Sm,n =< x, φm,n >, then Equations (F.3.19) and (F.3.20) are modified in the following way X X Sm,n = hk Sm−1,k and Tm,n = gk Sm−1,k k∈Z k∈Z where hk−2n and gk−2n are replaced with hk and gk . We set Tm = {Tm,n : n ∈ Z} ∈ L2 (Z) and Sm = {Sm,n : n ∈ Z} ∈ L2 (Z), and let hr , g r be recursive filters with g 0 = h and h0 = g. The hr , g r are computed by introducing zeros between each component of g r−1 and hr−1 . Two operators Gr , H r are defined as X r Gr : L2 (Z) → L2 (Z) with c → {(Gr c)n = gk−n ck } k∈Z and H r : L2 (Z) → L2 (Z) with c → {(H r c)n = X hrk−n ck } k∈Z r∗ r∗ The adjoint functions G , H are defined analogously to invert this mapping. The a trous decomposition algorithm is performed as follow: As input we need S0 = {S0,n : n ∈ Z} and M ∈ N, where 2M is the maximal scale. We then gradually compute ∀m = 1, .., M , Tm = Gm−1 Sm−1 , Sm = H m−1 Sm−1 and yield SM , Tm for m = 1, .., M to fill the vector in Equation (F.3.24). It is a multiscale decomposition of the time series with SM containing the information about the highest scale (the long-term component). For the reconstruction of the time series, we start with M , SM , Tm for m = 1, .., M and gradually compute ∗ ∗ ∀m = M, M − 1, .., 1 , Sm−1 = H m Sm + Gm Tm The result is S0 , and from that we yeld the time series via inversion of the respective convolution. F.4.1.3 Relating the a trous and Mallat algorithms Shensa [1992] showed that the a trous and Mallat algorithms are both filter bank structures where the only distinguishing featurePis the choice √ of two finite length filters, a lowpass filter h and a bandpass filter g. The lowpass condition given by k hk = 2 is necessary to the construction of the corresponding continuous wavelet function, and the bandpass requirement ensures that finite energy signals lead to finite energy transforms. Under these conditions, the filter bank output is referred to as the discrete wavelet transform (DWT). We discussed in Appendix (F.3.2) the Mallat algorithm and described the lowpass and bandpass filters in Equations (F.3.19) and (F.3.20). We will try to keep the √ , where δ(•) is the Dirac same notation. In the a trous algorithm, the lowpass filter satisfies the condition h2k = δ(k) 2 delta function, which corresponds to a non-orthogonal wavelet decomposition. If the filter h is a trous, then the DWT coincides with a CWT by wavelet g(t) (ψ in our notation) whose samples g(n) form the filter g. Given the CWT 685 Quantitative Analytics defined in Equation (F.3.9), we consider discrete values for a and b, and assume that a = 2i where i is the octave of the transform. We let Ti,n = T (2i , n) be the wavelet series and take b to be a multiple of a, getting b = n2i . We recover the dyadic wavelet transform ψm,n (t) in Equation (F.3.11) with scale m replaced by i. Discretising the integral, we get X T (2i , n2i ) = Ti,n = x(k)ψi,n (k) k which are decimated wavelet transforms since the octave i is only output every 2i samples. Hence, the resulting algorithms will not be translation invariant. To restore the invariance we can either filter separately the even and odd sequences, or we shall use the following algorithm Si,n = X h2n−j Si−1,j j Ti,n = X gn−j Si−1,j j where S0 is the original signal. Decimation is represented by the matrix ∆kj = δ(2k − j) with transpose Dkj = δ(k − 2j), and (h∗ )k = h−k is the adjoint filter. We now approximate the values at nonintegral points through interpolation via a finite filter h∗ , where X g( n2 ) if n is even ∗ hn−2k g(k) = n−1 n+1 1 2 (g( 2 ) + g( 2 )) if n is odd k approximates a sampling of g( 2t ). With the help of the dilation operator D, this method can be generalised, leading to [h∗ ∗ (Dg ∗ )]n = X k 1 n h∗n−2k g(k) ≈ √ g( ) 2 2 Inserting this approximation into the discrete sum, we get X ∗ T1,n ≈ h∗k−2n−2m gm x(k) = [g ∗ (∆(h ∗ S))]n k,m for i = 1. By induction, replacing S above with Si−1 , we obtain T (2i , n2i ) ≈ Ti,n for all i. Note, we can rewrite the a trous algorithm as Si+1 = ∆(h ∗ Si ) Ti = g ∗ Si which is a DWT for which the filter h satisfies δ(k) h2k = √ 2 and the filter g is obtained by sampling an apriori wavelet function g(t). When Ti,n is replaced by Ti,2n in the above system of equation, we recover the Mallat algorithm. Under certain regularity conditions, and some properties of the filters h and g, we get Z t Ti,2n = x(t)g( i − n)dt 2 686 Quantitative Analytics provided that Z x(t)φ(t − k)dt S0,k = (F.4.25) (approximation coefficients) where φ is related to g(t) and the filter g by X√ g(t) = 2g−k φ(2t − k) k Note, in Mallat algorithm, the sampled signal must lie in an appropriate subspace given by S0,k . Further, it is necessary and sufficient for h to be a trous, for the condition in Equation (F.4.25) to be dropped. F.4.2 Describing some redundant transforms While wavelet transforms can be classified as either redundant or non-redundant (orthogonal), the major drawback of the latter is their non-invariance in time (or space). That is, the coefficients of a delayed signal are not a time shifted version of those of the original signal. The time invariance property is of importance in statistical signal processing applications, such as detection or parameter estimation of signals with unknown arrival time. The non-invariance implies that if a detector is designed in the wavelet coefficient domain, its performances will then depend on the arrival time of the signal. This is very problematic in finance where we try to make forecast directly on the smooth time series obtained by denoising the original signal. As a way around, practitioners used redundant transforms in detection/estimation problems. Pesquet et al. [1996] showed that it was possible to build different orthogonal wavelet representations of a signal while keeping the same analysing wavelet. These decompositions differ in the way the time-scale plane is sampled. Optimising the decomposition to best-fit the time localisation of the signal, they obtained an improved representation which is time invariant. We first review their approach and then follow Nason et al. [1995] to review the basics of discrete wavelet transform (DWT) using a filter notation which we use to describe extensions of the DWT, namely the -decimated DWT and the stationary wavelet transform (SWT). The main idea of these extensions is to fill the gaps caused by the decimation step in the standard wavelet transform, leading to an over-determined, or redundant, representation of the original data, but with considerable statistical potential. F.4.2.1 The multiresolution analysis We briefly review the multiresolution analysis detailed in Appendix (F.3.2). We can decompose a signal x(t) ∈ L2 (R) with wavelet coefficients {Tab (x)}(a,b)∈Z 2 as in Equation (F.3.9) with normalised wavelet function given in Eqation (F.3.8). The orthonormal wavelet basis ψa,b (t) can be built from a multiresolution analysis of L2 (R). In this case, we need to sample the parameters a and b and consider the discrete step wavelet form ψj,k (t) given in Equation (F.3.11) with scale aj0 and translation step ∆b = b0 a0 (j), for a0 = 2 and b0 = 1. In this setting, the wavelet coefficients {Tjk (x)}k∈Z become Z ∞ ∗ Tj,k =< x, ψj,k >= x(t)ψj,k (t)dt −∞ where ψj,k (t) = 1 j 22 j ψ( t−k2 2j ). Then, considering the scaling function φj,k (t) given in Equation (F.3.12), it is con- volved with the signal to produce the approximation coefficients {Sj,k }(j,k)∈Z 2 in Equation (F.3.13). For well chosen filters {hk }k∈Z and {gk }k∈Z , the mother wavelet ψ and the scaling function φ satisfy the two-scale equations 1 t 2− 2 φ( − k) 2 = 1 t 2− 2 ψ( − k) 2 = ∞ X l=−∞ ∞ X l=−∞ 687 hl−2k φ(t − l) gl−2k φ(t − l) Quantitative Analytics and the approximation coefficients and wavelet coefficients satisfiy the Equations (F.3.19) and (F.3.20). Given the vector spaces Vj = Span{φj,k (t), k ∈ Z} and Oj = Span{ψj,k (t), k ∈ Z}, it results that Vj+1 = Vj ⊕⊥ Oj 4 such that for every j ∗ ∈ Z, {ψj,k (t), k ∈ Z, j ≤ j ∗ } ∪ {φj ∗ ,k (t), k ∈ Z} is an orthonormal basis of L2 (R). This decomposition, which is non-invariant in time (or space), implies that the wavelet coefficients of Tτ [x(t)] = x(t − τ ) for τ ∈ R are generally not delayed versions of {Tjk (x)}k∈Z . One way forward is to consider the redundant decomposition of the signal x(t) given by T̃2θj (x) S̃2θj (x) where ψj,θ2−j (t) = 1 j 22 −j = Tjθ2 −j = Sjθ2 = < x, ψj,θ2−j > (F.4.26) = < x, φj,θ2−j > , θ ∈ R, j ∈ Z ψ( t−θ 2j ). This representation is time-invariant since the redundant wavelet and approximation coefficients of Tτ [x(t)] are Tτ [T̃2θj (x)] and Tτ [S̃2θj (x)], respectively. One obvious way to construct/retrieve a signal from its wavelet representation is to select the subset of coefficients {Tjk (x)}(k,j)∈Z 2 from the set of redundant wavelet coefficients and reconstruct the signal from its orthonormal wavelet representation. However, there exists many different ways of achieving this reconstruction as one can extract different orthonormal bases from the wavelet family {ψj,θ2−j , θ ∈ R, j ∈ Z}. The wavelet packets are a generalisation of wavelets allowing for optimising R ∞the representation the signal (see Coifman et al. [1992]). We let ωm (t), m ∈ N be a function of L2 (R) such that −∞ ω0 (t)dt = 1 and for all k ∈ Z 1 t 2− 2 ω2m ( − k) 2 = 1 t 2− 2 ω2m+1 ( − k) 2 = ∞ X l=−∞ ∞ X hl−2k ωm (t − k) gl−2k ωm (t − k) l=−∞ k where {hk }k∈Z and {gk }k∈Z satisfy the QMF filters. For every j ∈ Z, given the vector space Ω = Span{ωj,m , k ∈ Z} j k with ωj,m = ωm ( t−k2 2j ), we can show that Ωj,m = Ωj+1,2m ⊕⊥ Ωj+1,2m+1 Hence, if we let P be a partition 5 of R+ into the intervals Ij,m = [2−j m, .., 2−j (m+1)[, j ∈ Z and m ∈ {0, .., 2j −1}, j k then {2− 2 ωj,m , k ∈ Z, (j, m)/Ij,m ∈ P} is an orthonormal basis of L2 (R). Such basis is called wavelet packet, where the coefficients resulting from the decomposition of a signal x(t) are k k Cj,m =< x, ωj,m > such that by varying the partition P, differentchoices of wavelet packets are possible. For instance, we can set φ(t) = ω0 (t) and ψ(t) = ω1 (t), getting Vj = Ωj,0 and Oj = Ωj,1 . This structure can be described by a binary tree (called frequency tree) with nodes indexed by (j, m) and leaves on that node satisfying Ij,m ∈ P. One should select the partition P for which an optimised representation of the analysed signal is obtained. For instance, one can choose the entropy criteria 4 5 The symbol ⊕⊥ means the orthogonal sum of vector spaces. A partition P of a set B is a set of nonempty disjoints subsets whose union is B. 688 Quantitative Analytics H({αk }k∈Z ) = − X Pk ln Pk k 2 k| where Pk = P|α|α 2 and {αk }k∈Z is the sequence of coefficients of the decomposition in a given basis. Coifman et l| l al. proposed a binary tree search method to find the wavelet packet minimising a given criterion H(•). Pesquet et al. [1996] proposed an extension of the wavelet packet decomposition and showed how to achieve time invariance while preserving the orthonormality. Proposition 22 Let two vector spaces be defined as Vj,p = span{φj,k (t − p) , k ∈ Z} Oj,p = span{ψj,k (t − p) , k ∈ Z} for j ∈ N and p ∈ {0, .., 2j − 1}. It follows that Vj,p = Vj+1,p ⊕⊥ Oj+1,p = Vj+1,p+2j ⊕⊥ Oj+1,p+2j (F.4.27) {φj,k (t − p), k ∈ Z} and {ψj,k (t − p), k ∈ Z} being respectively orthonormal bases of Vj,p and Oj,p . While two different orthonormal bases are possible for decomposing the space Vj,p at the next lower resolution 2−j−1 , they differ in the time localisation of the basis functions. A binary tree can be used to describe the different possible choices at each resolution level j where each node is indexed by parameters (j, p). Note, the redundant wavelet j +p }k∈Z to the coefficients {T̃2kj }k∈Z , for j ≥ 1, may be structured according to this tree by associating the set {T̃2k2 j −j node (j, p). That is, given T̃2θj in Equation (F.4.26), with θ = k2j + p, we obtain Tjk+p2 with t − p − k2j 1 t−p ) = j ψ( j − k) = ψj,k (t − p) j 2 2 2 22 −j where {ψj,k (t − p), k ∈ Z} corresponds to {ψj,k+p2 (t), k ∈ Z}. Assuming that the multiscale decomposition is ∗ performed on j ∗ levels, there exists (at least) 2j different ways of reconstructing a given signal. From Proposition (22), the reconstruction may be recursively obtained by using the relation ψj,k+p2−j (t) = j 1 ψ( j 2 S̃22j k+p = ∞ X j+1 hk−2l S̃22j+1 l+p + l=−∞ ∞ X j+1 gk−2l T̃22j+1 l+p l=−∞ This filter bank is generally visualised in a graph where the operator 2 ↑ is an interpolator by a factor 2, that is, its inputs {ek }k∈Z and its output {sk }k∈Z satisfy e k if k is even 2 sk = 0 if k is odd Similarly, the reconstruction may also be recursively obtained by using the relation j S̃22j k+p = ∞ X 0 j+1 j hk−2l S̃22j+1 l+p+2 + l=−∞ ∞ X 0 j+1 j gk−2l T̃22j+1 l+p+2 l=−∞ 0 The filter bank is now visualised with the operator 2 ↑ whose inputs {ek }k∈Z and output {sk }k∈Z satisfy e k−1 if k is odd 2 sk = 0 if k is even 689 Quantitative Analytics These filter banks may be associated to the dual filter banks corresponding to the decimator by a factor 2, 2 ↓ (resp. 0 2 ↓ ) is such that the output is obtained from its input by sk = e2k resp. sk = e2k+1 and retaining the even samples amounts to the decimation commonly used in any orthonormal wavelet decomposition. Hence, we can give a simple digital filtering interpretation to the relation in Equation (F.4.27). This show that the original signal can be reconstructed from its redundant wavelet decomposition by correctly selecting different sets of orthonormal coefficients. We are now left with choosing a criterion, such as the entropy, to select the best set of orthonormal coefficients. Considering the entropy criterion with extra additivity property, Pesquet et al. proposed an efficient optimisation algorithm. F.4.2.2 The standard DWT The discrete wavelet transform (DWT) for the sequence x0 , .., xN −1 , with N = 2J for some integer J is based on filters H and G, and on a binary operator D0 . The filter H is a lowpass filter defined by the sequence {hk } where only few values are non-zero. Its action is defined by X (Hx)k = hl−k xl l The definitions for sequences of finite length depending on the choice of treatment at the boundaries, we assume periodic boundary conditions. The filter satisfies the internal orthogonality relation X hk hk+2j = 0 k for all integers j 6= 0, and have the sum of squares P k h2k = 1. The highpass filter G is defined by the sequence gk = (−1)k h1−k , ∀k It satisfies the same internal orthogonality relations as H, and it also obeys the mutual orthogonality relation X hk gk+2j = 0 , ∀j k These filters are called quadratic mirror filters. The binary decimation operator D0 chooses every even member of a sequence, and is defined as (D0 x)j = x2j , ∀j From the properties of the quadratic mirror filters, the mapping of a sequence x to the pair of sequences (D0 Gx, D0 Hx) is an orthogonal transformation. Hence, given the finite sequence x of length 2J , with periodic boundary conditions, each of D0 Gx and D0 Hx is a sequence of length 2J−1 . In the multiresolution analysis, we define the smooth (approximation) at level J, written cJ , to be the original data cJ,k = xk for k = 0, ..., 2J − 1 For j = J − 1, ..., 0 we define recursively the smooth cj at level j and the detail dj at level j by cj = D0 Hcj+1 and dj = D0 Gcj+1 where cj and dj are sequences of length 2j . We see that the smooth at each level is fed down to the next level, giving the new smooth and detail at that level. Since the mapping (D0 Gx, D0 Hx) is an orthogonal transform, it can easily be 690 Quantitative Analytics inverted to find cj+1 in terms of cj and dj . To do so, we write the transform as a matrix and transpose it. Writing R0 for the inverse transform, we get cj+1 = R0 (cj , dj ) for each j Continuing this process, we obtain the detail at each level with the smooth at the zero level, so that the original sequence is orthogonally transformed to the sequence of sequences dJ−1 , dJ−2 , .., d0 , c0 J of total length 2 . The process can be reversed by reconstructing c1 from d0 and c0 , then c2 from d1 and c1 , and so on. Given that {hk } has a finite number of non-zero elements, the overall number of arithmetic operations for both the transform and its inverse is O(2J ). Stopping the process at any level R will give the sequence of sequences dJ−1 , dJ−2 , .., dR , cR called DWT curtailed at level R. Note, Nason et al. constructed bases by dilating and translating φ and ψ according to j j φj (t) = 2 2 φ(2j t) and ψj (t) = 2 2 ψ(2j t) so that for a function f and sequence cJ we get f (t) = X cJ,k φJ (t − 2−J k) k and the expansion for R < J of a function f in orthonormal functions is given by f (t) = X cR,k φR (t − 2−R k) + J−1 X dj,k ψj (t − 2−j k) = X j=R k R cR,k 2 2 φ(2R t − k) + J−1 X j dj,k 2 2 ψ(2j t − k) j=R k and Z dj,k = −j ψj (t − 2 Z k)f (t)dt = j 2 2 ψ(2j t − k)f (t)dt so that the detail coefficient dj,k gives information about f at scale 2−j near position t = 2−j k. In terms of the original sequence cJ , it corresponds to scale 2J−j near position 2J−j k. F.4.2.3 The -decimated DWT The DWT being an orthogonal transform, it corresponds to a particular choice of basis for the space RN where the original sequence lies. As a result, depending on the choice of the basis, we can get modifications of the DWT. We could also select every odd number of each sequence with the operator (D1 x)j = x2j+1 , getting the mapping (D1 Gx, D1 Hx) which is an orthogonal transformation. Reconstruction would be obtained by successive application of the corresponding inverse operator, R1 . Further, if we let J−1 , .., 0 be a sequence of 0 and 1, we can then use the operator Dj at level j, and perform the reconstruction by using the corresponding sequence of operators Rj , giving a different orthogonal transformation from the original sequence for each choice of the sequence . This transformation is called the -decimated DWT. To understand the mechanism, we consider the shift operator S defined by (Sx)j = xj+1 −1 such that D1 = D0 S and, thus, R1 S R0 . We can also see that SD0 = D0 S 2 and that the operator S commutes with H and G. We now let S be the integer with binary representation 0 1 ...J−1 , one can show that the coefficient sequences cj and dj yielded by the -decimated DWT are all shifted versions of the original DWT applied to the shifted sequence S S x. For example, fixing j, we let s1 and s2 be the integers with binary representations 0 1 ...j−1 691 Quantitative Analytics and j j+1 ...J−1 . In DWT the sequence dj = D0 G(D0 H)J−j−1 cJ , while in the -decimated case we get dj = D0 G(D0 H)J−j−1 S s2 cJ . Applying the operator S s1 , we get S s1 dj = D0 G(D0 H)J−j−1 S S cJ since S = 2J−j s1 +s2 . Thus, dj shifted by s1 is the jth detail sequence of the DWT applied to the original data shifted by an amount S. The result for cj can be similarly derived. Hence, the basis vectors of the -decimated DWT can be obtained from those of the DWT by applying the shift operator S S , and the choice of corresponds to a choice of origin with respect to which the basis functions are defined. If we let t0 = 2−J S, the coefficient sequences obtained will give an expansion of f in terms of φR (t − t0 − 2−R k) and ψj (t − t0 − 2−j k) for integers k and for j = R, R + 1, .., J − 1. In terms of the original sequence, it corresponds to scale 2J−j near position 2J−j k + S, a grid of integers of gauge 2J−j shifted to have origin S. F.4.2.4 The stationary wavelet transform In the stationary wavelet transform (SWT) we do not decimate but simply apply appropriate high and low pass filters to the data at each level to produce two sequences at the next level each having the same length as the original one. At each level, the filters are modified by padding them out with zeros. That is, the operator Z alternates a given sequence with zeros, so that for all integers j, we get (Zx)2j = xj and (Zx)2j+1 = 0. We define the filters H[r] and G [r] to have weights Z r h and Z r g, respectively, such that H[r] has weights H2r [r] = hj [r] Hk = 0 if k is not a multiple of 2r Thus, the filter H[r] is obtained by inserting a zero between every adjacent pair of elements of the filter H[r−1] , and similarly for G [r] . Hence, both H[r] and G [r] commute with S, and we get D0r H[r] = HD0r and D0r G [r] = GD0r As a result, setting aJ to be the original sequence, and bj be the detail, for j = J −1, J −2, .., , 1, we obtain recursively aj−1 = H[J−1] aj and bj−1 = G [J−1] aj Given the vector aJ of length 2J , then all the vectors aj and bj are of the same length, rather than decreasing as in the DWT. Thus, to find bJ−1 , bJ−1 , .., b0 , a0 J J takes O(J2 ) operations compared with O(2 ) with the DWT. One can show that SWT contains the coefficients of the -decimated DWT for every choice of . That is, for any given and corresponding origin S, the details at level j are a shifted version of D0J−1 S S bj , and similarly for the data D0J−1 S S aj . Given the same example as in Section (F.4.2.3), we let dj () be the j detail sequence obtained from the -decimated DWT. We then have for each j, S −s1 D0J−1 S S bj = dj , and the same link exists for aj and cj . Associating xJ with the function f , for any j and k, considering a decimated DWT with S = k and t0 = 2−J k, we get Z bj,k = ψj (t − 2−J k)f (t)dt which gives information at scale 2J−1 localised at position k. There is no-longer any restriction of the localisation position to a grid of integers. 692 Quantitative Analytics F.4.3 The autocorrelation functions of compactly supported wavelets Even though the coefficients of the orthonormal wavelet expansions are of finite size (allowing for exact computer implementation), they are not shift invariant and they also have asymmetric shape. Hence, symmetric basis functions are preferred since their use simplifies finding zero-crossings (or extrema) corresponding to the locations of edges in images at later stages of processings. One way forward is to construct approximately symmetric orthonormal wavelets giving rise to approximate QMF (see Mallat [1989]), or to use biorthogonal bases so that the basis functions may be chosen to be exactly symmetric (see Cohen et al. [1992]). An alternative solution proposed by Beylkin et al. [1992] is to use a redundant representation using dilations and translations of the auto-correlation functions of compactly supported wavelets. In that setting, the decomposition filters are exactly symmetric. Hence, rather than using the wavelets, the auto-correlation shell are used for signal analysis. The recursive definition of the autocorrelation functions of compactly supported wavelets leads to fast recursive algorithms to generate the multiresolution representation (see Saito et al. [1993]). We let Φ(x) be the auto-correlation function Z ∞ φ(y)φ(y − x)dy Φ(x) = (F.4.28) −∞ where φ(•) is a scaling function (used in wavelet analysis), and corresponds to the fundamental function of the symmetric iterative interpolation scheme (see Dubuc [1986]). Thus, there is a one-to-one correspondence between the iterative interpolation schemes and compactly supported wavelets. In general, the scaling functions corresponding to Daubechies’ wavelets with M vanishing moments lead to an iterative interpolation schemes using the Lagrange polynomials of degree L = 2M (see Deslauriers et al. [1989]). We are now going to derive the two-scale difference equation for the function Φ(x). Let m0 (ξ) and m1 (ξ) be the 2π-periodic functions L−1 1 X √ hk eikξ m0 (ξ) = 2 k=0 and L−1 1 X gk eikξ = ei(ξ+π) m∗0 (ξ + π) m1 (ξ) = √ 2 k=0 satisfying the quadrature mirror filter (QMF) condition |m0 (ξ)|2 + |m1 (ξ)|2 = 1 Given the trigonometric polynomial solutions to mi (ξ) for i = 0, 1, we get L 2 1 1X |m0 (ξ)| = + a2k−1 cos (2k − 1)ξ 2 2 2 k=1 where {ak } are the auto-correlation coefficients of the filter H = {hk }0≤k≤L−1 ak = 2 L−1−k X hl hl+k for k = 1, .., L − 1 l=0 and a2k = 0 for k = 1, .., 693 L −1 2 Quantitative Analytics Using the scaling equation (F.3.17), we obtain L 2 1X Φ(x) = Φ(2x) + a2l−1 Φ(2x − 2l + 1) + Φ(2x + 2l − 1) 2 (F.4.29) l=1 We can then introduce the autocorrelation function of the wavelet Z ∞ Ψ(x) = ψ(y)ψ(y − x)dy −∞ and repeat the same process. Note, both Φ(x) and Ψ(x) are supported within the interval [−L + 1, L − 1], and they have vanishing moments Z Mm Ψ ∞ = xm Ψ(x)dx = 0 for 0 ≤ m ≤ L − 1 −∞ ∞ Z Mm Φ = xm Φ(x)dx = 0 for 1 ≤ m ≤ L − 1 −∞ and R∞ −∞ Φ(x)dx = 1. One can also show that even moments of the coefficients a2k−1 vanish, that is, L 2 X a2k−1 (2k − 1)2m = 0 for 1 ≤ m ≤ M − 1 k=1 where L = 2M . Since L consecutive moments of the autocorrelation function Ψ(x) vanish, we have Ψ̂(ξ) = O(ξ l ) where Ψ̂(ξ) is the Fourier transform of Ψ(ξ). As a result, Ψ̂(ξ) can be seen as an approximation of the derivative d L operator ( dx ) , such that convolution with Ψ(x) behaves like a differential operator in detecting changes of spatial intensity, and it is designed to act at any desired scale. We can now relate the autocorrelation function in Equation (F.4.28) to iterative interpolation scheme. Given values of f (x) on set B0 , where Bn is the set of dyadic rationals 2mn for m = 0, 1, .., Dubuc [1986] proposed to extend f to B1 , B2 , .. in an iterative manner. He suggested computing 1 1 9 f (x − h) + f (x + h) − f (x − 3h) + f (x + 3h) , h = n+1 16 16 2 It was further generalised by Deslauriers et al. [1989] to f (x) = f (x) = X k∈Z k 1 F ( )f (x + kh) for x ∈ Bn+1 /Bn and h = n+1 2 2 where the function F ( k2 ) satisfy X k x F( ) = F ( )F (x − k) 2 2 k∈Z Using the Lagrange polynomials with L = 2M nodes, we get f (x) = M X L P2k−1 (0) f (x − (2k − 1)h) + f (x + (2k − 1)h) k=1 694 Quantitative Analytics L where {P2k−1 (x)}−M +1≤k≤M is a set of the Lagrange polynomials of degree L − 1 with nodes {−L + 1, −L + 3, ..., L − 3, L − 1} given by M Y L P2k−1 (x) = l=−M +1,l6=k x − (2l − 1) (2k − 1) − (2l − 1) and we get the fundamental function FL FL (x) = FL (2x) + M X L P2k−1 (0) FL (2x − 2k + 1) + FL (2x + 2k − 1) k=1 which is a special case of f (x) called the Lagrange iterative interpolation. Note, setting L = 4 we recover f (x). Thus, we have F (x) = Φ(x) and using the two-scale difference equation, we get M 1X k a2l−1 Φ(k − 2l + 1) + Φ(k + 2l + 1) Φ( ) = Φ(k) + 2 2 l∈N and therefore ak k Φ( ) = 2 2 As a result, the two-scale difference equation for the function Φ becomes X k x Φ( ) = Φ( )Φ(x − k) 2 2 (F.4.30) k∈Z It may beshown that the QMF relation for the periodic function m0 (ξ) can be rewritten as M |m0 (ξ)|2 = 1 1 (2M − 1)! 2 X (−1)k−1 cos (2k − 1)ξ + M −1 2 2 (M − 1)!4 (2k − 1)(M − m)!(M + k − 1)! k=1 and if M → ∞, then ∞ |m0 (ξ)|2 = 1 1 X (−1)k−1 + cos (2k − 1)ξ 2 2 2k − 1 k=1 which is the Fourier series of the characteristic function of [− π2 , π2 ]. Hence, the corresponding autocorrelation function is sin πx πx so that if the number M of vanishing moments of the compactly supported wavelets approaches infinity, then φ∞ (x) = sinc(x). As a result, we get the relation Φ∞ (x) = sinc(x) = φ∞ (x) = Φ∞ (x) and 695 Quantitative Analytics √ 2hk = sin πk ak = πk 2 for k ∈ Z 2 2 We then obtain a family of the symmetric iterative interpolation schemes parametrised by the number of vanishing moments 1 ≤ M < ∞. Further, the derivative of the function f (x) is computed via 0 f (x) = L−2 X rk f (x + kh) − f (x − kh) k=1 −n where h = 2 , x ∈ Bm , where m ≤ n, and ∞ Z φ(x − k) rk = −∞ d φ(x)dx dx The coefficient rk may be computed by solving L 2 1X a2l−1 r2k−2l+1 + r2k+2l−1 rk = 2 r2k + 2 l=1 and X krk = −1 k∈Z where a2l−1 are given above. If the number of vanishing moments of the wavelet are such that M ≥ 2, then the above equations have a unique solution with a finite number of non-zero rk . That is, rk 6= 0 for −L + 2 ≤ k ≤ L − 2 and rk = −r−k We now present the recursive algorithm proposed by Saito et al. [1993] to generate the multiresolution representation. We assume that the finest scale of interest is described by the N = 2M dimensional subspace V0 ⊂ L2 (R), and we only consider circulant shifts on V0 . We call the set of functions {Ψj,k (x)}1≤j≤m0 ,0≤k≤N −1 and {Φm0 ,k (x)}0≤k≤N −1 the shell of the auto-correlation functions of orthonormal wavelets, where m0 (≤ M ) is the coarsest scale of interest and Φj,k (x) Ψj,k (x) = = j 2− 2 Φ(2−j (x − k)) 2 − 2j (F.4.31) Ψ(2−j (x − k)) PN −1 We now need a fast algorithm to expand the function f ∈ V0 = Span(φ∗0,k : k ∈ Z), f = k=0 Sk0 φ0,k . We let the coefficients {pk } and {qk } be those of the two-scale difference equations (F.4.29) with solution in Equation (F.4.30), which we rewrite as −1 2 2 for k = 0 pk = 3 2− 2 a|k| otherwise and qk = 1 2− 2 for k = 0 −pk otherwise 696 Quantitative Analytics which we use as symmetric filters P = {pk }−L+1≤k≤L−1 and Q = {qk }−L+1≤k≤L−1 with only L2 + 1 distinct non-zero coefficients. As an example of coefficients {pk },for Daubechies’ wavelets with two vanishing moments and 1 9 9 1 1 L = 4, the coefficients are 2− 2 − 16 , 0, 16 , 1, 16 , 0, − 16 . Note, these filters do not form a QMF pair, but their role and use is similar in the algorithm. For the shift-invariance, we apply P and Q without subsampling at each scale, getting Skj L−1 X = j−1 pl Sk+2 j−1 l (F.4.32) l=−L+1 Dkj L−1 X = j−1 ql Sk+2 j−1 l l=−L+1 where Skj are the residuals and Dkj the details. Starting from the original discrete signal {Sk0 }0≤k≤N −1 we apply Equations (F.4.32) recursively and we obtain the auto-correlation shell coefficients {Dkj }1≤j≤m0 and {Skm0 }0≤k≤N −1 . Saito et al. established a relation between the original discrete signal and the auto-correlation shell. Proposition 23 For any function f ∈ V0 , f (x) = Equations (F.4.32) satisfy the following identities N −1 X PN −1 k=0 Skj Φ0,k Sk0 φ(x − k), the coefficients {Skj } and {Dkj } computed with = N −1 X k=0 k=0 N −1 X N −1 X Dkj Φ0,k = Sk0 Φj,k Sk0 Ψj,k k=0 k=0 where Φj,k and Ψj,k are defined in Equations (F.4.31). Since pk = −qk for k 6= 0, adding Equations (F.4.32) yields a simple reconstruction formula 1 Skj−1 = √ (Skj + Dkj ) for j = 1, .., m0 , k = 0, ..., N − 1 2 That is, given a smoothed signal at two consecutive resolution levels, the detailed signal can be derived as Dkj = √ 2Skj−1 − Skj Hence, given the auto-correlation shell coefficients {Dkj }1≤j≤m0 ,0≤k≤N −1 and {Skm0 }0≤k≤N −1 , the above equation leads to Sk0 = 2− m0 2 Skm0 + m0 X j 2− 2 Dkj for k = 0, ..., N − 1 j=1 At each scale j, we obtain the set of detail coefficients {Dj } having the same number of samples as the original signal, and the set {S m0 } which provides the residual. Adding Dj for j = m0 , m0 − 1, .. gives an increasingly more accurate approximation of the original signal. The additive form of the reconstruction allows one to combine the predictions in a simple additive manner. Note, representations using the auto-correlation functions of compactly supported wavelets can also be viewed as a way of obtaining a continuous multiresolution analysis. Further, since they can also be viewed as pseudo-differential 697 Quantitative Analytics operators of even order, the zero-crossings in that setting corresponds to the location of edges at different scales in the signal. At last, R xthis approach can be modified to produce the maxima-based representation of Mallat et al. [1992b] by considering −∞ Ψ(y)dy instead of Ψ(x) and the corresponding two-scale difference equation. 698 Bibliography [2012] Abernethy J., Chen Y., Vaughan J.W., Efficient market making via convex optimization, and a connection to online learning. Working Paper, University of California, Berkeley. [1993] Abry P., Goncalves P., Flandrin P., Wavelet-based spectral analysis of 1/f processes. IEEE International Conference on Acoustics, Speech, and Signal Processing, 3, pp 237–240. [1995] Abry P., Goncalves P., Flandrin P., Wavelets, spectrum estimation and 1/f processes. in A. Antoniadis and G. Oppenheim, eds, Lecture Notes in Statistics: Wavelets and Statistics, Springer-Verlag, pp 15–30. [1996] Abry P., Sellan F., The wavelet-based synthesis for fractional Brownian motion. proposed by F. Sellan and Y. Meyer, Remarks and Fast Implementation, Applied and Computational Harmonic Analysis, 3, (4), pp 377–383. [1998] Abry P., Veitch D., Wavelet analysis of long-range-dependent traffic. IEEE Transaction on Information Theory, 44, (1), pp 2–15. [1999] Abry P., Sellan F., A wavelet-based joint estimator of the parameters of long-range dependence. IEEE Transaction on Information Theory, 45, (3), pp 878–897. [2000] Abry P., Flandrin P., Taqqu M.S., Veitch D., Wavelets for the analysis, estimation, and synthesis of scaling data. in Self-similar Network Traffic and Performance Evaluation, ed. K. Park, W. Willinger, Wiley, pp 39–87. [2002] Abry P., Baraniuk R., Flandrin P., Riedi R., Veitch D., Multiscale nature of network traffic. IEEE Signal Processing Magazine, 19, (3), pp 28–46. [2002] Addison P.S., The illustrated wavelet transform handbook. Taylor & Francis Group, New York. [2004] Agarwal V., Naik N.Y., Risk and portfolio decisions involving hedge funds. The Review of Financial Studies, 17, (1), pp 63–98. [2011] Agarwal S., Delage E., Peters M., Wang Z., Ye Y., A unified framework for dynamic prediction market design. Operations Research, 59, (3), pp 550–568. [2003] Ahn D.H., Conrad J., Dittmar R.F., Risk adjustment and trading strategies. The Review of Financial Studies, 16, pp 459–485. [1998] Ait-Sahalia Y., Lo A.W., Nonparametric estimation of state price densities implicit in financial asset prices. Journal of Finance, 53 pp 499–547. [2000] Ait-Sahalia Y., Lo A.W., Nonparametric risk management and implied risk aversion. Journal of Econometrics, 94 pp 9–51. [1973] Akaike H., Information theory and an extension of the maximum likelihood principle. In B. N. Petrov and F. Csaki (Eds.). Second international symposium on information theory (pp. 267–281). Budapest: Academiai Kiado 699 Quantitative Analytics [2009] Aldridge I., High-frequency trading: A practical guide to algorithmic strategies and trading systems. John Wiley & Sons, Inc., New Jersey. [2002] Alessio E., Carbone A., Castelli G., Frappietro V., Second-order moving average and scaling of stochastic time series. European Physical Journal, 27, B, pp 197–200. [2002] Alexander C., Dimitriu A., The cointegration alpha: Enhanced index tracking and long-short equity market neutral strategies. Working Paper, SSRN eLibrary. [2008] Alexander C., Market risk analysis: Practical financial econometrics. John Wiley & Sons, Ltd., Chichester. [1988] Algoet P., Cover T., Asymptotic optimality asymptotic equipartition properties of log-optimum investments. Annals of Probability, 16, pp 876–898. [1992] Algoet P., Universal schemes for prediction, gambling, and portfolio selection. Annals of Probability, 20, pp 901–941. [1994] Algoet P., The strong law of large numbers for sequential decisions under uncertainty. IEEE Transactions on Information Theory, 40, pp 609–634. [1953] Allais M., Le comportement de l’homme rationnel devant le risque, critique des postulats et axiomes de l’ecole americaine. Econometrica, 21, 503–546. [1999] Allen F., Karjalainen R., Using genetic algorithms to find technical trading rules. Journal of Financial Economics, 51, pp 245–271. [2002] Alrumaih R.M., Al-Fawzan M.A., Time series forecasting using wavelet denoising: An application to Saudi Stock Index. Journal of King Saud University, Engineering Sciences, 2, (14), pp 221–234. [2005] Alvarez F., Jermann U.J., Using asset prices to measure the persistence of the marginal utility of wealth. Working Paper. [2003] Amenc N., Malaise P., Martellini L., Sfeir D., Tactical style allocation: A new form of market neutral strategy. Working Paper, EDHEC Risk and Asset Management Research centre. [2014] Analytics Engines, Value at risk calculations using Monte Carlo methods. [1998] Andersen T.G., Bollerslev T., Answering the skeptics: Yes, standard volatility models do provide accurate forecasts. International Economic Review, 39, (4), pp 885–905. [1976] Annis A.A., Lloyd E.H., The expected value of the adjusted rescaled Hurst range of independent normal summands. Biometrika, 63, (1), pp 111–116. [2004] Aoki M., Modeling aggregate behavior and fluctuations in economics: Stochastic views of interacting agents. Cambridge, Cambridge University Press. [1999] Appel G., Technical analysis power tools for active investors. Financial Times Prentice Hall. [2008] Appel G., Appel M., A quick tutorial in MACD: Basic concepts. Working Paper. [1990] Archibald B.C., Parameter space of the Holt-Winters’ model. International Journal of Forecasting, 6, pp 199–209. [1995] Arino M.A., Morettin P., Vidakovic B., Wavelet scalograms and their applications in economic time series. Discussion Paper No. 94-13, Institute of Statistics and Decision Sciences, Duke University. [2006] Arisoy Y.E., Altay-Salih A. and Akdeniz L., Is volatility risk priced in the securities market? Evidence from S&P 500 index options. Working Paper, Bilkent University, Faculty of Business Administration. 700 Quantitative Analytics [1991] Arneodo A., Bacry E., Muzy J-F., Wavelets and multifractal formalism for singular signals: Application to turbulence data. Phys. Rev. Lett., 67, pp 3515–3518. [1995] Arneodo A., Bacry E., Graves P.V., Muzy J-F., Characterizing long-range correlations in DNA sequences from wavelet analysis. Phys. Rev. Lett., 74, 3293. [1998] Arneodo A., Muzy J-F., Dornette D., Discrete causal cascade in the stock market. Eur. Phys. J., 2, pp 277–282. [1989] Arora J.S., Introduction to optimum design. McGraw-Hill, New York. [1951] Arrow K.J., Alternative approaches to the theory of choice in risk-taking situations. Econometrica, 19, (4), pp 404–437. [1952] Arrow K.J., Le role des valeurs boursieres pour la repartition la meilleure des risques. International Colloqium on Econometrics. [1953] Arrow K.J., Le role des valeurs boursieres pour la repartition la meilleure des risques. Econometrie, 40, Cahier du CNRS, pp 41–47. [1954] Arrow K.J., Debreu G., Existence of an equilibrium for a competitive economy. Econometrica, 22, pp 265–290. [1971] Arrow K.J., Essays in the theory of risk-bearing. Chicago: Markham. [1974] Arrow K.J., The use of unbounded utility functions in expected-utility maximisation: Response. Quarterly Journal of Econometrics, 88, (1), pp 136–138. [1999] Ausloos M., Vandewalle N., Boveroux P., Minhuet A., Ivanova K., Applications of statistical physics to economic and financial topics. Physica A: Statistical Mechanics and its Applications, 274, pp 229–240. [2000] Ausloos M., Statistical physics in foreign exchange currency and stock markets. Physica A, 285, pp 48–65. [2007] Ausloos M., Lambiotte R., Clusters of networks of economies? A macroeconomy study through gross domestic product. Physica A: Statistical Mechanics and its applications, 382, pp 16–21. [2010] Ausloos M., Econophysics in Belgium. The first 15 years. Science and Culture, 76, (9-10), pp 380–385. [1998] Aussem A., Campbell J., Murtagh F., Wavelet based feature extraction and decomposition strategies for financial forecasting. J. Computational Intelligence Finance, 6, (2), pp 5–12. [2008] Avellaneda M., Lee JH., Statistical arbitrage in the U.S. equities market. Working Paper, Courant Institute of Mathematical Sciences, New York. [1900] Bachelier L., Theorie de la speculation. Thesis for the doctorate in Mathematical Sciences. Annales Scientifique de l’Ecole Normale Superieure, 3, (17), pp 21–86. [2008] Bacon C.R., Practical risk-adjusted performance measurement. The Wiley Finance Series, John Wiley & Sons. [2000] Bacry E., Delour J., Muzy J-F., A multivariate multifractal model for return fluctuations. Quantitative Finance Papers. [2001] Bacry E., Delour J., Muzy J-F., Multifractal random walk. Physical Review E, 64, 026103–026106. [2003] Bacry E., Muzy J-F., Log-infinitely divisible multifractal processes. Communications in Mathematical Physics, 236, pp 449–475. [2008] Bacry E., Kozhemyak A., Muzy J-F., Continuous cascade model for asset returns. Journal of Economic Dynamics and Control, 32, pp 156–199. 701 Quantitative Analytics [2012] Bacry E., Duvernet L., Muzy J-F., Continuous-time skewed multifractal processes as a model for financial returns. Journal of Applied Probability, 49, pp 482–502. [2013] Bacry E., Kozhemyak A., Muzy J-F., Lognormal continuous cascades: Aggregation properties and estimation. Quantitative Finance, 13, pp 795–818. [1996] Baillie R.T., Bollerslev T., Mikkelsen H.O., Fractionally integrated generalized autoregressive conditional heteroskedasticity. Journal of Econometrics, 74, pp 3–30. [2003] Bakshi G., Kapadia N., Delta-hedged gains and the negative market volatility risk premium. Review of Financial Studies, 16, pp 527–566. [2007] Balamurugan R., Subramanian S., Self-adaptive differential evolution based power economic dispatch of generators with valve-point effects and multiple fuel options. International Journal of Computer Science and Engineering, Winter. [2012a] Baltas A.N., Kosowski R., Momentum strategies in futures markets and trend-following funds. Working Paper, Imperial College London. [2012b] Baltas A.N., Kosowski R., Improving time-series momentum strategies: The role of trading signals and volatility estimators. Working Paper, Imperial College London. [1993] Bansal R., Viswanathan S., No arbitrage and arbitrage pricing. Journal of Finance, 48, pp 1231–1262. [1991] Barabasi A-L., Vicsek T., Multifractality of self-affine fractals. Physical Review A, 44, (4), pp 2730–2733. [1998] Barberis N., Shleifer A., Vishny R., A model of investor sentiment. Journal of Financial Economics, 49, pp 307–343. [2002] Barberis N., Thaler T., A survey of behavioral finance. NBER Working Paper, 9222. [2001] Barndorff-Nielsen O.E., Prause K., Apparent scaling. Finance and Stochastics, 5, pp 103–113. [2002] Barndorff-Nielsen O.E., Shephard N., Econometric analysis of realized volatility and its use in estimating stochastic volatility models. Journal of the Royal Statistical Society: Series B, Statistical Methodology, 64, (2), pp 253– 280. [2008] Barone-Adesi G., Engle R., Mancini L., A GARCH option pricing model in incomplete markets. Review of Financial Studies, 21, pp 1223–1258. [2012] Barroso P., Santa-Clara P., Managing the risk of momentum. Working Paper, SSRN eLibrary. [2012] Barunik J., Understanding the source of multifractality in financial markets. Physica A, 391, (17), pp 4234– 4251. [1987] Battle G., A block spin construction of ondelettes, Part I: Lemarie functions. Commun. Math. Phys., 110, pp 601–615. [2013] Battula B.P., Satya Prasad R., An overview of recent machine learning strategies in data mining. International Journal of Avanced Computer Science and Applications, 4, (3), pp 50–54. [2001] Becherer D., The numeraire portfolio for unbounded semi-martingales. Finance and Stochastics, 5, (3), pp 327–341. [2000] Bekaert G., Wu G., Asymmetric volatility and risk in equity markets. The Review of Financial Studies, 13, (1), pp 1–42. 702 Quantitative Analytics [1980] Bell R.M., Cover T.M., Competitive optimality of logarithmic investment. Mathematics of Operations Research, 5, pp 161–166. [2000] Bellamy N., Jeanblanc M., Incompleteness of markets driven by a mixed diffusion. Finance and Stochastics, 4, Number 2. [2010] Bender J., Briand R., Nielsen F., Stefek D., Portolio of risk premia: a new approach to diversification. Journal of Portfolio Management, 36, (2), pp 17–25. [1977] Benedetti J.K., On the nonparametric estimation of regression functions. Journal of the Royal Statistical Society, 39, Series B, pp 248–253. [2012] Bennett C., Gil M., Measuring historical volatility. Equity Derivatives, Santander. [2003] Bentz Y., Quantitative equity investment management with time-varying factor sensitivities. In Dunis, C., Laws, J. and Naim, P, eds., Applied Quantitative Methods for Trading and Investment, John Wiley & Sons, Chichester, pp 213–237. [1994] Beran J., Statistics for long-memory processes. Monographs on Statistics and Applied Probability, Chapman & Hall, New York. [1996] Bergman Y.Z., Grundy B.D., Wiener Z., General properties of option prices. Preprint, Wharton School of the Univertity of Pennsylvania. [1964] Berman S.M., Limiting theorems for the maximum term in stationary sequences. Annals of Mathematical Statistics, 35, pp 502–516. [1989] Bernard V.L., Thomas J.K., Post-earnings annoucement drift: Delayed price response or risk premium? Journal of Accounting Research, 27, pp 1–36. [1996] Bernardo A.E., Ledoit O., Gain, loss and asset pricing. Working Paper. [2000] Bernardo A.E., Ledoit O., Gain, loss, and asset pricing. Journal of Political Economy, 108, pp 144–172. [2011] Bernemann A., Shreyer R., Spanderen K., Accelerating exotic option pricing and model calibration using GPUs. Working Paper, SSRN. [1738-1954] Bernoulli D., Specimen theoriae novae de mensura sortis, in Commentarii Academiae Scientiarum Imperialis Petropolitannae. Exposition of a new theory on the measurement of risk. translated by Dr. Louise Sommer, Econometrica, 22, (1), pp 22–36. [1713] Bernoulli J., Ars conjectandi. Thurnisorium, Basil. [2013] Bertrand P., Fhima M., Guillin A., Local estimation of the Hurst index of multifractional Brownian motion by increment ratio statistic method. ESAIM Probability and Statistics, 17, (1), pp 307–327. [1992] Beylkin G., Saito N., Wavelets, their autocorrelation functions, and multiresolution representation of signals. D.P. Casasent, eds., Intelligent Robots and Computer Vision XI: Biological, Neural Net, and 3D Methods, 39, doi:10.1117/12.131585. [2005] Billah B., Hyndman R.J., Koehler A.B., Empirical information criteria for time series forecasting model selection. Journal of Statistical Computation and Simulation. [2006] Bishop C., Pattern recognition and machine learning. Springer Verlag. [1972] Black F., Capital market equilibrium with restricted borrowing. Journal of Business, 45, (3), pp 444–454. 703 Quantitative Analytics [1972] Black F., Jensen M.C., Scholes M., The capital asset pricing model: Some empirical tests. Studies in the Theory of Capital Markets, M.C. Jensen, ed. New York: Praeger, pp 79–121. [1973] Black F., Scholes M., The pricing of options and corporate liabilities. Journal of Political Economics, 81, pp 637–659. [1990] Black F., Litterman R., Asset allocation: Combining investor views with market equilibrium. Working Paper, Goldman Sachs. [2008] Bloch D.A., Nakashima Y., Multi-currency local volatility model. Working Paper, SSRN-. [2010] Bloch D.A., A practical guide to implied and local volatility Working Paper, SSRN-id1538808. [2011] Bloch D.A., Coello Coello C.A., Smiling at evolution. Applied Soft Computing, 11, (8), pp 5724–5734. [2009] BNP Paribas, BNP Paribas CIB reduces supercomputer environmental impact. [1992] Boashash B., Estimating and interpreting the instantaneous frequency of a signal part 2: Algorithms and applications. Proceedings of the IEEE, 80, pp 540–568. [1986] Bollerslev T., Generalized autoregressive conditional heteroskedasticity. Journal of Econometrics, 31, pp 307– 327. [1999] Bollerslev T., Jubinski D., Equality trading volume and volatility: Latent information arrivals and common long-run dependencies. Journal of Business & Economic Statistics, 17, pp 9–21. [2011] Bollerslev T., Todorov V., Tails, fears, and risk premia. Journal of Finance. [2007] Bookstaber R., A demon of our own design: Markets, hedge funds, and the perils of financial innovation. Wiley. [1987] Boothe P., Glassman D., The statistical distribution of exchange rates, empirical evidence and economic implications. Journal of International Economics, 22, pp 297–319. [2010] Bordalo P., Gennaioli N., Shleifer A., Salience theory of choice under risk. Harvard University working paper. [1966] Bossons J., The effects of parameter misspecification and non-stationary on the applicability of adaptive forecasts. Management Science, 12, pp. 659–669. [2000] Bouchaud J-P., Potters M., Theory of financial risks: from statistical physics to risk management. Cambridge University Press, Cambridge. [1970] Box G.E.P., Pierce D., Distribution of residual autocorrelations in autoregressive-integrated moving average time series models. Journal of the American Statistical Association, 65, pp 1509–1526. [1994] Box G.E.P., Jenkins G.M., Reinsel G.C., Time series analysis: Forecasting and control. 3rd edition, Prentice Hall: Englewood Cliffs, New Jersey. [1997] Brace A., Gatarek D., Musiela M., The market model of interest rate dynamics. Mathematical Finance, 7 (2), pp 127–155. [2003] Bradley A.P., Shift-invariance in the discrete wavelet transform. in C. Sun, H. Talbot, S. Ourselin, T. Adriaansen, eds., Proc. VIIth Digital Image Computing: Techniques and Applications, pp 29–38. [2005] Brandt M.W., Kinlay J., Estimating historical volatility. Research Article, Investment Analytics. 704 Quantitative Analytics [1978] Breeden D.T., Litzenberger R.H., Prices of state-contingent claims implicit in option prices. Journal of Business, 51, pp 621–651. [1989] Breeden D.T., Gibbons M.R., Litzenberger R.H., Empirical tests of the consumption oriented CAPM. Journal of Finance, 44, (2), pp 221–262. [1998] Breidt F.J., Crato N., de Lima P., On the detection and estimation of long memory in stochastic volatility. Journal of Econometrics, 83, pp 325–348. [1961] Breiman L., Optimal gambling systems for favorable games. in Proc. of the Fourth Berkeley Symposium on Mathematical Statistics and Probability, Berkeley University, pp 65–78. [1950] Brier G., Verification of forecasts expressed in terms of probability. Monthly Weather Review, 78, (1), pp 1–3. [2000] Britten-Jones M., Neuberger A., Option prices, implied price processes, and stochastic volatility. Journal of Finance, 55, pp 839–866. [1987] Brock W.A., Dechert W.D., Scheinkman J.A., LeBaron B., A test for independence based on the correlation dimension. Working Paper, Classifications C10, C52. [1991] Brockwell P.J., Davis R.A., Time series: Theory and methods. Springer Series in Statistics. [1996] Brockwell P.J., Davis R.A., Introduction to time series and Forecasting. Springer Series in Statistics, New York. [1995] Bromley B.C., Quasirandom number generators for parallel Monte Carlo algorithms. Journal of Parallel and Distributed Computing, 38, (1), pp 101–104. [1959] Brown R.G., Statistical Forecasting for Inventory Control. McGraw-Hill, New York, NY. [1963] Brown R.G., Smoothing, forecasting and prediction of discrete time series. Englewood Cliffs, NJ, PrenticeHall. [2011] Bruder B., Dao TL., Richard JC., Roncalli T., Trend filtering methods for momentum strategies. White Paper, Quant Research by LYXOR. [1997] Brush J.S., Comparisons and combinations of long and long-short strategies. Financial Analysts Journal, 53, pp 81–89. [2011] Bryhn A.C., Dimberg P.H., An operational definition of a statistically meaningful trend. PLoS ONE, 6, (4), e19241. [1994] Burke G., A sharper Sharpe ratio. The Computerized Trader, March. [1994] Cai J., A Markov model of switching-regime ARCH. Journal of Business, 12, pp 309–316. [2004] Cajueiro D.O., Tabak B.M., The Hurst exponent over time: Testing the assertion that emerging markets are becoming more efficient. Physica A, 336, pp 521–537. [2007] Cajueiro D.O., Tabak B.M., Long-range dependence and multifractality in the term structure of LIBOR interest rates. Physica A, 373, pp 603–614. [2001] Calvet L., Fisher A., Forecasting multifractal volatility. Journal of Econometrics, 105, pp 27–58. [2002] Calvet L., Fisher A., Multifractality in asset returns: Theory and evidence. The Review of Economics and Statistics, 84, (3), pp 381–406. 705 Quantitative Analytics [2004] Calvet L., Fisher A., Regime-switching and the estimation of multifractal processes. Journal of Financial Econometrics, 2, pp 44–83. [2006] Calvet L., Fisher A., Thompson S., Volatility comovement: A multi-frequency approach. Journal of Econometrics, 31, pp 179–215. [2013] Calvet L., Fisher A., Wu L., Staying on top of the curve: A cascade model of term structure dynamics. Working Paper. [1988] Campbell J.Y., Shiller R.J., Stock prices, earnings and expected dividends. Journal of Finance, 43, (3), pp 661–676. [1997] Campbell J.Y., Lo A.W., MacKinlay A.C., The econometrics of financial markets. Princeton University Press, New jersey. [2004] Carbone A., Castelli G., Stanley H., Time-dependent Hurst exponents in financial time series. Physica A, 344, pp 267–271. [2007] Carbone A., Algorithm to estimate the Hurst exponent of high-dimensional fractals. Working Paper, Physics Department, Politecnico di Torino. [1997] Carhart M.M., On persistence in mutual fund performance. Journal of Finance, 52, (1), pp 57–82. [2009] Carmona R., Cinlar E., Indifference pricing, theory and application. Princeton. [2012] Carr P., Yu J., Risk, return, and Ross recovery. Journal of Derivatives, 20, pp 38–59. [1994] Carter C.K., Kohn R., On Gibbs sampling for state space models. Biometrica, 81, pp 541–553. [2006] Cesa-Bianchi N., Lugosi G., Prediction, learning, and games. Cambridge University Press. [1988] Chan N.H., Wei C.Z., Limiting distributions of least squares estimates of unstable autoregressive processes. Annals of Statistics, 16, pp 367–401. [2009] Chan E., Quantitative trading: How to build your own algorithmic trading business. John Wiley & Sons, Hoboken, New Jersey. [1994] Chande T.S., Kroll S., The new technical trader. John Wiley, New York. [1988] Chatfield C., Yar M., Holt-Winters forecasting: Some practical issues. Journal of the Royal Statistical Society, Series D, 37, pp 129–140. [1996] Chatfield C., Model uncertainty and forecast accuracy. Journal of Forecasting, 15, pp 495–508. [2002] Chatfield C., Confessions of a pragmatic statistician. Journal of the Royal Statistical Society, Series D, 51, pp 1–20. [2008] Chauhan A., Automated stock trading and portfolio optimization using XCS trader and technical analysis. Master of Science, Artificial Intelligence, School of Informatics, University of Edinburgh. [2007] Chen Y., Pennock D.M., A utility framework for bounded-loss market makers. in Proceedings of the 23rd Conference on Uncertainty in Artificial Intelligence. [2008] Chen Y., Fortnow L., Lambert N., Pennock D.M., Wortman J., Complexity of combinatorial market makers. in Proceedings of the 9th ACM Conference on Electronic Commerce. [1989] Chhabra A., Jensen R.V., Direct determination of the f (α) singularity spectrum. Phys. Rev. Lett., 62, (12), pp 1327–1330. 706 Quantitative Analytics [2005] Chianca C., Ticona A., Penna T., Fourier-detrended fluctuation analysis. Physica A, 357, (447), pp –. [2008] Chin W., Spurious long-range dependence: Evidence from malaysian equity markets. MPRA Paper No. 7914. [2008b] Chin W.C., A sectoral efficiency analysis of Malaysian stock exchange under structural break. American Journal of Applied Sciences, 5, pp 1291–1295. [1993] Chopra V.K., Ziemba W.T., The effect of errors in means, variances, and covariances on optimal portfolio choice. The Journal of Portfolio Management, 19, pp 6–11. [1960] Chow G., Tests of equality between sets of coefficients in two linear regressions. Econometrica, 28, pp 591–605. [2009] Christara C., Dang D.M., Jackson K., Lakhany A., A PDE pricing framework for cross-currency interest rate derivatives with Target Redemption features. Working Paper, SSRN. [2005] Christensen M.M., Platen E., A general benchmark model for stochastic jumps. Stochastic Analysis and Applications, 23 (5), pp 1017–1044. [2011] Christensen M.M., On the history of the growth optimal portfolio. Chapter 1, World Scientific Review, 9 (6), pp 1–70. [2005] Chui A.C., Titman S., Wei K.C.J., Individualism and momentum around the world. Working Paper, Hong Kong Polytechnic University, University of Texas at Austin and NBER. [1998] Chung H., Lee B.S., Fundamental and non-fundamental components in stock prices of Pacific-Rim countries. Pacific-Basin Journal of Finance, 6, 321–346. [1980] Clark R.M., Calibration, cross-validation and carbon 14 ii.. Journal of the Royal Statistical Society, 143, Series A, pp 177–194. [2002] Clarke R.G., de Silva H., Thorley S., Portfolio constraints and the fundamental law of active management. Financial Analysts Journal, 58, (5), pp 48–66. [2004] Clarke R.G., de Silva H., Sapra S.G., Towards more information-efficient portfolios’. Journal of Portfolio Management, 31, (1), pp 54–63. [2005] Clarke R.G., de Silva H., Murdock R., A factor approach to asset allocation exposure to global market factors. Journal of Portfolio Management, 32, pp 10–21. [2006] Clarke R.G., de Silva H., Thorley S., The fundamental law of active portfolio management with full covariance matrix. Journal of Investment Management, 4, (3), pp 54–72. [2008] Clarke R.G., de Silva H., Sapra S.G., Thorley S., Long-short extensions: How much is enough? Financial Analysts Journal, 64, (1), pp 16–30. [2009] Clauset A., Cosma R.S., Newman M.E.J., Power-law distributions in empirical data. SIAM Review, 51, pp 661–703. [2006] Clegg R.G., A practical guide to measuring the Hurst parameter. International Journal of Simulation: Systems, Science and Technology, 7, (2), pp 3–14. [2000] Cochrane J.H., Beyond arbitrage: Good deal asset price bounds in incomplete markets. Journal of Political Economy, 108, pp 79–119. [2001] Cochrane J.H., Asset pricing. Princeton University Press. 707 Quantitative Analytics [2000] Coello Coello C.A., Constraint-handling using an evolutionary multiobjective optimization technique. Civil Engineering and Environmental Systems, Vol. 17, pp 319–346. [2002] Coello Coello C.A., Mezura-Montes E., Constraint-handling in genetic algorithms through the use of dominance-based tournament selection. Advanced Engineering Informatic, Vol. 16, pp 193–203. [2003] Coello Coello C.A., Mezura-Montes E., Increasing successful offspring and diversity in differential evolution for engineering design. Advanced Engineering Informatic, Vol. 16, pp 193–203. [2000] Coeurjolly J.F., Simulation and identification of the fractional Brownian motion: A bibliographical and comparative study. Journal of Statistical Software, 5, (7). [1992] Cohen A., Daubechies I., Feauveau J-C., Biorthogonal bases of compactly supported wavelets. Communications on Pure and Applied Mathematics, 45, (5), pp 485–560. [1992] Coifman R.R., Wickerhauser M.V., Entropy-based algorithms for best basis selection. IEEE Trans. Inform. Theory, 38, pp 713–718. [1992] Collopy F., Armstrong J.S., Rule-based forecasting: Development and validation of an expert systems approach to combining time series extrapolations. Management Science, 38, pp 1394–1414. [2005] Conejo A.J., Plazas M.A. Espinola R. Molina A.B., Day-ahead electricity price forecasting using the wavelet transform and ARIMA models. IEEE Transactions on Power Systems, 20, (2), pp 1035–1042. [2002] Cont R., Tankov P., Calibration of jump-diffusion option-pricing models : a robust non-parametric approach. CMAP, 42, September. [2003] Cont R., Tankov P., Financial modelling with jump processes. Chapman & Hall, CRC Press. [1964] Cootner P., The random character of stock market prices. Cambridge: MIT Press. [2003] Costa R.L., Vasconcelos G.L., Long-range correlations and nonstationarity in the Brazilian stock market. Physica A, 329, pp 231–248. [2005] Couillard M., Davison M., A comment on measuring the Hurst exponent of financial time series. Physica A, 348, pp 404–418. [1984] Cover T.M., An algorithm for maximizing expected log investment return. IEEE Transactions on Information Theory, 30, pp 369–373. [1998] Cover T.M., Ordentlich E., Universal portfolios with short sales and margin. in Proceedings of IEEE International Symposium on Information Theory. [1974] Cox D.R., Hinkley D.V., Theoretical statistics. Chapman and Hall, London. [1985] Cox J.C., Ingersoll J.E. and Ross S.A., A theory of the term structure of interest rates. Econometrica, 53, pp 373–384. [1985b] Cox J.C., Rubinstein M., Options markets. Prentice-Hall, Englewood Cliffs. [2000] Cristi R., Tummula M., Multirate, multiresolution, recursive Kalman filter. Signal Processing, 80, pp 1945– 1958. [2001] Cvitanic J., Schachermayer W., Wang H., Utility maximisation in incomplete markets with random endowment. Finance and Stochastics, 5, (2), pp 259–272. 708 Quantitative Analytics [1988] Cybenko G., Continuous valued neural networks with two hidden layers are sufficient. Technical Report, Department of Computer Science, Tufts University, Medford, MA. [1989] Cybenko G., Approximation by superpositions of a sigmoidal function. Mathematics of Control, Signals, and Systems, 2, pp 303–314. [2008] Czarnecki L., Grech D., Pamula G., Comparison study of global and local approches describing critical phenomena on the Polish stock exchange market. Physica A: Statistical Mechanics and its Applications, 387, (29), pp 6601–6811. [1993] Dacorogna M.M., Muller U.A., Nagler R.J., Olsen R.B., Pictet O.V., A geographical model for the daily and weekly seasonal volatility in the foreign exchange market. Journal of International Money and Finance, 12, (4), pp 413–438. [1998] Dacorogna M.M., Muller U.A., Olsen R.B., Pictet O.V., Modelling short-term volatility with GARCH and HARCH models. in C. Dunis and B. Zhou, (eds.), Nonlinear Modelling of High Frequency Financial Time Series, John Wiley & Sons, pp 161–176. [2001] Dacorogna M.M., Gencay R., Muller U.A., Olsen R.B., Pictet O.V., An introduction to high frequency finance. Academic Press, San Diego, CA. √ [1973] D’Agostino R., Pearson E., Tests for departures from normality. Empirical results for the distribution of b1 and b2 . Biometrika, 60, pp 613–622. [1993] Dana R.A., Existence and uniqueness of equilibria when preferences are additively separable. Econometrica, 61, (4), pp 953–957. [1994] Dana R.A., Jeanblanc-Picque M., Marche financiers en temps continu: valorisation et equilibre. Recherche en Gestion, Economica, Paris. [2003] Darst D.M., The art of asset allocation: Asset allocation principles and investment strategies for any market. McGraw-Hill, New York. [1882] Darwin C.R., The variation of animals and plants under domestication. Murray, London, second edition. [2005] Da Silva S., Matsushita R., Gleria I., Figueiredo A., Rathie P., International finance, Levy distributions, and the econophysics of exchange rates. Communications in Nonlinear Science and Numerical Simulation, 10, (4), pp –. [1988] Daubechies I., Orthonormal bases of compactly supported wavelets. Communications on Pure and Applied Mathematics, 41, pp 909–996. [1992] Daubechies I., Ten lectures on wavelets. Regional Conference Series in Applied Mathematics, CSIAM [2004] Daubechies I., Defrise M., De Mol C., An iterative thresholding algorithm for linear inverse problems with a sparsity constraint. Communications on Pure and Applied Mathematics, 57, (11), pp 1413–1457. [1998] Davidson R., Labys W.C., Lesourd J-B., Wavelet analysis of commodity price behaviour. Comput. Econ., 11, pp 103–128. [2013] Davidson C., Chip and win: Banks expand use of GPUs. Risk magazine, 25th of March. [1999] Davis M.H.A., Option valuation and basis risk. In T.E. Djaferis and L.C. Shick, editors, System Theory: Modelling, Analysis and Control, Academic Publishers. [2010] Davis M.H.A. and Yoshikawa D., An equilibrium approach to indifference pricing. Working Paper, Imperial College London. 709 Quantitative Analytics [1988] Deaton A., Agricultural pricing policies and demand patterns in thailand. Unpublished Manuscript. [2000] Deb K., An efficient constraint handling method for genetic algorithms. Computer Methods in Applied Mechanics and Engineering, 186, (2/4), pp 311-338. [1985] De Bondt W.F.M., Thaler R., Does the stock market overreact? Journal of Finance, 40, (3), pp 793–805. [1987] De Bondt W.F.M., Thaler R., Further evidence of investor overreaction and stock market seasonality. Journal of Finance, 42, pp 557–581. [1953] Debreu G., Une economie de l’incertain. Electricte de France. [1959] Debreu G., Theorie de la valeur. Dunod, Paris. [1994] Delbaen F., Schachermayer W., A general version of the fundamental theorem of asset pricing. Math. Ann., 300, pp 463–520. [1990] De Long J.B., Shleifer A., Summers L.H., Waldmann R.J., Positive feedback investment strategies and destabilizing rational speculation. Journal of Finance, 45, pp 375–395. [1992] Demange G., Rochet J.C., Methode mathematiques de la finance. Economica, Paris. [1998] Dempster A., Logicist statistics I. Models and modelling. Statistical Science, 13, pp 248–276. [1999] Dempster M.A.H., Jones C.M., Can technical pattern trading be profitably automated? Working Paper, Judge Institutes of management Studies, Cambridge, UK. [2001] Dempster M.A.H., Jones C.M., A real-time adaptive trading system using genetic programming. Quantitative Finance, 1, Institute of Physics Publishing, pp 397–413. [2001b] Dempster M.A.H., Payne T.W., Romahi Y., Thompson G.W.P., Computational learning techniques for intraday FX trading using popular technical indicators. IEEE Transactions on Neural Networks, 12, (4). [2006] Der R., Lee D., Beyond Gaussian processes: On the distributions of infinite networks. Advances in Neural Information Processing Systems, 18, pp –. [1989] Deslauriers G., Dubuc S., Symmetric iterative interpolation processes. Constructive Approximation, 5, pp 49–68. [1991] Detemple J., and Selden L., A general equilibrium analysis of option and stock market interactions. International Economic Review, 32, pp 279–303. [1999] Detemple J., Sundaresan S., Nontraded asset valuation with portfolio constraints: A binomial approach. Review of Financial Studies, 12, pp. 835–872. [2008] Devlin K., The unfinished game. New York, NY: Basic Books. [1979] Dickey D.A., Fuller W.A., Distribution of the estimates for autoregressive time series with a unit root. Journal of the American Statistical Association, pp 427–431. [1989] Diebold F.X., Nerlove M., The dynamics of exchange rate volatility: A multivariate latent factor ARCH model. Journal of Applied Econometrics, 4, pp 1–21. [2003] Dieker A.B., Simulation of fractional Brownian motion. Master Thesis, Vrije Universiteit Amsterdam. [1993] Ding Z., Granger C.W.J., Engle R.F., A long memory property of stock market returns and a new model. Journal of the Empirical Finance, 1, pp 83–106. 710 Quantitative Analytics [2009] Dixon M., Chong D., Accelerating market value-at-risk estimation on GPUs. [2006] Do B., Faff R., Hamza K., A new approach to modeling and estimation for pairs trading. Working Papaer. [1995] Donoho D.L., Johnstone I.M., Adapting to unknown smoothness via wavelet shrinkage. Journal of the American Statistical Association, 90, pp 1200–1224. [1995b] Donoho D.L., Johnstone I.M., Kerkyacharian G., Picard D., Wavelet shrinkage: Asymptopia? J. R. Statistical Society, 57, (2), pp 301–369. [2000] Dowd K., Adjusting for risk: An improved Sharpe ratio. International Review of Economics and Finance, 9, (3), pp 209–222. [1999] Drummond C., Hearne T., The lessons. A series of 30 multi-media lessons, Drummond and Hearne Publications, Chicago. [2007] Duarte J., Jones C.S., The price of market volatility risk. Working Paper, University of Washington, University of Southern California. [1986] Dubuc S., Interpolation through an iterative scheme. J. Math. Anal. and Appl., 114, pp 185–204. [1993] Duffie D. Kan R., A yield factor model of interest rates. Journal of Finance, 1. [1997] Duffie D., Pan J., An overview of value at risk. Journal of Derivatives, Spring, pp 7–48. [2000] Duffie D., Pan J., Singleton K., Transform analysis and asset pricing for affine jump-diffusions. Econometrica, 68, (6), pp 1343–1376. [2003] D. Duffie, D. Filipovic and W. Schachermayer, Affine processes and applications in finance. Annals of Applied Probability 13, pp 984–1053. [1998] Dunis C.L., Zhou B., Nonlinear modeling of high frequency financial time series. Wiley. [2005] Dunis C.L., Shannon G., Emerging markets of south-east and central Asia: Do they still offer a diversification benefit? Journal of Asset Management 6, (3), pp 168–190. [2010] Dunis C.L., Giorgioni G., Laws J., Rudy J., Statistical arbitrage and high-frequency data with an application to Eurostoxx 50 equities. Working Paper, Liverpool Business School. [1994] Dupire B., Pricing with a smile. Risk, 7, pp. 18–20. [2003] Durrleman V., A note on initial volatility surface. Working Paper. [1989] Dutilleux P., An implementation of the algorithme a trous to compute the wavelet transform. in Wavelets, time-frequency methods and phase space, Proceedings of the International Conference, Marseille, J.M. Combes, A. Grossman, Ph. Tchamitchian, eds., Springer, Berlin, pp 298–304. [2003] Dybvig P.H., Ross S.A. Arbitrage, state prices and portfolio theory. in G.M. Constantinedes, M. Harris, and R.M. Stultz, eds. Handbook of the Economics if Finance, (Elsevier). [1908] Einstein A., Uber die von der molekularkinetischen theorie der warme geforderte bewegung von in ruhenden flussigkeiten suspendierten teilchen. Annals of Physics, 322. [2001] Einstein A., Wu H.S., Gil J., Detrended fluctuation analysis of chromatin texture for diagnosis in breast cytology. Fractals, 9, (4). [2004] Eisler Z., Kertesz J., Multifractal model of asset returns with leverage effect. Physica A, 343, pp 603–622. 711 Quantitative Analytics [2002] Eke A., Hermann P., Kocsis L., Kozak L.R., Fractal characterization of complexity in temporal physiological signals. Physiol. Meas., 23, R1–R38. [2006] Eling M., Autocorrelation, bias and fat tails: Are Hedge Funds really attractive investments? Derivatives Use, Trading and Regulation, 12, pp 1–20. [2006] Eling M., Schuhmacher F., Does the choice of performance measure influence the evaluation of hedge funds? Working Papers on Risk Management and Insurance No. 29, September. [1992] El Karoui N., Myneni R. Viswanathan R., Arbitrage pricing and hedging of interest rate claims with state variables : I theory. Working Paper, University of Paris. [1995] El Karoui N., Quenez M.C., Dynamic programming and pricing of contingent claims in an incomplete market. SIAM Journal of Control and Optimization, 33, pp. 29–66. [1997] El Karoui N., Modèles stochastiques de taux d’intéret. Laboratoire de Probabilités, Universite de Paris 6. [1998] El Karoui N., Jeanblanc M., Shreve S., Robustness of the BS formula. Mathematical Finance, 8, pp 93-126. [2002] Embrechts P., Maejima M., Selfsimilar processes. Princeton University Press. [1982] Engle R.F., Autoregressive conditional heteroskedasticity with estimates of the variance of U.K. inflation. Econometrica, 50, pp 987–1008. [1986] Engle R.F., Granger C.W.j., Rice j., Weiss A., Semiparametric estimates of the relation between weather and electricity sales. Journal of the American Statistical Association, 81, pp 310–320. [1987] Engle R.F., Granger C.W.j., Co-integration and error correction: Representation, estimation, and testing. Econometrica, 55, 2, pp 251–276. [1992] Evertsz C.J.G., Mandelbrot B.B., Multifractal measures. in H-O. Pleitgen, H. Jurgens and D. Saupe, eds., Chaos and Fractals: New Frontiers of Science, Berlin, Springer. [1963] Fama E.F., Mandelbrot and the stable Paretian hypothesis. Journal of Business, 36, pp 420–429. [1965a] Fama E.F., The behavior of stock-market prices. Journal of Business, 38, (1), pp 34–105. [1965] Fama E.F., Portfolio analysis in a stable Paretian market. Management Science, 11, pp 404–419. [1970] Fama E.F., Efficient capital markets: A review of theory and empirical work. Journal of Finance, 25, (2), 383–417. [1971] Fama E.F., Roll R., Parameter estimates for symmetric stable distributions. Journal of the American Association, 66, pp 331–338. [1972] Fama E.F., Miller M.H., The theory of finance. New York: Holt, Rinehart and Winston. [1973] Fama E.F., MacBeth J.D., Risk, return, and equilibrium: Empirical tests. Journal of Political Economy, 81, (3) pp 607–636. [1989] Fama E.F., French K., Business conditions and expected returns on stocks and bonds. Journal of Financial Economics, 25, pp 23–49. [1992] Fama E.F., French K., The cross-section of expected stock returns. Journal of Finance, 47, (2), 427–465. [1993] Fama E.F., French K., Common risk factors in the returns on stocks and bonds. Journal of Financial Economics, 33, (1) pp 3–56. 712 Quantitative Analytics [1996] Fama E.F., Multifactor portfolio efficiency and multifactor asset pricing. Journal of Financial and Quantitative Analysis, 31, (4), pp 441–465. [2004] Fama E.F., French K., The capital asset pricing model: Theory and evidence. Journal of Economic Perspectives, 18, (3), pp 25–46. [1997] Fang H., Lai T., Cokurtosis and capital asset pricing. Financial Review, 32, pp 293–307. [2002] Favre L., Galeano J.A., Mean-modified value-at-risk optimization with hedge funds. Journal of Alternative Investments, 5 (Fall), pp 21–25. [1988] Feder J., Fractals. Plenum Press, New York. [1951] Feller W., The asymptotic distribution of the range of sums of independent random variables. Ann. Math. Statist., 22, (3), pp 427–432. [1971] Feller W., An introduction to probability theory and its applications. Wiley, Vol. 2, New York. [2006] Fergussen K., Platen E., On the distributional characterisation of daily log-returns of a world stock index. Applied Mathematical Finance, 13, pp 19–38. [2005] Fernandez V., Time-scale decompositions of price transmissions in international markets. Emerging markets Finance and Trade, 41, (4), pp 57–90. [2008] Fernandez-Blanco P., Technical market indicators optimization using evolutionary algorithms. In proceedings of the 2008 GECCO conference companion on genetic and evolutionary computation. Atlanta, USA. [1992] Fildes R., The evaluation of extrapolative forecasting methods. International Journal of Forecasting, 8, pp 81–98. [1998] Fildes R., Hibon M., Makridakis S., Meade N., Generalising about univariate forecasting methods: Further empirical evidence. International Journal of Forecasting, 14, pp 339–358. [2001] Filipovic D., Separable term structures and the maximal degree problems. Manuscript, ETH Zurich, Switzerland. [1906] Fisher I., The nature of capital and income. Macmillan, London. [1997] Fisher A., Calvet L., Mandelbrot B.B., Multifractality of Deutschemark/US dollar exchange rates. Cowles Foundation Discussion Papers 1166, Cowles Foundation for Research in Economics, Yale University. [1992] Flandrin P., Wavelet analysis and synthesis of fractional Brownian motion. IEEE Trans. Inform. Theory, 38, (2), pp 910–917. [2004] Focardi S.M., Kolm P.N., Fabozzi F.J., New kids on the block. The Journal of Portfolio Management, 2004, pp 42–54. [1966] Fogel L.J., Artificial intelligence through simulated evolution. John Wiley, New York. [1990] Follmer H., Schweizer M., Hedging of contingent claims under incomplete information. In M.H.A. Davis and R.J. Elliott, editors, Applied Stochastic Analysis, pp 389–414, Gordon and Breach, London. [1986] Fox R., Taqqu M.S., Large-sample properties of parameter estimates for strongly dependent stationary Gaussian time series. The Annals of Statistics, 14, (2), pp 517–532. [1995] Frachot A., Factor models of domestic and foreign interest rates with stochastic volatilities. Mathematical Finance, 5, pp 167–185. 713 Quantitative Analytics [2001] Frachot A., Théorie et pratique des instruments financiers. Ecole Polytechnique, Janvier. [1987] French K.R., Schwert G.W., Stambaugh R.F., Expected stock returns and volatility. Journal of financical Economics, 19, pp 3–29. [1948] Friedman M., Savage L.J., The utility analysis of choices involving risks. Journal of Political Economy, 56, pp 279–304. [1989] Friedman B.M., Laibson D.I., Economic implications of extraordinary movements in stock prices. Brookings Papers on Economic Activity 2. [1985] Frisch U., Parisi G., Fully developed turbulence and intermittency. in M. Ghil, R. Benzi, G. Parisi, ed., Turbulence and Predictability in Geophysical Fluid Dynamics and Climate Dynamics, Amsterdam, pp 84–88. [2000] Frittelli M., The minimal entropy martingale measure and the valuation problem in incomplete markets. Mathematical Finance, 10, (1), pp 39–52. [2010a] Fruehwirth-Schnatter S., Fruehwirth R., Data augmentation and MCMC for binary and multinomial logit models. In T. Kneib and G. Tutz, Eds., Statistical Modelling and Regression Structure, Festschrift in Honour of Ludwig Fahrmeir, Heidelberg, Physica-Verlag, pp 111–132. [2010b] Fruehwirth-Schnatter S., Wagner H., Stochastic model specification search for Gaussian and partially nonGaussian state space models. Journal of Econometrics, 154, pp 85–100. [2010] Fuertes A., Miffre J., Rallis G., Tactical allocation in commodity futures markets: Combining momentum and term structure signals. Journal of Banking and Finance, 34, (10), pp 2530–2548. [1976] Fuller W.A., Introduction to statistical time series. John Wiley & Sons, New York. [1997] Galluccio S., Caldarelli G., Marsili M., Zhang Y.C., Scaling in currency exchange. Physica A, 245, pp 423–436. [2011] Gao J.B., Hu J., Tung W-W., Facilitating joint chaos and fractal analysis of biosignals through nonlinear adaptive filtering. PLoS One, 6. [1985] Gardner E.S. Jr, Exponential smoothing: The state of the art. Journal of Forecasting, 4, pp 1–28. [1985] Gardner E.S. Jr, McKenzie E., Forecasting trends in time series. Management Science, 31, pp 1237–1246. [1988] Gardner E.S. Jr, McKenzie E., Model identification in exponential smoothing. Journal of the Operational Research Society, 39, pp 863–867. [1989] Gardner E.S. Jr, McKenzie E., Seasonal exponential smoothing with damped trends. Management Science, 35, pp 372–376. [1999] Gardner E.S. Jr, Note: Rule-based forecasting vs. damped-trend exponential smoothing. Management Science, 45, pp 1169–1176. [2006] Gardner E.S. Jr, Exponential smoothing: The state of the art - Part II. International Journal of Forecasting, 22, pp 637–677. [2009] Gardner E.S. Jr, Damped trend exponential smoothing: A modelling viewpoint. Working Paper, C.T. Bauer College of Business, University of Houston. [1980] Garman M.B., Klass M.J., On the estimation of security price volatilities from historical data. Journal of Business, 53, (1), pp 67–78. 714 Quantitative Analytics [1979] Gasser T., Muller H.G., Kernel estimation of regression functions. in Gasser and Rosenblatt (eds), Smoothing techniques for curve estimation, Springer Verlag, Heidelberg. [2008] Gastineau G., The short side of 130/30 investing for the conservative portfolio manager. Journal of Portfolio Management, 34, (2), pp 39–52. [2006] Gatev E., Goetzmann W.N., Rouwenhorst K.G., Pairs trading: Performance of a relative-value arbitrage rule. The Review of Financial Studies, 19, (3), pp 797–827. [2006] Gatheral J., The volatility surface: A practitioner’s guide, John Wiley & Sons, Hoboken, New Jersey. [1991] Geltner D., Smoothing in appraisal-based returns. Journal of Real Estate Finance and Economics, 4, 327–345. [1995] Geman H., El Karoui N., Rochet J., Changes of numeraire, change of probability measure and option pricing. Journal of Applied Probability, 32, pp 443–458. [2001a] Genacy R., Selcuk F., Whitcher B., Scaling properties of foreign exchange volatility. Physica A: Statistical Mechanics and its Applications, 289, pp 249–266. [2001b] Genacy R., Selcuk F., Whitcher B., Differentiating intraday seasonalities through wavelet multi-scaling. Physica A, 289, pp 543–556. [2003] Genacy R., Selcuk F., Whitcher B., Systematic risk and timescales. Quantitative Finance, 3, (2), pp 108–116. [2005] Genacy R., Selcuk F., Whitcher B., Multiscale systematic risk. Journal of International Money and Finance, 24, pp 55–70. [1993] George E.I., McCulloch R.E., Variable selection via Gibbs sampling. J. Amer. Statist. Assoc., 88, pp 881–889. [1997] George E.I., McCulloch R.E., Approaches for Bayesian variable selection. Statistica Sinica, 7, pp 339–373. [1983] Geweke J., Porter-Hudak S., The estimation and application of long memory time series models. Journal of Time Series Analysis, 4, pp 221–238. [1999] Gijbels I., Pope A., Wand M.P., Understanding exponential smoothing via kernel regression. Journal of the Royal Statistical Society, Series B, 61, pp 39–50. [1960] Girsanov I., On transforming a certain class of stochastic processes by absolutely continuous substitution of measures. Theror. Probability Appl., 5, pp 285–301. [1987] Glassman D., Exchange rate risk and transactions costs: Evidence from bid-ask spreads. Journal of International Money and Finance, 6, pp 479–490. [1943] Gnedenko B.V., Sur la distribution limite du terme maximum d’une serie aleatoire. Annals of Mathematics, 44, pp 423–453. [2007] Gneiting T., Raftery A., Strictly proper scoring rules, prediction, and estimation. Journal of the American Statistical Association, 102, (477), pp 359–378. [2000] Goll T., Kallsen J., Optimal portfolios for logarithmic utility. Stochastic Processes and their Application, 89, (1), pp 31–48. [1999] Gonghui Z., Starck J-L., Campbell J., Murtagh F., The wavelet transform for filtering financial data streams. J. Comput. Intell. Finance, pp 18–35. [1952] Good I.J., Rational decisions. Journal of the Royal Statistical Society, Series B, 14, (1), pp 107–114. 715 Quantitative Analytics [2006] Gorton G., Rouwenhorst K.G., Facts and fantasies about commodities futures. Financial Analysts Journal, 62, (2), pp 47–68. [1980] Granger C.W.J., Joyeux R., An introduction to long memory time series models and fractional differencing. Journal of Time Series Analysis, 1, pp 15–29. [1999] Granger C.W.J., Terasvirta T., A simple nonlinear time series model with missleading linear properties. Economics Letters, 62, pp 161–165. [1983] Grassberger P., Procaccia I., Characterization of strange attractors. Physical Review Letters, 48. [2004] Grech D., Mazur Z., Can one make any crash prediction in finance using the local Hurst exponent idea? Physica A: Statistical Mechanics and its Applications, 336, (1), pp 133–145. [2005] Grech D., Mazur Z., Statistical properties of old and new techniques in detrended analysis of time series. Acta Physica Polonica B, 36, (8), pp 2403–2413. [1995] Green P.J., Reversible jump Markov chain Monte Carlo computation and Bayesian model determination. Biometrika, 82, (4), pp 711–732 [1977] Greene M.T., Fielitz B.D., Long-term dependence in common stock returns. Journal of Financial Econom., 4 pp 339–349 [2000] Greene W.H., Econometric analysis. 4th edition, Prentice-Hall: Upper Saddle River, New Jersey. [2003] Gregoriou G.N., Gueyie J.P., Risk-adjusted performance of funds of hedge funds using a modified Sharpe ratio. Journal of Alternative Investments, 6 (Winter), pp 77–83. [2003] Griffin j.M., Ji X., Martin S., Momentum investing and business cycle risk: Evidence from pole to pole. Journal of Finance, 58, pp 2515–2547. [1992] Grimmett G.R., Stirzaker D.R., Probability and random processes. Oxford Science Publications, Second Edition. [1989] Grinol R., The fundamental law of active management. Journal of Portfolio Management, 15, (3), pp 30–37. [1994] Grinol R.C., Alpha is volatility times IC times score. Journal of Portfolio Management, 20, (4), pp 9–16. [2000] Grinol R.C., Kahn R.N., Active portfolio management: A quantitative approach for producing superior returns and controlling risk. 2nd Edition, McGraw-Hill. [2000b] Grinol R.C., Kahn R.N., The efficiency and gains of long-short investing. Financial Analysts Journal, 56, pp 40–53. [1998] Groetsch C.W., Lanczo’s generalised derivative. American Mathematical Monthly, 105, (4), pp 320–326. [1984] Grossmann A., Morlet J., Decomposition of Hardy functions into square integrable wavelets of constant shape. SIAM Journal of Mathematical Analysis, 15, pp 723–736. [2010] Gu G-F., Zhou W-X., Detrending moving average algorithm for multifractals. Physical Review E, 82, 82.011136, pp –. [2012a] Gurrieri S., Monte-Carlo pricing under a hybrid local volatility model. GTC. [2012b] Gurrieri S., Monte-Carlo calibration of hybrid local volatility models. Working Paper, SSRN. [2006] Guthrie C., Equity market-neutral strategy. AIMA Canada Strategy Paper Series, June. 716 Quantitative Analytics [2009] Gyorfi L., Kevei P., St. Petersburg portfolio games. in R. Gavalda, G. Lugosi, T. Zeugmann, S. Zilles (eds.) Proceedings of Algorithmic Learning Theory, (Lecture Notes in Artificial Intelligence 5809), pp 83–96. [2011] Gyorfi L., Ottucsak G., Urban A., Empirical log-optimal portfolio selections: A survey. World Scientific Review Volume, 9, pp 79–115. [1910] Haar A., Zur theorie der orthogonalen funktionensysteme. Mathematische Annalen, 69, (3), pp 331–371. [1971] Hakansson N., Capital growth and the mean variance approach to portfolio selection. The Journal of Financial and Quantitative Analysis, 6, (1), pp 517–557. [1982] Hall P., Cross-validation in density estimation. Biometrika, 69, pp 383–390. [1693] Halley E., An estimate of the degrees of the mortality of mankind, drawn from curious tables of the births and funerals at the city of Breslau; with an attempt to ascertain the price of annuities upon lives. Phil. Trans., 17, pp 596–610. [1986] Halsey T.C., Jensen M.H., Kadanoff L.P., Procaccia I., Shraiman B.I., Fractal measures and their singularities: The characterisation of stange sets. Physical Review A, 33, (2), pp 1141–1151. [1994] Hamilton J., Time series analysis. Princeton University Press, Princeton, New Jersey. [2001] Hand D., Mannila H., Smyth P., Principles of data mining. MIT Press. [1982] Hansen L.P., Singleton K.J., Generalized instrumental variables estimation of nonlinear rational expectations models. Econometrica, 50, pp 1269–1286. [1983] Hansen L.P., Singleton K.J., Stochastic consumption, risk aversion, and the temporal behavior of asset returns. Journal of Political Economy, 91, pp 249–265. [1991] Hansen L.P., Jagannathan R., Implications of security market data for models of dynamic economies. Journal of Political Economy, 99, pp 225–262. [2003] Hanson R., Combinatorial information market design. Information Systems Frontiers, 5, (1), pp 105–119. [2007] Hanson R., Logarithmic market scoring rules for modular combinatorial information aggregation. Journal of Prediction Markets, 1, (1), pp 3–15. [1986] Hardle W., Marron J.S., Random approximations to an error criterion of nonparametric statistics. Journal of Multivariate Analysis, 20, pp 91–113. [1990] Hardle W., Applied nonparametric regression. Cambridge University Press, Cambridge. [1991] Hardle W., Smoothing techniques with implementation in S. Springer-Verlag, NY. [1979] Harrison J.M., Kreps D., Martingales and arbitrage in multi-period securities markets. Journal of Economic Theory, 20, pp 381–408. [1981] Harrison J.M., Pliska S.R., Martingales and stochastic integrals in the theory of continuous trading. Stochastic Processes and Their Applications, 11, pp 215–260. [1983] Harrison J.M., Pliska S.R., A stochastic calculus model of continuous trading: Complete markets. Stochastic Processes and Their Applications, 15, pp 313–316. [1984] Harvey A.C., A unified view of statistical forecasting procedures. Journal of Forecasting, 3, pp 245–275. [1989] Harvey A.C., Forecasting, structural time series models and the Kalman filter. Cambridge University Press, UK. 717 Quantitative Analytics [1994] Harvey A.C., Ruiz E., Shephard N., Multivariate stochastic variance models. Review of Economic Studies, 61, pp 247–264. [2008] Hazan E., Kale S., Extracting certainty from uncertainty: Regret bounded by variation in costs. COLT, pp –. [1994] Hauser M.A., Kunst R.M., Reschenhofer E., Modelling exchange rates: Long-run dependence versus conditional heterscedasticity. Appl. Financial Econom., 4, pp 233–239. [1992] Heath D., Jarrow V., Morton A., Bond pricing and the term structure of interest rates : A new methodology. Econometrica, 60, pp 77–105. [2002] Henderson V., Hobson D., Substitute hedging. Risk, 15, (5), pp 71–75. [2004] Henderson V., Hobson D., Utility indifference pricing: An overview. Volume on Indifference Pricing, (ed. R. Carmona), Princeton University Press. [1983] Hentschel H.G.E., Procaccia I., The infinite number of generalised dimensions of fractals and stange attractors. Physica 8D, pp 435–444. [2000] Hill J.R., Pruitt G., Hill L., The ultimate trading guide. John Wiley & Sons, Wiley Trading Advantage. [2004] Ho D-S., Lee C-K., Wang C-C., Chuang M., Scaling characteristics in the Taiwan stock market. Physica A, 332, pp 448–460. [1989] Hodges S., Neuberger A., Optimal replication of contingent claims under transactions costs. Review of Futures Markets, 8, pp 222–239. [1997] Hodges S.D., A generalisation of the Sharpe ratio and its applications to valuation bounds and risk measures. Financial Options Research Centre, Working Paper, University of Warwick. [1962] Holland J.H., Outline for a logical theory of adaptive systems. Journal of the Association for Computing Machinery, 9, pp 297-314. [1975] Holland J.H., Adaptation in natural and artificial systems. University of Michigan Press, Ann Arbor. [1989] Holschneider M., Kronland-Martinet R., Morlet J., Tchamitchian P., A real-time algorithm for signal analysis with the help of the wavelet transform. in Wavelets, time-frequency methods and phase space, Proceedings of the International Conference, Marseille, J.M. Combes, A. Grossman, Ph. Tchamitchian, eds., Springer, Berlin, pp 286–297. [1957] Holt C.C., Forecasting seasonal and trends by exponentially weighted moving averages. ONR Memorandum, 52, Pittsburgh, PA: Carnegie Institute of Technology. [2004a] Holt C.C., Forecasting seasonal and trends by exponentially weighted moving averages. International Journal of Forecasting, 20, pp 5–10. [2004b] Holt C.C., Author’s retrospective on Forecasting seasonal and trends by exponentially weighted moving averages. International Journal of Forecasting, 20, pp 11–13. [1999] Hong H., Stein J., A unified theory of underreaction, momentum trading, and overreaction in asset markets. Journal of Finance, 54, 2143–2184. [2011] Horvath M., Urban A., Growth optimal portfolio selection with short selling and leverage. World Scientific Review Volume, 9. [1980] Hosking J.R.M., The multivariate portmanteau statistic. Journal of the American Statistical Association, 75, pp 602–608. 718 Quantitative Analytics [1981] Hosking J.R.M., Fractional differencing. Biometrika, 68, pp 165–176. [1984] Hosking J.R.M., Modeling persistence in hydrological time series using fractional differencing. Water Resources Research, 20, (12), pp 1898–1908. [1989] Hseih D.A., Testing for nonlinear dependence in daily foreign exchange rates. Journal of Business, 62, –. [2001] Hu K., Ivanov P.C., Chen Z., Carpena P., Stanley H.E., Effect of trends on detrended fluctualtion analysis. Phys. Rev. E, 64, 011 114, pp 1–19. [1988] Huang C., Litzenberger R.H., Foundations for financial economics. North-Holland. [1995] Huang B.N., Yang C.W., The fractal structure in multinational stock returns. Appl. Econom. Lett., 2, pp 67–71. [1998] Huang N.E., Shen Z., Long S.R., Wu M.C., Shih H.H., Zheng Q., The empirical mode decomposition and the Hilbert spectrum for nonlinear and non-stationary time series analysis. Proceeding of the Royal Society A, 454, pp 903–995. [2005] Hubner G., The generalised Treynor ratio. Review of Finance, 9, No 3, pp 415–435. [2007] Hubner G., How do performance measures perform? EDHEC Business School, March. [1951] Hurst H.E., Long-term storage capacity of reservoirs. Trans. Amer. Soc. Civil Engineers, 116, pp 770–799. [1965] Hurst H.E., Black R.P., Simaika Y.M., Long-term storage: An experimental study. London, Constable. [2010] Hurst B., Ooi Y.H., Pedersen L.H., Understanding managed futures. AQR Working Paper [1989] Hurvich C.M., Tsai C.L., Regression and time series model selection in small samples. Biometrika, 76, pp 297–307. [1991] Hurvich C.M., Tsai C.L., Bias of the corrected AIC criterion for underfitted regression and time series models. Biometrika, 78, 499–509. [1657] Huygens C., De ratiociniis in ludo aleae (On reckoning at games of chance). London, UK: T. Woodward. [2001] Hyndman R.J., It’s time to move from what to why. International Journal of Forecasting, 17, pp 567–570. [2002] Hyndman R.J., Koehler A.B., Snyder R.D., Grose S., A state space framework for automatic forecasting using exponential smoothing methods. International Journal of Forecasting, 18, pp 439–454. [2003] Hyndman R.J., Billah B., Unmasking the theta method. International Journal of Forecasting, 19, pp 287–290. [2006] Hyndman R.J., Koehler A.B., Another look at measures of forecast accuracy. International Journal of Forecasting, 22, pp 679–688. [2008] Hyndman R.J., Khandakar Y., Automatic time series forecasting: The forecast package for R. Journal of Statistical Software, 27, Issue 3, pp 679–688. [2008b] Hyndman R.J., Koehler A., Ord J.K., Snyder R.D., Forecasting with exponential smoothing: The state space approach. Springer-Verlag, Berlin. [2012] Ihlen E.A.F., Introduction to multifractal detrended fluctuation analysis in Matlab. Frontiers in Physiology, 3 (141), pp 1–18. [2013] Ihlen E.A.F., Multifractal analyses of response time series: A comparative study. Behav. Res., 45, pp 928–945. 719 Quantitative Analytics [2014] Ihlen E.A.F., Vereijken B., Detection of co-regulation of local structure and magnitude of stride time variability using a new local detrended fluctuation analysis. Gait & Posture, 39, pp 466–471. [2011] Ilmanen A., Expected returns: An investor’s guide to harvesting market rewards. John Wiley & Sons, West Sussex, Unated Kingdom. [2012] Ilmanen A., Kizer J., The death of diversification has been greatly exaggerated. Journal of Portfolio Management, 38, pp 15–27. [2006] In F., Kim S., The hedge ratio and the empirical relationship between the stock and futures markets: A new approach using wavelet analysis. Journal of Business, 79, (2), pp 799–820. [2007] In F., Kim S., A note on the relationship between Fama-French risk factors and innovations of ICAPM state variables. Finance Research Letters, 4, pp 165–171. [2008] In F., Kim S., Marisetty V., Faff R., Analyzing the performance of managed funds using the wavelet multiscaling method. Review of Quantitative Finance and Accounting, 31, (1), pp 55–70. [1996] Jackwerth J.C., Rubinstein M., Recovering probability distributions from option prices. Journal of Finance, 51, pp 1611–1631. [1995] Jacobs B.I., Levy K.N., More on long-short strategies. Letter to the editor, Financial Analysts Journal, 51, (2), pp 88–90. [1998] Jacobs B.I., Levy K.N., Starer D., On the optimality of long-short strategies. Financial Analysts Journal, 54, pp 40–51. [1999] Jacobs B.I., Levy K.N., Starer D., Long-short portfolio management: An integrated approach. Journal of Portfolio Management, 22, pp 23–32. [2005] Jacobs B.I., Levy K.N., Markowitz H.M., Portfolio optimization with factors, scenarios, and realistic short positions. Operations Research, pp 586–599. [2006] Jacobs B., Levy K., Enhanced active equity strategies. Journal of Portfolio Management, 32, pp 45–55. [2007a] Jacobs B., Levy K., 20 myths about enhanced active 120-20 portfolios. Financial Analysts Journal, 63, pp 19–26. [2007b] Jacobs B., Levy K., Enhanced active equity portfolios are trim equitized long-short portfolios. Journal of Portfolio Management, 33, pp 19–27. [2004] Jacod J., Protter P., Probability essentials. Springer Second Edition, Universitext. [1994] Jacquier E., Polson N.G., Rossi P., Bayesian analysis of stochastic volatility models. Journal of Business & Economic Statistics, 12, pp 371–417. [2006] Jaffard B., Lashermes B., Abry P., Wavelet leaders in multifractal analysis. in Wavelet Analysis and Applications, ed. T. Qian, M.I. Vai, Y. Xu, pp 219–264. [2005] Janosi I., Muller R., Empirical mode decomposition and correlation properties of long daily ozone records. Physical Review E, 71, pp –. [1991] Jansen D., de Vries C., On the frequency of large stock market returns: putting booms and busts into perspective. Review of Economics and Statistics, 23, pp 18–24. [1980] Jarque C.M., Bera A.K., Efficient test for Normality, homoskedasticity, and serial independence of regression residuals. Economics Letters, 6, pp 255–259. 720 Quantitative Analytics [1987] Jarque C.M., Bera A.K., A test for Normality of observations and regression residuals. International Statistical Review, 55, pp 163–172. [1990] Jegadeesh N., Evidence of predictable behavior of security returns. Journal of Finance, 45, pp 881–898. [1993] Jegadeesh N., Titman S., Returns to buying winners and selling losers: Implications for stock market efficiency. Journal of Finance, 48, (1), pp 65–91. [2001] Jegadeesh N., Titman S., Profitability of momentum strategies: An evaluation of alternative explanations. Journal of Finance, 56, (2), pp 699–720. [1955] Jenkinson A.F., The frequency distribution of the annual maximum (or minimum) of meteorological elements. Quaterly Journal of the Royal Meteorological Society, 81, pp 158–171. [1968] Jensen M.J., The performance of mutual funds in the period 1945-1964. Journal of Finance, 23, No 2, pp 389–416. [1999] Jensen M.J., Using wavelets to obtain a consistent ordinary least squares estimator of the long-memory parameter. Journal of Forecasting, 18, pp 17–32. [2012] Jizba P., Korbel J., Methods and techniques for multifractal spectrum estimation in financial time series. FNSPE, Czech Technical University, Prague. [1988] Johansen S., Statistical analysis of cointegration vectors. Journal of Economic Dynamics and Control, 12, pp 231–254. [2007] Johnson S., Kahn R., Petrich D., Optimal gearing. Journal of Portfolio Management, 33, pp 10–20. [2014] Joshi M., Kooderive: Multi-Core Graphics Cards, the Libor market model, least-squares Monte Carlo and the pricing of cancellable swaps. Working Paper, SSRN. [2007] Jurek J.W., Yang H., Dynamic portfolio in arbitrage. Working Paper, SSRN. [1979] Kahneman D., Tversky A., Prospect theory: An analysis of decision under risk. Econometrica, 47, (2), pp 263–291. [2000] Kahneman D., Tversky A., Choices, values and frames. Cambridge University Ptress. [1958] Kaiser H.F., The varimax criterion for analytic rotation in factor analysis. Psychometrika, 23, pp187–200. [1960] Kalman R.E., A new approach to linear filtering and prediction problems. Transactions of the ASME Journal of Basic Engineering, 82, (D), pp 35–45. [2008] Kanamura T., Rachev S.T., Fabozzi F.J., The application of pairs trading to energy futures markets. Working Paper. [1996] Kandel S., Stambaugh R., On the predictability of stock returns: An asset allocation perspective. Journal of Finance, 51, pp 385–424. [2002] Kantelhardt J., Zschiegner S., Koscielny-Bunde E., Bunde A., Havlin S., Stanley H.E., Multifractal detrended fluctuation analysis of nonstationary time series. Physica A, 316, (1-4), pp 87–114. [2004] Kaplan P., Knowles J., Kappa: A generalised downside-risk performance measure. Journal of Performance Measurement, 8, (D), pp 42–54. [1991] Karatzas I., Lehoczky J.P., Shreve S.E., Xu GL., Martingale and duality methods for utility maximisation in an incomplete market. SIAM Journal of Control and Optimisation, 29, 702–730. 721 Quantitative Analytics [1997] Karatzas I., Shreve S., Brownian motion and stochastic calculus. Springer. [1990] Kariya T., Tsukuda Y., Maru J., Testing the random walk hypothesis for Japanese stock price in S. Taylor’s model. Working Paper, University of Chicago. [1986] Keim D., Stambaugh R., Predicting returns in the stock and bond markets. Journal of Financial Economics, 17, 357–390. [1956] Kelly J.L., A new interpretation of information rate. Bell System Technical Journal, 35, pp 917–926. [1960] Keltner C., How to make money in commodities. [1938] Kendall M., A new measure of rank correlation. Biometrika, 30, pp 81–89. [1948] Kendall M., Rank correlation methods. Charles Griffin & Company Limited [1976] Kendall M.G., Stuart A., The advanced theory of statistics. Vol. 3, Hafner, New York. [1976b] Kendall M.G., Time series. second edition, Charles Griffin and Company, London. [1994] Kennedy D., The term structure of interest rates as a Gaussian random field. Mathematical Finance, 4, pp 247–258. [2004] Kim S-J., Choi J-S., Multifractal measures for the yen-dollar exchange rate. Journal of the Korean Physical Society, 44, (3), pp 643–646. [2005] Kim S., In F., The relationship between stock returns and inflation: New evidence from wavelet analysis. Journal of Empirical Finance, 12, pp 435–444. [2006] Kim S., In F., A note on the relationship between industry returns and inflation through a multiscaling approach. Finance Research Letters, 3, pp 73–78. [2009] Kim S-J., Koh K., Boyd S., Gorinevsky D., l1 trend filtering. SIAM Review, 51, (2), pp 339–360. [1997] Kivinen J., Warmuth M., Exponential gradient versus gradient descent for linear predictors. Journal of Information and Computation, 132, (1), pp 1–63. [1992] Koedijk K.G., Stork P.A., de Vries C., Differences between foreign exchange rate regimes: The view from the tails. Journal of International Money and Finance, 11, pp 462–473. [1988] Koehler A.B., Murphree E.S., A comparison of results from state space forecasting with forecasts from the Makridakis competition. International Journal of Forecasting, 4, pp 45–55. [1978] Koenker R.W., Bassett G.W., Regression quantiles. Econometrica, 46, pp 33–50. [1933] Kolmogorov A.N., Grundbegriffe der Wahrscheinlichkeitsrechnung. Berlin, Germany: Springer. [Transl. Foundations of the theory of probability by N. Morrison, 2nd edn. New York, NY: Chelsea, 1956]. [1941] Kolmogorov A.N., Dissipation of energy in a locally isotropic turbulence. Dokl. Akad. Nauk., 32, pp 141. [1984] Kon S.J., Models of stock returns: A comparison. Journal of Finance, 39, pp 147–165. [1925] Kondratiev N., The Major Economic Cycles. English version Nikolai Kondratieff (1984). Long Wave Cycle. Guy Daniels. E P Dutton [1992] Koza J.R., Genetic programming: On the programming of computers by means of natural selection. MIT Press, USA. 722 Quantitative Analytics [1976] Kraus A., Litzenberger R., Skewness preference and the valuation of risky assets. Journal of Finance, 31, pp 1085–1100. [1990] Kreps D., A course in microeconomic theory. Princeton University Press, Princeton. [2009] Kristoufek L., Fractality of stock markets: A comparative study. Diploma Thesis, Charles University, Faculty of Social Sciences, Prague. [2013] Kristoufek L., Vosvrda M., Measuring capital market efficiency: Global and local correlations structure. Physica A, 392, (1), pp 184–193. [2000] Laloux L., Cizeau P., Potters M., Bouchaud J.P., Random matrix theory and financial correlations. International Journal of Theoretical and Applied Finance, 3, (3), pp 391–397. [2006] Landa Becerra R., Coello Coello C.A., Cultured differential evolution for constrained optimization. Computer Methods in Applied Mechanisand Engineering, 195, Jully, pp 4303–4322. [1984] Lane G., Lane’s stochastics. Technical Analysis of Stocks and Commodities, pp 87–90. [1990] Lang K.J., Waibel A.H., Hinton G.E., A time-delay neural network architecture for isolated word recognition. Neural Networks, 3, pp 33–43. [1991] Larrain M., Testing chaos and nonlinearities in T-bill rates. Financial Analysts Journal, 47, (5), pp 51–62. [1959] Latane H.A., Criteria for choice among risky ventures. Journal of Political Economy, 38, pp 145–155. [1995] Lau W.C., Erramilli A., Wang J.L., Willinger W., Self-similar traffic generation: The random midpoint displacement algorithm and its properties. Proceedings IEEE International Conference on Communications ICC, 1, pp 466–472. [1990] LeBaron B., Some relations between volatility and serial correlations in stock market returns. Working Paper, February. [1992] LeBaron B., Some relations between volatility and serial correlations in stock market returns. Journal of Business, 65, pp 199–219. [2014] Lebovits J., Levy Vehel J., White noise-based stochastic calculus with respect to multifractional Brownian motion. Stochastics, 86, (1), pp 87–124. [1989] LeCun Y., Boser B., Denker J.S., Henderson D., Howard R.E., Hubbard W., Jackel L.D., Backpropagation applied to handwritten zip code recognition. Neural Computation, 1, (4), pp –. [1998] Lee B.S., Permanent, temporary and nonfundamental components of stock prices. Journal of Finance and Quantitative Analysis, 33, pp 1–32. [1990] Lehmann B., Fads, martingales and market efficiency. Quaterly Journal of Economics, 105, pp 1–28. [1976] LeRoy S.F., Efficient capital markets: Comment. The Journal of Finance, 31, (1), pp 139–141. [1981] LeRoy S.F., Porter R.D., The present value relation: Tests based on implied variance bounds. Econometrica, 49, pp 557–574. [1967] Levy R., Relative strength as a criterion for investment selection. Journal of Finance, 22, pp 595–610. [2002] Lewellen J., Momentum and autocorrelation in stock returns. The Review of Financial Studies, 15, pp 533–563. [1999] Li J., Tsang E.P.K., Improving technical analysis predictions: An application of genetic programming. In proceedings of Florida Artificial Intelligence Research Symposium. 723 Quantitative Analytics [1981] Li W.K., McLeod A.I., Distribution of the residual autocorrelations in multivariate ARMA time series model. Journal of the Royal Statistical Society, Series B, 43, 231–239. [1967] Lilliefors H.W., On the Kolmogorov-Smirnov test for normality with mean and variance unknown. Journal of the American Statistical Association, 62, (318), pp 399–402. [2009] Lin BH., and Chen YJ., Negative market volatility risk premium: Evidence from the LIFFE equity index options. Asia-Pacific Journal of Financial Studies, 38, 5, pp 773–800. [1965] Lintner J., The valuation of risk assets and the selection of risky investments in stock portfolio and capital budgets. Review of Economics and Statistics, 47, No. 1, pp 13–37. [1992] Littlestone N., Warmuth M.K., The weighted majority algorithm. University of California, Santa Cruz. [1994] Littlestone N., Warmuth M., The weighted majority algorithm. Info. and Computation, 108, (2), pp 212–261. [2007] Liu R., di Matteo T., Lux T., True and apparent scaling: The proximities of the Markov-switching multifractal model to long-range dependence. Physica A, 383, pp 35–42. [2008] Liu R., Multivariate multifractal models: Estimation of parameters and application to risk management. University of Kiel, PhD thesis. [1978] Ljung G.M., Box G.E.P., On a measure of lack of fit in time series models. Biometrika, 65, pp 297–303. [1990] Lo A.W., MacKinlay A.C., When are contrarian profits due to stock market overreaction? The Review of Financial Studies, 3, No 2, pp 175–205. [1990b] Lo A.W., MacKinlay A.C., Data snooping biases in tests of financial asset pricing models. The Review of Financial Studies, 3, No 2, pp 431–468. [1991] Lo A.W., Long-term memory in stock market prices. Econometrica, 59, (5), pp 1279–1313. [2008] Lo A.W., Hedge funds, systemic risk, and the financial crisis of 2007-2008. Written Testimony of A.W. Lo, Prepared for the US House of Representative. [2008] Lo A.W., Patel P.N., 130/30: The new long-only. The Journal of Portfolio Management, pp 12–38. [1998] Lobato I., Savin N., Real and spurious long-memory properties of stock market data. Journal of Business and Economics Statistics, 16, pp 261–283. [1965] Loftsgaarden D.O., Quesenberry G.P., A nonparametric estimate of a multivariate density function. Annals of Mathematical Statistics, 36, pp 1049–1051. [1990] Long J.B., The numeraire portfolio. Journal of Financial Economics, 26, pp 29–69. [1995a] Longerstaey J., Zangari P., Five questions about RiskMetrics. Morgan Guaranty Trust Company, Market Risk Research, JPMorgan. [1995b] Longerstaey J., More L., Introduction to RiskMetrics. 4th edition, Morgan Guaranty Trust Company, New York. [1996] Longerstaey J., Spencer M., RiskMetrics: Technical document. Fourth Edition, Morgan Guaranty Trust Company, New York. [2008] Los C., Measuring the degree of financial market efficiency. Finance India, 22, (4), pp 1281–1308. [1978] Lucas R., Asset prices in an exchange economy. Econometrica, 46, pp 1429–1445. 724 Quantitative Analytics [1990] Luede E., Optmization of circuits with a large number of parameters. Archiv f. Elektr. u. Uebertr., Band (44), Heft (2), pp 131-138. [1996] Lux T., The stable Paretian hypothesis and the frequency of large returns: An examination of major German stocks. Applied Economics Letters, 6, pp 463–475. [2003] Lux T., The multi-fractal model of asset returns: Its estimation via GMM and its use for volatility forecasting. Economics Working Paper No. 2003-13, Christian-Albrechts-Universitat Kiel. [2004] Lux T., Detecting multi-fractal properties in asset returns: The failure of the scaling estimator. International Journal of Modern Physics, 15, pp 481–491. [2013] Lux T., Morales-Arias L., Relative forecasting performance of volatility models: Monte Carlo evidence. Quantitative Finance, 13, pp –. [2012] Lye C-T., Hooy C-W., Multifractality and efficiency: Evidence from Malaysian sectoral indices. Int. Journal of Economics and Management, 6, (2), pp 278–294. [1995] Lyons T., Uncertainty volatility and risk-free synthesis of derivatives. Appl. Math. Fin., 2, pp 117–133. [1977] Mackey M.C., Glass L., Oscillation and chaos in physiological control systems. Science, 197, pp 287–289. [2004] Magdon-Ismail M., Atiya A., Maximum drawdown. Risk Magazine, October. [2007] Maginn J.L., Managing investment portfolios: A dynamic process. 3rd ed, ed. C.I.I. Series, Wiley. [1993] Maheswaran S., Sims C., Empirical implications of arbitrage-free asset markets. in P.C.B. Phillips, ed., Models, Methods and Applications of Econometrics, Cambridge, Basil Blackwell, pp 301–316. [1987] Majani B.E., Decomposition methods for medium-term planning and budgeting. in S. Makridakis, S. Wheelwright, edt., The handbook of forecasting: A manager’s guide, Whiley, New York, pp 219–237. [1982] Makridakis S., Andersen A., Carbon R., Fildes R., Hibon M., Lewandowski R., Newton J., Parzen R., Winkler R., The accuracy of extrapolation (time series) methods: Results of a forecasting competition. Journal of Forecasting, 1, pp 111–153. [1989] Makridakis S., Wheelwright S.C., Forecasting methods for management. John Wiley & Sons. [1991] Makridakis S., Hibon M., Exponential smoothing: The effect of initial values and loss functions on postsample forecasting accuracy. International Journal of Forecasting, 7, pp 317–330. [2000] Makridakis S., Hibon M., The M3-competition: results, conclusions and implications. International Journal of Forecasting, 16, pp 451–476. [1973] Malkiel B., A random walk down Wall Street. W.W. Norton & Company. [1989] Mallat S.G., A theory for multiresolution signal decomposition: The wavelet representation. IEEE Transactions on Pattern Analysis and Machine Intelligence, 11, (7), pp 674–693. [1990] Mallat S.G., Hwang W.L., Singularity detection and processing with wavelets. Technical Report No. 549, Computer Science Department, New York University. [1992] Mallat S.G., Hwang W.L., Singularity detection and processing with wavelets. IEEE Trans. Inform. Theory, 38, pp 617–643. [1992b] Mallat S.G., Zhong S., Complete signal representation with multiscale edges. IEEE Trans., PAMI 14, pp 710–732. 725 Quantitative Analytics [1960] Mandelbrot B.B., The Pareto-Levy law and the distribution of income. International Economic Revue, 1. [1963a] Mandelbrot B.B., New methods in statistical economics. The Journal of Political Economy, 71. [1963] Mandelbrot B.B., The variation of certain speculative prices. Journal of Business, 36, (4), pp 394–419. [1964] Mandelbrot B.B., The variation of certain speculative prices. in P. Cootner, ed., The random character of stock prices. Cambridge: MIT Press. [1967] Mandelbrot B.B., Taylor H.M., On the distribution of stock price differences. Operations Research, 15, pp 1057–1062. [1967] Mandelbrot B.B., Forecasts of future prices, unbiased markets and martingale models. Journal of Business, 39, pp 242–255. [1968] Mandelbrot B.B., van Ness J., Fractional Brownian motions, fractional noises and applications. SIAM Review, 10, (4), pp 422–437. [1969a] Mandelbrot B.B., Wallis J., Computer experiments with fractional Gaussian noises: Part 1, averages and variances. Water Resources Research 5. [1969b] Mandelbrot B.B., Wallis J., Computer experiments with fractional Gaussian noises: Part 2, rescaled ranges and spectra. Water Resources Research 5. [1974] Mandelbrot B.B., Intermittent turbulence in self similar cascades: Divergence of high moments and dimension of the carrier. Journal of Fluid Mechanics, 62, (2), pp 331–358. [1975] Mandelbrot B.B., Les objets fractals: forme, hasard et dimension. Paris, Flammarion. [1975b] Mandelbrot B.B., Stochastic models for the earth’s relief, the shape and the fractal dimension of the coastlines, and the number-area rule for islands. Pr. of the National Academy of Sciences USA, 72, pp 3825–3828. [1982] Mandelbrot B.B., The fractal geometry of nature. W.H. Freeman and Company, New York. [1989] Mandelbrot B.B., Multifractal measures, especially for the geophysicist. Pure and Applied Geophysics, 131, pp 5–42. [1997] Mandelbrot B.B., Fisher A., Calvet L., A multifractal model of asset returns. Cowles Foundation Discussion Paper No. 1164. [2004] Mandelbrot B.B., The (mis)behavior of markets, a fractal view of risk, ruin and reward. Basic Books. [2005] Manimaran P., Panigrahi P.K., Parikh J.C., Wavelet analysis and scaling properties of time series. Phys. Rev. E, 72, 046120, pp 1–5. [2009] Manimaran P., Panigrahi P.K., Parikh J.C., Multiresolution analysis of fluctuations in non-stationary time series through descrete wavelets. Physica A, 388, pp 2306–2314. [1945] Mann H.B., Nonparametric tests against trend. Econometrica, 13, (3), pp 245–259. [1995] Mantegna R.N., Stanley H.E., Scaling behaviour in thedynamics of an economic index. Nature, 376, pp 46–49. [2000] Mantegna R.N., Stanley H.E., An introduction to econophysics: Correlation and complexity in finance. Cambridge University Press, Cambridge. [1952] Markowitz H.M., Portfolio selection. Journal of Finance, 7, (1), pp 77–91. 726 Quantitative Analytics [1952b] Markowitz H.M., The utility of wealth. Journal of Political Economy, 60, pp 151–158. [1959] Markowitz H.M., Portfolio selection, efficient diversification of investments. John Wiley and Sons, New York. [1976] Markowitz H.M., Investment for the long run: New evidence for an old rule. Journal of Finance, 31, (5), pp 1273–1286. [1938] Marschak J., Money and the theory of assets. Econometrica, 6, pp 311–325. [2005] Martielli J.D., Quantifying the benefits of relaxing the long-only constraint. SEI Investments Developments Inc., pp 1–18. [1989] Martin P., McCann B., The investor’s guide to fidelity funds: Winning strategies for mutual fund investors. [2003] Matia K., Ashkenazy Y., Stanley H.E., Multifractal properties of price fluctuations of stocks and commodities. Europhysics Letters, 61, (3), pp 422–428. [2004] Matos J.A.O., Gama S.M.A., Ruskin H., Duarte J., An econophysics approach to the Portuguese stock index-psi-20. Physica A, 342, (3-4), pp 665–676. [2008] Matos J.A.O., Gama S.M.A., Ruskin H.J., Al Sharkasi A., Crane M., Time and scale Hurst exponent analysis for financial markets. Physica A, 387, pp 3910–3915. [1996] McCoy E.J., Walden A.T., Wavelet analysis and synthesis of stationary long-memory processes. Journal of Computational and Graphical Statistics, 5, (1), pp 26–56. [1943] McCulloch W., Pitts W., A logical calculus of the ideas immanent in nervous activity. Bulletin of Mathematical Biophysics, 5, pp 115–133. [1959] McKenzie L., On the existence of general equilibrium for a competitive market. Econometrica, 27, pp 54–71. [1997] Mehrabi A.R., Rossamdana H., Sahimi M., Characterization of long-range correlations in complex distributions and profiles. Phys. Rev., 56, (1), pp 712–722. [1990] Melino A., Turnbull S.M., Pricing foreign currency options with stochastic volatility. Journal of Econometrics, 45, pp 239–265. [1934] Menger K., Das unsicherheitsmoment in der wertlehre. Journal of Economics, 5, pp 459–485. [1969] Merton R.C., Lifetime portfolio selection under uncertainty: The continuous-time case. Rev. Econom. Statist., 51, pp 247–257. [1971] Merton R.C., Optimum consumption and portfolio rules in a continuous-time model. Journal of Economic Theory, 3, pp 373–413. [1973] Merton R.C., An intertemporal capital asset pricing model. Econometrica, 41 (5), pp 867–887. [2005] Meucci A., Risk and asset allocation. Springer Finance. [2004a] Mezura-Montes E., Coello Coello C.A., Tun-Morales E.I., Simple feassibility rules and differential evolution for constrained optimization. Third Mexican International Conference on Artificial Intelligence, MICAI, Lecture Notes in Artificial Intelligence, pp 707–716. [2004] Mezura-Montes E., Coello Coello C.A., A study of mechanisms to handle constraints in evolutionary algorithms. Workshop at the Genetic and Evolutionary Computation Conference, Seattle, Washington, ISGEC. [2006] Mezura-Montes E., Velazquez-Reyes J., Coello Coello C.A., Modified differential evolution for constrained optimization. IEEE Congress on Evolutionary Computation, IEEE Press, pp 332–339. 727 Quantitative Analytics [2006b] Mezura-Montes E., Coello Coello C.A., Velazquez-Reyes J., Munoz-Davila L., Multiple offspring in differential evolution for engineering design. Engineering Optimization, 00, pp 1–33. [1995] Michalewicz Z., Gnetic algorithms, numerical optimization and constraints. L. Eshelman, ed., Proceeding of the Sixth International Conference on Genetic Algorithms, San Mateo, pp 151–158. [1993] Michaud R., Are long-short equity strategies superior? Financial Analysts Journal, 49, pp 44–50. [2007] Miffre J., Rallis G., Momentum strategies in commodity futures markets. Journal of Banking and Finance, 31 (6), pp 1863–1886. [2003] Millen S., Beard R., Estimation of the Hurst Exponent for the Burdekin river using the Hurst-Mandelbrot rescaled range statistics. First Queensland Statistics Conference, Toowoomba, Australia. [1991] Miller M.H., Financial innovations and market volatility. Cambridge, MA, Blackwell Publishing. [2007] Miskiewicz J., Ausloos M., Delayed information flow effect in economy systems. An ACP model study. Physica A: Statistical Mechanics and its Applications, 382 (1), pp 179–186. [1927] Mitchell W.C., Business cycles: The problem and its setting. New York, National Bureau of Economic Research. [1997] Mitchell T.M., Machine learning. McGraw-Hill. [1997] Modigliani F., Modigliani F., Risk-adjusted performance: How to measure it and why. Journal of Portfolio Management, 23 (2), pp 45–54. [2003] Moler C., Van Loan C., Nineteen dubious ways to compute the exponential of a matrix, twenty-five years later. SIAM Review, 45, No. 1, pp 3-000. [2001] Moody J., Saffell M., Learning to trade via direct reinforcement. IEEE Transactions on Neural Networks, 12 (4). [1982] Mori T.F., Asymptotic properties of empirical strategy in favourable stochastic games. in Proc. Colloquia Mathematica Societatis Janos Bolyai 36 Limit Theorems in Probability and Statistics, pp 777–790. [1984] Mori T.F., I-divergence geometry of distributions and stochastic games. in Proc. of the 3rd Pannonian Symp. on Math. Stat, (Reidel, Dordrecht), pp 231–238. [1986] Mori T.F., Is the empirical strategy optimal? Statistics and Decision, 4, pp 45–60. [1984] Morozov V.A., Methods for solving incorrectly posed problems. Springer-Verlag, New York. [2012] Moskowitz T., Ooi Y.H., Pedersen L.H., Time series momentum. Journal of Financial Economics, 104, (2), pp 228–250. [2006] Moyano L.G., de Souza J., Duarte Queiros S.M., Multi-fractal structure of traded volume in financial markets. Physica A, 371, pp 118–121. [1990] Muller U.A., Dacorogna M.M., Olsen R.B., Pictet O.V., Schwarz M., Morgenegg C., Statistical study of foreign exchange rates, empirical evidence of a price change scaling law, and intraday analysis. Journal of Banking and Finance, 14, pp 1189–1208. [1997] Muller U.A., Dacorogna M.M., Dave R.D., Olsen R.B., Pictet O.V., von Weizsacker J.E., Volatilities of different time resolutions: Analyzing the dynamics of market components. Journal of Empirical Finance, 4, pp 213–239. 728 Quantitative Analytics [2009] Murguia J.S., Perez-Terrazas J.E., Rosu H.C., Multifractal properties of elementary cellular automata in a discret wavelet approach of MF-DFA. EPL Journal, 87, pp 2803–2808. [1999] Murphy J.J., Technical analysis of the financial markets: A comprehensive guide to trading methods and applications. Prentice Hall Press. [2003] Murtagh F., Stark J.L., Renaud O., On neuro-wavelet modeling. Working Paper, School of Computer Science, Queen’s University Belfast. [1960] Muth J.F., Optimal properties of exponentially weighted forecasts. Journal of the American Statistical Association, 55, pp 299–306. [1991] Muzy J.F., Bacry E., Arneodo A., Wavelets and multifractal formalism for singular signals: Application to turbulence data. Phys. Rev. Lett., 67, (25), pp 3515–3518. [1993] Muzy J.F., Bacry E., Arneodo A., Multifractal formalism for fractal signals: The structure-function approach versus the wavelet-transform modulus-maxima method. Phys. Rev. E, 47, (2), pp 875–884. [1964] Nadaraya E.A., On estimating regression. Theory of Probability and its Application, 10, pp 186–190. [2006] Nagarajan R., Reliable scaling exponent estimation of long-range correlated noise in the presence of random spikes. Physica A, 366, (1), pp 1–17. [1995] Nason G.P., Silverman B.W., The stationary wavelet transform and some statistical applications. Lecture Notes in Statistics, 103, pp 281–299. [1997] Neely C., Weller P., Dittmar R., Is technical analysis in the foreign exchange market profitable? A genetic programming approach. Journal of Financial Quantitative Analysis, 32, pp 405–426. [1990] Nelson D.B., ARCH models as diffusion approximations. Journal of Econometrics, 45, pp 7–38. [1991] Nelson D.B., Conditional heteroskedasticity in asset returns: A new approach. Econometrica, 59, pp 347–370. [1987] Newey W.K., West K.D., A simple, positive semi-definite, heteroskedasticity and autocorrelation consistent covariance matrix. Econometrica, 55, (3), pp 703–708. [2013] Niere H.M., A multifractality measure of stock market efficiency in Asean region. European Journal of Business and Management, 5, (22), pp 13–19. [2005] Norouzzadeh P., Jafari G.R., Application of multifractal measures to Tehran price index. Physica A, 356, pp 609–627. [2006] Norouzzadeh P., Rahmani B., A multifractal detrended fluctuation description of Iranian rial-US dollar exchange rate. Physica A, 367, pp 328–336. [2014a] NVIDIA, Introducing NVIDIA Tesla GPUs for computational finance. Available: //www.nvidia.com/content/tesla/pdf /F inanceb rochure2 014f in2.pdf . http : [2014b] NVIDIA, CUDA Toolkit Documentation v6.5. [2012] Oh G., A multifractal analysis of Asian foreign exchange markets. European Physical Journal B, pp 85–214. [1998] Oksendal V, Stochastic differential equations. Springer Fifth Edition. [2002] Onoz B., Bayazit M., The power of statistical tests for trend detection. Istanbul Technical University, Faculty of Civil Engineering. 729 Quantitative Analytics [2009] Oppenheim A.V., Schafer R.W., Discrete-time signal processing. third edition, Prentice-Hall. [1997] Ord J.K., Koehler A.B., Snyder R.D., Estimation and prediction for a class of dynamic nonlinear statistical models. Journal of the American Statistical Association, 92, pp 1621–1629. [1964] Osborne M.F.M, Brownian motion in the stock market. in P. Cootner, ed., The random character of stock market prices. Cambridge: MIT Press. [1997] Oussaidene M., Chopard B., Pictet O.V., Tomassini M., Parallel genetic programming and its application to trading model induction. Parallel Computing, 23. [2005] Oyama A., Shimoyama K., Fujii K., New constraint-handling method for multi-objective multi-constraint evolutionary optimization and its application to space plane design. Evolutionary and Deterministic Methods for Design. [1494] Pacioli F.L.B., Summa de arithmetica, geometrica, proportioni et proportionalita. Venice, Italy: Paganino de Paganini. [2001] Panas E., Estimating fractal dimension using stable distributions and exploring long memory through ARFIMA models in Athens stock exchange. Applied Financial Economics, 11. [2000] Papagelis A., Kalles D., GA tree: Genetically evolved decision trees. ICTAI. [1896] Pareto V., Cours d’economie politique. Droz, Geneva. [1985] Parisi G., Frisch U., On the singularity structure of fully developed turbulence. in M. Ghil, R. Benzi, G. Parisi, eds., Turbulence and Predictability in Geophysical Fluid Dynamics, Proceedings of the International School of Physics, Amsterdam, pp 84–87. [1980] Parkinson M., The extreme value method for estimating the variance of the rate of return. Journal of Business, 53, (1), pp 61–65. [2000] Pasquini M., Serva M., Clustering of volatility as a multiscale phenomenon. European Physical Journal B, 16, (1), pp 195–201. [1997] Paxson V., Fast, approximate synthesis of fractional Gaussian noise for generating self-similar network traffic. ACM SIGCOMM Computer Communication Review, 27, (5), pp 5–18. [1992] Peitgen H.O., Jurgens H., Saupe D., Chaos and fractals. Springer, New York. [1969] Pegels C., Exponential forecasting: Some new variations. Management Science, 15, pp 311–315. [1995] Peltier R.F., Levy Vehel J., Multifractional Brownian motion: Definition and preliminary results. INRIA, Technical Report No. 2645. [1994] Peng C.K., Buldyrev S.V., Havlin S., Simons M., Stanley H.E., Goldberger A.L., Mosaic organization of DNA nucleotides. Physical Review E, 49, (2), pp 1685–1689. [2000] Percival D.B., Walden A.T., Wavelet methods for time series analysis. Cambridge University Press, Cambridge. [2009] Pesaran M., Schleicher C., Zaffaroni P., Model averaging in risk management with an application to futures markets. Journal of Empirical Finance, 16 (2), pp 280–305. [1996] Pesquet J-C., Krim H., Carfantan H., Time invariant orthonormal wavelet representations. IEEE Trans. Signal Processing, 44 (8), pp 1964–1970. 730 Quantitative Analytics [1991-96] Peters E.E., Chaos and order in the capital markets. second edition, John Wiley & Sons. [1994] Peters E.E., Fractal market analysis: Applying chaos theory to investment and economics. John Wiley & Sons. [2011a] Peters O., The time resolution of the St Petersburg paradox. Philosophical Transactions of the Royal Society, 369, pp 4913–4931. [2011b] Peters O., Menger 1934 revisited. Journal of Economics Literature, 104 (2), pp 228–250. [2011c] Peters O., Optimal leverage from non-ergodicity. Quantitative Finance, 11 (11), pp 1593–1602. [2006] Pezier J., White A., The relative merits of investable hedge fund indices and of funds of hedge funds in optimal passive portfolios. ICMA Centre Discussion Papers in Finance, The University of Reading. [1992] Pictet O., Real-time trading models for foreign exchange rates. Neural Network World, 6, pp 713–744. [2013] Piketty T., Le capital au XXIe siecle. Les livres du nouveau monde, Edition du Seuil. [2005] Pirrong C., Momentum in futures markets. Working Paper. [2002] Plerou V., Gopikrishnan P., Rosenow B., Amaral L.N., Guhr T., Stanley H.E., Random matrix approach to cross correlations in financial data. Phys. Re., E65, 066126. [2002] Pochart B., Bouchaud J.P., The skewed multifractal random walk with applications to option smiles. Quantitative Finance, 24, pp 303–314. [2007] Pole A., Statistical arbitrage: Algorithmic trading insights and techniques. Wiley Finance. [1993] Pomerleau D.A., Knowledge-based training of artificial neural networks for autonomous robot driving. in J. Connell and S. Mahadevan, (eds.), Robot Learning, pp 19–43, Kluwe Academic Publishers. [1964] Pratt J., Risk aversion in the small and in the large. Econometrica, 32, pp 122–136. [1992] Press W.H., Teukolsky S.A., Vetterling W.T., and Flannery B.P., Numerical recipes. 2nd ed. Cambridge, Cambridge University Press. [1972] Priestley M.B., Chao M.T., Nonparametric function fitting. Journal of the Royal Statistical Society, 34, Series B, pp 385–392. [2004] Protter P., Stochastic integration and differential equations. 2nd edt., Springer Verlag. [1994] Pulley L.B., Mean-variance approximation to expected logarithmic utility. IEEE Transactions on Information Theory, 40, pp 409–418. [1993] Rabemananjara R., Zakoian J., Threshold ARCH models and asymmetries in volatility. Journal of Applied Econometrics, 8, pp 31–49. [1976] Radner R., Existence of equilibrium of plans, prices and price expectations in a sequence of markets. Econometrica, 40, pp 289–303. [2009] Rakhlin A., Lecture notes on online learning. Draft. [2003] Ramamoorthy S., A strategy for stock trading based on multiple models and trading rules. Class Projects from CS395T, Agent Based E-Commerce at UT Austin, USA. 731 Quantitative Analytics [2004] Ramamoorthy S., Subramanian H.K., Stone P., Kuipers B.J., Safe strategies for autonomous financial trading agents: A qualitative multiple-model approach. Department of Computer Sciences, University of Texas at Austin. [2011] Ramirez-Chavez L., Coello Coello C., Rodriguez-Tello E., A GPU-based implementation of differential evolution for solving the gene regulatory network model inference problem. The Fourth International Workshop On Parallel Architectures and Bioinspired Algorithms. [1995] Ramsey J.B., Usikov D., Zaslavsky G.M., An analysis of US stock price behaviour using wavelets. Fractals, 3, (2), pp 377–389. [1996] Ramsey J.B., Zhang Z., The application of wave from dictionaries to stock market index data. Predictability of Complex Dynamical Systems, ed Y.A. Kravtsov and J.B. Kadtke, Springer, pp 189–205. [1997] Ramsey J.B., Zhang Z., The analysis of foreign exchange data using waveform dictionaries. Journal of Empirical Finance, 4, pp 341–372. [1998] Ramsey J.B., Lampart C., Decomposition of economic relationships by timescale using wavelets. Macroeconomic Dynamics, 2, pp 49–71. [1999] Ramsey J.B., The contribution of wavelets to the analysis of economic and financial data. Phil. Trans. R. Soc., 357, pp 2593–2606. [2011] Raubenheimer H., Constraints on investment weights: What mandate authors in concentrated equity markets such as South Africa nee to know. Investment Analysts Journal, 74, pp 39–51. [2000] Ray B.K., Tsay R.S., Long-range dependence in daily stock volatilities. Journal of Business & Economic Statistics, 18, pp 254–262. [1995] Refenes A., Neural networks in capital markets. Wiley. [2009] Reid M.D., Williamson R.C., Surogate regret bounds for proper losses. in ICML. [1997] Reiss R., Thomas M., Statistical analysis of extreme values with applications to insurance, finance, hydrology and other fields. Birkhauser, Basel. [2002] Renaud O., Starck J-L., Murtagh F., Wavelet-based forecasting of short and long memory time series. Cahiers du departement d’econometrie, No 2002.04, Faculte des sciences economiques et sociales, Universite de Geneve. [2003] Renaud O., Starck J-L., Murtagh F., Prediction based on multiscale decomposition. International Journal of Wavelets, Multiresolution and Information Processing. [2005] Renaud O., Starck J-L., Murtagh F., Wavelet-based combined signal filtering and prediction. IEEE Transaction on Systems, Man, and Cybernetics, 35, (6), pp 1241–1251. [1995] Rice J.A., Mathematical statistics and data analysis. Thomson Information, Second Edition. [2000] Richards G.R., The fractal structure of exchange rates: measurement and forecasting. Journal of International Financial Markets, Institutions and Money, 10, pp 163–180. [1999] Riedi R.H., Crouse M.S., Ribeiro V.J., Baraniuk R.G., A multifractal wavelet model with application to network traffic. IEEE Trans. Inform. Theory, 45, (3), pp 992–1018. [1964] Roberts H.V., Stock market patterns and financial analysis: Methodological suggestions. in P. Cootner, ed., The random character of stock market prices. Cambridge: MIT Press. 732 Quantitative Analytics [1995] Robinson P.M., Gaussian semiparametric estimation of long-range dependence. The Annals of Statistics, 23, pp 1630–1661. [1995] Rockafellar R.T., Convex analysis. Princeton University Press. [1994] Rogers L.C.G., Satchell S.E., Yoon Y., Estimating the volatility of stock prices: A comparison of methods that use high and low prices. Applied Financial Economics, 4, (3), pp 241–247. [1997] Rogers L.C.G., Arbitrage with fractional Brownian motion. Mathematical Finance, 7, (1), pp 95–105. [1973] Roll R., Evidence on the growth-optimum model. Journal of Finance, 28, pp 551–566. [1980] Roll R., Ross S.A., An empirical investigation of the arbitrage pricing theory. Journal of Finance, 35, (5), pp 1073–1103. [2010] Roper M., Arbitrage free implied volatility surfaces. Working Papaer, School of Mathematics and Statistics, The University of Sydney, Australia. [2001] Rosenberg J.V., Engle R.F., Empirical pricing kernels. Working Paper, Federal Reserve Bank of New York, Stern School of Business, New York University. [2002] Rosenberg J.V., Engle R.F., Empirical pricing kernels. Journal of Financial Economics, 64, pp 341–372. [1956] Rosenblatt M., Remarks on some nonparametric estimates of a density function. Annals of Mathematical Statistics, 27, pp 642–669. [1976] Ross S.A., The arbitrage theory of capital asset pricing. Journal of Economic Theory, 13, pp 341–360. [1978] Ross S., A simple approach to the valuation of risky streams. Journal of Business, 51, pp 453–475. [2005] Ross S., Neoclassical finance. Princeton University Press, Princeton, NJ. [2013] Ross S., The recovery theorem. Working Paper, forthcoming Journal of Finance. [2000] Rouge R., El Karoui N., Pricing via utility maximization and entropy. Mathematical Finance, 10, pp 259–276. [1952] Roy A.D., Safety first and the holding of assets. Econometrica, 20, pp 431–449. [2002] Rubinstein M., Markowitz’s portfolio selection: A fifty-year retrospective. The Journal of Finance, 57, (3), pp 1041–1045. [1986] Rumelhart D., McClelland J., Parallel distributed processing. MIT Press, Cambridge, Mass. [1994] Rumelhart D., Widrow B., Lehr M., The basic ideas in neural networks Communications of the ACM, 37, (3), pp 87–92. [1993] Saito N., Beylkin G., Multiresolution representations using the autocorrelation functions of compactly supported wavelets. IEEE Trans. Signal Processing, 41, (12), pp 3584–3590. [1960] Samuelson P.A., The St. Petersburg paradox as a divergent double limit. International Economic Review, 1, pp 31–37. [1965] Samuelson P.A., Proof that properly anticipated prices fluctuate randomly. Industrial Management Review, 6, pp 41–50. [2005] Santana-Quintero L.V., Coello Coello C.A., An algorithm based on differential evolution for multi-objective problems. International Journal of Computational Intelligence Research, 1, ISSN 0973-1873, pp 151–169. 733 Quantitative Analytics [1988] Saupe D., Algorithms for random fractals. Springer-Verlag, New York. [1954] Savage L.J., The foundations of statistics. Wiley, New York, second revised edition: Dover, New York, 1972. [2007] Scherer B., Portfolio construction and risk budgeting. Third Edition, Risk Books, London [1991] Schertzer D., Lovejoy S., Lavallee D., Schmitt F., Universal hard multifractal turbulence: Theory and observations. in R. Sagdeev, U. Frisch, F. Hussain, S. Moisdeev, N. Erokin, eds., Nonlinear Dynamics of Structures, World Scientific, Singapore, pp 213–235. [1991b] Schertzer D., Lovejoy S., Scaling nonlinear variability in geodynamics: Multiple singularities, observables and universality classes. in D. Schertzer, S. Lovejoy, eds., Nonlinear Variability and Geophysics: Scaling and Fractals, Kluwer, Dordrecht, pp 41–82. [2002] Schleicher C., An introduction to wavelets for economists. Bank of Canada, Working Paper 2002-3. [1999] Schmitt F., Schertzer D., Lovejoy S., Multifractal analysis of foreign exchange data. Applied Stochastic Models and Data Analysis, 15, pp 29–53. [2006] Schobel R., Veith J., An overreaction implementation of the coherent market hypothesis and option pricing. Tubinger Diskussionsbeitrag, No. 306. [1946] Schoenberg I.J., Contribution to the problem of approximation of equidistant data by analytic functions. Quart. Appl. Math., 4, pp 45–99, 112–141. [2006] Scholz H., Wilkens M., The Sharpe ratio’s market climate bias: Theoretical and empirical evidence from US equity mutual funds. Working Paper, Catholic University of Eichstaett-Ingolstadt. [1969] Schonfeld P., Methoden der okonometrie. Verlag Franz Vahlen GmbH, Berlin und Frankfurt. [2011] Schumann A.Y., Kantelhardt J.W., Multifractal moving average analysis and test of multifractal model with tuned correlations. Physica A: Statistical Mechanics and its Applications, 390, pp 2637–2654. [1927] Schumpeter J., The Explanation of the Business Cycle. Economica. [1996] Schwager W.F., Technical analysis. Wiley. [1987] Scott D.W., Terrell G.R., Biased and unbiased cross-validation in density estimation. Journal of the American Statistical Association, 82, (400), pp 1131–1146. [2012] Segara R., Das A., Turner J., Performance of active extension strategies: Evidence from the Australian equities market. Australasian Accounting, Business and Finance Journal, 6, (3), pp 3–24. [2013] Segnon M., Lux T., Multifractal models in finance: Their origin, properties, and applications. Working Paper No. 1860, Kiel Institute for the World Economy. [2001] Segura J.V., Vercher E., A spreadsheet modeling approach to the Holt-Winters optimal forecasting. European Journal of Operational Research, 131, pp 375–388. [2002] Shadwick W.F., Keating C., A universal performance measure. Journal of Performance Measurement, Spring, pp 59–84. [1948] Shannon C.E., A mathematical theory of communication. Bell System Technical Journal, 27, (3), pp 379–423. [1949] Shannon C.E., Communication in the presence of noise. Proc. I.R.E., 37, pp 10–21. [1964] Sharpe W.F., Capital asset prices: A theory of market equilibrium under conditions of risk. Journal of Finance, 19, (3), pp 425–442. 734 Quantitative Analytics [1966] Sharpe W.F., Mutual fund performance. The Journal of Business, 39, (1), pp 119–138. [1970] Sharpe W.F., Portfolio theory and capital markets. New York: McGraw-Hill. [1994] Sharpe W.F., The Sharpe ratio. Journal of Portfolio Management, 21, pp 49–58. [1992] Shensa M.J., Discrete wavelet transforms: Wedding the a trous and Mallat algorithms. IEEE Transactions on Signal Processing, 40, pp 2464–2482. [2003] Sherstov A., Automated stock trading in PLAT. Class Projects from CS395T, Agent Based E-Commerce at UT Austin, USA. [1981] Shiller R.J., Do stock prices move too much to be justified by subsequent changes in dividends? American Economic Review, 71, pp 421–436. [1989] Shiller R.J., Market volatility. Cambridge, MIT Press. [2000] Shiller R.J., Irrational exuberance. Princeton, First Edition, Princeton University Press. [2002] Shimizu Y., Thurner S., Ehrenberger K., Multifractal spectra as a measure of complexity in human posture. Fractals, 10, pp 103–. [2000] Shin T., Han I., Optimal signal multi-resolution by genetic algorithms to support financial neural networks for exchange-rate forecasting. Expert Syst. Appl., 18, pp 257–269. [1997] Shleifer A., Vishny R.W., The limits of arbitrage. Journal of Finance, 52, (1), pp 35–55. [1998] Simonsen I., Hansen A., Nes O.M., Determination of the Hurst exponent by use of wavelet transforms. Phys. Rev., 58, (3), pp 2779–2787. [1995] Smith J.E., Nau R.F., Valuing risky projects: Option pricing theory and analysis. Management Science, 41, (5), pp 795–816. [2012] Smith J., The strategic case for momentum. Strategic View, Shroders. [1980] Snedecor G.W., Cochran W.G., Statistical methods. Iowa State University Press, 7th edition, Ames, Iowa. [2000] Soltani S., Boichu D., Simard P., Canu S., The long-term memory prediction by multiscale decomposition. Signal Processing, 80, (10), pp 2195–2205. [1970] Sorenson H.W., Least-squares estimation: From Gauss to Kalman. IEEE Spectrum, 7, pp 63–68. [1998] Sorensen E.H., Mezrich J.J., Miller K.L., A new technique for tactical asset allocation. Chapter 12 in F.J. Fabozzi, erd., Active Equity Portfolio Management, Hoboken, John Wiley & Sons. [2007] Sorensen E.H., Shi J., Hua R., Qian E., Aspects of constrained long-short equity portfolios. The Journal of Portfolio Management, 33, (2), 12–20. [1991] Sortino F.A., Van Der Meer R., Downside risk. The Journal of Portfolio Management, 17, (4), 27–31. [1999] Sortino F.A., Van Der Meer R., Plantinga A., The Dutch triangle: A framework to measure upside potential relative to downside risk. The Journal of Portfolio Management, 26, pp 50–58. [1989] Sterge A.J., On the distribution of financial futures price changes. Financial Analysts Journal, pp –. [1977] Stone C.J., Consistent nonparametric regression (with discussion). Annals of Statistics, 5, pp 595–645. 735 Quantitative Analytics [1995] Storn R., Price K., Differential evolution: A simple and efficient adaptive scheme for global optimization over continuous spaces. International Computer Science Institute, Berkeley, TR-95-012. [1996] Storn R., System design by constraint adaptation and differential evolution. International Computer Science Institute, Berkeley, TR-96-039. [2014] Stosic D., Stosic D., Stosic T., Stanley H.E., Multifractal analysis of managed and independent float exchange rates. Department of Physics, Boston University. [1971] Strang G., Fix G., A Fourier analysis of the finite element variational method. in Constructive Aspect of Functional Analysis, Rome, Edizioni Cremonese, pp 796–830. [1980] Strang G., Linear algebra and its applications. 2nd ed, Harcourt Brace Jovanovich, Chicago. [1996] Strang G., Nguyen T., Wavelets and filter banks. Wellesley, Wellesley-Cambridge. [1998] Struzik Z.R., Removing divergence in the negative moments of the multi-fractal partition function with the wavelet transformation. Working Paper INS-R9803, Centrum voor Wiskunde en Informatica, Amsterdam, The Netherlands. [1999] Struzik Z.R., Local effective Holder exponent estimation on the wavelet transform maxima tree. in Fractals: Theory and Applications in Engineering, eds., M. Dekking, J. Levy Vehel, E. Lutton, C. Tricot, Springer Verlag, pp 93–112. [2000] Struzik Z.R., Determining local singularity strengths and their spectra with the wavelet transform. Fractals, 8, (2), pp 163–179. [2002] Struzik Z.R., Siebes A., Wavelet transform based multifractal formalism in outlier detection and localisation for financial time series. Physica A, 309, pp 388–402. [2003] Struzik Z.R., Econophysics vs cardiophysics: The dual face of multifractality. Working Paper, Centrum voor Wiskunde en Informatica, Amsterdam, The Netherlands. [2004] Subramanian H.K., Evolutionary algorithms in optimization of technical rules for automated stock trading. M.S. Thesis, The University of Texas at Austin. [1998] Sutton R.S., Barto A.G., Reinforcement learning: An introduction. (Adaptive Computation and Machine Learning). The MIT Press, USA. [1985] Sweet A.L., Computing the variance of the forecast error for the Holt-Winters seasonal models. The Journal of Forecasting, 4 pp 235–243. [2007] Tabb L., Johnson J., Alternative investments 2007: The quest for alpha. Technical Report, Tabb Group. [1981] Takens F., Detecting strange attractors in turbulence. Springer Lecture Notes in Mathematics, 898, pp 366–381. [2005] Tankov P., Calibration de modeles et couverture de produits derives. Working Paper, Universite Paris VII. [1995] Taqqu M.S., Teverovsky V., Willinger W., Estimators for long-range dependence: An empirical study. Fractals, 3, (4), pp 785–798. [1999] Taqqu M.S., Montanari A., Teverovsky V., Estimating long-range dependence in the presence of periodicity: An empirical study. Mathematical and Computer Modelling, 29, (10), pp 217–228. [1986] Taylor S.J., Modelling financial time series. New York, John Wiley & Sons. [1994] Taylor S.J., Modeling stochastic volatility. Mathematical Finance, 4, pp 183–204. 736 Quantitative Analytics [2003] Taylor J.W., Exponential smoothing with a damped multiplicative trend. International Journal of Forecasting, 19, pp 715–725. [2004a] Taylor J.W., Volatility forecasting with smooth transition exponential smoothing. International Journal of Forecasting, 20, pp 273–286. [2004b] Taylor J.W., Smooth transition exponential smoothing. Journal of Forecasting, 23, pp 385–404. [2004c] Taylor J.W., Forecasting with exponentially weighted quantile regression. Working Paper, Said Business School, University of Oxford, Park End St., Oxford. [1867] Tchebichef P., Des valeurs moyennes. Journal de mathematiques pures et appliquees, 2, (12), pp 177–184. [1999] Teverovsky V., Taqqu M.S., Willinger W., A critical look at Lo’s modified R/S statistic. Journal of Statistical Planning and Inference, 80, pp 211–227. [2004] Thadewald T., Buning H., Jarque-Bera test and its competitors for testing normality: A power comparison. School of Business & Economics Discussion Paper: Economics, No. 2004/9. [1983] Tiao G.c., Tsay R.S., Consistency properties of least squares estimates of autoregressive parameters in ARMA models. Annals of Statistics, 11, pp 856–871. [1998] Tikhonov A.N., Leonov A.S., Yagola A.G., Nonlinear ill-posed problems. Chapman & Hall, London. [1958] Tobin J., Liquidity preference as behavior towards risk. The Review of Economic Studies, 25, pp 65–86. [1990] Tong H., Non-linear time series: A dynamical system approach. Oxford University Press, Oxford. [1965] Treynor J.L., How to rate management of investment funds. Harvard Business Review, 43, (1), pp 63–75. [1973] Treynor J.L., Black F., How to use security analysis to improve portfolio selection. Journal of Business, pp 66–85. [1967] Trigg D.W., Leach D.H., Exponential smoothing with an adaptive response rate. Operational Research Quarterly, 18, pp 53–59. [1984] Tsay R.S., Tiao G.C., Consistent estimates of autoregressive parameters and extended sample autocorrelation function for stationary and nonstationary ARMA models. Journal of the American Statistical Association, 79, 84–96. [2002] Tsay R.S., Analysis of financial time series. John Wiley & Sons, Hoboken, New Jersey. [1993] Tsitsiklis J., Bertsimas D., Simulated annealing. Statistical Science, 8, (1), pp 10–15. [2013] Turc J., Ungari S., Risk-premia strategies: a way to distance yourself from the crowd. Global Quantitative Research, Societe Generale. [2003] Turiel A., Perez-Vicente C.J., Multifractal geometry in stock market time series. Physica A, 322, pp 629–649. [2006] Turiel A., Perez-Vicente C.J., Grazzini J., Numerical methods for the estimation of multifractal singularity spectra on sampled data: A comparative study. Journal of Computational Physics, 216, pp 362–390. [2008] Turiel A., Yahia H., Perez-Vicente C.J., Microcanonical multifractal formalism: a geometrical approach to multifractal systems. Part I: Singularity analysis. Journal of Physics A: Mathematical and General, 41, 015501, pp –. [1990] Turner A.L., Weigel E.J., An analysis of stock market volatility. Russel Research Commentaries, Frank Russell Company, Tacoma, WA. 737 Quantitative Analytics [1990] Tversky A., The psychology of risk. in Quantifying the market risk premium phenomena for investment decision making, Charlottesville, Institute of Chartered Financial Analysts. [1987] Ullah A., Nonparametric estimation of econometric funktionals. Unpublished Manuscript. [2013] Ungari S., Turc J., Momentum strategies for rate: Bridging the gap between statistics and option theory. Global Quantitative Research, Societe Generale. [1992] Unser M., Aldroubi A., Eden M., On the asymptotic convergence of B-spline wavelets to Gabor functions. IEEE Trans. Information Theory, 38, (2), pp 864–872. [1993] Unser M., Aldroubi A., Eden M., A family of polynomial spline wavelet transforms. Signal Processing, 30, (2), pp 141–162. [1999] Unser M., Splines: A perfect fit for signal and image processing. IEEE Signal Processing Magazine, pp 22–38. [1996] Urzua C., On the correct use of omnibus tests for normality. Economics Letters, 53, pp 247–251. [1990] Vaga T., The coherent market hypothesis. Financial Analysts Journal, 46, (6), pp 36–49. [1992] Vaidyanathan P.P., Multirate systems and filter banks. Prentice Hall, New Jersey. [2006] Vajda I., Analysis of semi-log-optimal investment strategies. in M. Huskova and M. Janzura (eds.), Prague Stochastics (MATFYZ-PRESS, Prague). [1997] Vandewalle N., Ausloos M., Coherent and random sequences in financial fluctuations. Physica A, 246, (3), pp 454–459. [1998] Vandewalle N., Ausloos M., Crossing of two mobile averages: A method for measuring the robustness exponent. Phys. Rev., 58, pp 177–188. [1998b] Vandewalle N., Ausloos M., Multi-affine analysis of typical currency exchange rates. European Physical Journal B., 4, (2), pp 257–261. [1998c] Vandewalle N., Ausloos M., Boveroux PH., Detrended fluctuation analysis of the foreign exchange market. Working Paper. [1977] Vasicek O., An equilibrium characterization of the term structure. Journal of Financial Economics, 5, pp 177– 188. [1999] Vidakovic B., Statistical modeling by wavelets. Wiley, New York. [2004] Vidyamurthy G., Pairs trading, quantitative methods and analysis. John Wiley & Sons, Canada. [1996] Vokurka R.J., Flores B.E., Pearce S.L., Automatic feature identification and graphical support in rule-based forecasting: A comparison. International Journal of Forecasting, 12, pp 495–512. [1944] Von Neumann J., Morgenstern O., Theory of games and economic behavior. Princeton: Princeton University Press, second edition: Princeton UP, 1947. [2011] Vovk V., Losing money with a high Sharpe ratio. Working Paper. [1999] Wagman L., Stock portfolio evaluation: An application of genetic programming based technical analysis. Working Paper, Stanford University, California. [1874-7] Walras L., Elements d’economie politique pure. Lausanne: Corbaz. Translated as: Elements of pure economics. Chicago: Irwin (1954). 738 Quantitative Analytics [2009] Wang Y., Liu L., Gu R., Analysis of efficiency for Shenzhen stock market based on multifractal detrended fluctuation analysis. International Review of Financial Analysis, 18, pp 271–276. [2011] Wang Y., Wei Y., Wu C., Analysis of the efficiency and multifractality of gold markets based on multifractal detrended fluctuation analysis. Physica A: Statistical Mechanics and its Applications, 390, pp 817–827. [2011b] Wang Y., Wu C., Pan Z., Multifractal detrending moving average analysis on the US Dollar exchange rates. Physica A, 390, pp 3512–3523. [1964] Watson G.S., Smooth regression analysis. Sankhya, Series A, (26), pp 359–372. [2008] Wendt H., Contributions of wavelet leaders and bootstrap to multifractal analysis: Images, estimation performance, dependence structure and vanishing moments. Confidence intervals and hypothesis tests. Docteur de l’Universite de Lyon, Ecole Normale Superieure de Lyon, Traitement du Signal - Physique. [2002] Weron R., Estimating long-range dependence: Finite sample properties and confidence intervals. Physica A, 312, pp –. [2000] White H., A reality check for data snooping. Econometrica, 68, pp 1097–1127. [1997a] Whitelaw R.F., Stock market risk and return: An equilibrium approach. Working Paper, NYU, Stern School of Business. [1997] Whitelaw R.F., Time-varying Sharpe ratios and market timing. Working Paper, NYU, Stern School of Business. [1978] Wilder W., New concepts in technical trading systems. Trend Research, Greensboro, NC. [1936] Williams J.B., Speculation and the carryover. The Quaterly Journal of Economics, 50, (3), pp 436–455. [1936] Williams J.B., The theory of investment value. North Holland Publishing, Amsterdam, reprinted: Fraser Publishing, 1997. [1999] Willinger W., Taqqu M.S., Teverovsky V., Stock market prices and long-range dependence. Finance and Stochastic, 3, pp 1–13. [2005] Willmott C.J., Matsuura K., Advantages of the mean absolute error (MAE) over the root mean square error (RMSE) in assessing average model performance. Climate Research, 30, pp 79–82. [2012] Wilson C., Concave functions of a single variable. Mathematics for Economics, New York University. [1960] Winters P.R., Forecasting sales by exponentially weighted moving averages. Management Science, 6, pp 324– 342. [2011] Witkowski B., Building a solver for optimisation problems. BSc Thesis, University of Science and Technology in krakow. [1997] Wolpert D.H., Macready W.G., No free lunch theorems for optimization. IEEE Transactions on Evolutionary Computation, 1, (1), pp 67–82. [2003] Wong H., Ip W.C., Xie Z., Lui X., Modelling and forecasting by wavelets, and the application to exchange rates. Journal of Applied Statistics, 30, (5), pp 537–553. [1994] Wood A.A., Chan G., Simulation of stationary Gaussian processes in [0, 1]d . Journal of Computational and Graphical Statistics, 3, (4), pp 409–432. [2013] Woodie A., GPUs show big potential to speed pricing routines at banks. HPC Wire. 739 Quantitative Analytics [1991] Wright A.H., Genetic algorithms for real parameter optimization. in Foundation of Genetic Algorithms, ed. G. Rawlins, First Workshop on the Foundation of Gen. Alg. and Classified Systems, Los Altos, CA, pp 205-218. [2009] WST, Bloomberg uses GPUs to speed up bond pricing. WallStreet & Technology. [2009] Wu Z., Huang N.E., Ensemble empirical mode decomposition: A noise-assisted data analysis method. Advances in Adaptive Data Analysis, 1, pp 1–41. [2009] Xu S.J., Jin X.J., Predicting drastic drop in Chinese stock market with local Hurst exponent. International Conference on Management Science and Engineering, pp 1309–1315. [2003] Yan W., Profitable, return enhancing portfolio adjustments: An application of genetic programming with constrained syntactic structure. MSc Computer Science Project 2002/2003, University College London, UK. [2005] Yan W., Clack C.D., Evolving robust GP solutions for hedge fund stock selection in emerging markets. Working Paper, University College London, UK. [2000] Yang D., Zhang Q., Drift-independent volatility estimation based on high, low, open, and close prices. Journal of Business, 73, (3), pp 477–491. [1991] Young T.W., Calmar ratio: A smoother tool. Futures Magazine, 20 (1), October. [2009] Yuan Y., Zhuang X-T., Jin X., Measuring multifractality of stock price fluctuation using multifractal detrended fluctuation analysis. Physica A, 388, (11), pp 2189–2197. [2002] Yue S., Pilon P., Caradias G., Power of the Mann-Kendall and Spearman’s rho tests for detecting monotonic trends in hydrological series. Journal of Hydrol., 259, pp 254–271. [2001] Zhang B-L., Coggins R., Jabri M.A., Dersch D., Flower B., Multiresolution forecasting for futures trading using wavelet decompositions. IEEE Trans. on Neural Networks, 12, (4), pp 765–775. [1999] Zheng G., Stark J.L., Campbell J., Murtagh F., The wavelet transform for filtering financial data streams. Journal of Computational Intelligence in Finance, 7, pp 18–35. [2005] Zhu K., A statistical arbitrage strategy. Master’s Thesis in Numerical Analysis, Royal Institute of Technology, Stockholm. [2005] Ziemba W.T., The symmetric downside-disk Sharpe ratio. The Journal of Portfolio Management, 32, (1), pp 108–122. [2003] Zinkevich M., Online convex programming and generalized infinitesimal gradient ascent. ICML, pp –. [2006a] Zumbach G., Back testing risk methodologies from 1 day to 1 year. Technical Report, RiskMetrics Group. [2006b] Zumbach G., The riskmetrics 2006 methodology. Technical Report, RiskMetrics Group. [2007] Zunino L., Tabak B.M., Perez D.G., Garavaglia M., Rosso O.A., Inefficiency in Latin-American market indices. The European Physical Journal B, 60, (1), pp 111–121. [2008] Zunino L., Tabak B.M., Figlioa A., Perez D.G., Garavaglia M., Rosso O.A., A multifractal approach for stock market inefficiency. Physica A, 387, pp 6558–6566. 740
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.5 Linearized : No Page Count : 743 Page Mode : UseOutlines Author : Title : Subject : Creator : LaTeX with hyperref package Producer : pdfTeX-1.40.14 Create Date : 2015:01:14 18:05:05Z Modify Date : 2015:01:14 18:05:05Z Trapped : False PTEX Fullbanner : This is MiKTeX-pdfTeX 2.9.4902 (1.40.14)EXIF Metadata provided by EXIF.tools