Sei sulla pagina 1di 281

Exercises in Advanced Risk and Portfolio Management

R
(ARPM)
with Solutions and Code, supporting the 6-day intensive course ARPM Bootcamp

Attilio Meucci
attilio.meucci@arpm.co
Contents

0.1 Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ix

1 Univariate statistics 1
E 1 Pdf of an invertible transformation of a univariate random variable (www.1.1) . . . . . . 1
E 2 Cdf of an invertible transformation of a univariate random variable (www.1.1) . . . . . . 2
E 3 Quantile of an invertible transformation of a random variable (www.1.1) . . . . . . . . . 2
E 4 Pdf of a positive affine transformation of a univariate random variable (www.1.2) . . . . 3
E 5 Cdf of a positive affine transformation of a univariate random variable (www.1.2) . . . . 3
E 6 Quantile of a positive affine transformation of a univariate random variable (www.1.2) . 3
E 7 Characteristic function of a positive affine transformation of a univariate random variable
(www.1.2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
E 8 Pdf of an exponential transformation of a univariate random variable (www.1.3) . . . . . 4
E 9 Cdf of an exponential transformation of a univariate random variable (www.1.3) . . . . 4
E 10 Characteristic function of an exponential transformation of a univariate random variable
(www.1.3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
E 11 Affine equivariance of the expected value (www.1.4) . . . . . . . . . . . . . . . . . . . 5
E 12 Affine equivariance of the median (www.1.4) . . . . . . . . . . . . . . . . . . . . . . . 5
E 13 Affine equivariance of the range (www.1.4) . . . . . . . . . . . . . . . . . . . . . . . . 5
E 14 Affine equivariance of the mode (www.1.4) . . . . . . . . . . . . . . . . . . . . . . . . 6
E 15 Expected value vs. median of symmetrical distributions (www.1.5) . . . . . . . . . . . . 6
E 16 Raw moments to central moments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
E 17 Relation between the characteristic function and the moments (www.1.6) . . . . . . . . 8
E 18 First four central moments (www.1.6) . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
E 19 Central moments of a normal random variable . . . . . . . . . . . . . . . . . . . . . . 9
E 20 Histogram vs. pdf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
E 21 Sum of random variables via the characteristic function . . . . . . . . . . . . . . . . . 11
E 22 Sum of random variables via simulation . . . . . . . . . . . . . . . . . . . . . . . . . 11
E 23 Simulation of univariate random normal variable . . . . . . . . . . . . . . . . . . . . 12
E 24 Simulation of a Student t random variable . . . . . . . . . . . . . . . . . . . . . . . . 12
E 25 Simulation of a lognormal random variable . . . . . . . . . . . . . . . . . . . . . . . . 13
E 26 Raw moments of a lognormal random variable . . . . . . . . . . . . . . . . . . . . . . 14
E 27 Comparison of the gamma and chi-square distributions . . . . . . . . . . . . . . . . . 14

2 Multivariate statistics 15
E 28 Distribution of the grades (www.2.1) . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
E 29 Simulation of random variables by inversion (www.2.1) . . . . . . . . . . . . . . . . . 15
E 30 Pdf of an invertible function of a multivariate random variable (www.2.2) . . . . . . . . 16
E 31 Cdf of an invertible function of a multivariate random variable (www.2.2) . . . . . . . 17

ii
CONTENTS iii

E 32 Pdf of a copula (www.2.3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17


E 33 Pdf of the normal copula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
E 34 Cdf of a copula (www.2.3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
E 35 Cdf of the normal copula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
E 36 Cdf of the lognormal copula . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
E 37 Invariance of a copula (www.2.3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
E 38 Normal copula and given marginals . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
E 39 FX copula-marginal factorization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
E 40 Pdf of an affine transformation of a multivariate random variable (www.2.4) . . . . . . 20
E 41 Characteristic function of an affine transformation of a multivariate random variable
(www.2.4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
E 42 Pdf of a non-invertible affine transformation of a multivariate random variable (www.2.4) 21
E 43 Characteristic function of a non-invertible affine transformation of a multivariate random
variable (www.2.4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
E 44 Affine equivariance of the mode (www.2.5) . . . . . . . . . . . . . . . . . . . . . . . . 23
E 45 Affine equivariance of the modal dispersion (www.2.5) . . . . . . . . . . . . . . . . . . 24
E 46 Modal dispersion and scatter matrix (www.2.5) . . . . . . . . . . . . . . . . . . . . . . 24
E 47 Affine equivariance of the expected value (www.2.6) . . . . . . . . . . . . . . . . . . . 25
E 48 Affine equivariance of the covariance (www.2.6) . . . . . . . . . . . . . . . . . . . . . 26
E 49 Covariance and scatter matrix (www.2.6) . . . . . . . . . . . . . . . . . . . . . . . . . 26
E 50 Regularized call option payoff (www.2.7) . . . . . . . . . . . . . . . . . . . . . . . . . 26
E 51 Regularized put option payoff (www.2.7) . . . . . . . . . . . . . . . . . . . . . . . . . 27
E 52 Location-dispersion ellipsoid and geometry . . . . . . . . . . . . . . . . . . . . . . . . 28
E 53 Location-dispersion ellipsoid and statistics . . . . . . . . . . . . . . . . . . . . . . . . 28
E 54 The align of the enshrouding rectangle (www.2.8) . . . . . . . . . . . . . . . . . . . . 29
E 55 The Chebyshev’s inequality (www.2.9) . . . . . . . . . . . . . . . . . . . . . . . . . . 30
E 56 Relation between the characteristic function and the moments (www.2.10) . . . . . . . 32
E 57 Expected value and covariance matrix as raw moments . . . . . . . . . . . . . . . . . 32
E 58 Pdf of a uniform random variable on the ellipsoid (www.2.11) . . . . . . . . . . . . . . 33
E 59 Characteristic function of a uniform random variable on the ellipsoid (www.2.11) . . . 33
E 60 Moments of a uniform random variable on the ellipsoid (www.2.11) . . . . . . . . . . . 34
E 61 Marginal distribution of a uniform random variable on the unit sphere (www.2.11) . . . 35
E 62 Characteristic function of a multivariate normal random variable (www.2.12) . . . . . 35
E 63 Characteristic function of a multivariate normal random variable . . . . . . . . . . . . 36
E 64 Simulation of a multivariate normal random variable with matching moments . . . . . 37
E 65 Pdf of the copula of a bivariate normal random variable (www.2.12) . . . . . . . . . . 39
E 66 Lognormal random variable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
E 67 Pdf of the matrix-valued normal random variable (www.2.13) . . . . . . . . . . . . . . 40
E 68 Covariance of a matrix-valued normal random variable (www.2.13) . . . . . . . . . . . 41
E 69 Limit of the Student t distribution (www.2.14) . . . . . . . . . . . . . . . . . . . . . . . 42
E 70 Mode of a Cauchy random variable (www.2.15) . . . . . . . . . . . . . . . . . . . . . 44
E 71 Modal dispersion of a Cauchy random variable (www.2.15) . . . . . . . . . . . . . . . 44
E 72 Pdf of a log-variable (www.2.16) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
E 73 Raw moments of a log-variable (www.2.16) . . . . . . . . . . . . . . . . . . . . . . . . 46
E 74 Relation between the Wishart and the gamma distributions (www.2.17) . . . . . . . . . 47
E 75 Simulation of a Wishart random variable . . . . . . . . . . . . . . . . . . . . . . . . . 47
E 76 Pdf of an inverse-Wishart random variable (www.2.17) . . . . . . . . . . . . . . . . . . 48
E 77 Characteristic function of the empirical distribution . . . . . . . . . . . . . . . . . . . 49
E 78 Order statistics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
E 79 Pdf of an elliptical random variable (www.2.18) . . . . . . . . . . . . . . . . . . . . . 49
E 80 Moments of an elliptical random variable (www.2.18) . . . . . . . . . . . . . . . . . . 50
E 81 Radial-uniform representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
E 82 Elliptical markets and portfolios . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
E 83 Generalized function m (www.2.19) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
E 84 Correlation in normal markets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
E 85 Correlation in lognormal markets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
E 86 Independence versus no correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
E 87 Correlation and location-dispersion ellipsoid . . . . . . . . . . . . . . . . . . . . . . . 56
E 88 Copula vs. correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
E 89 Full co-dependence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57

3 Modeling the market 58


E 90 Approximation of the ATMF implied volatility (www.3.1) . . . . . . . . . . . . . . . . . 58
E 91 Distribution of the sum of independent variables (www.3.2) . . . . . . . . . . . . . . . 59
E 92 Investment-horizon characteristic function (www.3.2) . . . . . . . . . . . . . . . . . . 60
E 93 The square-root rule for the expectation (www.3.3) . . . . . . . . . . . . . . . . . . . . 61
E 94 The square-root rule for the covariance (www.3.3) . . . . . . . . . . . . . . . . . . . . 61
E 95 Multivariate square-root rule . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
E 96 Projection of Cauchy invariants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
E 97 Projection of skewness, kurtosis, and all standardized summary statistics . . . . . . . . 64
E 98 Explicit factors: regression factor loadings (www.3.4) . . . . . . . . . . . . . . . . . . 66
E 99 Explicit factors: expected value and correlation of residuals (www.3.4) . . . . . . . . . 67
E 100 Explicit factors: covariance of residuals (www.3.4) . . . . . . . . . . . . . . . . . . . 67
E 101 Explicit factors (with a constant among the factors): recovered invariants (www.3.4) . 68
E 102 Explicit factors (with a constant among the factors): expected value of residuals (www.3.4)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69
E 103 Explicit factors (with a constant among the factors): covariance of residuals (www.3.4) 70
E 104 Explicit factors: generalized r-square (www.3.4) . . . . . . . . . . . . . . . . . . . . 70
E 105 Spectral decomposition: symmetry . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
E 106 Spectral decomposition: positivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
E 107 Hidden factors: recovered invariants as projection (www.3.5) . . . . . . . . . . . . . 73
E 108 Hidden factors: generalized r-square (www.3.5) . . . . . . . . . . . . . . . . . . . . . 74
E 109 Hidden factors: derivation, correlations and r-square . . . . . . . . . . . . . . . . . . 76
E 110 Hidden factors: principal component analysis of a two-point swap curve . . . . . . . 78
E 111 Hidden factors: puzzle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
E 112 Pure residual models: duration/curve attribution . . . . . . . . . . . . . . . . . . . . 79
E 113 Time series factors: unconstrained time series correlations and r-square . . . . . . . . 79
E 114 Time series factors: unconstrained time series industry factors . . . . . . . . . . . . . 80
E 115 Time series factors: generalized time-series industry factors . . . . . . . . . . . . . . 81
E 116 Time series factors: analysis of residuals I . . . . . . . . . . . . . . . . . . . . . . . . 81
E 117 Time series factors: analysis of residuals II . . . . . . . . . . . . . . . . . . . . . . . 83
E 118 Time series factors: analysis of residuals III . . . . . . . . . . . . . . . . . . . . . . . 83
E 119 Time series factors: analysis of residuals IV . . . . . . . . . . . . . . . . . . . . . . . 84
E 120 Cross-section factors: unconstrained cross-section correlations and r-square I . . . . 84
E 121 Cross-section factors: unconstrained cross-section correlations and r-square II . . . . 85
E 122 Cross-section factors: unconstrained cross-section industry factors . . . . . . . . . . 85
E 123 Cross-section factors: generalized cross-section industry factors . . . . . . . . . . . . 86
E 124 Cross-section factors: comparison cross-section with time-series industry factors . . . 87
CONTENTS v

E 125 Correlation factors-residual: normal example . . . . . . . . . . . . . . . . . . . . . . 87


E 126 Factors on demand: horizon effect . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
E 127 Factors on demand: no-Greek hedging . . . . . . . . . . . . . . . . . . . . . . . . . 89
E 128 Factors on demand: selection heuristics . . . . . . . . . . . . . . . . . . . . . . . . . 90
E 129 Spectral basis in the continuum (www.3.6) . . . . . . . . . . . . . . . . . . . . . . . . 91
E 130 Eigenvectors for Toeplitz structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
E 131 Numerical market projection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
E 132 Simulation of a jump-diffusion process . . . . . . . . . . . . . . . . . . . . . . . . . . 97
E 133 Simulation of a Ornstein-Uhlenbeck process . . . . . . . . . . . . . . . . . . . . . . . 97
E 134 Simulation of a GARCH process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
E 135 Equity market: quest for invariance . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
E 136 Equity market: multivariate GARCH process . . . . . . . . . . . . . . . . . . . . . . 98
E 137 Equity market: linear vs. compounded returns projection I . . . . . . . . . . . . . . . 99
E 138 Equity market: linear vs. compounded returns projection II . . . . . . . . . . . . . . 100
E 139 Fixed-income market: quest for invariance . . . . . . . . . . . . . . . . . . . . . . . 100
E 140 Fixed-income market: projection of normal invariants . . . . . . . . . . . . . . . . . 100
E 141 Fixed-income market: projection of Student t invariants . . . . . . . . . . . . . . . . 102
E 142 Derivatives market: quest for invariance . . . . . . . . . . . . . . . . . . . . . . . . 104
E 143 Derivatives market: projection of invariants . . . . . . . . . . . . . . . . . . . . . . . 104
E 144 Statistical arbitrage: co-integration trading . . . . . . . . . . . . . . . . . . . . . . . 105

4 Estimating the distribution of the market invariants 106


E 145 Smallest ellipsoid (www.4.1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
E 146 Ordinary least squares estimator of the regression factor loadings (www.4.1) . . . . . 107
E 147 Maximum likelihood estimation for elliptical distributions (www.4.2) . . . . . . . . . 108
E 148 Maximum likelihood estimation for univariate elliptical distributions . . . . . . . . . 109
E 149 Maximum likelihood estimator of explicit factors under conditional elliptical distribution
(www.4.2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
E 150 Explicit factors: t-test of factor loadings . . . . . . . . . . . . . . . . . . . . . . . . . 112
E 151 Explicit factors: maximum likelihood estimator of the factor loadings . . . . . . . . . 113
E 152 Explicit factors: maximum likelihood estimator of the dispersion parameter . . . . . . 113
E 153 Explicit factors: t-test of factor loadings . . . . . . . . . . . . . . . . . . . . . . . . . 114
E 154 Explicit factors: hypothesis testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
E 155 Independence of the sample mean and the sample covariance (www.4.3) . . . . . . . . 115
E 156 Distribution of the sample mean (www.4.3) . . . . . . . . . . . . . . . . . . . . . . . 116
E 157 Testing of the sample mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
E 158 p-value of the sample mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
E 159 t-test of the sample mean . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
E 160 Distribution of the sample covariance (www.4.3) . . . . . . . . . . . . . . . . . . . . 120
E 161 Estimation error of the sample mean . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
E 162 Estimation error of the sample covariance (www.4.3) . . . . . . . . . . . . . . . . . . 122
E 163 Maximum likelihood estimator of the conditional factor loadings (www.4.4) . . . . . . 123
E 164 Stein’s lemma (www.4.5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
E 165 Shrinkage estimator of location (www.4.5) . . . . . . . . . . . . . . . . . . . . . . . . 127
E 166 Shrinkage estimator of location . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
E 167 Singular covariance matrix (www.4.6) . . . . . . . . . . . . . . . . . . . . . . . . . . 130
E 168 Sample covariance and eigenvalue dispersion . . . . . . . . . . . . . . . . . . . . . . 130
E 169 Shrinkage estimator of dispersion (www.4.6) . . . . . . . . . . . . . . . . . . . . . . 130
E 170 Shrinkage estimator of scatter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
E 171 Maximum likelihood estimator as implicit functional (www.4.7) . . . . . . . . . . . . 132
E 172 Influence function of the sample mean I (www.4.7) . . . . . . . . . . . . . . . . . . . 132
E 173 Influence function of the sample mean II . . . . . . . . . . . . . . . . . . . . . . . . . 133
E 174 Influence function of the sample covariance (www.4.7) . . . . . . . . . . . . . . . . . 134
E 175 Influence function of the sample variance . . . . . . . . . . . . . . . . . . . . . . . . 136
E 176 Influence function of the ordinary least squares estimator (www.4.7) . . . . . . . . . . 137
E 177 Expectation-Maximization algorithm for missing data: formulas (www.4.8) . . . . . . 138
E 178 Expectation-Maximization algorithm for missing data: example . . . . . . . . . . . . 140
E 179 Mixture distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
E 180 Moment-based functional of a mixture I . . . . . . . . . . . . . . . . . . . . . . . . . 143
E 181 Moment-based functional of a mixture II . . . . . . . . . . . . . . . . . . . . . . . . . 144
E 182 Moment-based functional of a mixture III . . . . . . . . . . . . . . . . . . . . . . . . 144
E 183 Moment-based functional of a mixture IV . . . . . . . . . . . . . . . . . . . . . . . . 145
E 184 Estimation of a quantile of a mixture I . . . . . . . . . . . . . . . . . . . . . . . . . . 145
E 185 Estimation of a quantile of a mixture II . . . . . . . . . . . . . . . . . . . . . . . . . 146
E 186 Maximum likelihood estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
E 187 Quantile estimation: maximum likelihood vs. non-parametric . . . . . . . . . . . . . 147
E 188 Maximum likelihood estimation of a multivariate Student t distribution . . . . . . . . 147
E 189 Random matrix theory: semi-circular law . . . . . . . . . . . . . . . . . . . . . . . . 148
E 190 Random matrix theory: Marchenko-Pastur limit . . . . . . . . . . . . . . . . . . . . . 149
E 191 Non-parametric estimators of regression parameters . . . . . . . . . . . . . . . . . . 149
E 192 Maximum likelihood vs. non-parametric estimators of regression parameters . . . . . 150
E 193 Simulation of the distribution of statistics of regression parameters . . . . . . . . . . . 150

5 Evaluating allocations 151


E 194 Gamma approximation of the investor’s objective (www.5.1) . . . . . . . . . . . . . . 151
E 195 Moments of the approximation of the investor’s objective (www.5.1) . . . . . . . . . . 155
E 196 Estimability and sensibility imply consistence with weak dominance (www.5.2) . . . . 157
E 197 Translation invariance and positive homogeneity imply constancy (www.5.2) . . . . . 158
E 198 Consistence with weak dominance (www.5.3) . . . . . . . . . . . . . . . . . . . . . . 159
E 199 Positive homogeneity of the certainty-equivalent and utility functions (www.5.3) . . . . 160
E 200 Translation invariance of the certainty-equivalent and utility functions (www.5.3) . . . 160
E 201 Risk aversion/propensity of the certainty-equivalent and utility functions (www.5.3) . . 162
E 202 Risk premium in the case of small bets (www.5.3) . . . . . . . . . . . . . . . . . . . . 162
E 203 Dependence on allocation: approximation in terms of the moments of the objective
(www.5.3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
E 204 First-order sensitivity analysis of the certainty-equivalent I (www.5.3) . . . . . . . . . 164
E 205 First-order sensitivity analysis of the certainty-equivalent II . . . . . . . . . . . . . . 164
E 206 Second-order sensitivity analysis of the certainty-equivalent (www.5.3) . . . . . . . . 166
E 207 Interpretation of the certainty-equivalent . . . . . . . . . . . . . . . . . . . . . . . . 167
E 208 Certainty-equivalent computation I . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
E 209 Certainty-equivalent computation II . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
E 210 Constancy of the quantile-based index of satisfaction (www.5.4) . . . . . . . . . . . . 169
E 211 Homogeneity of the quantile-based index of satisfaction (www.5.4) . . . . . . . . . . . 169
E 212 Translation invariance of the quantile-based index of satisfaction (www.5.4) . . . . . . 170
E 213 Example of strong dominance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
E 214 Example of weak dominance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
E 215 Additive co-monotonicity of the quantile-based index of satisfaction (www.5.4) . . . . 171
E 216 Cornish-Fisher approximation of the quantile-based index of satisfaction (www.5.4) . 171
CONTENTS vii

E 217 First-order sensitivity analysis the quantile-based index of satisfaction (www.5.4) . . . 172
E 218 Second-order sensitivity analysis of the quantile-based index of satisfaction I (www.5.4) 173
E 219 Second-order sensitivity analysis of the quantile-based index of satisfaction II (www.5.4) 176
E 220 Value-at-Risk in elliptical markets I . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
E 221 Value-at-Risk in elliptical markets II . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
E 222 Value-at-Risk in elliptical markets III . . . . . . . . . . . . . . . . . . . . . . . . . . 178
E 223 Cornish-Fisher approximation of the Value-at-Risk . . . . . . . . . . . . . . . . . . . 179
E 224 Spectral representation (www.5.5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
E 225 Spectral indices of satisfaction and risk aversion . . . . . . . . . . . . . . . . . . . . 181
E 226 Cornish-Fisher approximation of the spectral index of satisfaction (www.5.5) . . . . . 181
E 227 Extreme value theory I (www.5.5) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
E 228 Extreme value theory II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
E 229 Extreme value theory approximation of Value-at-Risk . . . . . . . . . . . . . . . . . . 183
E 230 First-order sensitivity analysis of the expected shortfall (www.5.5) . . . . . . . . . . . 184
E 231 Second-order sensitivity analysis of the expected shortfall (www.5.5) . . . . . . . . . . 185
E 232 Expected shortfall in elliptical markets I . . . . . . . . . . . . . . . . . . . . . . . . . 186
E 233 Expected shortfall in elliptical markets II . . . . . . . . . . . . . . . . . . . . . . . . 187
E 234 Expected shortfall in elliptical markets III . . . . . . . . . . . . . . . . . . . . . . . . 187
E 235 Expected shortfall and linear factor models . . . . . . . . . . . . . . . . . . . . . . . 188
E 236 Simulation of the investor’s objectives . . . . . . . . . . . . . . . . . . . . . . . . . . 188
E 237 Arrow-Pratt aversion and prospect theory . . . . . . . . . . . . . . . . . . . . . . . . 189

6 Optimizing allocations 191


E 238 Feasible set of the mean-variance efficient frontier (www.6.1) . . . . . . . . . . . . . 191
E 239 Maximum achievable certainty-equivalent with exponential utility I (www.6.1) . . . . 191
E 240 Maximum achievable certainty-equivalent with exponential utility II (www.6.1) . . . . 192
E 241 Results on constrained optimization: QCQP as special case of SOCP (www.6.2) . . . 193
E 242 Feasible set of the mean-variance problem in the space of moments (www.6.3) . . . . . 194
E 243 Reformulation of the efficient frontier with affine constraints (www.6.3) . . . . . . . . 198
E 244 Least-possible variance allocation (www.6.3) . . . . . . . . . . . . . . . . . . . . . . 198
E 245 Highest-possible Sharpe ratio allocation (www.6.3) . . . . . . . . . . . . . . . . . . . 198
E 246 Geometry of the mean-variance efficient frontier (www.6.3) . . . . . . . . . . . . . . . 199
E 247 Reformulation of the efficient frontier with linear constraints (www.6.3) . . . . . . . . 199
E 248 Effect of correlation on the mean-variance efficient frontier: total correlation case
(www.6.4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
E 249 Effect of correlation on the mean-variance efficient frontier: total anti-correlation case
(www.6.4) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 201
E 250 Total return efficient allocations in the plane of relative coordinates (www.6.5) . . . . 202
E 251 Benchmark-relative efficient allocation in the plane of absolute coordinates (www.6.5) 204
E 252 Formulation of mean-variance in terms of returns I (www.6.6) . . . . . . . . . . . . . 205
E 253 Formulation of mean-variance in terms of returns II (www.6.6) . . . . . . . . . . . . . 205
E 254 Mean-variance pitfalls: two-step approach I . . . . . . . . . . . . . . . . . . . . . . 206
E 255 Mean-variance pitfalls: two-step approach II . . . . . . . . . . . . . . . . . . . . . . 206
E 256 Mean-variance pitfalls: horizon effect . . . . . . . . . . . . . . . . . . . . . . . . . . 207
E 257 Benchmark driven allocation I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
E 258 Benchmark driven allocation II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
E 259 Mean-variance for derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
E 260 Dynamic strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 209
E 261 Buy and hold . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
E 262 Utility maximization I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
E 263 Utility maximization II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
E 264 Constant proportion portfolio insurance . . . . . . . . . . . . . . . . . . . . . . . . . 213
E 265 Option based portfolio insurance I . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
E 266 Option based portfolio insurance II . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

7 Estimating the distribution of the market invariants 217


E 267 Mahalanobis square distance of normal random variables (www.7.1) . . . . . . . . . 217
E 268 Normal-inverse-Wishart location-dispersion: posterior distribution (www.7.2) . . . . 219
E 269 Normal-inverse-Wishart location-dispersion: mode (www.7.3) . . . . . . . . . . . . . 221
E 270 Normal-inverse-Wishart location-dispersion: modal dispersion (www.7.3) . . . . . . . 223
E 271 Inverse-Wishart dispersion: mode (www.7.4) . . . . . . . . . . . . . . . . . . . . . . 224
E 272 Inverse-Wishart dispersion: modal dispersion (www.7.4) . . . . . . . . . . . . . . . . 225
E 273 Normal-inverse-Wishart location-dispersion: marginal distribution of location (www.7.5)
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 227
E 274 Normal-inverse-Wishart factor loadings-dispersion: posterior distribution (www.7.6) . 228
E 275 Normal-inverse-Wishart factor loadings-dispersion: mode (www.7.7) . . . . . . . . . 232
E 276 Normal-inverse-Wishart factor loadings-dispersion: modal dispersion (www.7.7) . . . 234
E 277 Normal-inverse-Wishart factor loadings-dispersion: marginal distribution of factor load-
ings (www.7.8) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
E 278 Allocation-implied parameters (www.7.9) . . . . . . . . . . . . . . . . . . . . . . . . 237
E 279 Likelihood maximization (www.7.9) . . . . . . . . . . . . . . . . . . . . . . . . . . . 238
E 280 Markov chain Monte Carlo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 239
E 281 Bayesian: prior on correlation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240
E 282 Bayesian: normal-inverse-Wishart posterior . . . . . . . . . . . . . . . . . . . . . . 241

8 Evaluating allocations 243


E 283 Optimal allocation as function of invariant parameters (www.8.1) . . . . . . . . . . . 243
E 284 Statistical significance of sample allocation (www.8.2) . . . . . . . . . . . . . . . . . 244
E 285 Estimation risk and opportunity cost . . . . . . . . . . . . . . . . . . . . . . . . . . . 245

9 Optimizing allocations 246


E 286 Allocation of the resampled allocation (www.9.1) . . . . . . . . . . . . . . . . . . . . 246
E 287 Probability bounds for the sample mean (www.9.2) . . . . . . . . . . . . . . . . . . . 246
E 288 Bayes’ rule (www.9.3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
E 289 Black-Litterman posterior distribution (www.9.3) . . . . . . . . . . . . . . . . . . . . 248
E 290 Black-Litterman conditional distribution (www.9.4) . . . . . . . . . . . . . . . . . . . 251
E 291 Black-Litterman conditional expectation (www.9.4) . . . . . . . . . . . . . . . . . . . 252
E 292 Black-Litterman conditional covariance (www.9.4) . . . . . . . . . . . . . . . . . . . 253
E 293 Computations for the robust version of the leading example (www.9.5) . . . . . . . . . 253
E 294 Computations for the robust mean-variance problem I (www.9.6) . . . . . . . . . . . . 255
E 295 Computations for the robust mean-variance problem II (www.9.6) . . . . . . . . . . . 257
E 296 Restating the robust mean-variance problem in SeDuMi format . . . . . . . . . . . . 258
E 297 Normal predictive distribution (www.9.7) . . . . . . . . . . . . . . . . . . . . . . . . 259
E 298 The robustness uncertainty set for the mean vector (www.9.8) . . . . . . . . . . . . . 262
E 299 The robustness uncertainty set for the covariance matrix (www.9.8) . . . . . . . . . . 264
E 300 Robust Bayesian mean-variance problem (www.9.8) . . . . . . . . . . . . . . . . . . 267
E 301 Robust mean-variance for derivatives . . . . . . . . . . . . . . . . . . . . . . . . . . 267
E 302 Black-Litterman and beyond I . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268
CONTENTS ix

E 303 Black-Litterman and beyond II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 268


E 304 Entropy pooling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 269

Bibliography 270
0.1 Preface

This exercise book supports the review sessions of the 6-day intensive course Advanced Risk and Portfolio
Management (ARPM) Bootcamp R
. The latest version of this exercise book is available at www.symmys.
com/node/170.

This exercise book complements the Textbook Risk and Asset Allocation - Springer, by Attilio Meucci
(Meucci, 2005). Each chapter of this exercise book refers to the respective chapter in the textbook. Icons
indicate if an exercise is theoretical or code-based. The number of stars corresponds to the difficulty of
an exercise.

The MATLAB R
files and this exercise book are provided "as is": no claim of accuracy is made and no
responsibility is taken for possible errors. Both this exercise book and the MATLAB R
scripts can and
must be used and distributed freely. Please quote the author and the source: "Attilio Meucci, ARPM -
Advanced Risk and Portfolio Management".
Any feedback is highly appreciated, please contact the author at .

Attilio Meucci is grateful to David Ardia for his help editing and consolidating this exercise book.
Chapter 1

Univariate statistics

E 1 – Pdf of an invertible transformation of a univariate random variable (www.1.1)


Consider the following transformation of the generic random variable X:

X 7→ Y ≡ g(X) , (1.1)

where g is an increasing and thus invertible function. Show that:

fX (g −1 (y))
fY (y) = . (1.2)
|g 0 (g −1 (y))|

Solution of E 1
By the definition (1.3, AM 2005) of the pdf fY we have:

fY (y)dy = P{Y ∈ [y, y + dy]}


= P{g(X) ∈ [y, y + dy]}
= P{X ∈ [g −1 (y), g −1 (y + dy)]} (1.3)
Z g−1 (y+dy)
= fX (x)dx ,
g −1 (y)

where the third equality follows from the invertibility of the function g. On the other hand, from a Taylor
expansion we obtain:

1
g −1 (y + dy) = g −1 (y) + dy . (1.4)
g 0 (g −1 (y))
Substituting (1.4) in the last expression of (1.3) we obtain:

Z g −1 (y)+ g0 (g−1
1
dy
(y)) 1
fX (x)dx = fX (g −1 (y))

fY (y)dy = 0 −1
dy , (1.5)
g −1 (y) g (g (y))
which yields the desired result. 

1
E 2 – Cdf of an invertible transformation of a univariate random variable (www.1.1)
(see E 1)
Consider the same setup than in E 1. Show that:

FY (y) = FX (g −1 (y)) . (1.6)

Solution of E 2
By the definition (1.7, AM 2005) of the cdf FY we have:

FY (y) ≡ P {Y ≤ y}
= P {g(X) ≤ y}
(1.7)
= P X ≤ g −1 (y)


= FX (g −1 (y)) ,
where the third equality follows from the invertibility of the function g, under the assumption that g is an
increasing function of its argument.
Note. In case g is a decreasing function of its argument we obtain:

FY (y) ≡ P{Y ≤ y}
= P{g(X) ≤ y}
(1.8)
= P{X ≥ g −1 (y)} = 1 − P{X ≤ g −1 (y)}
= 1 − FX (g −1 (y)) .


E 3 – Quantile of an invertible transformation of a random variable (www.1.1)


(see E 1)
Consider the same setup than in E 1. Show that:

QY (p) = g(QX (p)) . (1.9)

Solution of E 3
Consider the following series of identities that follow from the definition (1.7, AM 2005) of the cdf FY :

FY (g(QX (p))) ≡ P{Y ≤ g(QX (p))} = P{X ≤ QX (p)} = p , (1.10)

where the second equality follows from the invertibility of the function g, under the assumption that g
is an increasing function of its argument. By applying the FY−1 to the first and last terms and using the
definition (1.17, AM 2005) of the quantile QY we obtain the desired result.
Note. In the case where g is a decreasing function of its argument we have:

QY (p) = g(QX (1 − p)) . (1.11)


CHAPTER 1. UNIVARIATE STATISTICS 3

E 4 – Pdf of a positive affine transformation of a univariate random variable (www.1.2)


Consider the following positive affine transformation of the generic random variable X:

X 7→ Y ≡ g(X) ≡ m + sX , (1.12)

where s > 0 and m is a generic constant. Show that:

 
1 y−m
fY (y) = fX . (1.13)
s s

Solution of E 4
We use the fact that:

y−m
g −1 (y) = , g 0 (x) = s , (1.14)
s
in (1.2). 
E 5 – Cdf of a positive affine transformation of a univariate random variable (www.1.2)
(see E 4)
Consider the same setup than in E 4. Show that:

 
y−m
FY (y) = FX . (1.15)
s

Solution of E 5
We use the fact that:

y−m
g −1 (y) = , g 0 (x) = s , (1.16)
s
in (1.6). 
E 6 – Quantile of a positive affine transformation of a univariate random variable
(www.1.2) (see E 4)
Consider the same setup than in E 4. Show that:

QY (p) = m + s QX (p) . (1.17)

Solution of E 6
We use the fact that:

y−m
g −1 (y) = , g 0 (x) = s , (1.18)
s
in (1.9). 
E 7 – Characteristic function of a positive affine transformation of a univariate
random variable (www.1.2) (see E 4)
Consider the same setup than in E 4. Show that:

φY (ω) = eiωm φX (sω) . (1.19)

Solution of E 7
We use the definition (1.12, AM 2005) of the characteristic function:

n o
φY (ω) ≡ E{eiωY } = E eiω(m+sX) = eiωm E eisωX .

(1.20)

E 8 – Pdf of an exponential transformation of a univariate random variable (www.1.3)


Given the following exponential transformation:

X 7→ Y ≡ g(X) ≡ eX , (1.21)

show that:

1
fY (y) = fX (ln(y)) . (1.22)
y

Solution of E 8
We use the fact that:

g −1 (y) = ln(y) , g 0 (x) = ex , (1.23)

in (1.2). 
E 9 – Cdf of an exponential transformation of a univariate random variable (www.1.3)
(see E 8)
Consider the same setup than in E 8. Show that:

FY (y) = FX (ln(y)) . (1.24)

Solution of E 9
We use the fact that:

g −1 (y) = ln(y) , g 0 (x) = ex , (1.25)

in (1.6). 
CHAPTER 1. UNIVARIATE STATISTICS 5

E 10 – Characteristic function of an exponential transformation of a univariate


random variable (www.1.3) (see E 8)
Consider the same setup than in E 8. Show that:

QY (p) = eQX (p) . (1.26)

Solution of E 10
We use the fact that:

g −1 (y) = ln(y) , g 0 (x) = ex , (1.27)


in (1.9). 

E 11 – Affine equivariance of the expected value (www.1.4)


Prove that the expected value (1.25, AM 2005) is an affine equivariant parameter of location, i.e. it
satisfies (1.22, AM 2005).
Solution of E 11
Z Z Z
E {m + sX} ≡ (m + s x)fX (x)dx = m fX (x)dx + s x fX (x)dx
R R R (1.28)
≡ m + s E {X} .


E 12 – Affine equivariance of the median (www.1.4)


Prove that the median (1.26, AM 2005) is an affine equivariant parameter of location, i.e. it satisfies (1.22,
AM 2005).
Solution of E 12
From (1.17), the quantile, and thus in particular the median, is invariant with respect to any positive affine
transformation:
   
1 1
Med {m + sX} ≡ Qm+sX = m + s QX
2 2 (1.29)
≡ m + s Med {X} .


E 13 – Affine equivariance of the range (www.1.4)


Prove that the range (1.37, AM 2005) is an affine equivariant parameter of location, i.e. it satisfies (1.22,
AM 2005).
Solution of E 13
Using (1.9) and assuming s > 0, we have:

Ran {m + sX} ≡ Qm+sX (p) − Qm+sX (p)


 
= [m + sQX (p)] − m + sQX (p)
  (1.30)
= s QX (p) − QX (p)
≡ s Ran {X} .
When s < 0, using (1.11), we have:

Ran {m + sX} ≡ Qm+sX (p) − Qm+sX (p)


 
= [m + sQX (1 − p)] − m + sQX (1 − p)
  (1.31)
= s QX (1 − p) − QX (1 − p)
≡ s Ran {X} .

E 14 – Affine equivariance of the mode (www.1.4)


Prove that the mode (1.37, AM 2005) is an affine equivariant parameter of location, i.e. it satisfies (1.22,
AM 2005).
Solution of E 14
From (1.13) we know the density fY (y) and therefore:

  
1 y−m
Mod{m + sX} ≡ argmax {fm+sX (y)} = argmax fX
y∈R y∈R s s
  
y−m (1.32)
= argmax fX = m + s argmax {fX (x)}
y∈R s x∈R

≡ m + s Mod{X} .

E 15 – Expected value vs. median of symmetrical distributions (www.1.5)


Show that if a pdf is symmetrical around x e, the area underneath the pdf on the half-line (−∞, x
e] is
the same as the area underneath the pdf on the half-line [e
x, +∞), and thus they must both equal 1/2.
Moreover, show that the symmetry point xe is the expected value and the median.
Solution of E 15
For any pdf fX and a point x
e in the domain of the density we have:

Z x
e Z ∞
fX (x)dx + fX (x)dx = 1 . (1.33)
−∞ x
e

If x
e is the symmetry point, then both terms in the left-hand side are equal:

Z x
e
2 fX (x)dx = 1 , (1.34)
−∞

and therefore:

Z x
e
1
x) ≡
FX (e fX (x)dx = . (1.35)
−∞ 2

For the expected value, we proceed as follows:


CHAPTER 1. UNIVARIATE STATISTICS 7

Z
E{X} ≡ x fX (x)dx
R
Z
e + (x − x
=x e)fX (x)dx (1.36)
ZR
=x
e + u fX (e x + u)du = x
e.
R

where the last integral in (1.36) is null since due to (1.28, AM 2005) we have:

Z 0 Z +∞
x + u)du = −
u fX (e x − u)du = 0 .
u fX (e (1.37)
−∞ 0

Finally, from the definition of the median (1.26, AM 2005) we have:

   
1 −1 1
Med{X} ≡ QX = FX =x
e. (1.38)
2 2


E 16 – Raw moments to central moments


Consider the raw moments (1.47, AM 2005):

RMX n
n ≡ E{X }, n = 1, 2, . . . , (1.39)

and the central moments (1.48, AM 2005):

CMX X
1 ≡ RM1
(1.40)
CMX n
n ≡ E{(X − E{X}) }, n = 2, 3, . . . .
Determine how to map the first n raw moments into the first n central moments, and how to map the first
n central moments into the first n raw moments. Write two MATLAB R
functions which implement the
respective mappings.
Solution of E 16
Consider first the mapping of the raw moments to the central moments. For n > 1, from the definition of
central moment (1.40) and the binomial expansion we obtain:

CMX n
n ≡ E{(X − E{X}) }
(n−1 )
X
=E (−1)n−k CMX k
n−k X + X
n

k=0
n−1
X (1.41)
(−1)n−k CMX
 k
= n−k E X + E {X n }
k=0
n−1
X
= (−1)n−k CMX X X
n−k RMk + RMn .
k=0
Now, for the mapping of the central moments to the raw moments, we have from (1.41) the following
recursive formula:

n−1
X
RMX X
n = CMn + (−1)n−k+1 CMX X
n−k RMk , (1.42)
k=0

which is initialized with RMX X


1 = CM1 . See the MATLAB
R
functions Raw2Central and Central2Raw for
the implementations of the mappings. 

E 17 – Relation between the characteristic function and the moments (www.1.6)


Assume the characteristic function of the random variable X is analytical, i.e. it can be recovered entirely
from its Taylor expansion. Consider the expansion of the characteristic function of X around the origin:

(iω)k
φX (ω) = 1 + (iω) RMX
1 +··· + RMX
k +··· , (1.43)
k!
where the generic coefficient RMX
k is defined in terms of the derivatives of the characteristic function as
follows:

dk φX (ω)

−k
RMX
k ≡i . (1.44)
dω k ω=0

Show that that RMX k is the k-th raw moment of X defined in (1.47, AM 2005). Hence, show that raw
moment of a random variable X, and in particular the expected value of X, can be easily computed by
differentiating its characteristic function.
Solution of E 17
By performing the derivatives on the definition (1.12, AM 2005) of the characteristic function we obtain:

dk dk
Z 
iωx
{φ X (ω)} ≡ e fX (x)dx
dω k dω k R
Z (1.45)
= ik eiωx xk fX (x)dx .
R

Therefore:

dk φX (ω)
Z
k
xk fX (x)dx = ik E X k ,

k
=i (1.46)

ω=0 R

and substituting this in (1.44) concludes the solution. The expected value is obtained as a special case
with k = 1. 

E 18 – First four central moments (www.1.6)


Using the fact that the generic central moment of order k defined in (1.48, AM 2005) is a function of the
raw moments of order up to k:

k
X k!(−1)k−j
CMX
k = RMX X k−j
j (RM1 ) , (1.47)
j=0
j!(k − j)!
CHAPTER 1. UNIVARIATE STATISTICS 9

see e.g. Abramowitz and Stegun (1974), derive the following first four central moments:

CMX X 2 X
2 = −(RM1 ) + RM2

CMX X 3 X X X
3 = 2(RM1 ) − 3(RM1 )(RM2 ) + RM3 (1.48)
CMX
4 = −3(RMX
1 )
4
+ 6(RMX 2 X
1 ) (RM2 ) − 4 RMX
1 RMX
3 + RMX
4 ,

and show that these expressions in turn allow to easily compute variance, standard deviation, skewness
and kurtosis.
Solution of E 18
Simply express formula (1.47) for k = 2, 3, 4. Expressions for the variance, standard deviation, skewness
and kurtosis follow from their definitions:

Var{X} ≡ E{(X − E{X})2 } = CMX


2 (1.49)
p q
X
Sd{X} ≡ Var{X} = CM2 (1.50)
E{(X − E{X})3 } CMX3
Sk{X} ≡ = (1.51)
(Sd{X})3 CMX
3/2
2

E{(X − E{X})4 } CMX4


Ku{X} ≡ =  . (1.52)
(Sd{X})4 X 2
CM2

E 19 – Central moments of a normal random variable


Compute the central moments:

CMX n
n ≡ E {(X − E {X}) } , (1.53)

of a normal distribution:

X ∼ N(µ, σ 2 ) , (1.54)

using the moment generating function.


Hint. For a generic random variable X, the moment generating function:

Z
MX (z) ≡ ezx fX (x)dx , (1.55)

is such that Dn MX (0) = RMX


n , where D is the derivation operator and:

RMX n
n ≡ E {X } , (1.56)

is the raw moment. This follows from explicitly applying D on both sides of (1.55). The moment
generating function is the characteristic function φX (ω) defined in (1.12, AM 2005) evaluated at ω ≡ z/i:
MX (z) = φX (z/i) . (1.57)

Solution of E 19
First we focus on the raw moments of the standard normal distribution:

Y ∼ N(0, 1) . (1.58)
1 2
From (1.69, AM 2005) and (1.57) we obtain MY (z) ≡ e 2 z . Computing the derivatives:

1 2
D0 MY (z) = e 2 z
1 2
D1 MY (z) = ze 2 z
1 2 1 2
D2 MY (z) = e 2 z + z 2 e 2 z
1 2 1 2
D3 MY (z) = z 3 e 2 z + 3ze 2 z
1 2 1 2 1 2 (1.59)
D4 MY (z) = 3e 2 z + 6z 2 e 2 z + z 4 e 2 z
1 2 1 2 1 2
D5 MY (z) = 10z 3 e 2 z + z 5 e 2 z + 15ze 2 z
1 2 1 2 1 2 1 2
D6 MY (z) = 15e 2 z + 45z 2 e 2 z + 15z 4 e 2 z + z 6 e 2 z
..
.

and evaluating at zero yields the result:


0 if n is odd
RMYn = (1.60)
(n − 1)!! if n is even ,

where n!! ≡ 1 × 3 × 5 × · · · × n. Now we notice that:

CMX X−µ
n = RMn , (1.61)

which follows from (1.53), (1.56) and E{X} = µ. Furthermore:

RMnX−µ = σ n RMYn , (1.62)

d
because X − µ = σY . Hence CMX n X−µ
n = σ RMn and:


0 if n is odd
CMX = (1.63)
n σ n (n − 1)!! if n is even .


CHAPTER 1. UNIVARIATE STATISTICS 11

E 20 – Histogram vs. pdf *


Consider a set of T random i.i.d. variables:

d
Xt = X, t = 1, . . . T , (1.64)

and their realizations iT ≡ {x1 , . . . , xT }. Consider the histogram of the empirical pdf Em(iT ) stemming
from the realization iT , as defined in (1.119, AM 2005), where the width of all the bins is ∆. Show that
the histogram represents a regularized version of the true pdf, rescaled by the factor T ∆.
Solution of E 20
The Glivenko-Cantelli theorem (4.34, AM 2005) states that, under a few mild conditions, the empirical
distribution converges to the true distribution of X as the number of observations T goes to infinity. In
terms of the pdf, the Glivenko-Cantelli theorem reads:

T
1 X (xt )
f iT ≡ δ −→ fX . (1.65)
T t=1 T →∞

Denoting #∆
i the number of points included in the generic i-th bin, the following relation holds:

Z xi + ∆
2
∆→0
#∆
i ≡T fiT (y)dy −→ fX (xi )T ∆ . (1.66)
xi − ∆ T →∞
2

Therefore the histogram represents a regularized version of the true pdf. 

E 21 – Sum of random variables via the characteristic function


Consider the random variable defined in distribution as:

d
X =Y +Z, (1.67)

where Y and Z are independent. Compute the characteristic function φX of X from the characteristic
functions φY of Y and φZ of Z.
Solution of E 21
n o
φX (ω) ≡ E eiωX = E eiω(Y +Z) = E eiωY eiωZ
 
(1.68)
= E eiωY E eiωZ ≡ φY (ω)φZ (ω) .
 
(1.69)

E 22 – Sum of random variables via simulation


Consider a Student t random variable:

X ∼ St(ν, µ, σ 2 ) , (1.70)

where ν ≡ 8, µ ≡ 0 and σ 2 ≡ 0.1. Consider an independent lognormal random variable:

Y ∼ LogN(µ, σ 2 ) , (1.71)
where µ ≡ 0.1 and σ 2 ≡ 0.2. Consider the random variable defined as:

Z ≡X +Y . (1.72)

Write a MATLAB R
script which you:
• Generate a sample of 10,000 draws X from the Student t above, a sample Y of equal size from the
lognormal, sum them term by term (do not use loops) and obtain a sample Z of their sum;
• Plot the sample Z. Do not join the observations (use the plot option ’.’ as in a scatter plot);
• Plot the histogram of Z. Use hist and choose the number of bins appropriately;
• Plot the empirical cdf of Z. Use [f,z] = ecdf(Z) and plot(z, f);
• Plot the empirical quantile of Z. Use prctile.
Solution of E 22
See the MATLAB R
script S_NonAnalytical. 

E 23 – Simulation of univariate random normal variable


Consider as in (1.66, AM 2005) a normal random variable X ∼ N(µ, σ 2 ). First, determine µ and σ 2 such
that E {X} ≡ 3 and Var {X} ≡ 5. Then write a MATLAB R
script in which you:
• Generate a sample of 10,000 draws X from this distribution using normrnd;
• Plot the sample. Do not join the observations (use the plot option ’.’ as in a scatterplot);
• Plot the histogram. Use hist and choose the number of bins appropriately;
• Plot the empirical cdf. Use [f,x] = ecdf(X) and plot(x, f);
• Superimpose (use hold on) the exact cdf as computed by normcdf. Use a different color;
• Plot the empirical quantile. Use prctile;
• Superimpose (use hold on) the exact quantile as computed by norminv. Use a different color.

Hint. Notice that the MATLAB R
built-in functions take µ and σ 2 as inputs.

Solution of E 23
From (1.71, AM 2005) we have E {X} = µ and from (1.72, AM 2005) Var {X} = σ 2 . For the
implementation, see the MATLAB
R
script S_NormalSample. 

E 24 – Simulation of a Student t random variable


Consider a Student t random variable:

X ∼ St(ν, µ, σ 2 ) . (1.73)

Knowing that σ 2 ≡ 6, determine ν and µ such that E {X} ≡ 2 and Var {X} ≡ 7. Then write a
MATLAB R
script in which you:
• Generate a sample X_a from (1.73) using the built-in Student t number generator;
• Generate a sample X_b from (1.73) using the normal number generator, the chi-square number
generator and the following result:

d Y
X =µ+ p , (1.74)
Z/ν
where Y and Z are independent variables distributed as follows:

Y ∼ N(0, σ 2 ) , Z ∼ χ2ν ; (1.75)


CHAPTER 1. UNIVARIATE STATISTICS 13

• Generate a sample X_c of observations from (1.73) using the uniform generator number, tinv and
(2.27, AM 2005);
• In a figure, subplot the histogram of the simulations of X_a, subplot the histogram of the simulations
of X_b and subplot the histogram of the simulations of X_c;
• Compute the empirical quantile functions of the three simulations corresponding to the confidence
grid G ≡ {0.01, 0.02, . . . , 0.99};
• In a separate figure superimpose the plots of the above empirical quantiles, which should coincide.
Use different colors.
q
ν

Note. There is a typo in (1.90, AM 2005), which should be Sd{X} = ν−2 σ2 .

Solution of E 24
From (1.89, AM 2005) E{X} = µ and Var{X} = ν 2
ν−2 σ , which leads to ν = 14. See the MATLAB
R

script S_StudentTSample for the implementation. 

E 25 – Simulation of a lognormal random variable


Consider as in (1.94, AM 2005) a lognormal random variable:

X ∼ LogN(µ, σ 2 ) . (1.76)

Write a MATLAB R
function which determine µ and σ 2 from E{X} and Var{X}, and use it to determine
µ and σ such that E {X} ≡ 3 and Var {X} ≡ 5. Then write a MATLAB
2 R
script in which you:
• Generate a large sample X from this distribution using lognrnd;
• Plot the sample. Do not join the observations (use the plot option ’.’ as in a scatterplot);
• Plot the histogram. Use hist and choose the number of bins appropriately;
• Plot the empirical cdf. Use [f,x] = ecdf(X) and plot(x, f);
• Superimpose (use hold on) the exact cdf as computed by logncdf. Use a different color;
• Plot the empirical quantile. Use prctile;
• Superimpose (use hold on) the exact quantile as computed by logninv. Use a different color.

Note. The MATLAB R
built-in functions take µ and σ 2 as inputs.

Solution of E 25
From (1.98, AM 2005)-(1.99, AM 2005) we need to solve for µ and σ 2 the following system:

σ2 2 2
E = eµ+ 2 , V = e2µ+σ (eσ − 1) , (1.77)

or:

2 ln(E) = 2µ + σ 2
2 (1.78)
ln(V ) = 2µ + σ 2 + ln(eσ − 1) .

Therefore:

 
V 2
ln = ln(eσ − 1) , (1.79)
E2
or:
 
V
σ 2 = ln 1 + 2 . (1.80)
E
From (1.78) we then obtain:

 
1 V
µ = ln(E) − ln 1 + 2 . (1.81)
2 E
See the MATLAB
R
function LognormalMoments2Parameters and the script S_LognormalSample for the imple-
mentation. 

E 26 – Raw moments of a lognormal random variable


Consider as in (1.94, AM 2005) a lognormal random variable:

X ∼ LogN(µ, σ 2 ) . (1.82)

Compute the raw moments RMX n


n ≡ E {X } for all n = 1, 2, . . ..

Solution of E 26
From (1.94, AM 2005) we have:

d
X n = enY , (1.83)
where Y ∼ N(µ, σ 2 ) and from (2.163, AM 2005) we have nY ∼ N(nµ, n2 σ 2 ). Therefore:

X n ∼ LogN(nµ, n2 σ 2 ) , (1.84)
and the moments follow from (1.98, AM 2005):

2
σ 2 /2
RMX
n =e
nµ+n
. (1.85)


E 27 – Comparison of the gamma and chi-square distributions


Consider as in (1.107, AM 2005) a gamma-distributed random variable:

X ∼ Ga(ν, µ, σ 2 ) . (1.86)
Determine for which values of ν, µ and σ 2 this distribution coincides with the chi-square distribution
with ten degrees of freedom?
Hint. We recall that such variable is defined in distribution as follows:

d
X = Y12 + · · · + Yν2 , (1.87)
d d
where Y1 = · · · = Yν ∼ N(µ, σ 2 ) are independent.

Solution of E 27
For ν ≡ 10, µ ≡ 0 and σ 2 ≡ 1 we obtain X ∼ χ210 , see (1.109, AM 2005). 
Chapter 2

Multivariate statistics

E 28 – Distribution of the grades (www.2.1)


Prove that the grade of X, U ≡ FX (X), is uniformly distributed on [0, 1]:

U ∼ U([0, 1]) . (2.1)

Solution of E 28
From the standard uniform distribution defined in (1.54, AM 2005), we have to show that:


 0 if u≤0
P {U ≤ u} = u if u ∈ [0, 1] (2.2)
1 if u ≥ 1.

We first observe that by the definition of the cdf (1.7, AM 2005) the variable U always lies in the interval
[0, 1], therefore:


0 if u≤0
P {U ≤ u} = (2.3)
1 if u ≥ 1.
As for the remaining cases, from the definition of the quantile function (1.17, AM 2005) we obtain:

P {U ≤ u} = P {FX (X) ≤ u}
= P {X ≤ QX (u)} (2.4)
= FX (QX (u)) = u .


E 29 – Simulation of random variables by inversion (www.2.1)


Prove that if U ∼ U([0, 1]), then for any random variable Z we have:

d
QZ (U ) = Z , (2.5)
d
where = means "has the same distribution as".

15
Solution of E 29
P {QZ (U ) ≤ z} = P {U ≤ FZ (z)}
= P {FZ (Z) ≤ FZ (z)} (2.6)
= P {Z ≤ z} .

E 30 – Pdf of an invertible function of a multivariate random variable (www.2.2) *

Define a random variable Y as an invertible, increasing function g of a random variable X:

X 7→ Y ≡ g(X) , (2.7)
meaning that each entry yn ≡ gn (x) is a non-decreasing function of any of the arguments (x1 , . . . , xN ).
Show that:

fX (g−1 (y))
fY (y) = , (2.8)
|Jg (g−1 (y))|
where Jg denotes the Jacobian of g defined as follows:

∂gm (x)
Jgmn (x) ≡ . (2.9)
∂xn

Solution of E 30
From the definition of the pdf (2.4, AM 2005) we can write:

fy (y)dy ≡ P {g(X) ∈ [y, y + dy]}


= P X ∈ g−1 (y), g−1 (y + dy)
  
Z (2.10)
= fX (x)dx .
[g−1 (y),g−1 (y+dy)]

On the other hand, from a first order Taylor expansion we obtain:

−1
g−1 (y + dy) ≈ g−1 (y) + Jg (g−1 (y))

dy , (2.11)
Therefore:
Z
fY (y)dy = fX (x)dx
[g−1 (y),g−1 (y)+[Jg (g−1 (y))]−1 dy] (2.12)
 −1
= fX (g−1 (y)) Jg (g−1 (y)) dy ,

where the determinant accounts for the difference in volume between the infinitesimal parallelotope with
sides dy and the infinitesimal parallelotope with sides dx, see (A.34, AM 2005). Using (A.83, AM 2005)
we obtain the desired result.
Note. To compute the pdf of the variable Y, we do not need to assume that the function g is increasing.
Indeed, as long as g is invertible, it suffices to replace the absolute value of the determinant in (2.12).
Thus in this slightly more general case we obtain:
CHAPTER 2. MULTIVARIATE STATISTICS 17

fX (g−1 (y))
fY (y) = q . (2.13)
2
|Jg (g−1 (y))|

E 31 – Cdf of an invertible function of a multivariate random variable (www.2.2)


(see E 30)
Consider the same setup than in E 30. Show that:

FY (y) = FX (g−1 (y)) . (2.14)

Solution of E 31
From the definition (2.9, AM 2005) of the cdf FY we have:

FY (y) ≡ P {Y ≤ y} = P {g(X) ≤ y} = P X ≤ g−1 (y) = FX (g−1 (y)) .



(2.15)

E 32 – Pdf of a copula (www.2.3)


Show that the pdf of the copula of X can be expressed as in (2.30, AM 2005).
Solution of E 32
Consider the random variable U defined by the following transformation:

X 7→ U ≡ g(X) , (2.16)

where g is defined component-wise in terms of the cdf FXn of the the generic n-th component Xn :

gn (x1 , . . . , xN ) ≡ FXn (xn ) . (2.17)

This is an invertible increasing transformation and we can use (2.8). From (1.17, AM 2005) the inverse
of this transformation is the component-wise quantile:

gn−1 (u1 , . . . , uN ) ≡ QXn (un ) , (2.18)

By definition, the copula of X is the distribution of U. Since the pdf is the derivative of the cdf, the
Jacobian (2.9) of the transformation reads:

J = diag(fX1 , . . . , fXN ) , (2.19)

and thus from (A.42, AM 2005) its determinant is:

|J| = fX1 · · · fXN , (2.20)


which yields:

fX (QX1 (u1 ), . . . , QXN (uN ))


fU (u1 , . . . , uN ) = . (2.21)
fX1 (QX1 (u1 )) · · · · · fXN (QXN (uN ))


E 33 – Pdf of the normal copula


Consider a generic N -variate normal random variable X ∼ N(µ, Σ). Write a MATLAB R
function which
takes as inputs a generic value u in the N -dimensional unit hypercube as well as the parameters µ and Σ
and outputs the pdf of the copula of X in u. Use the following function header: pdfu = NormalCopulaPdf(u,

R
Mu, Sigma) and save the function as NormalCopulaPdf. In a second step, write a MATLAB script which
calls the above function to evaluate the copula pdf at a select grid of bivariate values:

u ∈ G ≡ [0.05 : 0.05 : 0.95] × [0.05 : 0.05 : 0.95] . (2.22)


Pick µ and Σ of your choice and plot the ensuing surface using surf.
Hint. See (2.30, AM 2005). Since µ is a generic N × 1 vector and Σ is a generic symmetric and positive
N × N matrix, you need the multivariate normal distribution function. Use mvnpdf and norminv. For the
display, calculate the pdf value on each grid point, which gives you a 19 × 19 matrix.

Solution of E 33
See the MATLAB R
script S_DisplayNormalCopulaPdf. 

E 34 – Cdf of a copula (www.2.3) (see E 32)


Consider the same setup than in E 32. Show that the cdf of the copula of X can be expressed as in (2.31,
AM 2005):

FU (u1 , . . . , uN ) = FX (QX1 (u1 ), . . . , QXN (uN )) . (2.23)

Solution of E 34
Use (2.14) with gn−1 (u1 , . . . , un ) ≡ QXn (un ). 

E 35 – Cdf of the normal copula


Consider a bi-variate normal random variable:

   
0 1 ρ
X ∼ N(µ, Σ) , µ≡ , Σ≡ . (2.24)
0 ρ 1
Pick ρ as you please, but make sure to play around with the values ρ ≡ 0.99, ρ ≡ −0.99 and ρ ≡ 0.
Write a MATLAB R
script which evaluates the copula cdf at a select grid of bivariate values:

u ∈ G ≡ [0.05 : 0.05 : 0.95] × [0.05 : 0.05 : 0.95] . (2.25)


Do not call functions from within the script. In a separate figure, plot the ensuing surface using surf.
Hint. Calculate the cdf value on each grid point, which gives you a 19 × 19 matrix. Use (2.31, AM 2005)
and the built-in function mvncdf.
CHAPTER 2. MULTIVARIATE STATISTICS 19

Solution of E 35
See the MATLAB R
script S_DisplayNormalCopulaCdf. 

E 36 – Cdf of the lognormal copula


Consider a generic N -variate lognormal random variable X ∼ LogN(µ, Σ). Write a MATLAB R
func-
tion which takes as input a generic value u in the N -dimensional unit hypercube as well as the parameters
µ and Σ and outputs the pdf of the copula of X in u. Write a MATLAB R
script where you call the above
function to evaluate the copula pdf at a select grid of bivariate values:

u ∈ G ≡ [0.05 : 0.05 : 0.95] × [0.05 : 0.05 : 0.95] . (2.26)

In a separate figure, plot the ensuing surface.


Hint. Use (2.38, AM 2005) and (2.196, AM 2005).

Solution of E 36
See the MATLAB R
function LognormalCopulaPdf and the script S_DisplayLogNormalCopulaPdf. 

E 37 – Invariance of a copula (www.2.3) (see E 32)


Consider the same setup than in E 32. Prove the invariance of the copula under a generic increasing
transformation X 7→ Y ≡ h(X).
Solution of E 37
From (2.23) the copulas of X and Y are the same if and only if the following is true:

FY (QY1 (u1 ), . . . , QYN (uN )) = FX (QX1 (u1 ), . . . , QXN (uN )) . (2.27)

From (2.14) we have:

FY (y1 , . . . , yN ) = FX (h−1 −1
1 (y1 ), . . . , hN (yN )) . (2.28)

On the other hand, the invariance property of the quantile (1.9), reads in this context:

QYn (un ) = hn (QXn (un )) . (2.29)

Substituting (2.29) in (2.28) yields (2.27). 

E 38 – Normal copula and given marginals


Write a MATLAB R
script in which you:
• Generate a bivariate sample X, i.e. a (T ≡ 10,000) × (N ≡ 2) matrix of joint observations, from a
bivariate random variable X whose distribution is defined as follows: the copula is the copula of a
normal distribution with correlation r ≡ −0.8 and the marginals are distributed as follows:

X1 ∼ Ga(ν1 , σ12 )
(2.30)
X2 ∼ LogN(µ2 , σ22 ) ,

where ν1 ≡ 9, σ12 ≡ 2, µ2 ≡ 0 and σ22 ≡ 0.04;


• In a separate figure, subplot the histogram of the simulations for X1 and subplot the histogram of
the simulations of X2 ;
• Comment on how these histograms, which represent the marginal pdf’s of X1 and X2 , change as
the correlation r of the normal distribution varies;
• Scatter-plot the simulations of X1 against the respective simulations of X2 ;
• Use hist3 to plot the respective 3D-histogram to visualize the joint pdf of X1 and X2 ;
• Plot the histogram of the grade of X1 and subplot the histogram of the grade of X2 ;
• Scatter-plot the simulations of the grade of X1 against the respective simulations of the grade of
X2 .
Hint. You are asked to generate a bivariate sample, which has a marginal gamma distribution and a log-
normal distribution but with a copula which is the same as the copula from a bivariate normal distribution.
You will notice that the correlation of this normal distribution is r, but no other information is provided
on the expected values or the standard deviations. Why? See (2.38, AM 2005). Therefore, first generate a
bivariate normal distribution sample with correlation r; then calculate its copula using (2.28, AM 2005);
finally remap it to the bivariate distribution you want using (2.34, AM 2005).

Solution of E 38
See the MATLAB R
script S_BivariateSample. 

E 39 – FX copula-marginal factorization
Write a MATLAB R
script in which you:
• Load from DB_FX the daily observations of the foreign exchange rates USD/EUR, USD/GBP and
USD/JPY. Define as variables the daily log-changes of the rates;
• Represent the marginal distribution of the three variables and display the respective histograms;
• Represent the copula of the three variables and display the scatter-plot of the copula of all pairs of
variables.
Hint. Applying the marginal cdf to the simulations of a random variable is equivalent to sorting.

Solution of E 39
See the MATLAB R
script S_FxCopulaMarginal. 

E 40 – Pdf of an affine transformation of a multivariate random variable (www.2.4)


Consider a generic random variable X and a random variable Y defined as an invertible affine transfor-
mation of X:

X 7→ Y ≡ g(X) ≡ m + BX , (2.31)

where m is an N -dimensional vector and B is a N × N invertible matrix. Show that:

fX (B−1 (y − m))
fY (y) = p . (2.32)
|BB0 |

Solution of E 40
In this case the Jacobian (2.9) is:

Jg ≡ B . (2.33)
CHAPTER 2. MULTIVARIATE STATISTICS 21

From (A.82, AM 2005) and (A.84, AM 2005) we see that:

2 2
|Jg | = |B| = |B| |B0 | = |BB0 | . (2.34)

Therefore, according to (2.13) the pdf of Y reads:

fX (B−1 (y − m))
fY (y) = p . (2.35)
|BB0 |


E 41 – Characteristic function of an affine transformation of a multivariate ran-
dom variable (www.2.4) (see E 40)
Consider the same setup than in E 40. Show that:

0
φY (ω) = eiω m φX (B0 ω) . (2.36)

Solution of E 41
From the definition (2.13, AM 2005) of the characteristic function:

n 0 o
φY (ω) ≡ E eiω Y
n 0 o
= E eiω (m+BX)
n o (2.37)
0 0 0
= eiω m E ei(B ω) X
0
= eiω m φX (B0 ω) .


E 42 – Pdf of a non-invertible affine transformation of a multivariate random vari-
able (www.2.4) **
Consider a generic random variable X and a random variable Y defined as an non-invertible affine trans-
formation of X:

X 7→ Y ≡ g(X) ≡ m + BX , (2.38)

where:

rank(B) 6= N ≡ dim(X) . (2.39)

In particular, consider linear combinations of random variables:

Ψ ≡ b0 X . (2.40)

Determine the pdf fΨ .


Solution of E 42
The distribution of Ψ is the marginal distribution of any invertible affine transformation that extends
(2.40):

 
Ψ
 Y2 
Y≡  ≡ BX . (2.41)
 
..
 . 
YN

For example, we can extend (2.40) defining B as follows:

 
b1 (b2 , . . . , bN )
B≡ , (2.42)
0N −1 IN −1

where 0N −1 is an (N − 1)-dimensional column vector of zeros and IN −1 is the (N − 1)-dimensional


identity matrix. The pdf of (2.40) is obtained by integrating out in (2.32) the dependence on the ancillary
variables (2.41) as in (2.22, AM 2005):

Z
fΨ (ψ) = fY (ψ, y2 , . . . , yN ) dy2 · · · dyN
RN −1
Z (2.43)
1
=p fX (B−1 Y)dy2 · · · dyN .
|BB0 | RN −1
Nevertheless, it is in general very difficult to perform this last step, as it involves a multiple integration.
For instance, if b1 6= 0 we can choose the extension B according to (2.42) we obtain:

− (b2 ,...,b N)
 1

B−1 = b1 b1 , (2.44)
0N −1 IN −1

and thus from (2.43) the pdf of (2.40) reads:

Z  
1 ψ b2 bN
fΨ (ψ) = p 2 fX − y2 · · · − yN , y2 , . . . , yN dy2 · · · dyN . (2.45)
b1 RN −1 b1 b1 b1


E 43 – Characteristic function of a non-invertible affine transformation of a multi-
variate random variable (www.2.4) (see E 42)
Consider the same setup than in E 42. Determine the expression for the characteristic function φΨ .
Solution of E 43
The characteristic function of (2.40) is obtained by setting to zero in (2.36) the dependence on the ancil-
lary variables (2.41) as in (2.24, AM 2005):

φΨ (ω) = φY (ω, 0N −1 )
(2.46)
  
ω
= φX B0 .
0N −1
CHAPTER 2. MULTIVARIATE STATISTICS 23

For instance, if we choose the extension B according to (2.42) we obtain from (2.46) that the characteristic
function of (2.40) reads:

φΨ (ω) = φX (ωb) . (2.47)




E 44 – Affine equivariance of the mode (www.2.5)


Consider a generic invertible affine transformation:

Y = a + BX , (2.48)
of the N -dimensional random variable X. Prove that the mode is affine equivariant, i.e. it satisfies (2.51,
AM 2005), which in this context reads:

Mod {a + BX} = a + B Mod {X} . (2.49)

Hint. From (2.32) we derive the vector of the first order derivatives of the pdf of Y in terms of the pdf of
X:

(B0 )−1 ∂fX



∂fY (y)
=p . (2.50)
∂y |BB0 | ∂x x=B−1 (y−a)
Deriving further, we obtain the matrix of the second order derivatives:

∂ 2 fY (y) (B0 )−1 ∂ 2 fX



= B−1 . (2.51)
∂y∂y0 |BB0 | ∂x∂x0 x=B−1 (y−a)
p

Solution of E 44
By its definition (2.52, AM 2005), the mode Mod {X} is the maximum. Thus it is determined by the
following first order condition:


∂fX
= 0. (2.52)
∂x x=Mod{X}

From (2.50) and (2.52) we obtain:

(B0 )−1 ∂fX



∂fY
= p = 0. (2.53)
∂y y=a+B Mod{X} |BB0 | ∂x x=Mod{X}
By the definition (2.52) of mode we have:


∂fY
= 0, (2.54)
∂y y=Mod{Y}

then (2.49) follows. 


E 45 – Affine equivariance of the modal dispersion (www.2.5) (see E 44)
Consider the same setup than in E 44. Prove that the modal dispersion (2.65, AM 2005) is affine equiv-
ariant, i.e. it satisfies (2.64, AM 2005).
Solution of E 45
From its definition, the modal dispersion of a generic random variable X reads:

!−1
∂ 2 ln fX

MDis {X} ≡ −
∂x∂x0 x=Mod{X}
  !−1
∂ 1 ∂fX
=−
∂x fX ∂x0 x=Mod{X}
!−1 (2.55)
1 ∂ 2 fX

1 ∂fX ∂fX
=− − 2
fX ∂x∂x0 x=Mod{X} fX ∂x ∂x0 x=Mod{X}
!−1
∂ 2 fX

= −fX (Mod {X}) .
∂x∂x0 x=Mod{X}

Therefore from (2.51) and (2.49) we obtain:

!−1
∂ 2 fY

MDis {Y} = −fY (Mod {Y})
∂y∂y0 y=Mod{Y}
!−1
(B0 )−1 ∂ 2 fX

−1 (2.56)
= −fY (Mod {Y}) B
|BB0 | ∂x∂x0 x=B−1 (Mod{Y}−a)
p
!−1
(B0 )−1 ∂ 2 fX

−1
= −fY (Mod {Y}) B .
|BB0 | ∂x∂x0 x=Mod{X}
p

Using (2.32) and (2.49) this expression becomes:

!−1
(B0 )−1 ∂ 2 fX

fX (Mod {X})
MDis {Y} = − p B−1
|BB0 | ∂x∂x0 X=Mod{X}
p
|BB0 |
!−1 (2.57)
∂ 2 fX

= −fX (Mod {X})B B0 .
∂x∂x0 x=Mod{X}

Finally, using (2.55) we obtain:

MDis {Y} = B MDis {X} B0 . (2.58)

This proves that the modal dispersion is affine equivariant. 

E 46 – Modal dispersion and scatter matrix (www.2.5) (see E 44)


Consider the same setup than in E 44. Show that the modal dispersion is a scatter matrix.
CHAPTER 2. MULTIVARIATE STATISTICS 25

Solution of E 46
It is immediate to check from the definition (2.65, AM 2005) that the modal dispersion is a symmetric
matrix. Furthermore, the mode is a maximum for the log-pdf, and therefore the matrix of the second
derivatives of the log-pdf at the mode is negative definite. Therefore, the modal dispersion is positive
definite. Affine equivariance, symmetry and positivity make the modal dispersion a scatter matrix. 

E 47 – Affine equivariance of the expected value (www.2.6) *


Consider a generic affine transformation:

X 7→ Y
e ≡a
e + BX
e , (2.59)

where a e is a non-invertible K × N matrix. Prove the affine equivariance


e is a K-dimensional vector and B
(2.51, AM 2005) of the expected value under generic affine transformations, i.e.:
n o
E ae + BX
e =a e E {X} .
e+B (2.60)

Hint. Consider adding (N − K) non-collinear rows to B


e and (N − K) elements to a
e.

Solution of E 47
e (N − K) elements a to a
Adding (N − K) non-collinear rows B to B, e and denoting Y a set of (N − K)
ancillary random variables as follows:

     
Y
e a B
e
Y≡ , a≡ , B≡ , (2.61)
e
Y a B
we extend the transformation (2.59) to an invertible affine transformation as in (2.31):

X 7→ Y ≡ a + BX . (2.62)
From the definition of expected value and using (2.32) we obtain:

n o Z Z
E ae + BX ≡
e ye fY
e (e
y)de
y= y
e fY,Y
e (e
y, y)de
ydy
RK RN
fX (B−1 (y − a))
Z Z
= ye fY (y)dy = y
e p dy (2.63)
RN RN |BB0 |
Z
fX (x)
= (e
a + Bx)
e p dy .
RN |BB0 |
With the change of variable y ≡ a + Bx we obtain:

n o Z fX (x)
E ae + BX
e = (e
a + Bx)
e p |B| dx
RN |BB0 |
Z
(2.64)
=a
e+B e xfX (x)dx
RN
=a e E {X} .
e+B

E 48 – Affine equivariance of the covariance (www.2.6) (see E 47)
Consider the same setup than in E 47. Prove the affine equivariance (2.64, AM 2005) of the covariance
matrix under generic affine transformations, i.e.:

n o
Cov ae + BX
e =B e0 .
e Cov {X} B (2.65)

Moreover, prove that the covariance matrix is a scatter matrix, i.e. it is affine equivariant, symmetric and
positive definite.
Solution of E 48
From the definition of covariance (2.67, AM 2005) and the equivariance of the expected value (2.60) we
obtain:

n o  n o  n o0 
Cov ae + BX
e ≡E a e −E a
e + BX e + BX
e a e −E a
e + BX e + BX
e

(2.66)
n o
= E B(X
e − E {X})(X − E {X})0 B
e0

e0 ,
e Cov {X} B
=B

where the last equality follows from the linearity of the expectation operator (B.56, AM 2005). 

E 49 – Covariance and scatter matrix (www.2.6) (see E 48)


Consider the same setup than in E 48. Show that the covariance is a scatter matrix.
Solution of E 49
It is immediate to check from the definition (2.68, AM 2005) that the covariance matrix is symmetric.
Furthermore, from the affine equivariance (2.65) we obtain:

a0 Cov {X} a = Cov {a0 X} = Var {a0 X} ≥ 0 . (2.67)

which proves the positiveness of the covariance matrix. Affine equivariance, symmetry and positivity
make the covariance matrix a scatter matrix. 

E 50 – Regularized call option payoff (www.2.7)


Show that the regularized call payoff is given by:

  
(x − K) x−K  1 2
C (x) = 1 + erf √ + √ e− 22 (x−K) . (2.68)
2 2 2 2π

Hint. See (B.4, AM 2005).

Solution of E 50
From the definition (B.49, AM 2005) of regularization, the regularized profile of the call option is the
convolution of the exact profile (2.36, AM 2005) with the approximate Dirac delta (B.18, AM 2005).
Therefore, from the definition of convolution (B.43, AM 2005) we obtain:
CHAPTER 2. MULTIVARIATE STATISTICS 27

h i
C (x) ≡ C ∗ δ(0) (x)
Z +∞
1 1 2
=√ max(y − K, 0)e− 22 (x−y) dy
2π −∞
Z +∞
1 1 2
=√ (y − K)e− 22 (y−x) dy
2π K
Z +∞
1 1 2 (2.69)
=√ (u + x − K)e− 22 u du
2π K−x
Z +∞ Z +∞
1 1 2 1 1 2
=√ ue− 22 u du + √ (x − K) e− 22 u du
2π K−x 2π K−x
 
Z +∞ Z +∞
1 d h 2 − 12 u2 i (x − K)  2 2
=√ − e 2 du + √ e−z dz  ,
2π K−x du 2 π √ K−x
2 2


where in the last line we used the change of variable u/ 22 ≡ z. Using the relation (B.78, AM 2005)
between the complementary error function and the error function, as well as (B.76, AM 2005), i.e. the
fact that the error function is odd, we obtain the desired result. 

E 51 – Regularized put option payoff (www.2.7)


Show that the regularized put payoff is given by:

  
(x − K) x−K  1 2
P (x) = − 1 − erf √ + √ e− 22 (x−K) . (2.70)
2 22 2π

Hint. See (B.4, AM 2005).

Solution of E 51
From the definition (B.49, AM 2005) of regularization, the regularized profile of the put option is the
convolution of the exact profile (2.113, AM 2005) with the approximate Dirac delta (B.18, AM 2005).
Therefore, from the definition of convolution (B.43, AM 2005) we obtain:

h i
P (x) ≡ P ∗ δ(0) (x)
Z +∞
1 1 2
=√ − min(y − K, 0)e− 22 (x−y) dy
2π −∞
Z K
1 1 2
=− √ (y − K)e− 22 (y−x) dy
2π −∞
Z K−x (2.71)
1 1 2
= −√ (u + x − K)e− 22 u du
2π −∞
Z K−x Z K−x
1 1 2 1 1 2
= −√ ue− 22 u du − √ (x − K) e− 22 u du
2π −∞ 2π −∞
K−x
Z K−x " Z √ #
1 d 2 − 12 u
h 2
i (x − K) 2 22 −z 2
=√  e 2 du − √ e dz ,
2π −∞ du 2 π −∞

where in the last line we used the change of variable u/ 22 ≡ z. Using the relation (B.78, AM 2005)
between the complementary error function and the error function, as well as (B.76, AM 2005), i.e. the
fact that the error function is odd, we obtain the desired result. 

E 52 – Location-dispersion ellipsoid and geometry


Consider the ellipsoid:

Em,S ≡ X ∈ RN | (X − m)0 S−1 (X − m) ≤ 1 .



(2.72)

• What is the geometrical interpretation of m?


• What is the geometrical interpretation of the eigenvectors of S?
• What is the geometrical interpretation of the eigenvalues of S?
• What is the statistical interpretation of this ellipsoid?
Solution of E 52
The vector m represents the center of ellipsoid. The eigenvectors are the directions of the principal axes
of the ellipsoid. The square root of the eigenvalues are the length of the principal axes of the ellipsoid.
There is no statistical interpretation, as long as m and S are not the expected value and the covariance
matrix respectively of a multivariate distribution. 

E 53 – Location-dispersion ellipsoid and statistics


Write a MATLAB
R
script in which you generate J ≡ 10,000 simulations from a bi-variate log-Student-t
variable:

ln(X) ∼ St(ν, µ, Σ) , (2.73)

where ν ≡ 40, µ ≈ 0.5 and diag(Σ) ≈ 0.01 (you can choose the off-diagonal element). Consider the
generic vector in the plane:

 
cos θ
eθ ≡ . (2.74)
sin θ

Consider the random variable Zθ ≡ e0θ X, namely the projection of X on the direction eθ . In the same
MATLAB R
script:
• Compute and plot the sample standard deviation σθ of Zθ as a function of θ ∈ [0, π] (select a grid
of 100 points);
• Show in a figure that the minimum and the maximum of σθ are provided by versors (normalized
vector) parallel to the principal axes of the ellipsoid defined by the sample mean m and the sample
covariance S as plotted by the function TwoDimEllipsoid;
• Compute the radius rθ , i.e. the distance between the surface of the ellipsoid and the center of the
ellipsoid along the direction of the vector as a function of θ ∈ [0, π] (select a grid of 100 points);
• In a separate figure superimpose the plot of σθ and the plot of rθ , showing that the minimum and the
maximum of σθ (i.e. the minimum and the maximum volatility), correspond to the the minimum
and the maximum of rθ respectively (i.e. the length of the smallest and largest principal axis).
Notice that the radius equals the standard deviation only on the principal axes.

Hint. You will have to shift and rescale the output of the MATLAB
R
function mvtrnd. Also, to compute
rθ notice that it satisfies:
CHAPTER 2. MULTIVARIATE STATISTICS 29

(rθ eθ )0 S−1 (rθ eθ ) = 1 . (2.75)

Solution of E 53
See the MATLAB R
script S_MaxMinVariance. 

E 54 – The align of the enshrouding rectangle (www.2.8) *


Prove that for n = 1, . . . , N , the two hyperplanes described by the following align:

xn = E {Xn } ± Sd {Xn } , (2.76)

are tangent to the ellipsoid EE,Cov defined in (2.75, AM 2005).


Solution of E 54
First consider the implicit representation of the surface of EE,Cov :

g(x) = 0 , (2.77)

where from (2.75, AM 2005) the function g is:

g(x) ≡ (x − E)0 Cov−1 (x − E) − 1 . (2.78)

To find the tangency condition of the ellipsoid with the rectangle we compute the gradient of the implicit
representation of EE,Cov :

∂g
= 2 Cov−1 (x − E) . (2.79)
∂x
Since the generic n-th side of the rectangle is perpendicular to the n-th axis, when the gradient is parallel
to the n-th axis, the rectangle is tangent to the ellipsoid. Therefore, to find the tangency condition we
must impose the following condition:

Cov−1 (x − E) = α δ (n) , (2.80)

where α is some scalar that we have to compute and δ (n) is the n-th element of the canonical basis of
RN , see (A.15, AM 2005). To compute α we substitute (2.80) in (2.77):

1 = (x − E)0 Cov−1 (x − E)
= (α Cov δ (n) )0 Cov−1 (α Cov δ (n) ) (2.81)
2
= α Var {Xn } ,

so that:

1
α=± . (2.82)
Sd {Xn }
Substituting (2.82) back in (2.80) and then again in (2.77) yields:

1 = (x − E)0 Cov−1 (x − E)
(2.83)
 
0 1 (n) xn − E {Xn }
= (x − E) ± δ =± .
Sd {Xn } Sd {Xn }

E 55 – The Chebyshev’s inequality (www.2.9) **


Show that the location-dispersion ellipsoid EE,Cov in (2.74, AM 2005) is, among all the ellipsoids of
equal volumes, the one that contains the highest probability of occurrence of the N dimensional random
variable X withing its boundaries.
Solution of E 55
Consider a generic vector v and a generic symmetric and positive matrix U. These define an ellipsoid
q
Ev,U as in (2.87, AM 2005). Therefore:

n o Z
q
q2 P X ∈
/ Ev,U = q 2 fX (x)dx
q
RN /Ev,U
Z
≤ (X − v)0 U−1 (x − v)fX (x)dx
q
RN /Ev,U
Z (2.84)
≤ (x − v)0 U−1 (x − v)fX (x)dx
Rn
= E (x − v)0 U−1 (x − v)


≡ a(v, U) .

Notice that we can re-write a(v, U) as follows:

a(v, U) = tr(E {(X − v)(X − v)0 } U−1 ) . (2.85)

From this we obtain:

a(E, Cov) = tr(Cov Cov−1 ) = tr(IN ) = N . (2.86)

Now we prove that the minimum of (2.85) is (2.86). In other words, among all possible vectors v and
symmetric, positive matrices U such that:

|U| = |Cov {X}| , (2.87)

the minimum value of (2.85) is achieved by the choice v ≡ E {X} and U ≡ Cov {X}. Consider an
arbitrary vector u and a perturbation:

v 7→ v + ηu . (2.88)

If v minimizes (2.85), in the limit η → 0 we must have:


CHAPTER 2. MULTIVARIATE STATISTICS 31

0 = E (X − (v + ηu))0 U−1 (X − (v + ηu))




− E (X − v)0 U−1 (X − v)

(2.89)
≈ − 2η E u0 U−1 (X − v) = −2ηu0 U−1 (E {X} − v) ,


and therefore we must have:

v ≡ E {X} . (2.90)

Now consider an arbitrary perturbation of U:

U 7→ U(I + B) , (2.91)

where I is the identity matrix and B is a matrix that preserves the volumes. From (A.77, AM 2005) this
means:

|U(I + B)| = |U| . (2.92)

In the limit of small perturbations  → 0, from (A.122, AM 2005) this condition becomes:

tr(B) = 0 . (2.93)

If (E {X} , U) minimize (2.85), in the limit  → 0 we must have:

n o
−1
0 = E (X − E {X})0 [U(I + B)] (X − E {X})
− E (X − E {X})0 U−1 (X − E {X})


−1
= tr(Cov {X} [U(I + B)] ) − tr(Cov {X} U−1 ) (2.94)
= tr(Cov {X} (I − B)U−1 ) − tr(Cov {X} U−1 )
= −  tr(Cov {X} BU−1 )
= −  tr(BU−1 Cov {X}) .

To summarize, from (2.93) and (2.94) we must have:

tr(B) = 0 ⇒ tr(BU−1 Cov {X}) = 0 , (2.95)

which is only true if U is proportional to the covariance, i.e.:

U = α Cov {X} , (2.96)

for some scalar α. Given the normalization (2.87) we obtain the desired result. 
E 56 – Relation between the characteristic function and the moments (www.2.10)
Assume that the characteristic function of a random variable X is analytical, i.e. it can be recovered
entirely from its Taylor expansion. Show that any raw moment of X can be easily computed by differen-
tiating the characteristic function of X.
Solution of E 56
Consider the expansion of the characteristic function of X around zero:

N
X
φX (ω) = 1 + i ωn RMX
n +···
n=1
N
(2.97)
k
i X
+ (ωn1 · · · ωnk ) RMX
n1 ···nk + · · · .
k! n ,...,n =1
1 k

where RMX
n1 ···nk is defined as follows:

∂ k φX (ω)

−k
RMX
n1 ···nk ≡i . (2.98)
∂ωn1 · · · ∂ωnk ω=0

By performing the derivatives on the definition (2.13, AM 2005) of the characteristic function we obtain:

∂k ∂k
Z 
0
{φX (ω)} ≡ eiω x fX (x)dx
∂ωn1 · · · ∂ωnk ∂ωn1 · · · ∂ωnk RN
Z (2.99)
0
= ik xn1 · · · xnk eiω X fX (x)dx .
RN

Therefore:

∂ k φX (ω)
Z
k
=i xn1 · · · xnk fX (x)dx = ik E {Xn1 · · · Xnk } . (2.100)
∂ωn1 · · · ∂ωnk ω=0 RN

Substituting this in (2.98) shows that RMX


n1 ···nk is the k-th raw moment defined in (2.91, AM 2005):

RMX
n1 ···nk ≡ E {Xn1 · · · Xnk } . (2.101)

Therefore any raw moment can be easily computed by differentiating the characteristic function. 

E 57 – Expected value and covariance matrix as raw moments


Express the expected value and the covariance matrix as raw moments.
Solution of E 57
From (2.98) we obtain the expected value, which is the raw moment of order one:


1 ∂φX (ω)
E {Xn } = RMX
n = . (2.102)
i ∂ωn ω=0

On the other hand, the k-th central moment:


CHAPTER 2. MULTIVARIATE STATISTICS 33

CMX
n1 ···nk ≡ E {(Xn1 − E {Xn1 }) · · · (Xnk − E {Xnk })} , (2.103)

is a function of the raw moments of order up to k, a generalization of (1.47). Similarly k-th raw moment
is a function of the central moments of order up to k. These statements follow by expanding the products
in (2.103) and inverting the ensuing triangular transformation. In particular for the covariance matrix,
which is the central moment of order two, we obtain:

Cov {Xm , Xn } = CMX X X X


mn = RMmn − RMm RMn , (2.104)

where the second raw moment follows from (2.98):

∂ 2 φX (ω)

RMX
mn =− . (2.105)
∂ωm ∂ωn ω=0

E 58 – Pdf of a uniform random variable on the ellipsoid (www.2.11)


Show that the pdf of a uniform random variable on the ellipsoid Eµ,Σ in RN is given by (2.145, AM
2005).
Solution of E 58
First, assume that the random variable X is uniformly distributed on the unit sphere in RN :

X ∼ U(E0N ,IN ) . (2.106)

The pdf of X reads:

1
IE (X) , (2.107)
VN 0,I

where VN is the volume of the unit sphere in RN :

N
π2
VN ≡ N
, (2.108)
Γ( 2 + 1)

where Γ is the gamma function (B.80, AM 2005). With the transformation X 7→ Y ≡ µ + BX, where
BB0 ≡ Σ, we obtain a variable Y that is uniformly distributed on the ellipsoid Eµ,Σ , Y ∼ U(Eµ,Σ ), and
the pdf of Y is obtained by applying (2.8) to (2.107). 

E 59 – Characteristic function of a uniform random variable on the ellipsoid (www.2.11)


Show that the characteristic function of a uniform random variable on the ellipsoid Eµ,Σ in RN is given
by (2.146, AM 2005).
Note. There is a typo in Fang et al. (1990).
Solution of E 59
Using Fang et al. (1990, result 2.9) and (2.119) the characteristic function of a variable X uniformly
distributed on the unit sphere in RN is given by:

n 0 o n √ 0 o
φ(ω) ≡ E eiω X = E ei ω ωXN
Z +∞ √
0
= ei ω ωxN f (xN )dxN
−∞
Γ( N2+2 )
Z +1 √ N −1 (2.109)
= N +1 1 cos( ω 0 ωx)(1 − x2 ) 2 dx
Γ( 2 )π 2 −1
Γ( N2+2 )
Z +∞ √ N −1
+ i N +1 1 sin( ω 0 ωx)(1 − x2 ) 2 dx .
Γ( 2 )π 2 −∞

The last term vanishes due to the symmetry of (1 − x2 ) around the origin. From (B.89, AM 2005) and
(B.82, AM 2005) we have:


Γ( 21 )Γ( N2+1 ) πΓ( N2+1 )
 
1 N +1
B , = = . (2.110)
2 2 Γ( N2+2 ) Γ( N2+2 )

Therefore the characteristic function of X reads:

2
Z +1 √ N −1
φ(ω) = cos( ω 0 ωx)(1 − x2 ) 2 dx . (2.111)
B( 12 , N2+1 ) 0

With the transformation X 7→ Y ≡ µ + BX, where BB0 ≡ Σ, we obtain a variable Y that is uniformly
distributed on the ellipsoid Eµ,Σ , Y ∼ U(Eµ,Σ ), and the characteristic function of Y is obtained by
applying (2.36) to (2.111). 

E 60 – Moments of a uniform random variable on the ellipsoid (www.2.11)


Compute the moments of a uniform random variable on the ellipsoid Eµ,Σ in RN .
Solution of E 60
First, consider a variable X uniformly distributed on the unit sphere in RN . To compute the moments,
we represent X as follows:

X = RU , (2.112)

where from (2.259, AM 2005), R ≡ kXk and U ≡ X/ kXk are independent and U is uniformly
distributed on the surface of the unit ball E0N ,IN . From (2.228) in E 80 we obtain:

E {X} = E {R} E {U} = 0 . (2.113)

Similarly:

Cov {X} = E R2 UU0 = E R2 Cov {U} .


 
(2.114)
CHAPTER 2. MULTIVARIATE STATISTICS 35

From Fang et al. (1990, p.75) the pdf of R reads:

fR (r) = N rN −1 I[0,1] (r) , (2.115)

where I is the indicator function (B.72, AM 2005). Therefore:

Z 1 Z 1
N −1 N
E Rk = k
rN +k−1 dr =

r Nr dr = N . (2.116)
0 0 N +k
Using (2.229) in E 80 we obtain:

N IN IN
Cov {X} = = . (2.117)
N +2 N N +2
More in general, we can obtain any moment by applying (2.233):

CMX RU RU
m1 ···mk = CMm1 ···mk = RMm1 ···mk
= E {RUn1 · · · RUnk }
= E Rk E {Un1 · · · Unk }
 (2.118)
N
= E {Un1 · · · Unk } ,
N +k
and then using (2.227). With the transformation X 7→ Y ≡ µ + BX, where BB0 ≡ Σ, we obtain a
variable Y that is uniformly distributed on the ellipsoid Eµ,Σ , Y ∼ U(Eµ,Σ ), and the expected value of
Y is obtained by applying (2.56, AM 2005) to (2.113) and the covariance is obtained by applying (2.71,
AM 2005) to (2.117). 
E 61 – Marginal distribution of a uniform random variable on the unit sphere
(www.2.11)
Show that its marginal distribution of a uniform random variable on the unit sphere is not uniform.
Solution of E 61
In Fang et al. (1990, p.75), we find the expression of the marginal pdf of the last (N − K) entries of
(B.80, AM 2005) which reads:

N
! K2
Γ( N2+2 ) X
f (xK+1 , . . . , xN ) = N −K 1− x2n , (2.119)
Γ( K+2
2 )π
2
n=K+1

where:

N
X
x2n ≤ 1 . (2.120)
n=K+1

Therefore, the marginal distribution is not uniform.


Note. Expression (2.151, AM 2005) is a special case of (2.119), as follows immediately from (B.81, AM
2005) and (B.82, AM 2005). See also Fang et al. (1990, p.75). 
E 62 – Characteristic function of a multivariate normal random variable (www.2.12)
Show that the characteristic function of a multivariate normal random variable Y ∼ N(µ, Σ) is given by:

0 1 0
φY (ω) = eiµ ω− 2 ω Σω . (2.121)

Solution of E 62
Consider first a univariate standard normal variable X ∼ N(0, 1). Its characteristic function reads:

φ(ω) ≡ E{eiωX }
Z +∞
1 x2
=√ eiωx e− 2 dx
2π −∞
Z +∞
1 1 2
=√ e− 2 (x −2iωx) dx
2π −∞
Z +∞ (2.122)
1 2 2
e− 2 [(x−iω) +ω ] dx
1
=√
2π −∞
Z +∞
− 12 ω 2 1 1 2
=e √ e− 2 (x−iω) d(x − iω)
2π −∞
1 2
= e− 2 ω

Consider now a set of N independent standard normal variables X ≡ (X1 , . . . , Xn )0 . By definition, their
juxtaposition is a standard N -dimensional normal random vector:

X ∼ N(0, I) . (2.123)

Therefore:

n 0 o Y N N
Y 1 2 1 0
φ(ω) ≡ E eiω X = E eiωn Xn = e− 2 ωn = e− 2 ω ω .

(2.124)
n=1 n=1

With the transformation X 7→ Y ≡ µ + BX where BB0 ≡ Σ we obtain a generic multivariate normal


random vector Y ∼ N(µ, Σ) whose characteristic function is obtained by applying (2.36) to (2.124). 

E 63 – Characteristic function of a multivariate normal random variable


Shows that the characteristic function (2.157, AM 2005) of the multivariate normal random variable can
be written as:

 Z 
iµ0 ω 2
φN
µ,Σ (ω) = e exp − |ω 0 s| mΣ (s)ds . (2.125)
RN

Hint. Use |ω 0 s| = (ω 0 s)(s0 ω).


CHAPTER 2. MULTIVARIATE STATISTICS 37

Solution of E 63
First note that we have:

Z Z N 
0 1 X 
ss mΣ (s)ds ≡ ss0 δ (vn ) + δ (−vn ) (s)ds
RN 4 RN n=1
N
1 X 1 1 1 1 (2.126)
= vn vn0 = VV0 = EΛ 2 Λ 2 E0
2 n=1 2 2
1
= Σ.
2
Therefore:

Z Z
2
|ω 0 s| mΣ (s)ds = (ω 0 s)(s0 ω)mΣ (s)ds
RN RN
Z 
0 0 (2.127)
=ω ss mΣ (s)ds ω
RN
1 0
= ω Σω .
2
With this result, we have:

 Z 
0 2 0 1 0
eiµ ω exp − |ω 0 s| mΣ (s)ds = eiµ ω− 2 ω Σω ≡ φN
µ,Σ (ω) . (2.128)
RN


E 64 – Simulation of a multivariate normal random variable with matching mo-
ments **
Consider a multivariate normal market:

X ∼ N(µ, Σ) , (2.129)

where µ and Σ are arbitrary. Write a MATLAB R


script in which you generate a large number of scenar-
ios {Xj }j=1,...,J from the distribution (2.129) in such a way that the sample mean and covariance:

J J
1X b ≡ 1
X
b≡
µ Xj , Σ (Xj − µ)(Xj − µ)0 , (2.130)
J j=1 J j=1

satisfy:

b ≡ µ,
µ b ≡ Σ.
Σ (2.131)

Hint. At a certain point, you will need to solve a Riccati align, which can be solved as follows. First
define the Hamiltonian matrix
 
0 −Σb
H≡ . (2.132)
−Σ 0
Next perform its Schur decomposition:

H ≡ UTU0 , (2.133)
where UU0 ≡ I and T is upper triangular with the eigenvalues of H on the diagonal sorted in such a
way that the first N have negative real part and the remaining N have positive real part; the terms in this
decomposition are similar in nature to principal components and are computed by MATLAB R
. Then the
solution of the Riccati align (2.138) reads:

B ≡ ULL U−1
UL , (2.134)
where UU L is the upper left N × N block of U and ULL is the lower left N × N block of U.

Solution of E 64
First produce an auxiliary set of scenarios:

{Y
e j}
j=1,..., J (2.135)
2

from the distribution N(0, Σ). Then complement these scenarios with their opposite

(
ej ≡ Y
ej if 1 ≤ j ≤ J/2
Y (2.136)
−Ye J
j− if J/2 + 1 ≤ j ≤ J .
2

These antithetic variables still represent the distribution N(0, Σ), but they are more efficient as they satisfy
the zero-mean condition. Next apply a linear transformation to the scenarios Y e j , which again preserves
normality:

Yj ≡ BY
e j, j = 1, . . . , J . (2.137)
For any choice of the invertible matrix B, the sample mean is null. To determine B we impose that the
sample covariance matches the desired covariance. Using the affine equivariance of the sample covariance
which follows from (4.42, AM 2005), (4.36, AM 2005), (2.67, AM 2005) and (2.64, AM 2005), we obtain
the matrix Riccati align:

Σ ≡ BΣB,
b B ≡ B0 . (2.138)
With the solution (2.134) we can perform the affine transformation (2.137) and finally generate the desired
scenarios:

Xj ≡ µ + Yj , j = 1, . . . , J , (2.139)
which satisfy (2.131). See the MATLAB
R
function MvnRnd and the script S_ExactMeanAndCovariance for an
implementation of this methodology. 
CHAPTER 2. MULTIVARIATE STATISTICS 39

E 65 – Pdf of the copula of a bivariate normal random variable (www.2.12)


Show that the pdf of a bivariate normal distribution can be expressed as:

1
f N (u1 , u2 ) = p exp(gρ (u1 , u2 )) , (2.140)
1 − ρ2

where:

0 −1 !
erf −1 (2u1 − 1)
  
1 ρ 1 0
gρ (u1 , u2 ) ≡ − −
erf −1 (2u2 − 1) ρ 1 0 1
(2.141)
erf −1 (2u1 − 1)
 
.
erf −1 (2u2 − 1)

Solution of E 65
From (2.30, AM 2005), the pdf of the normal copula reads:

N
fµ,Σ (QN
µ1 ,σ 2
(u1 ), QN
µ2 ,σ 2
(u2 ))
f N (u1 , u2 ) = 1 2
, (2.142)
fµN1 ,σ2 (QN
µ1 ,σ 2
(u1 ))fµN2 ,σ2 (QN
µ2 ,σ 2
(u2 ))
1 1 2 2

where Q is the quantile (1.70, AM 2005) of the marginal one-dimensional normal distribution:


QN
µ,σ 2 (u) = µ + 2σ 2 erf −1 (2u − 1) . (2.143)
N
From the expression (2.170, AM 2005) of the two dimensional joint normal pdf fµ,Σ we obtain:

1
(σ12 σ22 (1 − ρ2 ))− 2 − 21 z1 −2ρz
2 2
1 z2 +z2
N
fµ,Σ (QN N
µ1 ,σ 2 (u1 ), Qµ2 ,σ 2 (u2 )) = e (1−ρ2 ) , (2.144)
1 2 2π
where:


zi ≡ 2 erf −1 (2ui − 1) (i = 1, 2) . (2.145)

On the other hand, from the expression (1.67, AM 2005) of the marginal pdf we obtain:

1 zi2
2 −2 −
fµNi ,σ2 (QN
µi ,σ 2 (ui )) = (2πσi ) e 2 . (2.146)
i i

Therefore:

1
f N (u1 , u2 ) = p exp(gρ (u1 , u2 )) , (2.147)
1 − ρ2

where:
0 −1 !
erf −1 (2u1 − 1)
  
1 ρ 1 0
gρ (u1 , u2 ) ≡ − −
erf −1 (2u2 − 1) ρ 1 0 1
(2.148)
erf −1 (2u1 − 1)
 
.
erf −1 (2u2 − 1)

E 66 – Lognormal random variable


Consider an N -variate lognormal random variable:

X ∼ LogN(µ, Σ) . (2.149)

Write a MATLAB R
function that computes m ≡ E {X}, S ≡ Cov {X} and C ≡ Corr {X} as functions
of the generic inputs µ, Σ.
Solution of E 66
See the MATLAB R
function LognormalParam2Statistics. 

E 67 – Pdf of the matrix-valued normal random variable (www.2.13) *


Show that the pdf of a matrix-valued normal random variable (2.81, AM 2005) can be expressed as
follows:

−1
−K −N (X−M)0 Σ−1
e− 2 tr{SK N (X−M)}
NK 1
f (X) ≡ (2π)− 2 |ΣN | 2
|SK | 2
. (2.150)

Solution of E 67
From the definition (2.180, AM 2005) and the definition of the normal pdf (2.156, AM 2005) we have:

f (X) ≡ f (vec(X))
NK − 12
≡ (2π)− 2 |SK ⊗ ΣN | (2.151)
− 12 (vec(X)−vec(M))0 (SK ⊗ΣN )−1 (vec(X)−vec(M))
×e .

From the property (A.102, AM 2005) of the Kronecker product we can write:

− 12 −N −K
|SK ⊗ ΣN | = |SK | 2
|ΣN | 2
. (2.152)

Furthermore, from the property (A.101, AM 2005) of the Kronecker product, we can write:

−1
(SK ⊗ ΣN )−1 = S−1
K ⊗ ΣN . (2.153)

Therefore (2.151) can be written as follows:

NK −N −K
f (X) = (2π)− 2 |SK | 2
|ΣN | 2

−1
(2.154)
0
⊗Σ−1
× e− 2 {(vec(X)−vec(M)) (SK N )(vec(X)−vec(M))}
1
.
CHAPTER 2. MULTIVARIATE STATISTICS 41

On the other hand, defining:

Y ≡ X − M, ΩN ≡ Σ−1
N , ΦK ≡ S−1
K , (2.155)

and recalling the definition (A.96, AM 2005) of the Kronecker product, and the definition (A.104, AM
2005) of the "vec" operator, the term in curly brackets in (2.154) can be written as follows:

{· · · } ≡ vec(Y)0 (ΦK ⊗ ΩN ) vec(Y)


Y(1)
  
Φ11 Ω · · · Φ1K Ω
(1) 0 (K) 0  .. .. .. ..
≡ (Y ···Y )
 
. . .  . 
ΦK1 Ω · · · ΦKK Ω (K)
Y
X 0
= Y(k) (Φkj Ω)Y(j)
k,j (2.156)
X
= Ynk Φkj Ωnm Ymj
n,m,k,j
X
= Ωmn Ynk Φkj Ymj
n,m,k,j

= tr {ΩYΦY0 } = tr {ΦY0 ΩY} .




E 68 – Covariance of a matrix-valued normal random variable (www.2.13) *


Given a matrix-valued normal random variable X with pdf (2.181, AM 2005), show that the matrix
ΣN defines the overall covariance structure between any two N -dimensional columns among the K that
constitute the random matrix X, and that SK defines the overall covariance structure between any two
K-dimensional rows among the N that constitute the random matrix X.
Solution of E 68
To prove the role of the matrices ΣN and SK , consider two generic N -dimensional columns X(j) and
X(k) among the K that compose the random matrix X. The (m, n)-entry of the N ×N covariance matrix
between the two columns X(j) and X(k) can be written as follows:

h n oi
Cov X(j) , X(k)

= Cov X(j−1)N +m , X(k−1)N +n
m,n
= (SK ⊗ ΣN )(j−1)N +m,(k−1)N +n
 
S11 Σ · · · S1K Σ (2.157)
=
 .. .. .. 
. . . 
SK1 Σ · · · SKK Σ (j−1)N +m,(k−1)N +n

= Sj,k Σm,n .

This proves that if X ∼ N(M, Σ, S) then:

n o
Cov X(j) , X(k) = Sj,k Σ . (2.158)

On the other hand, from the following identities:


−1
−K −N (X−M)0 Σ−1
e− 2 tr{SK N (X−M)}
NK 1
f (X) ≡ (2π)− 2 |ΣN | 2
|SK | 2

−1
(2.159)
−N −K (X−M)S−1 0
e− 2 tr{ΣN K (X−M) }
NK 1
= (2π)− 2 |SK | 2
|ΣN | 2
,

we see that if X ∼ N(M, Σ, S), then X0 ∼ N(M0 , S, Σ). Using (2.158) and the fact that the columns of
X0 are the rows of X we thus obtain:


Cov X(m) , X(n) = Σmn S . (2.160)

E 69 – Limit of the Student t distribution (www.2.14) *


Show that the Student t distribution yields the normal distribution when the degrees of freedom tend to
infinity. In other words, prove the following result:

St(∞, M, Σ, S) = N(M, Σ, S) , (2.161)

where the term on the left hand side is the matrix-variate Student t distribution (2.198, AM 2005) and the
term on the right hand side is the matrix-variate normal distribution (2.181, AM 2005).
Note. The above result immediately proves the specific vector-variate case. Indeed, from (2.183, AM
2005) and (2.201, AM 2005) we obtain:

St(∞, m, Σ) = St(∞, m, Σ, 1) = N(m, Σ, 1) = N(m, Σ) . (2.162)

In turn, since the vector-variate pdf (2.188, AM 2005) generalizes the one-dimensional pdf (1.86, AM
2005) we also obtain St(∞, m, σ 2 ) = N(m, σ 2 ).

Note. The generalization of the Student t distribution to matrix-variate random variables was studied by
Dickey (1967). Our definition of the pdf corresponds in the notation of Dickey (1967) to the following
special case:

p≡N, q ≡K, m≡ν+N, Q ≡ νS , P ≡ Σ−1 . (2.163)

If X ∼ St(ν, M, Σ, S) then:

E {X} = M
n o ν
Cov X(j) , X(k) = Sjk Σ (2.164)
ν−2
 ν
Cov X(m) , X(n) = Σmn S .
ν−2

Solution of E 69
To prove (2.161) we start using (A.122, AM 2005) in the definition (2.199, AM 2005) of the pdf of a
matrix-valued Student distribution St(ν, M, Σ, S). In the limit ν → ∞ we obtain:
CHAPTER 2. MULTIVARIATE STATISTICS 43

−1 − ν+N
2
−K −N IK + S−1 (X − M)0 Σ (X − M)

f (X) ≡ γ |Σ| 2
|S|2
ν
 − ν+N (2.165)
−K −N 1 −1 0 −1
2
≈ γ |Σ| 2
|S|2
1 + tr(S (X − M) Σ (X − M)) ,
ν
where γ is the normalization constant (2.200, AM 2005), which we report here:

NK Γ( ν+N
2 ) Γ(
ν−1+N
) Γ( ν−K+1+N )
γ(ν) ≡ (νπ)− 2
ν
2
ν−1 · · · 2
ν−K+1
. (2.166)
Γ( 2 ) Γ( 2 ) Γ( 2 )

Using the following limit (see e.g. Rudin, 1976):

 x n
ex = lim 1+ , (2.167)
n→∞ n
we can then write:

St −K −N
fν→∞,µ,Σ,S (X) ≈ γ |Σ| 2 |S| 2
 ν − 21
1 −1 0 −1 (2.168)
× 1 + tr(S (X − M) Σ (X − M))
ν
−K −N 1 −1
(X−M)0 Σ−1 (X−M))
≈ γ |Σ| 2
|S| 2
e− 2 tr(S .

Turning now to the normalization constant (2.166), the following approximation holds in the limit n →
∞, see e.g. www.mathworld.com:


 
1
Γ n+ ≈ nΓ(n) . (2.169)
2
Applying this result recursively we obtain in the limit n → ∞ the following approximation:


n+N
  n  N2 n
Γ ≈ Γ . (2.170)
2 2 2
Applying this to the normalization constant (2.166) we obtain in the limit ν → ∞ the following approxi-
mation:

 ν  N2   N2
− N2K ν−K +1
γ(ν → ∞) ≈ (νπ) ···
2 2
NK
 ν  N2K (2.171)
≈ (νπ)− 2
2
NK
= (2π)− 2 .

Thus in the limit ν → ∞ the pdf of the matrix-variate Student t distribution St(ν, M, Σ, S) reads:
h i
NK −K −N 1 −1
(X−M)0 Σ−1 (X−M))
St
fν→∞,µ,Σ,S (X) → (2π)− 2 |Σ| 2
|S| 2
e− 2 tr(S , (2.172)

which is the pdf of the matrix-variate normal distribution N(M, Σ, S). 

E 70 – Mode of a Cauchy random variable (www.2.15)


Show that for X ∼ Ca(µ, Σ), we have the following result:

Mod {X} = µ . (2.173)

Solution of E 70
The logarithm of the Cauchy pdf (2.209, AM 2005) reads:

N +1
Ca
ln fµ,Σ (x) = γ − ln(1 + (x − µ)0 Σ−1 (x − µ)) , (2.174)
2
where γ is a constant which does not depend on x. The first order derivative of the log pdf function reads:

Ca
∂ ln fµ,Σ (x) Σ−1 (x − µ)
= −(N + 1) . (2.175)
∂x 1 + (x − µ)0 Σ−1 (x − µ)
Setting this expression to zero we obtain the mode. 

E 71 – Modal dispersion of a Cauchy random variable (www.2.15)


Show that for X ∼ Ca(µ, Σ), we have the following result:

1
MDis {X} = Σ. (2.176)
N +1

Solution of E 71
The logarithm of the Cauchy pdf (2.209, AM 2005) reads:

N +1
Ca
ln fµ,Σ (x) = γ − ln(1 + (x − µ)0 Σ−1 (x − µ)) , (2.177)
2
where γ is a constant which does not depend on x. The Hessian of the log-Cauchy pdf reads:

∂ 2 ln fµ,Σ
Ca
(x) ∂ (x − µ)0 Σ−1
= − (N + 1)
∂x∂x0 ∂x 1 + (x − µ)0 Σ−1 (x − µ)
1 ∂ 
(x − µ)0 Σ−1

= − (N + 1) 0 −1
1 + (x − µ) Σ (x − µ) ∂x
 
∂ 1
− (N + 1) (x − µ)0 Σ−1 (2.178)
∂x 1 + (x − µ)0 Σ−1 (x − µ)
Σ−1
= − (N + 1)
1 + (x − µ)0 Σ−1 (x − µ)
2Σ−1 (x − µ)(x − µ)0 Σ−1
− (N + 1) − .
(1 + (x − µ)0 Σ−1 (x − µ))2
CHAPTER 2. MULTIVARIATE STATISTICS 45

Evaluating this expression at the mode (2.211, AM 2005) we obtain:


∂ 2 fµ,Σ
Ca
(x)
= −(N + 1)Σ−1 . (2.179)
∂x∂x0

x=Mod{X}

Therefore the modal dispersion (2.65, AM 2005) reads:

 −1
∂ 2 fµ,Σ
Ca
(x) 1
MDis {X} ≡ −   = Σ. (2.180)
∂x∂x0 N +1

x=Mod{X}

E 72 – Pdf of a log-variable (www.2.16)


Assume the distribution of the random variable X is known and is represented by its pdf fX . Consider a
random variable Y defined as follows:

Y ≡ eX , (2.181)

where the exponential is defined component-wise. Show that the pdf of the log distribution reads:

fX (ln(Y))
fY (Y) = QN , (2.182)
n=1 yn

and find the expression for the special case of a lognormal pdf, i.e. when X ∼ N(µ, Σ).
Solution of E 72
This is a transformation g of the form (2.7), which reads component-wise as follows:

gn (x1 , . . . , xN ) ≡ exn . (2.183)

The inverse transformation g−1 reads component-wise:

gn−1 (y1 , . . . , yN ) ≡ ln(yn ) . (2.184)

The Jacobian (2.9) reads:

Jg = diag(ex1 , . . . , exN ) , (2.185)

and thus from (A.42, AM 2005) its determinant reads:

N
Y
g
|J | = exn . (2.186)
n=1

We have to evaluate (2.186) in x = g−1 (y). Therefore from (2.184) we obtain:


N
g −1 Y
J (g (y)) = yn , (2.187)
n=1

and the expression (2.182) follows. In particular, for a lognormal distribution, from (2.156, AM 2005)
and (2.182) we have:

N − 12
LogN (2π)− 2 |Σ| 1 0 −1
fµ,Σ (y) = QN e− 2 (ln(y)−µ) Σ (ln(y)−µ)
. (2.188)
n=1 yn

E 73 – Raw moments of a log-variable (www.2.16)


Determine the raw moments of a log-variable Y ≡ eX in terms of the characteristic function φX of X.
In particular, determine the expression for the lognormal distribution and its first two raw moments.
Solution of E 73

RMY
n1 ···nk ≡ E {Yn1 · · · Ynk }

= E eXn1 · · · eXnk

(2.189)
= E eXn1 +···+Xnk


= E exp(iω 0n1 ···nk X) ,




where the vector ω is defined in terms of the canonical basis (A.15, AM 2005) as follows:

1  (n1 ) 
ω n1 ···nk ≡ δ + · · · + δ (nk ) . (2.190)
i
Comparing with (2.13, AM 2005), we realize that the last term in (2.189) is the characteristic function of
X. Therefore we obtain:

RMY
n1 ···nk = φX (ω n1 ···nk ) . (2.191)

From (2.157, AM 2005) and (2.191) we obtain the expression of the raw moments of the lognormal
distribution:

0 (n1 )
+···+δ (nk ) )
RMY
n1 ···nk = e
µ (δ
(2.192)
1 (n1 )
+···+δ (nk ) )0 Σ(δ (n1 ) +···+δ (nk ) )
× e 2 (δ .
In particular the expected value, which is the first raw moment, reads:

Σnn
E {Yn } = RMY
n =e
µn + 2 . (2.193)

The second raw moment reads:

Σmm
+ Σnn
E {Ym Yn } = RMY
mn = e
µm +µn + 2 2 +Σmn . (2.194)
CHAPTER 2. MULTIVARIATE STATISTICS 47

Therefore the covariance matrix reads:

Cov {Xm , Xn } = E {Ym Yn } − E {Ym } E {Yn }


Σmm
+ Σnn
(2.195)
= eµm +µn + 2 2 (eΣmn − 1) .

E 74 – Relation between the Wishart and the gamma distributions (www.2.17)


Given W ∼ W(ν, Σ), a Wishart distributed variable as in (2.223, AM 2005) and a generic vector a, show
that:

a0 Wa ∼ Ga(ν, a0 Σa) . (2.196)

Solution of E 74
If W is Wishart distributed then from (2.222, AM 2005) for any conformable matrix A we have:

AWA0 = AX1 X01 A0 + · · · + AXν X0ν A0


= Y10 Y10 + · · · + Yν Yν0 (2.197)
0
∼ W(ν, AΣA ) ,

since:

Yt ≡ AXt ∼ N(0, AΣA0 ) . (2.198)

In particular, we can reconcile the multivariate Wishart with the one-dimensional gamma distribution by
choosing A ≡ a0 , a row vector. In that case each term in the sum is normally distributed as follows:

Yt ≡ a0 Xt ∼ N(0, a0 Σa) . (2.199)

Therefore from (1.106, AM 2005):

a0 Wa ∼ Ga(ν, a0 Σa) . (2.200)

E 75 – Simulation of a Wishart random variable


Consider the bivariate Wishart random variable W ∼ W(ν, Σ) where:

σ12
 
ρσ1 σ2
Σ≡ . (2.201)
ρσ1 σ2 σ22

Fix σ1 ≡ 1 and σ2 ≡ 1 and write a MATLAB R


script in which you:
• Set the inputs ρ and ν;
• Generate a sample of size J ≡ 10,000 from W(ν, Σ) using the equivalent stochastic representation
(2.222, AM 2005);
• Plot the histograms of the realizations of D ≡ det(W) and T ≡ tr(W) to show that indeed these
random variables are positive, see (2.236, AM 2005) and (2.237, AM 2005). Comment on whether
this is also true for ν ≡ 1;
• Plot the 3D scatter-plot of the realizations of W11 vs. W12 vs. W22 to show the Wishart cloud.
Note that symmetry implies that a matrix is fully determined by the three non-redundant entries
(W11 , W22 , W12 ) and notice that as the degrees of freedom ν increases the clouds becomes less
and less "wedgy". Eventually, it becomes a normal ellipsoid, in accordance with the central limit
theorem;
• Plot the separate histograms of the realizations of W11 , W12 and W22 ;
• Superimpose the rescaled pdf (1.110, AM 2005) of the marginals of W11 and W22 to the respective
histograms to show that histogram and gamma pdf coincide. Indeed, from (2.230, AM 2005) the
marginal distributions of the diagonal elements of a Wishart matrix are gamma-distributed:

Wnn ∼ Ga(ν, Σnn ) ; (2.202)

• Compute and show on the command window the sample means, sample covariances, sample stan-
dard deviations and sample correlations;
• Compute and show on the command window the respective analytical results (2.227, AM 2005)
and (2.228, AM 2005), making sure that they coincide.
Solution of E 75
See the MATLAB R
script S_Wishart. 

E 76 – Pdf of an inverse-Wishart random variable (www.2.17)


Show that the pdf of the inverse-Wishart distribution reads:

1 ν
− ν+N +1 1 −1
IW
fν,Ψ (Z) = |Ψ| 2 |Z| 2
e− 2 tr(ΨZ ) . (2.203)
κ

Solution of E 76
If Z has an inverse-Wishart distribution:

Z ∼ IW(ν, Ψ) , (2.204)

then by definition Z ≡ g(W) ≡ W−1 where W ∼ W(ν, Ψ−1 ). Then, from (2.13):

W −1
IW
fν,Ψ−1 (g (Z))
fν,Ψ (Z) = q . (2.205)
2
|Jg (g−1 (Z))|

Using the following result in Magnus and Neudecker (1999) that applies to any invertible N × N matrix
Q:

∂Q−1

N (N +1)
−(N +1)
∂Q = (−1)
2 |Q| , (2.206)

we derive:
CHAPTER 2. MULTIVARIATE STATISTICS 49

IW −(N +1)W −1
fν,Ψ (Z) = |Z| fν,Ψ−1 (Z )
−(N +1) 1 − ν ν−N −1
Ψ−1 2 Z−1 2 e− 12 tr(ΨZ−1 )

= |Z| (2.207)
κ
1 ν
− ν+N +1 1 −1
= |Ψ| |Z|
2 2
e− 2 tr(ΨZ ) .
κ


E 77 – Characteristic function of the empirical distribution


Derive expression (2.243, AM 2005) for the characteristic function of the empirical distribution.
Solution of E 77
n 0 o Z 0
φiT (ω) ≡ E eiω X = eiω x fiT (x)dx
R N

Z " T
#
iω x 1
0 X
(xt )
= e δ (x) dx (2.208)
RN T t=1
T Z
1X 0
= eiω x δ (xt ) (x)dx .
T t=1 RN

Using (B.17, AM 2005) we obtain:

T
1 X iω0 xt
φiT (ω) = e . (2.209)
T t=1

E 78 – Order statistics
Replicate the exercise of the MATLAB R
script S_OrderStatisticsPdfStudentT assuming that the i.i.d.
variables are lognormal instead of Student t distributed.
Solution of E 78
See the MATLAB R
script S_OrderStatisticsPdfLognormal. 

E 79 – Pdf of an elliptical random variable (www.2.18) *


Show that the pdf of an elliptical random variable is of the form:

1
g Ma2 (x, µ, Σ) ,
 
fµ,Σ (x) = p (2.210)
|Σ|
where g is any positive function that satisfies:

Z ∞
N −2
y 2 g(y)dy < ∞ . (2.211)
0

Hint. See Fang et al. (1990, p.35).


Solution of E 79
The family of ellipsoids centered in µ with shape Σ are described by the following implicit aligns:

Ma(x, µ, Σ) = u , (2.212)

where Ma is the Mahalanobis distance of the point x from µ through the metric Σ, as defined in (2.61,
AM 2005) and u ∈ (0, ∞), see (A.73, AM 2005). If the pdf fX is constant on those ellipsoids then it
must be of the form:

fµ,Σ (x) = h Ma2 (x, µ, Σ) ,


 
(2.213)

where h is a positive function, such that the normalization condition is satisfied, i.e.:

Z
h Ma2 (x, µ, Σ) dx = 1 .
 
(2.214)
RN

Suppose we have determined such a function h. From (2.32), changing µ into a generic parameter µ e
does not affect the normalization condition, and therefore the ensuing pdf is still the pdf of an elliptical
distribution centered in µ
e . On the other hand, if we change Σ into a generic dispersion parameter Σ, e in
order to preserve the normalization condition we have to rescale (2.213) accordingly:

v
u
u Σ
e
t h 2 i
fµ,
e Σ (x) = h Ma (x, µ
e , Σ)
e . (2.215)
|Σ|
e

Therefore, it is more convenient to replace (2.213) with the following specification:

1
g Ma2 (x, µ, Σ) ,
 
fµ,Σ (x) = p (2.216)
|Σ|
in such a way that the same functional form g is viable for any location and dispersion parameters (µ, Σ).


E 80 – Moments of an elliptical random variable (www.2.18)


Consider a generic elliptical random variable X with location parameter µ and scatter parameter Σ. Show
the that the following relations hold:

E {X} = µ
E{R2 } (2.217)
Cov {X} = Σ,
N
where R is defined in (2.260, AM 2005).
Solution of E 80
First we follow Fang et al. (1990) to compute the moments of a random variable U uniformly distributed
on the surface of the unit ball. Consider a standard multivariate normal variable:

X ∼ N(0, IN ) . (2.218)
CHAPTER 2. MULTIVARIATE STATISTICS 51

We can write X = kXk U and from (2.259, AM 2005) we have that kXk and U ≡ X/ kXk are
independent and U is uniformly distributed on the surface of the unit ball. Then:

(N ) (N )
Y Y
E Xi2si =E (kXk Ui ) 2si

i=1 i=1
( N
! N
!)
Y 2si
Y
=E kXk Ui2si (2.219)
i=1 i=1
(N )
n o Y
2s 2si
= E kXk E Ui ,
i=1

PN
where s ≡ i=1 si . Thus:

(N ) QN
E Xi2si

Y
E Ui2si = i=1
n o . (2.220)
2s
i=1 E kXk

On the other hand, for a standard normal variable Xi we have:

(2si )!
E Xi2si = si ,

(2.221)
2 si !
see e.g. www.mathworld.com and references therein. For a standard multivariate normal variable X we
have:

n o
2s
= E (X12 + · · · + XN
2 s
) ≡ E {Y s } ,

E kXk (2.222)

where Y ∼ χ2N . Therefore from (1.109, AM 2005) we see that (2.222) is the s-th raw moment of a chi-
square distribution with N degrees of freedom and thus, see e.g. www.mathworld.com and references
therein, we have:

n o Γ( N + s)2s
2s 2
E kXk = . (2.223)
Γ( N2 )

From (B.82, AM 2005) we have:

    √
N N + 2s (N + 2s − 2)(N + 2(s − 1)) · · · n0 π
Γ +s =Γ = N +2s−1 , (2.224)
2 2 2 2
where n0 ≡ 1 is n is odd and n0 ≡ 2 if n is even. Defining:

x[s] ≡ x(x + 1) · · · (x + s − 1) , (2.225)

we can write (2.223) as follows:


n o
2s
E kXk = (N + 2(s − 1)) · · · (N + 2)N
   
N N N
= 2s + (s − 1) · · · +1 (2.226)
2 2 2
 [s]
N
= 2s .
2

Substituting (2.221) and (2.226) in (2.220) we obtain:

(N ) N
Y 1 Y (2si )!
E Ui2si = , (2.227)
i=1
( N2 )[s] i=1 4si si !

which is Fang et al. (1990, formula 3.6). In particular:

E {U} = 0 , (2.228)

and

IN
Cov {U} = , (2.229)
N
where IN is the N ×N identity matrix. Consider now a generic elliptical random variable X with location
parameter µ and scatter parameter Σ. To compute its central moments we write:

X ≡ µ + RAU , (2.230)

where:

AA0 ≡ Σ
A−1 (X − µ)
U≡ (2.231)
kA−1 (X − µ)k
−1
R ≡ A (X − µ) .

From (2.259, AM 2005)-(2.260, AM 2005), R is independent of U, which is uniformly distributed on the


surface of the unit ball. Using (2.228) we obtain:

E {X} = E {µ + RAU} = µ + E {R} A E {U} = µ . (2.232)

Using (2.93, AM 2005) we obtain:


CHAPTER 2. MULTIVARIATE STATISTICS 53

CMX µ+RAU ARU


m1 ···mk = CMm1 ···mk = CMm1 ···mk
N
X
= Am1 n1 · · · Amk nk CMRU
m1 ···mk
n1 ,...,nk =1
N
X
= Am1 n1 · · · Amk nk RMRU
m1 ···mk
n1 ,...,nk =1 (2.233)
N
X
= Am1 n1 · · · Amk nk E {RUn1 · · · RUnk }
n1 ,...,nk =1
N
X
= E Rk

Am1 n1 · · · Amk nk E {Un1 · · · Unk } .
n1 ,...,nk =1

Substituting (2.227) in (2.233) yields the desired result. 

E 81 – Radial-uniform representation
Write a MATLAB R
script in which you:
• Generate a non-trivial 30 × 30 symmetric and positive matrix Σ and a 30-dim vector µ;
• Generate J ≡ 10,000 simulations from a 30-dimensional elliptical random variable:

X ≡ µ + RAU . (2.234)

In this expression µ, R, A, U are the terms of the radial-uniform decomposition, see (2.259, AM
2005). In particular, set:

R ∼ LogN(ν, τ 2 ) , (2.235)

where ν ≡ 0.1 and τ 2 ≡ 0.04.


Solution of E 81
See the MATLAB R
script S_EllipticalNDim. 

E 82 – Elliptical markets and portfolios


Consider an elliptical market M ∼ El(µ, Σ, gN ) together with the objective Ψa ≡ a0 M, where a is a
generic vector of exposures. Prove that:

d
Ψa = µa + σa Z , Z ∼ El(0, 1, g1 ) , (2.236)

and write the expression for µa and σa .


Solution of E 82
From (2.270, AM 2005) we obtain:

Ψa ∼ El(µa , σa2 , g1 ) , (2.237)

where µa ≡ a0 µ and σa2 ≡ a0 Σa. From (2.258, AM 2005):


d
Ψa = µa + σa Z , (2.238)
where Z is spherically symmetrical and therefore Z ∼ El(0, 1, g1 ). 

E 83 – Generalized function m (www.2.19)


Show that mΣ in (2.291, AM 2005) satisfies (2.283, AM 2005) and (2.284, AM 2005).
Solution of E 83
First, note that the vectors v(n) and their opposite belong to the surface of the ellipsoid centered at zero
with shape parameter Σ in (A.73, AM 2005). Indeed:

h i0 h i h i0 h i
±v(m) Σ−1 ±v(n) = v(m) Σ−1 v(n)
= V0 Σ−1 V mn
 
h 1 1 1 1
i (2.239)
= (Λ 2 E0 )EΛ− 2 Λ− 2 E0 (EΛ 2 )
mn
= [I]mn .
Thus, in particular:

h i0 h i
±v(n) Σ−1 ±v(n) = 1 . (2.240)

Due to (2.240), mΣ satisfies (2.284, AM 2005) and thus it is defined on the surface of the ellipsoid. Also,
it trivially satisfies (2.283, AM 2005) and thus it is symmetrical. 

E 84 – Correlation in normal markets


Consider a bivariate normal random variable:

σ12
     
X1 µ1 ρσ1 σ2
∼N ,S ≡ . (2.241)
X2 µ2 ρσ1 σ2 σ22
Fix µ1 ≡ 0, µ2 ≡ 0, σ1 ≡ 1, σ2 ≡ 1 and write a MATLAB R
script in which you:
• Plot the correlation between X1 and X2 as a function of ρ ∈ (−1, 1);
• Use eig to plot as a function of ρ ∈ (−1, 1) the condition ratio of S, i.e. the ratio of the smallest
eigenvalue of S over its largest eigenvalue:
CR(S) ≡ λ2 /λ1 . (2.242)

Hint. Remember the relationship between eigenvalues and ellipsoid.

Solution of E 84
See the MATLAB R
script S_AnalyzeNormalCorrelation. 

E 85 – Correlation in lognormal markets


Consider the bivariate lognormal variable:

σ12
     
X1 µ1 ρσ1 σ2
∼ LogN , . (2.243)
X2 µ2 ρσ1 σ2 σ22
Fix µ1 ≡ 0, µ2 ≡ 0, σ1 ≡ 1, σ2 ≡ 1 and write a MATLAB
R
script in which you:
CHAPTER 2. MULTIVARIATE STATISTICS 55

• Rely on the MATLAB R


function LogNormalParam2Statistics to plot the correlation between X1
and X2 as a function of ρ ∈ (−1, 1) (notice that the correlation will not approach −1, why?);
• Use eig to plot as a function of ρ ∈ (−1, 1), the condition ratio of S, i.e. the ratio of the smallest
eigenvalue of S over its largest eigenvalue:

CR(S) ≡ λ2 /λ1 . (2.244)

Hint. Remember the relationship between eigenvalues and ellipsoid.

Solution of E 85
See the MATLAB R
script S_AnalyzeLognormalCorrelation. 

E 86 – Independence versus no correlation


Consider a random vector X ≡ (X1 . . . , XT )0 that is Student t distributed:

X ∼ St(ν, 0T , IT ) , (2.245)

where 0T is a T -dimensional vector of zeros and IT is the T × T identity matrix.


• Compute the distribution of the marginals Xt , t = 1, . . . , T , the correlation among each pair of
entries and the distribution of:

T
X
Y ≡ Xt . (2.246)
t=1

• Then consider T i.i.d. Student t-distributed random variables:

et ∼ St(ν, 0, 1),
X t = 1, . . . , T , (2.247)

and compute the correlation among each pair of entries.


• Finally, consider the limit T → ∞ and compute the distribution of:

T
X
Ye ≡ X
et , (2.248)
t=1

and comment on the difference between the distribution of Y versus the distribution of Ye .
Solution of E 86
From (2.194, AM 2005) the marginals read:

Xt ∼ St(ν, 0, 1), t = 1, . . . , T . (2.249)

From (2.191, AM 2005) the cross-correlations read:

Corr {Xt , Xs } = 0, t 6= s . (2.250)

From (2.195, AM 2005) we obtain:


T
X
Y ≡ Xt = 10 X ∼ St(ν, 10 0T , 10 IT 1) . (2.251)
t=1

Therefore:

Y ∼ St(ν, 0, T ) . (2.252)

As far as X
e is concerned, from (2.136, AM 2005) the cross-correlations read:

n o
Corr Xet , X
es = 0, t 6= s . (2.253)

From the central limit theorem and (1.90, AM 2005) (fix the typo with the online "Errata" at www.
symmys.com) we obtain:

 
ν
Y → N 0,
e T . (2.254)
ν−2

Both Y and Ye are the sum of uncorrelated identically distributed t variables. If the variables are indepen-
dent, the CLT kicks in and the sum becomes normal.
Note. This only holds for ν > 2, otherwise the variance is not defined and the CLT does not hold. Indeed,
if ν = 1 we obtain the Cauchy distribution, which is stable: the sum of i.i.d. Cauchy variables is Cauchy.
If the variables are jointly Student t, they cannot be independent, even if they are uncorrelated, recall the
plot of the pdf of the Student t copula. 

E 87 – Correlation and location-dispersion ellipsoid (see E 75)


Consider the same setup than in E 75. Consider the first diagonal entry and the off-diagonal entry
(W11 , W12 ). Define the following two rescaled variables:

W11 − E {W11 }
X1 ≡ (2.255)
Sd {W11 }
W12 − E {W12 }
X2 ≡ . (2.256)
Sd {W12 }

Write a MATLAB R
script in which you:
• Simulate and scatter-plot a large number of joint samples of X ≡ (X1 , X2 )0 ;
• Superimpose to the above scatter-plot the plot of the location-dispersion ellipsoid of these variables.
In order to do so, feed the MATLAB R
function TwoDimEllipsoid with the real inputs E {X} and
Cov {X} as they follow from the analytical results (2.227, AM 2005) and (2.228, AM 2005), do
not use the sample estimates from the simulations. Make sure that the ellipsoid suitably fits the
simulation cloud;
• Fix ν ≡ 15 and σ1 ≡ σ2 ≡ 1 in (2.201) and plot the correlation Corr {X1 , X2 } as a function of
ρ ∈ (−1, +1). (Compare with the result of the previous point, which is a geometrical representation
of the correlation.)
CHAPTER 2. MULTIVARIATE STATISTICS 57

Hint. The correlation can be computed analytically.

Solution of E 87

Corr {X1 , X2 } = Cov {X1 , X2 }


1
=p p Cov {W11 , W12 }
Var {W11 } Var {W12 }
1 (2.257)
=p 2
p ν(Σ11 Σ12 + Σ12 Σ11 )
ν2Σ11 ν(Σ11 Σ22 + Σ12 Σ21 )


=p .
1 + ρ2

For the MATLAB


R
scripts, see S_WishartLocationDispersion and S_WishartCorrelation. 

E 88 – Copula vs. correlation


Consider a generic N -variate Student t random variable X ∼ St(ν, µ, Σ). First, write a MATLAB R

function which takes as inputs a generic value u in the N -dimensional unit hypercube as well as the
parameters ν, µ and Σ and outputs the pdf of the copula of X in u.
Hint. Use (2.30, AM 2005) and (2.188, AM 2005) and the built-in functions tpdf and tinv. Notice that
you will have to re-scale the built-in pdf and the built-in quantile of the standard t distribution.
Then, write a MATLAB R
script where you call the above function to evaluate the copula pdf at a select
grid of bivariate values:

u ∈ G ≡ [0.05 : 0.05 : 0.95] × [0.05 : 0.05 : 0.95] . (2.258)

In a separate figure, plot the ensuing surface. Comment on the (dis)similarities with the normal copula
when ν ≡ 200 and comment on the (dis)similarities with the normal copula when ν ≡ 1 and Σ12 ≡ 0.
What is the correlation in this case?
Solution of E 88
From (2.191, AM 2005), when the off-diagonal entries are null, the marginals are uncorrelated, if the
correlation is defined, which is true only for ν > 2 (see fix in the Errata). Therefore, for ν > 2 null
correlation does not imply independence, because the pdf is clearly not flat as ν → 2. For ν ≤ 2 the
correlation simply does not exist. However the co-scatter parameter Σ12 can be set to zero, but this does
not imply independence because, again, the pdf is far from flat as ν ≤ 2. For the implementation, see the
MATLAB R
function StudentTCopulaPdf and the script S_DisplayStudentTCopulaPdf. 

E 89 – Full co-dependence
Write a MATLAB R
script in which you generate J ≡ 10,000 joint simulations for an 10-variate random
variable X in such a way that each marginal is gamma-distributed, Xn ∼ Ga(n, 1), n = 1, . . . , 10, and
such that each two entries are fully codependent, i.e. the cdf of their copula is (2.106, AM 2005).
Hint. Use (2.34, AM 2005).

Solution of E 89
See the MATLAB R
script S_FullCodependence. 
Chapter 3

Modeling the market

E 90 – Approximation of the ATMF implied volatility (www.3.1)


Prove the following approximation for the ATMF implied volatility:

r (K ,E)
(Kt ,E) 2π Ct t
σt ≈ . (3.1)
E − t Ut

Hint. Using the following Maple command: taylor(RootOf(erf(y) = x, y), x = 0, 3); we can perform a
third-order Taylor expansion of the inverse error function:

π 1/2 π 3/2 3
erf −1 (x) = x+ x + ··· . (3.2)
2 24
(Kt ,E)
Ct
Moreover, since the term Ut is of the order of a few percentage points, you can stop at the first order.

Solution of E 90
Substituting the definition (3.48, AM 2005) of the ATMF strike in the Black-Scholes pricing formula
(3.41, AM 2005) we obtain:

(Kt ,E) (E) (K,E)


Ct = C BS (E − t, Kt , Ut , Zt , σt )
 √ 
1 E − t (K,E)
= Ut 1 + erf σt
2 2
  √  (3.3)
1 E − t (K,E)
− Ut 1 + erf − σt
2 2
 √ 
E − t (K,E)
= Ut erf √ σt .
8
Therefore:

!
r (Kt ,E)
(K ,E) 8 Ct
σt t = erf −1 , (3.4)
E−t Ut

58
CHAPTER 3. MODELING THE MARKET 59

and using the fact that the term in the argument of the inverse error function in (3.4) is of the order of a
few percentage points, we can use the Taylor expansion at the first order, and the approximation follows.


E 91 – Distribution of the sum of independent variables (www.3.2)


Show that the pdf of the sum of two independent variables XA and XB is the convolution of the marginal
pdfs fXA and fXB :

fXA +XB = fXA ∗ fXB . (3.5)

Note. Repeating the argument in (3.7) we obtain that the sum of any number of independent and identi-
cally distributed random variables reads:

fX1 +···+XT = fX ∗ · · · ∗ fX , (3.6)

where fX is the common pdf of each generic variable Xt .

Solution of E 91
Consider two variables XA and XB whose joint pdf is fXA ,XB . Consider now Y, the sum of these
variables. The pdf of the sum is:

Z
fY (y) = fXA +XB (y) = fXA ,XB (y − x, x)dx , (3.7)
R

which follows from:

fY (y)dy = P {Y ∈ [y, y + dy]} = P {XA + XB ∈ [y, y + dy]}


= P {XA ∈ [y − XB , y − XB + dy]}
Z  (3.8)
= fXA ,XB (y − xB , xB )dxB dy .
R

If the variables X and Y are independent, the joint pdf is the product of the marginal pdf:

fXA ,XB (xA , xB ) = fXA (xA )fXB (xB ) . (3.9)

Therefore the pdf of the sum (3.7) becomes:

Z
fXA +XB (y) = fXA (y − x)fXB (x)dx . (3.10)
R

We see that this is the convolution (B.43, AM 2005) of the marginal pdf:

fXA +XB = fXA ∗ fXB . (3.11)


E 92 – Investment-horizon characteristic function (www.3.2)
Show that the investment-horizon characteristic function is simply a power of the estimated characteristic
function:

φX1 +···+XT (ω) = (φX (ω))T . (3.12)

Note. This result is not surprising. Indeed, we recall from (2.14, AM 2005) that the characteristic function
of a distribution is the Fourier transform (B.45, AM 2005) of the pdf of that distribution. Therefore:

φX1 +···+XT = F [fX1 +···+XT ] , (3.13)

and using the the expression of the pdf of the sum (3.6) and the relation between convolution and the
Fourier transform (B.45, AM 2005) we obtain:

φX1 +···+XT = F [fX ∗ · · · ∗ fX ] = (F [fX ])T = (φX (ω))T , (3.14)

which is again (3.12).

Note. Formula (3.12) also provides a faster way to compute the pdf. Indeed we only need to apply once
the inverse Fourier transform F −1 as defined in (B.40, AM 2005), if the distribution of X is known
through its characteristic function:

fX1 +···+XT = F −1 (φX (ω))T .


 
(3.15)

In case the distribution of X is known through its pdf we only need to apply once the inverse Fourier
transform F −1 and once the Fourier transform F:

fX1 +···+XT = F −1 (F [fX ])T .


 
(3.16)

Solution of E 92
Using the factorization (2.48, AM 2005) of the characteristic function of independent variables we obtain:

n 0 o
φX1 +···+XT (ω) ≡ E eiω (X1 +···+XT )
n 0 0
o
= E eiω X1 · · · eiω XT (3.17)
n 0 o n 0 o
= E eiω X1 · · · E eiω XT .

Therefore:

φX1 +···+XT (ω) = (φX (ω))T , (3.18)

where φX is the common characteristic function of each generic variable Xt . 


CHAPTER 3. MODELING THE MARKET 61

E 93 – The square-root rule for the expectation (www.3.3)


Prove the "square-root rule" for the expectation:

τ
E {XT,τ } = E {XT,eτ } . (3.19)
τe

Hint. Use the characteristic function.

Note. The statement in Meucci (2005, p.125): "More in general, a multiplicative relation such as (3.19)
or (3.25) holds for all the raw moments and all the central moments, when they are defined" is incorrect:
it only holds for the expected value and the covariance.

Solution of E 93
We recall from (3.64, AM 2005) the relation between the investment-horizon characteristic function and
the estimation interval characteristic function:

τ
φXT ,τ = (φXT ,τe ) τe . (3.20)

The first derivative of the characteristic function reads:

τ 
∂φXT ,τ (ω) ∂ φXT ,τe (ω) τe
=
∂ω ∂ω (3.21)
τ τ ∂φXT ,τe (ω)
= (φXT ,τe (ω)) τe −1 .
τe ∂ω
From (2.98), evaluating this derivatives at the origin and using the fact that:

n 0 o
φX (0) ≡ E eiX 0 = 1 , (3.22)

we obtain for the first raw moment:

∂φXT ,τe (0)


 
∂φXT ,τ (0) τ
E {XT,τ } = −i = −i . (3.23)
∂ω τe ∂ω

Using again (2.98) in (3.23) we obtain:

τ
E {XT,τ } = E {XT,eτ } . (3.24)
τe


E 94 – The square-root rule for the covariance (www.3.3)


Prove the "square-root rule" for the covariance:

τ
Cov {XT,τ } = (Cov {XT,eτ }) . (3.25)
τe
Hint. Use the characteristic function.

Note. The statement in Meucci (2005, p.125): "More in general, a multiplicative relation such as (3.19)
or (3.25) holds for all the raw moments and all the central moments, when they are defined" is incorrect:
it only holds for the expected value and the covariance.

Solution of E 94
We recall from (3.64, AM 2005) the relation between the investment-horizon characteristic function and
the estimation interval characteristic function:

τ
φXT ,τ = (φXT ,τe ) τe . (3.26)

The second derivative of the characteristic function reads:

∂ 2 φXT ,τ (ω) −1 ∂φXT ,τe (ω)


 
∂ τ τ
= (φXT ,τe (ω)) τ
e
∂ω∂ω 0 ∂ω τe ∂ω 0
τ τ  τ ∂φXT ,τe (ω) ∂φXT ,τe (ω) (3.27)
= − 1 (φXT ,τe (ω)) τe −2
τe τe ∂ω ∂ω 0
τ τ ∂φ XT ,τe (ω)
+ (φXT ,τe (ω)) τe −1 .
τe ∂ω∂ω 0
From (2.98), evaluating these derivatives at the origin and using the fact that:

n 0 o
φX (0) ≡ E eiX 0 = 1 , (3.28)

we obtain the second raw moment:

∂ 2 φXT ,τ (0)
E XT,τ X0T,τ = −

∂ω∂ω 0 (3.29)
 ∂φ
τ τ XT ,τe (0) ∂φXT ,τe (0) τ ∂φXT ,τe (0)

=− −1 0
− .
τe τe ∂ω ∂ω τe ∂ω∂ω 0
Therefore for the covariance we obtain:

0
Cov {XT,τ } = E XT,τ X0T,τ − E {XT,τ } E {XT,τ }

 ∂φ
τ τ XT ,τe (0) ∂φXT ,τe (0)
= − −1
τe τe ∂ω ∂ω 0
τ ∂φXT ,τe (0)  τ 2 ∂φXT ,τe (0) ∂φXT ,τe (0)
− 0
+ 0 (3.30)
τe ∂ω∂ω τe ∂ω ∂ω
τ ∂φXT ,τe (0) ∂φXT ,τe (0) ∂φXT ,τe (0)

= −
τe ∂ω ∂ω 0 ∂ω∂ω 0
∂φXT ,τe (0) ∂φXT ,τe (0) ∂φXT ,τe (0)
     
τ
= − −i −i + − .
τe ∂ω ∂ω 0 ∂ω∂ω 0

Using again (2.98) in (3.30) we obtain:


CHAPTER 3. MODELING THE MARKET 63

τ 0
− E {XT,eτ } E {XT,eτ } + E XT,eτ X0T,eτ
 
Cov {XT,τ } =
τe (3.31)
τ
= (Cov {XT,eτ }) .
τe


E 95 – Multivariate square-root rule


Write a MATLAB R
script in which you:
• Scatter-plot the differences over a time τe = one day of the two-year versus the ten-year point of the
swap curve from the database DB_Swaps;
• Compute the sample covariance Σ e between these two series;
• Represent geometrically Σ e by means of its location dispersion ellipsoid;
• Consider the empirical covariance Σ at different horizons of τ = one week and τ = one month
respectively;
• Represent all of these covariances by means of their location-dispersion ellipsoids, which we plot
in the figure as solid red lines;
• Compare these ellipsoids with the suitable multiple Στ e /eτ as in (3.76, AM 2005) of the daily
ellipsoid, which we plot as dashed ellipsoids;
• See from the figure that the solid and the dashed ellipsoids are comparable and thus the swap rate
changes are approximately invariants: the volatilities increase according to the square-root rule and
the correlation is approximately constant.
Solution of E 95
See the MATLAB R
script S_MultiVarSqrRootRule. 

E 96 – Projection of Cauchy invariants


Assume that the distribution of the market invariants at the estimation horizon τe is multivariate Cauchy:

Xτe ∼ Ca(µ, Σ) . (3.32)


Assume that the invariants satisfy the accordion property (3.60, AM 2005). Prove that the distribution
of the market invariants at any generic investment horizon τ is Cauchy. Draw your conclusions on the
propagation law of risk in terms of the modal dispersion (2.212, AM 2005).
Hint. Like the normal distribution, the Cauchy distribution is stable. Use the characteristic function
(2.210, AM 2005) to represent this distribution at any horizon. Notice that the covariance is not defined.

Solution of E 96
From (3.64, AM 2005) and (2.210, AM 2005) we obtain:

τ
φτ (ω) = (φτe (ω)) τe
0
√ τ
ω 0 Σω
= (eiω µ− ) τe (3.33)

iω0µ ττe − ω 0 Σ( ττe )2 ω
=e .
Therefore:

τ2
 
τ
Xτ ∼ Ca µ, 2 Σ . (3.34)
τe τe
In particular, from (2.212, AM 2005) we obtain:

τ2
MDisτ {X} = MDisτe {X} . (3.35)
τe2
Therefore, the propagation law for risk is linear in the horizon, instead of being proportional to the square
root of the horizon. 
E 97 – Projection of skewness, kurtosis, and all standardized summary statistics *

Consider an invariant, which we denote by Xt . Assume that we have properly estimated the distribution
of such one-period invariant. Then we can compute the expectation (1.25, AM 2005):

µX ≡ E{X} , (3.36)

the standard deviation (1.42, AM 2005):

p
σX ≡ E{(X − µX )2 } , (3.37)

the skewness (1.49, AM 2005):

skX ≡ E{(X − µX )3 }/σX


3
, (3.38)

the kurtosis (1.51, AM 2005):

kuX ≡ E{(X − µX )4 }/σX


4
, (3.39)

and in general n-th standardized summary statistics


(n)
γX ≡ E{(X − µX )n }/σX
n
, n ≥ 3. (3.40)

Consider the projected invariant, defined as the sum of k intermediate single-period invariants:

Y = X1 + · · · + Xk . (3.41)

Such rule applies e.g. to the compounded return (3.11, AM 2005), but not to the linear return (3.10, AM
2005). Project the single-period statistics (3.36)-(3.40) to the arbitrary horizon k, i.e. compute the first n
standardized summary statistics for the projected invariant Y :

(5) (n)
µY , σY , skY , kuY , γY , . . . , γY , (3.42)

from the first n single-period statistics for the single-period invariant X:

(5) (n)
µX , σX , skX , kuX , γX , . . . , γX . (3.43)

Hint. Use the central moments, see (1.48, AM 2005):


CHAPTER 3. MODELING THE MARKET 65

CMX
1 ≡ µX , CMX n
n ≡ E{(X − E{X}) } , n = 2, 3, . . . , (3.44)
the non-central, or raw, moments, see (1.47, AM 2005):

RMX n
n ≡ E{X }, n = 1, 2, . . . , (3.45)
and the cumulants:

dn ln(E{ezX })

(n)
κX ≡ , n = 1, 2, . . . . (3.46)
dz n
z=0

Then use recursively the identity:

n−1
(n) (k)
X
n−1
κX = RMX κX RMX

n − k−1 n−k , (3.47)
k=1

see Kendall and Stuart (1969).

Note. See Meucci (2010a).

Solution of E 97
The steps involved are the following:
• Step 0. We collect the first n statistics (3.36)-(3.40) of the invariant Xt :

(5) (n)
µX , σX , skX , kuX , γX , . . . , γX . (3.48)

• Step 1. We compute from (3.48) the central moments CMX X


1 , . . . , CMn of Xt . To do so, notice
X 2
from the definition of central moments (3.44) that CM2 ≡ σX and that from (3.40) we obtain:

(n)
CMX n
n = γX σX , n ≥ 3. (3.49)

• Step 2. We compute from the central moments the raw moments RMX X
1 , . . . , RMn of Xt .
(1) (n)
• Step 3. We compute from the raw moments the cumulants κX , . . . , κX of Xt . To do so, we
(1)
start from κX = RMX 1 : this follows from the Taylor approximations E{e
zX
} ≈ E{1 + zX} =
X
1 + z RM1 for any small z and ln(1 + x) ≈ x for any small x, and from the definition of the first
cumulant in (3.46). Then we apply recursively the identity (3.47).
(1) (n) (1) (n)
• Step 4. We compute from the cumulants κX , . . . , κX of Xt the cumulants κY , . . . , κY of the
projection Y ≡ X1 + · · · + Xτ . To do so, we notice that for any independent variables X1 , . . . , Xτ
we have E{ez(X1 +···+Xτ ) } = E{ezX1 } · · · E{ezXτ }. Substituting this in the definition of the
cumulants (3.46) we obtain:

(n) (n) (n)


κX1 +···+Xτ = κX1 + · · · + κXτ . (3.50)
In particular, since Xt is an invariant, all the Xt ’s are identically distributed. Therefore the pro-
jected cumulants read:

(n) (n)
κY = τ κX . (3.51)
(1) (n)
• Step 5. We compute from the cumulants κY , . . . , κY the raw moments RMY1 , . . . , RMYn of Y .
To do so, we use recursively the identity:

n−1
(n) (k)
X
n−1
RMYn = κY + κY RMYn−k ,

k−1 (3.52)
k=1

which follows from applying (3.47) to Y and rearranging the terms.


• Step 6. We compute from the raw moments of Y the central moments of Y .
• Step 7. We compute from the central moments of Y the standardized summary statistics:

(5) (n)
µY , σY , skY , kuY , γY , . . . , γY , (3.53)
of the projected multi-period invariant Y , by applying to Y the definitions (3.36)-(3.40). See the
MATLAB R
script S_ProjectSummaryStatistics for the implementation


E 98 – Explicit factors: regression factor loadings (www.3.4) *


Derive the expression for the regression factor loadings in (3.121, AM 2005):

−1
Br ≡ E {XF0 } E {FF0 } . (3.54)

Solution of E 98
From the definition (3.116, AM 2005) of the generalized r-square and (3.120, AM 2005), the regression
factor loadings minimizes the following quantity:

M ≡ E {(X − BF)0 (X − BF)}


X
= E {(Xn − Bnk Fk )(Xn − Bnj Fj )}
n,k,j
X  X
= E Xn2 − E {Bnk Fk Xn }
n n,k
(3.55)
X X
− E {Xn Bnj Fj } + E {Bnk Fk Bnj Fj }
n,j n,k,j
X X
E Xn2 − 2

= Bnk E {Xn Fk }
n n,k
X
+ Bnj Bnk E {Fk Fj } .
n,k,j

Therefore the first order conditions with respect to Bsl read:

∂M
0sl =
∂Bsl
 
∂ X
= −2 E {Xs Fl } + Bnj Bnk E {Fk Fj } (3.56)
∂Bsl
n,k,j
X
= −2 E {Xs Fl } + 2 Bsk E {Fk Fl } .
k
CHAPTER 3. MODELING THE MARKET 67

In matrix notation these equations read:

0N ×K = −2 E {XF0 } + 2B E {FF0 } , (3.57)

whose solution is:

−1
Br = E {XF0 } E {FF0 } . (3.58)

E 99 – Explicit factors: expected value and correlation of residuals (www.3.4)


Show that in general the residuals of the general regression do not have zero expected values and are
correlated.
Solution of E 99
The residuals read:

U ≡ X − Br F
−1 (3.59)
= X − E {XF0 } E {FF0 } F,

where Br is given by (3.121, AM 2005). In general, the residuals do not have zero expected value:

n o
−1
E {U} = E X − E {XF0 } E {FF0 } F
(3.60)
−1
= E {X} − E {XF0 } E {FF0 } E {F} .

Furthermore, in general the residuals are correlated:

Cov {U, F} = E {UF0 } − E {U} E {F0 }


n o
−1
= E (X − E {XF0 } E {FF0 } F)F0
n o
−1
− E X − E {XF0 } E {FF0 } F E {F0 }
(3.61)
−1
= E {XF0 } − E {XF0 } E {FF0 } E {FF0 }
−1
− E {X} E {F0 } + E {XF0 } E {FF0 } E {F} E {F0 }
−1
= E {XF0 } E {FF0 } E {F} E {F0 } − E {X} E {F0 } .

This expression is zero if E {F} = 0. 

E 100 – Explicit factors: covariance of residuals (www.3.4)


Show that the covariance of the residuals of the general regression with the factors can be expressed as:

Cov {U, F} = Cov {X, F} − Br Cov {F} , (3.62)

where Br is given by (3.121, AM 2005).


Solution of E 100
Using (3.121, AM 2005), we can also express the covariance of the residuals with the factor as follows:

Cov {U, F} = E {UF0 } − E {U} E {F0 }


n o
−1
= E (X − E {XF0 } E {FF0 } F)F0
n o
−1
− E X − E {XF0 } E {FF0 } F E {F0 }
= E {XF0 } − E {X} E {F0 } (3.63)
−1
+ E {XF0 } E {FF0 } (E {F} E {F0 } − E {FF0 })
−1
= Cov {X, F} − E {XF0 } E {FF0 } Cov {F}
= Cov {X, F} − Br Cov {F} .


E 101 – Explicit factors (with a constant among the factors): recovered invariants
(www.3.4) *
Show that in the case of a regression with a constant among the factors, the regression coefficients (3.121,
AM 2005) yield the recovered invariants (3.127, AM 2005):

e r ≡ E {X} + Cov {X, F} Cov {F}−1 (F − E {F}) .


X (3.64)

Solution of E 101
Assume one of the factors is a constant as in (3.126, AM 2005). Then the linear model (3.119, AM 2005)
becomes:

X ≡ a + GF + U . (3.65)

In order to maximize the generalized r-square (3.116, AM 2005) we have to minimize the following
expression:

 0
M ≡ E [X − (a + GF)] [X − (a + GF)]
= E {X0 X} + a0 a + E {F0 G0 GF} (3.66)
0 0 0
+ 2a G E {F} − 2a E {X} − 2 E {X GF} .

We re-write (3.66) emphasizing the terms containing a:

X X X
M = ··· + (aj )2 + 2 aj Gjk E {Fk } − 2 aj E {Xj } . (3.67)
j j,k j

Setting to zero the first order derivative with respect to aj we obtain:

X
aj = E {Xj } − Gjk E {Fk } , (3.68)
k
CHAPTER 3. MODELING THE MARKET 69

which in matrix notation yields:

ar = E {X} − Gr E {F} . (3.69)


Now we re-write (3.66) emphasizing the terms containing G:

X X X
M = ··· + E {Fj Gkj Gkl Fl } + 2 aj Gjk E {Fk } − 2 E {Xj Gjk Fk }
jkl jk jk
X X X (3.70)
= E {Fk Gjk Gjl Fl } + 2 aj Gjk E {Fk } − 2 E {Xj Gjk Fk } .
jkl jk jk

Setting to zero the first order derivative with respect to Gjk and using (3.68) we obtain:

X
0= E {Fk Gjl Fl } + aj E {Fk } − E {Xj Fk }
l
!
X X
= E {Fk Gjl Fl } + E {Xj } − Gjl E {Fl } E {Fk } − E {Xj Fk }
l l
!
X X
= E {Fk Gjl Fl } − E {Gjl Fl } E {Fk } (3.71)
l l
− (E {Xj Fk } − E {Xj } E {Fk })
X
= Cov {Gjl Fl , Fk } − Cov {Xj , Fk }
l
n o
= Cov [GF]j , Fk − Cov {Xj , Fk } .

In matrix notation this expression reads:

G Cov {F} = Cov {X, F} , (3.72)


which implies:

−1
Gr = Cov {X, F} Cov {F} . (3.73)
Substituting (3.68) and (3.72) in (3.65) we find the expression of the recovered invariants:

e r ≡ E {X} + Cov {X, F} Cov {F}−1 (F − E {F}) .


X (3.74)

E 102 – Explicit factors (with a constant among the factors): expected value of
residuals (www.3.4) *
Define the residuals as Ur ≡ X − X
e r in (3.119, AM 2005) and (3.126, AM 2005) and show that:

E{Ur } = 0 , Corr{F, U} = 0K×N . (3.75)


Solution of E 102
The residuals read:

e r = X − Gr F ,
Ur ≡ X − X (3.76)

where:

X ≡ X − E {X} , F ≡ F − E {F} . (3.77)

Therefore the residuals have zero expected value. The covariance of the residuals with the factors reads:

n  0o
Cov {Ur , F} = E X − Gr F F
0
n o n 0o
= E XF − Gr E FF (3.78)

= Cov {X, F} − Gr Cov {F} .

Therefore using (3.73) we obtain:

−1
Cov {Ur , F} = Cov {X, F} − Cov {X, F} Cov {F} Cov {F} = 0K×N . (3.79)


E 103 – Explicit factors (with a constant among the factors): covariance of residu-
als (www.3.4) *
Show that the covariance of the residuals (3.129, AM 2005) reads:

−1
Cov {Ur } = Cov {X} − Cov {X, F} Cov {F} Cov {F, X} . (3.80)

Solution of E 103
The covariance of the residual reads:

n  0 o
Cov {Ur } = E X − Gr F X − Gr F
0 0
n o n o n 0o
= E XX − 2 E XF G0r + Gr E FF G0r (3.81)

= Cov {X} − 2 Cov {X, F} G0r + Gr Cov {F} G0r .

Therefore using (3.73) we obtain:

−1
Cov {Ur } = Cov {X} − Cov {X, F} Cov {F} Cov {F, X} . (3.82)

E 104 – Explicit factors: generalized r-square (www.3.4) *


Show that the generalized r-square (3.116, AM 2005) of the explicit factor model can be expressed as an
average correlation (3.140, AM 2005):
CHAPTER 3. MODELING THE MARKET 71

e r = 1 tr(Corr {X, E0 F} Corr {E0 F, X}) ,


n o
R2 X, X (3.83)
N
where E is the (N × K) matrix of eigenvalues of Σ, see (3.135, AM 2005).
Solution of E 104
First of all we consider a scale independent model. We recall from (1.35, AM 2005) that the z-scores of
the variables are defined as follows:

ZX ≡ D−1
X (X − E {X}) , (3.84)

where:

DX ≡ diag(Sd {X1 } , . . . , Sd {XN }) . (3.85)


−1
Left-multiplying (3.127, AM 2005) by DX we obtain the recovered z-score of the original variable X:

e X ≡ D−1 (X
Z e r − E {X})
X
−1
= D−1
X Cov {X, F} Cov {F} (F − E {F}) (3.86)
 −1 −1
= Cov DX X, F Cov {F} (F − E {F}) .

Consider the spectral decomposition (2.76, AM 2005) of the covariance of the factors:

Cov {F} ≡ EΛE0 , (3.87)

where E is the juxtaposition of the eigenvectors:

E ≡ (e(1) , . . . , e(K) ) , (3.88)

and satisfies EE0 = IK , the identity matrix; and Λ is the diagonal matrix of the eigenvalues sorted in
decreasing order:

Λ ≡ diag(λ1 , . . . , λK ) . (3.89)

With the spectral decomposition we can always rotate the factors in such a way that they are uncorrelated.
Indeed the rotated factors E0 F satisfy:

Cov {E0 F} = E0 Cov {F} E = E0 EΛE0 E = Λ , (3.90)

which is diagonal. Now consider the z-scores of the rotated factors:

1
ZF ≡ Λ− 2 E0 (F − E {F}) , (3.91)

which are uncorrelated and have unit standard deviation:


1 1
Cov {ZF } = Λ− 2 E0 EΛE0 EΛ− 2 = IK . (3.92)
From (3.86) the recovered z-score of the original variable X reads:

e X = Cov D−1 X, F EΛ−1 E0 (F − E {F})



Z X
n oh i
− 12 0 1
= Cov D−1X X, Λ E (F − E {F}) Λ− 2 E0 (F − E {F}) (3.93)
h 1
i
= Corr {X, E0 F} Λ− 2 E0 (F − E {F}) .

On the other hand, the generalized r-square defined in (3.116, AM 2005) reads in this context:

n o n o
R2 X, X e r ≡ R2 ZX , Z eX
n o
E (ZX − Z e X )0 (ZX − Z
eX )
≡1− (3.94)
tr {Cov {ZX }}
a
=1− .
N
The term in the numerator can be written as follows:

n o
a ≡ E (ZX − Z e X )0 (ZX − Z
eX )
h i0 
−1 −1
= E DX (X − X) DX (X − X)
e e
n o (3.95)
= E (X − X)e 0 D−1 D−1 (X − X)e
X X
 n o
−1 −1 e 0
= tr DX DX E (X − X)(X e − X) ,

using (3.129, AM 2005) this becomes:

−1
a ≡ tr(D−1 −1
X DX [Cov {X} − Cov {X, F} Cov {F} Cov {F, X}])
−1
= tr(D−1 −1
X DX Cov {X}) − tr(D−1 −1
X DX Cov {X, F} Cov {F} Cov {F, X})
−1 −1 −1
= tr(Corr {X}) − tr(DX DX Cov {X, F} Cov {F} Cov {F, X})
n 1
o n 1
o (3.96)
−1 0
= N − tr(Cov D−1
X X, EΛ ZF EΛ
2 E Cov EΛ 2 ZF , D−1
X X )

= N − tr(Cov D−1 −1
 
X X, ZF Cov ZF , DX X )
= N − tr(Corr {X, E0 F} Corr {E0 F, X}) .
Therefore the r-square (3.94) reads:

0 0
e X = 1 − N − tr(Corr {X, E F} Corr {E F, X})
n o
R2 ZX , Z
N (3.97)
1
= tr(Corr {X, E F} Corr {E0 F, X}) .
0
N

CHAPTER 3. MODELING THE MARKET 73

E 105 – Spectral decomposition: symmetry


Consider a N × N matrix of the form:

Σ ≡ EΛE0 , (3.98)
where Λ is diagonal and E is invertible. Prove that Σ is symmetric, see definition (A.51, AM 2005).
Solution of E 105
Σ0 ≡ (EΛE0 )0 = EΛ0 E0 = EΛE0 = Σ . (3.99)


E 106 – Spectral decomposition: positivity


Consider a N × N matrix of the form:

Σ ≡ EΛE0 , (3.100)
where Λ is diagonal and E is invertible. Prove that Σ is positive if and only if all the diagonal elements
of Λ are positive, see definition (A.52, AM 2005).
Solution of E 106
For any v there exists one and only one w ≡ E0 v and w ≡ 0 ⇐⇒ v ≡ 0. Assume that all the diagonal
elements of Λ are positive and v 6= 0. Then:

N
X
v0 Σv ≡ v0 EΛE0 v = w0 Λw = wn2 λn > 0 . (3.101)
n=1

Similarly, from the above identities, if 0 < v0 Σv for any v 6= 0, then each λn has to be positive. 

E 107 – Hidden factors: recovered invariants as projection (www.3.5) *


Show that the the expression of the PCA-recovered invariants (3.160, AM 2005) represents the orthogonal
projection of the original invariants onto the hyperplane spanned by the K longest principal axes.
Solution of E 107
From (3.160, AM 2005), the PCA-recovered invariants can be expressed as:

e p ≡ a + GX ,
X (3.102)
where:

a ≡ (IN − EK E0K ) E {X} (3.103)


G≡ EK E0K . (3.104)

Consider a generic point x in RN . Since the eigenvectors of the covariance matrix are a basis of RN we
can express x as follows:

N
X
x ≡ E {X} + αn e(n) , (3.105)
n=1
for suitable coefficients {α1 , . . . , αN }, where e(n) denotes the n-th eigenvector.
To prove that (3.102) represents the projection on the hyperplane of maximal variation generated by the
first K principal axes we need to prove the following relation:

K
X
a + Gx = E {X} + αn e(n) . (3.106)
n=1

By substituting (3.103), (3.104) and (3.105) in the left hand side of the above relation we obtain:

N
!
X
a + Gx ≡ (IN − EK E0K ) E {X} + EK E0K E {X} + αn e(n)
n=1
(3.107)
N
X
= E {X} + αn EK E0K e(n) .
n=1

Therefore in order prove our statement it suffices to prove that if n ≤ K then the following holds:

EK E0K e(n) = e(n) , (3.108)

and if n > K then the following holds:

EK E0K e(n) = 0 . (3.109)

Both statements follow from the definition (3.157, AM 2005) of EK , which implies:

  0
e(1) e(n)

..
 
EK E0K e(n) ≡ e(1 · · · e(K) , (3.110)
 
 .
 (K) 0 (n)
e e

and the fact that E is orthonormal:

EE0 = IN , (3.111)

where IN is the identity matrix of order N . 

E 108 – Hidden factors: generalized r-square (www.3.5)


Show that the generalized r-square (3.116, AM 2005) of the PCA dimension reduction can be expressed
in terms of the eigenvalues (3.150, AM 2005) of the covariance matrix as follows:

o PK
e p = Pn=1 λn .
n
R2 X, X N
(3.112)
n=1 λn
CHAPTER 3. MODELING THE MARKET 75

Solution of E 108
The residual of the PCA dimension reduction reads:

e p ≡ (IN − EK E0 )(X − E {X})


Up ≡ X − X K
(3.113)
= RK R0K (X − E {X}) ,

where RK is the juxtaposition of the last (N − K) eigenvectors:

RK ≡ (e(K+1) · · · e(N ) ) . (3.114)

This matrix satisfies:

RK R0K RK R0K = RK R0K . (3.115)

Indeed, from (3.111) and the definition of RK we obtain:

  (K+1) 0 (n) 
e e
RK R0K e(n) ≡ (e (K+1) (N ) 
···e ) .
.. . (3.116)

 (N ) 0 (n)
e e

Therefore, if n > K then:

RK R0K e(n) = e(n) , (3.117)

and if n ≤ K then:

RK R0K e(n) = 0 . (3.118)

Since the set of eigenvectors is a basis in RN , (3.117) and (3.118) prove (3.115). Therefore the term in
the numerator of the generalized r-square (3.116, AM 2005) of the PCA dimension reduction reads:

n o
e p )0 (X − X
M ≡ E (X − X e p)

= E {(X − E {X})0 RK R0K RK R0K (X − E {X})} (3.119)


= E {(X − E {X})0 RK R0K (X − E {X})}
= tr(Cov {R0K X}) .

On the other hand from the definition (3.114) of RK we obtain:

E0 RK = (δ (K+1) · · · δ (N ) ) , (3.120)

where δ (n) is the n-th element of the canonical basis (A.15, AM 2005). Therefore:
Cov {R0K X} = R0K Cov {X} RK
= R0K EΛE0 RK (3.121)
= diag(λK+1 , . . . , λN ) .

Substituting (3.121) in (3.119) we obtain:

N
X
M= λn . (3.122)
n=K+1

The term in the denominator of the generalized r-square (3.116, AM 2005) is the sum of all the eigen-
values. This follows from (3.149, AM 2005) and (A.67, AM 2005). Therefore, the generalize r-square
reads:

PN PK
λ
e p = 1 − Pn=K+1 n = P n=1 λn .
n o
R2 X, X N N
(3.123)
n=1 λn . n=1 λn .

The residual (3.113) clearly has zero expected value. Similarly, the factors:

Fp ≡ E0K (X − E {X}) (3.124)

have zero expected value. From (3.117) and (3.118) we obtain:

RK R0K E = (0 · · · 0 e(K+1) · · · e(N ) ) . (3.125)

Similarly:

(E0 EK ) = (e(1) · · · e(K) ) . (3.126)

Therefore the covariance of the residuals with the factors reads:

Cov {Up , Fp } = E Up F0p




= E {RK R0K (X − E {X})(X − E {X})0 EK }


= RK R0K Cov {X} EK
(3.127)
= (RK R0K E)Λ(E0 EK )
= (0 · · · 0 e(K+1) · · · e(N ) )(λ1 e(1) · · · λK e(K) )
= 0N ×K ,

where the last equality follows from EE0 = IN . 

E 109 – Hidden factors: derivation, correlations and r-square


Consider the approximation Y provided to the market X by a given model:
CHAPTER 3. MODELING THE MARKET 77

X ≡ Y + U, (3.128)

where U is the residual that the model fails to approximate. To evaluate the goodness of a model, we
introduce the generalized r-square as in Meucci (2010e):

2 tr(Cov {w(Y − X)})


Rw {Y, X} ≡ 1 − . (3.129)
tr(Cov {WX})
Consider now a linear factor model:

Y ≡ BF , (3.130)

where the factors are extracted by linear combinations from the market:

F ≡ GX . (3.131)

Then each choice of B and G gives rise to a different model Y. Determine analytically the expressions for
the optimal B and G that maximize the r-square (3.129) and verify that they are the principal components
of the matrix Cov {WX}. What is the r-square provided by the optimal optimal B and G? Then compute
the residuals U. Are the residuals correlated with the factors F? Are the residuals idiosyncratic?
Hint. See Meucci (2010e).

Solution of E 109
First, we perform the spectral decomposition of the covariance matrix:

Cov {WX} ≡ EΛE0 . (3.132)

In this expression Λ is the diagonal matrix of the decreasing, positive eigenvalues of the covariance:

Λ ≡ diag(λ21 , . . . , λ2N ) , (3.133)

and E is the juxtaposition of the respective eigenvectors, which are orthogonal and of length 1 and thus
EE0 = IN :

E ≡ (e(1) , . . . , e(N ) ) . (3.134)

Next, we define a N × K matrix as the juxtaposition of the first K eigenvectors:

EK ≡ (e(1) , . . . , e(K) ) . (3.135)

Then optimal B and G read:

B∗ = w−1 EK , G∗ ≡ E0K w . (3.136)


The r-square (3.185) provided by the principal component solution (3.136) reads:

PK 2
2 k=1 λk
Rw = PN . (3.137)
2
n=1 λn

The residuals are not correlated with the factors F but they are correlated with each other and therefore
they are not idiosyncratic. See all the solutions in Meucci (2010e). 

E 110 – Hidden factors: principal component analysis of a two-point swap curve


Write a MATLAB R
script in which you:
• Upload the database DB_Swap2y4y of the 2yr and 4yr daily par swap rates;
• Plot the "current curve" i.e. the rates at the last observation date as functions of the respective
maturities ("points on the curve");
• Find the two invariants for the two rate series for a weekly estimation horizon (one week = five
days). Use the MATLAB R
function PerformIidAnalysis test;
• Scatter plot the time series of one invariant against the time series of the other invariant;
• Superimpose the two-dimensional location-dispersion ellipsoid determined by sample mean and
sample covariance of the invariants (set the scale factor equal to 2): you should see a highly elon-
gated ellipsoid;
• Perform the spectral decomposition of the sample covariance of the invariants.
• Plot the two entries of the first eigenvector (first factor loadings) as a function of the respective
points on the curve;
• Superimpose the plot of the two entries of the second eigenvector (second factor loadings) as a
function of the respective points on the curve;
• Compute and plot a one-standard-deviation effect and a minus-one-standard-deviation effect of the
first factor on the current curve as in the case study in the textbook;
• Compute and plot a one-standard-deviation effect and a minus-one-standard-deviation effect of the
second factor on the current curve, as in the case study in the textbook;
• Compute the generalized R2 provided by the first factor;
• Compute the generalized R2 provided by both factors.
Solution of E 110
See the MATLAB R
script S_SwapPca2Dim. 

E 111 – Hidden factors: puzzle


Consider a N -dimensional market that is normally distributed:

X ∼ N(µ, Σ) . (3.138)

Write a MATLAB R
script in which you:
• Choose an arbitrary dimension N and generate µ arbitrarily;
• Generate Σ as follows:

Σ ≡ BB0 + ∆2 , (3.139)

where B is an arbitrary matrix N × K, with K < N and ∆2 is an arbitrary diagonal matrix;


• Generate a large number of scenarios {Xj }j=1,...,J from the distribution (3.138) with matching
sample first and second moment µb and Σ;
b
CHAPTER 3. MODELING THE MARKET 79

• Run the built-in MATLAB R


function factoran, which outputs the estimated values of B
b and ∆
b as
well as the hidden factors {fj }j=1,...,J ;
• Verify that the factor analysis routine works well, i.e.:

b ≡B
Σ bB b2;
b0 + ∆ (3.140)

• Compute the residuals uj ≡ Xj − BFj and their sample covariance;


• Verify that the residuals are not idiosyncratic, in contradiction with the very principles of factor
analysis.
Note. See Meucci (2010e).

Solution of E 111
See the MATLAB R
script S_FactorAnalysisNotOK. 

E 112 – Pure residual models: duration/curve attribution


Consider as market Xt the weekly linear returns of N ≡ 3 bonds, net of the "carry", or "roll-down",
i.e. the deterministic component as in (3.108, AM 2005) and comments thereafter in Meucci (2005).
Consider as exogenous factors Ft the weekly changes in K ≡ 9 key rates of the government curve: 6
months, one year, 2, 3, 5, 7 10, 20 and 30 years. Consider as exogenous loadings Bt the key rate durations
of these bonds, where Bt is a N × K = 3 × 9 matrix. Consider the pure residual factor model:

Xt ≡ Bt Ft + Ut . (3.141)

Write a MATLAB R
script in which you:
• Upload the database DB_BondAttribution with time series over the year 2009 of the above variables;
• Model the joint distribution of the yet-to-be realized factors and residuals by means of the empirical
distribution:

T
1 X (ft ,ut )
fFT +! ,UT +! ≡ δ , (3.142)
T t=1

see (4.35, AM 2005);


• Compute the correlation among residuals and between factors and residuals according to the em-
pirical distribution (3.142) and verify that (3.141) is not a systematic-plus-idiosyncratic model.
Hint. See Meucci (2010e).

Solution of E 112
See the MATLAB R
script S_PureResidualBonds. 

E 113 – Time series factors: unconstrained time series correlations and r-square
Consider the approximation Y provided to the market X by a given model:

X ≡ Y + U, (3.143)

where U is the residual that the model fails to approximate. To evaluate the goodness of a model, we
introduce the generalized r-square as in Meucci (2010e):
2 tr(Cov {w(Y − X)})
Rw {Y, X} ≡ 1 − . (3.144)
tr(Cov {WX})
Consider now a linear factor model:

Y ≡ BF , (3.145)

where the factors F are imposed exogenously. Then each choice of B gives rise to a different model
Determine analytically the expressions for the optimal B that maximize the r-square (3.144). Then com-
pute the residuals U. Are the residuals correlated with the factors F? Are the residuals idiosyncratic?
What is the r-square provided by the optimal optimal B?
Hint. See Meucci (2010e).

Solution of E 113
The solution reads:

−1
B∗ ≡ Cov {X, F} Cov {F} , (3.146)

The residuals and the factors are uncorrelated but the residuals are not idiosyncratic because their corre-
lations with each other are not null. The r-square provided by the model with loadings (3.146) is:

−1
2 tr(Cov {WX, F} Cov {F} Cov {F, WX})
Rw = . (3.147)
tr(Cov {WX})
See all the solutions in Meucci (2010e). 

E 114 – Time series factors: unconstrained time series industry factors


Consider the n = 1, . . . , N ≈ 500 stocks in the S&P 500 and the k = 1, . . . , K ≡ 10 industry indices.
We intend to build a factor model:

X = a + BF + U , (3.148)

where X ≡ (X1 , . . . , XN )0 are the yet to be realized returns of the stocks over next week; a ≡
(a1 , . . . , aN )0 are N constants; F ≡ (F1 , . . . , FK )0 are the factors, i.e. the yet to be realized returns
of the industry indices over next week; B is a N × K matrix of coefficients that transfers the random-
ness of the factors into the randomness of the risk drivers; and U ≡ (U1 , . . . , UN )0 are defined as the N
residuals that make (3.148) an identity. Write a MATLAB R
script in which you:
• Upload the database of the weekly stock returns {Xt }t=1,...,T in DB_Securities_TS, and the database
of the simultaneous weekly indices returns {ft }t=1,...,T in DB_Sectors_TS;
• Model the joint distribution of X and F by means of the empirical distribution:

T
1 X (Xt ,ft )
fX,F ≡ δ , (3.149)
T t=1

where δ (Y) denotes the Dirac-delta, which concentrates a unit probability mass on the generic point
Y;
CHAPTER 3. MODELING THE MARKET 81

• Compute the optimal loadings B∗ in (3.148) that give the factor model the highest generalized
multivariate distributional r-square as in Meucci (2010e) (you will notice that the weights are arbi-
trary):

B∗ ≡ argmax Rw
2
{BF, X} ; (3.150)
B

• Compute the correlations of the residuals with the factors and verify that it is null;
• Compute the correlations of the residuals with each other and verify that it is not null, i.e. the
residuals are not idiosyncratic.
Hint. The optimal loadings turn out to be the standard multivariate OLS.

Note. See Meucci (2010e).

Solution of E 114
See the MATLAB R
script S_TimeSeriesIndustries. 

E 115 – Time series factors: generalized time-series industry factors (see E 114)
Consider the same setup than in E 114. Write a MATLAB R
script in which you:

• Compute the optimal loadings B in (3.148) that give the factor model the highest constrained
generalized multivariate distributional r-square defined in Meucci (2010e):

B∗ ≡ argmax Rw
2
{BF, X} . (3.151)
B∈C

In this expression, assume that the constraints C are the following: all the loadings are bound from
below by B ≡ 0.8 and from above by B ≡ 1.2 and the market-capitalization weighted sum of the
loadings be one:

0.8 ≤ Bn,k ≤ B , n = 1, . . . , N , k = 1, . . . , K
N
X (3.152)
Mn Bn,k ≡ 1 .
n=1

Proxy the market capitalization as equal weights for this exercise;


• Compute the correlations of the residuals among each other and with the factors and verify that
neither is null. In other words, the model is not of systematic-plus-idiosyncratic type.
Solution of E 115
See the MATLAB R
script S_TimeSeriesConstrainedIndustries. 

E 116 – Time series factors: analysis of residuals I


Consider a market of N stocks, where each stock n = 1, . . . , N trades at time t at the price Pt,n . Consider
as interpretation factors the linear returns on a set of K indices, such as GICS sectors, where each index
k = 1, . . . , K quotes at time t at the price St,k . As in Black-Scholes, assume that stocks and indices
follow a geometric Brownian motion, i.e.:

      
X µX ΣX ΣXF
∼N τ ,τ , (3.153)
F µF Σ0XF ΣF
where:

 
PT +τ,n
Xn ≡ ln
PT,n
  (3.154)
ST +τ,k
Fk ≡ ln .
ST,k
We want to represent the linear returns on the securities:

R = eX − 1 , (3.155)

in terms of the explanatory factors:

Z = eF − 1 , (3.156)

by means of a linear model:

R ≡ BZ + U . (3.157)

Compute the expression of B that minimizes the generalized r-square, the expression of the covariance
ΣZ of the explanatory factors and the expression of the covariance ΣU of the residuals.
Solution of E 116
From (3.121, AM 2005) the optimal loadings read:

B ≡ E {RZ0 } (E {ZZ0 })−1 . (3.158)

Also from (2.219, AM 2005)-(2.220, AM 2005) in general for a log-normal variable:

Y ∼ LogN(µ, Σ) . (3.159)

then:

1
E {Y} = eµ+ 2 diag(Σ) (3.160)
0 µ+ 12 diag(Σ) µ+ 12 diag(Σ) 0 Σ
E {YY } = (e (e ))◦e , (3.161)

where ◦ denotes the term-by-term Hadamard product. Since:

      
R µX ΣX ΣXF
1+ ∼ LogN τ ,τ , (3.162)
Z µF Σ0XF ΣF

using (3.160), (3.161) and the property:

E {(Y − 1)} = E {Y} − 1


(3.163)
E {(Y − 1)(Y − 1)0 } = E {YY0 } + 110 − E {Y10 } − E {1Y0 } ,
CHAPTER 3. MODELING THE MARKET 83

we can easily compute all the terms E {R}, E {RR0 }, E {Z}, E {ZZ0 } and E {RZ0 }. Therefore we
obtain the loadings (3.158). The covariance of the explanatory factors then follows from:

ΣZ = E {ZZ0 } − E {Z} E {Z0 } , (3.164)

and similarly the covariance of the returns follows from:

ΣR = E {RR0 } − E {R} E {R0 } . (3.165)

E 117 – Time series factors: analysis of residuals II (see E 116)


Consider the same setup than in E 116. Write a MATLAB R
script in which you:
• Generate randomly the parameters of the distribution (3.154);
• Generate a large number of Monte Carlo scenarios from (3.154) and verify that the sample covari-
ances of explanatory factors and linear returns match with (3.164) and (3.165);
• Estimate the loadings by OLS of the Monte Carlo simulations i.e. the sample counterpart of (3.158);
• Compute the residuals and their sample covariance Σ b R and verify that Σ
b R is not diagonal and that:

b R 6= B
Σ bΣ b0 + Σ
b ZB bU . (3.166)

Solution of E 117
See the MATLAB R
script S_ResidualAnalysisTheory. 

E 118 – Time series factors: analysis of residuals III (see E 116)


Consider the same setup than in E 116. Assume now that one of the factor is non-random, by setting the
respective volatility to zero in (3.154) and verify that:

bR ≡ B
Σ bΣ b0 + Σ
b ZB bU . (3.167)

Solution of E 118
In this case the most explanatory interpretation reads:

R ≡ a + BZ + U , (3.168)

where the OLS loadings are:

B ≡ ΣRZ Σ−1
ZZ (3.169)

and:

a ≡ E{R} − B E{Z} . (3.170)


E 119 – Time series factors: analysis of residuals IV (see E 116)
Consider the same setup than in E 116. Repeat the experiment assuming that all the factors are random,
but enforcing E {Z} ≡ 0 by suitably setting the drift µF in (3.154) as a function of the diagonal of ΣF
and verify again that:

bR ≡ B
Σ bΣ b0 + Σ
b ZB bU . (3.171)

Note. Notice that under no circumstance is the residual covariance matrix Σ


b U diagonal. See Meucci
(2010e).

Solution of E 119
See the MATLAB R
script S_ResidualAnalysisTheory. 
E 120 – Cross-section factors: unconstrained cross-section correlations and r-square
I
Consider the approximation Y provided to the market X by a given model:

X ≡ Y + U, (3.172)

where U is the residual that the model fails to approximate. To evaluate the goodness of a model, we
introduce the generalized r-square as in Meucci (2010e):

2 tr(Cov {w(Y − X)})


Rw {Y, X} ≡ 1 − . (3.173)
tr(Cov {WX})
Consider now a linear factor model:

Y ≡ BF , (3.174)

where the loadings B are exogenously chosen, but the factors F are left unspecified. Then each choice of
F gives rise to a different model. Assume that the factors are a linear function of the market:

F ≡ GX . (3.175)

Determine analytically the expressions for the optimal G that maximize the r-square (3.173).
Solution of E 120
The solution reads:

G∗ = (B0 ΦB)−1 B0 Φ , (3.176)

where Φ ≡ w0 w. Then r-square provided by this solution reads:

2 tr(Cov {WBF})
Rw = , (3.177)
tr(Cov {WX})
see the solution in Meucci (2010e). 
CHAPTER 3. MODELING THE MARKET 85

E 121 – Cross-section factors: unconstrained cross-section correlations and r-square


II (see E 120)
Consider the same setup than in E 120. Compute the factors F, the explained market Y and the residual
U. Is the market Y explained by the factors orthogonal to the residual U? Is the explained market Y
correlated with the residual U? Are the residual idiosyncratic?
Solution of E 121
With (3.176) the factors (3.175) read:

F ≡ (B0 ΦB)−1 B0 ΦX , (3.178)

and the model-recovered market is:

Y ≡ PX , (3.179)

where:

P ≡ B(B0 ΦB)−1 B0 Φ (3.180)

is a projection operator. Indeed, it is easy to check that P2 = P. The linear assumption (3.175) gives rise
to the residuals:

U ≡ P⊥ X , (3.181)

where:

P⊥ ≡ I − B(B0 ΦB)−1 B0 Φ , (3.182)

is the projection in the space orthogonal to the span of the model-recovered market. Therefore, the
recovered market and the residuals live in orthogonal spaces. However, the residuals and the factors are
not uncorrelated and the residuals are not idiosyncratic, see also the discussion in Meucci (2010e). 

E 122 – Cross-section factors: unconstrained cross-section industry factors


Consider the n = 1, . . . , N ≈ 500 stocks in the S&P 500 and the k = 1, . . . , K ≡ 10 industry indices.
We intend to build a factor model:

X = a + BF + U , (3.183)

where X ≡ (X1 , . . . , XN )0 are the yet to be realized returns of the stocks over next week; a ≡
(a1 , . . . , aN )0 are N constants, F ≡ (F1 , . . . , FK )0 are the factors, i.e. the yet to be realized random
variables, B is a N × K matrix of coefficients that transfers the randomness of the factors into the ran-
domness of the risk drivers and that is imposed exogenously, and U ≡ (U1 , . . . , UN )0 are defined as the
N residuals that make (3.148) an identity. Write a MATLAB R
script in which you:
• Upload the database DB_Securities_TS of the matrix B of dummy exposures of each stock to its
industry;
• Upload the database DB_Securities_IndustryClassification of weekly stock returns {Xt }t=1,...,T ;
• Model the distribution of X by means of the empirical distribution:

T
1 X (Xt )
fX ≡ δ , (3.184)
T t=1

where δ (Y) denotes the Dirac-delta, which concentrates a unit probability mass on the generic point
Y;
• Define the cross-sectional factors as linear transformation of the market F ≡ GX;
• Compute the optimal coefficients G∗ that give the factor model the highest generalized multivariate
distributional r-square defined in Meucci (2010e):

G∗ ≡ argmax Rw
2
{BGX, X} , (3.185)
G

In this expression assume that the r-square weights matrix w to be diagonal and equal to the inverse
of the standard deviation of each stock return;
• Compute the correlations of the residuals among each other and with the factors and verify that
neither is null. In other words, the model is not of systematic-plus-idiosyncratic type.
Hint. The optimal loadings turn out to be the standard multivariate weighted-OLS.

Note. See Meucci (2010e).

Solution of E 122
See the MATLAB R
script S_CrossSectionIndustries. 

E 123 – Cross-section factors: generalized cross-section industry factors (see E 122)


Consider the same setup than in E 122. Write a MATLAB R
script in which you:
• Compute similarly to (3.185) the optimal coefficients G∗ that give the cross-sectional industry
factors the highest generalized multivariate distributional r-square defined in Meucci (2010e), but,
unlike in E 122 add a set of constraints C:

G∗ ≡ argmax Rw
2
{BGX, X} . (3.186)
B∈C

In this expression, assume that the constraints C are that the factors F ≡ GX be uncorrelated with
the overall market:

C : G Cov {X} m ≡ 0 , (3.187)

where you can assume the market weights m to be equal weights for this exercise;
• Compute the correlations of the residuals among each other and with the factors and verify that
neither is null. In other words, the model is not of systematic-plus-idiosyncratic type.
Note. See Meucci (2010e).

Solution of E 123
See the MATLAB R
script S_CrossSectionConstrainedIndustries. 
CHAPTER 3. MODELING THE MARKET 87

E 124 – Cross-section factors: comparison cross-section with time-series industry


factors (see E 114 and E 122)
Consider the same setups than in E 114 and E 122. Verify that the time series factors are highly correlated
with their cross-sectional counterparts.
Note. See Meucci (2010e).

Solution of E 124
See the MATLAB R
script S_TimeSeriesVsCrossSectionIndustries. 

E 125 – Correlation factors-residual: normal example


Consider an N -dimensional normal market:

X ∼ N(µ, Σ) , (3.188)
and assume that we want to explain it through a linear model:

X ≡ BF + U , (3.189)
where B is a given vector of loadings, F is a yet-to-be defined explanatory factor, and U are residuals
that make (3.189) hold. Write a MATLAB R
script in which you:
• Choose N and generate arbitrarily the parameters in (3.188) and the vector of loadings in (3.189);
• Generate a large number of simulations from (3.188);
• Define the factor F through cross-sectional regression and compute the residuals U;
• Show that factor and residual are correlated:

Corr {F, U} =
6 0. (3.190)

Hint. See Meucci (2010e).

Solution of E 125
See the MATLAB R
script S_FactorResidualCorrelation. 

E 126 – Factors on demand: horizon effect (see E 116)


Consider as in E 116 a market of N stocks, where each stock n = 1, . . . , N trades at time t at the price
Pt,n . Consider as interpretation factors the linear returns on a set of K indices, such as GICS sectors,
where each index k = 1, . . . , K quotes at time t at the price St,k . As in Black-Scholes, assume that
stocks and indices follow a geometric Brownian motion, i.e.:

      
X µX ΣX ΣXF
∼N τ ,τ , (3.191)
F µF Σ0XF ΣF
where:

 
PT +τ,n
Xn ≡ ln (3.192)
PT,n
 
ST +τ,k
Fk ≡ ln . (3.193)
ST,k
In particular, assume that the compounded returns are generated by the linear model:

X ≡ τ µX + DF +  , (3.194)

where D is a constant matrix of loadings:

     
F 0 τ ΣF 0
∼N , , (3.195)
 0 0 τ Σ

and Σ is diagonal. Notice that (3.194)-(3.195) is a specific case of, and fully consistent with, the more
general formulation (3.191). The specification (3.194) is the "estimation" side of the model, i.e. the
model that would be fitted to the empirical observations. We want to represent the linear returns on the
securities:

R = eX − 1 , (3.196)

in terms of the explanatory factors:

Z = eF − 1 , (3.197)

by means of a linear model:

R ≡ a + BZ + U . (3.198)

The specification (3.198) is the interpretation side of the model, i.e. the model that would be used for
portfolio management applications, such as hedging or style analysis. Write a MATLAB R
script in which
you:
• Upload µX , D, ΣF and Σ from DB_LinearModel;
• Study the relationship between the constant τ µX in (3.194) and the intercept a in (3.198);
• Study the relationship between the loadings D in (3.194) and the loadings B in (3.198);
• Determine if U idiosyncratic?
Note. See Meucci (2010c) and Meucci (2010b).

Solution of E 126
In the simple bi-variate and rescaled case such that Pt = St = 1 the returns are shifted multivariate
lognormal:

!
(t)     2

RP µX σX ρX,F σX σF
∼ LogN t ,t − 1. (3.199)
(t)
RS µF ρX,F σX σF σF2

We recall from (2.219, AM 2005)-(2.220, AM 2005) in that in general if:

Y ∼ LogN(µ, Σ) . (3.200)

then:
CHAPTER 3. MODELING THE MARKET 89

1
E {Y} = eµ+ 2 diag(Σ) .
1 1
(3.201)
E {YY0 } = (eµ+ 2 diag(Σ) (eµ+ 2 diag(Σ) )0 ) ◦ eΣ .

Also:

Cov {Y} = E {YY0 } − E {Y} E {Y0 } . (3.202)

From (3.127, AM 2005) the beta in (3.198) simplifies as:

n o
(t) (t)
Cov RP , RS
β≡ n o . (3.203)
(t)
Var RS

Therefore:

2 2
(eµeX t+eσX t/2+µeF t+eσF t/2 )(eρeX,F σeX σeF t − 1)
β= 2 2 . (3.204)
e2µeF t+eσF t (eσeF t − 1)

Finally, U is not idiosyncratic, and the longer the horizon, the more pronounced this effect. See MATLAB R

script S_HorizonEffect for the implementation. 

E 127 – Factors on demand: no-Greek hedging (see E 143)


Consider the same market of call options than in E 143. Write a MATLAB R
script in which you:
• Upload the time series of the underlying and the implied volatility surface provided in DB_ImplVol;
• Fit a joint normal distribution to the weekly invariants, namely the log-changes in the underly-
ing and the residuals from a vector autoregression of order one in the log-changes in the implied
volatilities surface Σt :

 
ln St+τ − ln St
∼ N(τ µ, τ Σ) ; (3.205)
ln Σt+τ − ln Σt

Assume that the investment horizon is eight weeks. We want to represent the linear returns on the
options RC in terms of the linear returns R of the underlying S&P 500 by means of a linear model:

RC ≡ a + BR + U . (3.206)

Notice that the specification (3.206) is the interpretation side of a "factors on demand" model.
• Generate joint simulations for RC and R and scatter-plot the results;
• Compute a and B by OLS;
• Compute the cash and underlying amounts necessary to hedge RC based on the delta of the Black-
Scholes formula. Compare with a and B;
• Repeat the above exercise when the investment horizon shifts further or closer in the future.
Hint. See Meucci (2010c) and Meucci (2010b).
Solution of E 127
To compute the hedge, consider the risk-neutral pricing align for a generic option (not necessarily a call
option):

∆O − δ∆S ≈ Cr∆t , (3.207)

where O is the option price; S is the underlying value; r is the risk-free rate; δ is the "delta":

∂O
δ≡ , (3.208)
∂S
and C is the cash amount:

C ≡ O − δS . (3.209)

Then:

∆O C δ ∆S
≈ r∆t + S , (3.210)
O O O S
or:

RO ≈ a + bR , (3.211)

where:

C δ
a≡ r∆t, b≡ S. (3.212)
O O
See the MATLAB
R
script S_HedgeOptions for the implementation. 

E 128 – Factors on demand: selection heuristics


Consider the linear return R from the current date to the investment horizon of a portfolio and a pool of
N generic risk factors {Zn }n=1,...,N , such as the returns of hedging instruments for hedging purposes or
the returns of style indices for style analysis. As prescribed by the Factors on Demand approach, we want
to express the portfolio return in a dominant-plus-residual way as a linear combination of only the best
K out of the N factors

X
R= dk Zk + η , (3.213)
k∈CK

where CK is a subset of {1, . . . , N } of cardinality K. Define the optimal exposures d in (3.213) to


maximize the r-square (3.116, AM 2005). Generate arbitrarily the parameters of the joint distribution
fR,Z of the portfolio return and the factors necessary to maximize the r-square of the fit and write a
MATLAB R
script that compares three approaches:
• A naive approach that ranks the r-square provided by each single factor and collects the K with the
most explanatory power;
CHAPTER 3. MODELING THE MARKET 91

• The recursive rejection routine in Meucci (2005, section 3.4.5) to solve heuristically the above
problem by eliminating the factors one at a time starting from the full set;
• The recursive acceptance routine, which is the same as the above recursive rejection, but it starts
from the empty set, instead of from the full set.

Note. See Meucci (2010c).


Solution of E 128
See the MATLAB R
script S_SelectionHeuristics. 

E 129 – Spectral basis in the continuum (www.3.6) **


Show that the generic eigenfunction of a Toepliz covariance matrix must be an oscillating function with
frequency ω, modulo a multiplicative factor, and determine the explicit form of the eigenvalues.
Hint. In order to better capture the analogies between the continuum and the discrete case, we advise the
reader to refer to Appendix B of (Meucci, 2005) and in particular to the (rationale behind) Tables B.4,
B.11 and B.20.
Solution of E 129
First of all, we consider a generic Toeplitz operator S defined on L2 (R), i.e. an operator whose kernel
representation S(x, y) vanishes fast enough at infinity and satisfies:

S(x + z, y) = S(x, y − z) . (3.214)

Suppose that the operator admits a one-dimensional eigenvalue/eigenfunction pair, i.e. there exist a num-
ber λω and a function:

h i
S e(ω) = λω e(ω) , (3.215)

where the function is unique up to a constant. Using Table (B.4, AM 2005), the spectral equation (3.215)
reads explicitly as follows:

Z
S(x, y)e(ω) (y)dy = λω e(ω) (x) . (3.216)
R

First of all we determine the generic form of such an eigenfunction, if it exists. Expanding in Taylor
series the spectral basis and using the spectral equation we obtain

Z
λω e(ω) (x + dx) = S(x + dx, y)e(ω) (y)dy
R
Z
= S(x, y − dx)e(ω) (y)dy (3.217)
R
Z
= [S(x, y) − ∂y S(x, y)dx] e(ω) (y)dy .
R

On the other hand from another Taylor expansion we obtain:

de(ω)
 
λω e(ω) (x + dx) = λω e(ω) (x) + dx . (3.218)
dx
Therefore, integrating by parts and using the assumption that the matrix S vanishes at infinity, we obtain
the following identity:

de(ω)
Z
λω =− (∂y S(x, y))e(ω) (y)dy
dx R
Z h i Z
=− (ω)
∂y S(x, y)e (y) dy + S(x, y)∂y e(ω) (y)dy (3.219)
Z R R

= S(x, y)∂y e(ω) (y)dy ,


R

or, in terms of the (one-dimensional) derivative operator (B.25, AM 2005):

h i h i
S De(ω) = λω De(ω) , (3.220)

Therefore De(ω) is an eigenvector relative to the same eigenvalue as e(ω) .


Now assume that the Toeplitz operator S is symmetric and positive. Similarly to (A.51, AM 2005) the
operator is symmetric if its kernel is symmetric across the diagonal, i.e.:

S(x, y) = S(y, x) . (3.221)

Similarly to (A.52, AM 2005) the operator is positive if for any function v in its domain the following is
true:

Z Z
hv, S [v]i ≡ v(x) S(x, y)v(y)dydx ≥ 0 . (3.222)
R R

In this case we can restate the spectral theorem in the continuum making use of the formal substitutions
in Tables B.4, B.11 and B.20 of Meucci (2005): if the kernel representation S of a linear operator satisfies
(3.221) and (3.222), then the operator
 admits an orthogonal basis of eigenfunctions. In other words, then
there exists a set of functions e(ω) (·) ω∈R and a set of positive values {λω }ω∈R such that (3.215) holds,
which is the equivalent of (A.53, AM 2005) in the continuous setting of functional analysis.
Furthermore, the set of eigenfunctions satisfies the equivalent of (A.54, AM 2005) and (A.56, AM 2005),
i.e.:

D E Z
e(ω) , e(ψ) ≡ e(ω) (x)e(ψ) (x)dx = 2πδ (ω) (ψ) , (3.223)
R

where we chose a slightly more convenient normalization constant. Consider the operator E represented
by the following kernel:

E(y, ω) ≡ e(ω) (y) . (3.224)

This is the equivalent of (A.62, AM 2005), i.e. it is a (rescaled) unitary operator, the same way as (A.62,
AM 2005) is a rotation. Indeed:
CHAPTER 3. MODELING THE MARKET 93

Z Z Z
2 (ω)
kEgk = ( e (x)g(ω)dω)( e(ψ) (x)g(ψ)dψ)dx
ZR Z R Z R
(ω)
= ( e (x)e(ψ) (x)dx)g(ω)g(ψ)dψdω
R R R
Z Z (3.225)
= 2π δ (ω) (ψ)g(ω)g(ψ)dψdω
R R
Z
2
= 2π g(ω)g(ω)dω = 2π kgk .
R

By means of the spectral theorem we can explicitly compute the eigenfunctions and the eigenvalues of a
positive and symmetric Toeplitz operator. First of all from (3.215), (3.220) and the fact that in the spectral
theorem to each eigenvalue corresponds only one eigenvector, we obtain that the following relation must
hold:

de(ω) (x)
= gω e(ω) (x) , (3.226)
dx
for some constant gω that might depend on ω. The general solution to this equation is:

e(ω) (x) = Aω egω x . (3.227)

To determine this constant, we compare the normalization condition (3.223) with (B.41, AM 2005) ob-
taining:

e(ω) (x) = eiωx . (3.228)

To compute the eigenvalues of S we substitute (3.228) in (3.216) and we re-write the spectral equation:

Z Z
iωx iω(x+z) iωx
λω e = S(x, x + z)e dz = e S(x, x + z)eiωz dz . (3.229)
R R

Now recall that S is Toeplitz and thus it is fully determined by its cross-diagonal section:

S(x, x + z) = S(0, z) ≡ h(z) , (3.230)

where h is symmetric around the origin. Therefore we only need to evaluate (3.229) at x = 0, which
yields:

Z
λω = h(z)eiωz dz . (3.231)
R

In other words, the eigenvalues as a function of the frequency ω are the Fourier transform of the cross-
diagonal section of the kernel representation (3.230) of the operator:

λω = F[h](ω) . (3.232)
In particular, if:

h(z) ≡ σ 2 e−γ|z| , (3.233)

then:

Z Z
−γ|z|
λω = σ 2
e cos(ωz)dz + iσ 2
e−γ|z| sin(ωz)dz
R R
Z +∞
= 2σ 2
e−γz cos(ωz)dz + 0 (3.234)
0
2σ 2 γ
= .
γ 2 + ω2


E 130 – Eigenvectors for Toeplitz structure


Write a MATLAB R
script that generates a N × N Toeplitz matrix with structure as in (3.209, AM 2005),
(3.214, AM 2005) and (3.222, AM 2005), i.e.:

Sj,j+k ≡ r|k| , (3.235)

where 0 < r < 1. Show in a figure that the eigenvectors have a Fourier basis structure as in (3.217, AM
2005).
Solution of E 130
See the MATLAB R
script S_Toeplitz. 

E 131 – Numerical market projection *


Show how to perform the operations (3.65, AM 2005) by means of the fast Fourier transform in the
standard case where analytical results are not available. More precisely, describe the following steps:
• Approximating the pdf;
• Approximating the characteristic function;
• The discrete Fourier transform.
Hint. The idea draws on Albanese et al. (2004), the solution relies heavily on Xi Chen’s contribution.

Solution of E 131
• Approximating the pdf.
Consider a random variable X with pdf fX . We approximate the pdf with a histogram of N bins:

N
X
fX (x) ≈ fn 1∆n (x) , (3.236)
n=1

where bins ∆1 , . . . , ∆N are defined as follows. First of all, we define the bins’ width:

2a
h≡ , (3.237)
N
CHAPTER 3. MODELING THE MARKET 95

where a is a large enough real number and N is an even larger integer number. Now, consider a
grid of equally spaced points:

ξ1 ≡ −a + h
..
.
ξn ≡ −a + nh (3.238)
..
.
ξN −1 ≡ a − h .
Then for n = 1, . . . , N − 1 we define ∆n as the interval of length h that surrounds symmetrically
the point ξn :

 
h h
∆n ≡ ξn − , ξn + . (3.239)
2 2
For n = N we define the interval as follows:

   
h h
∆N ≡ −a, −a + ∪ a − ,a . (3.240)
2 2
This wraps the real line around a circle where the point −a coincides with the point a.
As far as the coefficients fn in (3.236) are concerned, for all n = 1, . . . , N they are defined as
follows:

Z
1
fn ≡ f (x)dx . (3.241)
h ∆n

We collect the discretized pdf values fn into a vector fX .


• Approximating the characteristic function:
We need to compute the characteristic function:

Z
φX (ω) ≡ eiωx fX (x)dx . (3.242)
R

Using (3.236) and:

Z
1
g(x)1∆n (x)dx ≈ g(−a + nh) , (3.243)
h R

we can approximate the characteristic function as follows:

N
X Z
φX (ω) ≈ fn eiωx 1∆n (x)dx
n=1 R
(3.244)
N N
− 2πi ωa N
X X
iω(−a+nh) π ( 2 −n)
≈ fn he = fn he N .
n=1 n=1
In particular, we can evaluate the approximate characteristic function at the points:

π
ωr ≡ −(r − 1) , (3.245)
a
obtaining:

N
2πi N
X
φX (ωr ) ≈ fn he− N (r−1)(n− 2 )

n=1
N
2πi
X
= fn he− N (r−1)n eπi(r−1)
n=1
(3.246)
N
− 2πi − 2πi 2πi
X
πi(r−1) N (r−1) N (r−1)n N (r−1)
=e he fn e e
n=1
N
2 2πi
X
= eπi(r−1)(1− N ) h fn e− N (r−1)(n−1) .
n=1

Finally, since N is supposed to be very large we can finally write:

N
2πi
X
φX (ωr ) ≈ eπi(r−1) h fn e− N (r−1)(n−1) . (3.247)
n=1

• The discrete Fourier transform


Consider now the discrete Fourier transform (DFT), an invertible matrix operation f 7→ p which is
defined component-wise as follows:

N
2πi
X
pr (f ) ≡ fn e − N (r−1)(n−1) . (3.248)
n=1

Its inverse, the inverse discrete Fourier transform (IDFT), is the matrix operation p 7→ f which is
defined component-wise as follows:

N
1 X 2πi
fn (p) ≡ pr e N (r−1)(n−1) . (3.249)
N r=1

Comparing (3.247) with (3.248) we see that the approximate cf is a simple multiplicative function
of the DFT of the discretized pdf f :

φX (ωr ) ≈ eπi(r−1) hpr (fX ) . (3.250)

Now consider the random variable:

Y ≡ X1 + · · · + XT , (3.251)
CHAPTER 3. MODELING THE MARKET 97

where X1 , . . . , XT are i.i.d. copies of X. The cf of Y satisfies the identity φY ≡ φTX , see (3.64,
AM 2005). Therefore:

φY (ωr ) ≈ eπi(r−1)T hT (pr (fX ))T . (3.252)

On the other hand, from (3.250), the relation between the cf φY and the discrete pdf fY is:

φY (ωr ) ≈ eπi(r−1) h pr (fY ) , (3.253)

Therefore:

pr (fY ) ≈ eπi(r−1)(T −1) hT −1 (pr (fX ))T . (3.254)

The values pr (fY ) can now be fed into the IDFT (3.249) to yield the discretized pdf fY of Y as
defined in (3.251).


E 132 – Simulation of a jump-diffusion process


Write a MATLAB R
script in which you simulate a Merton jump-diffusion process Xt at discrete times
with arbitrary parameters. What are the invariants in this process?
Hint. See Merton (1976).

Solution of E 132
The invariants are the non-overlapping changes in the process ∆Xt over arbitrary intervals. Notice that
these are not the only invariants, as any i.i.d. shock used to generate the process is also an invariant. How-
ever, these invariants are directly observable and their distribution can be estimated with the techniques
discussed in the course. See the MATLAB R
script S_JumpDiffusionMerton. 

E 133 – Simulation of a Ornstein-Uhlenbeck process


Write a MATLAB R
script in which you simulate an Ornstein-Uhlenbeck process. Prove analytically/empirically
that for small time intervals and/or low reversion parameters the Ornstein-Uhlenbeck process is a Brow-
nian motion.
Solution of E 133
Consider the solution of the Ornstein-Uhlenbeck process:

XT +τ = m(1 − e−θτ ) + e−θτ XT + T,τ , (3.255)

where:

σ2
 
T,τ ∼ N 0, (1 − e−2θτ ) . (3.256)

If θτ ≈ 0 we can write:

XT +τ ≈ XT + mθτ + T,τ , (3.257)


where:

T,τ ∼ N(0, σ 2 τ ) , (3.258)


which is the standard arithmetic Brownian motion. See the MATLAB
R
script S_AutocorrelatedProcess
for the implementation. 

E 134 – Simulation of a GARCH process


Write a MATLAB R
script in which you simulate a GARCH(1,1) process with arbitrary parameters. What
are the invariants of this process?
Solution of E 134
The invariants are the shocks in the volatility, which also directly drive the randomness of the process. No-
tice that these invariants are not directly measurable. See the MATLAB R
script S_VolatilityClustering.


E 135 – Equity market: quest for invariance


Write a MATLAB R
script in which you:
• Upload the daily time series of stock prices Pt in the database DB_Equities;
• Define the following variables:

Pt
Xt ≡ (3.259)
Pt−1
Yt ≡ Pt − Pt−1 (3.260)
 2
Pt
Zt ≡ (3.261)
Pt−1
Wt ≡ Pt+1 − 2Pt + Pt−1 ; (3.262)
• Determine which among Xt , Yt , Zt , Wt , can potentially be an invariant and which certainly cannot
be an invariant, by computing the histogram from two sub-samples and by plotting the location-
dispersion ellipsoid of a variable with its lagged value.
Solution of E 135
The Wt ’s are clearly not invariants. See the MATLAB
R
script S_EquitiesInvariants. 

E 136 – Equity market: multivariate GARCH process


Write a MATLAB R
script in which you:
• Upload the daily prices time series of a set of stocks from the database DB_Equities;
• Define the k-period compounded return:

(k)
Xt ≡ ln(Pt+k − Pt ) , (3.263)
where Pt are the prices at time t of the securities, see (3.11, AM 2005);
• Assume a diagonal-vech GARCH(1,1) process for the one-period compounded returns:

(1)
p
U
Xt =µ+ Ht t . (3.264)

U
In this expression S denotes the upper triangular Cholesky decomposition of the generic sym-
metric and positive matrix S, t are normal invariants:
CHAPTER 3. MODELING THE MARKET 99

t ∼ N(0, I) , (3.265)

and the scatter matrix Ht has the following dynamics:

Ht = C + a ◦ Σt−1 + B ◦ Ht−1 , (3.266)

where ◦ is the element-by-element Hadamard product and

(1) (1)
Σt ≡ (Xt − µ)(Xt − µ)0 ; (3.267)

• Estimate the parameters (µ, C, a, B) with the methodology in Ledoit et al. (2003);
• Use the estimated parameters to simulate the distribution of the T -day linear return.
Solution of E 136
Assume it is now time t = 0. We are interested in the T -horizon compounded return:

T T p
(T ) (1)
X X U
X0 = Xt = Tµ + Ht  t . (3.268)
t=1 t=1

We use Monte Carlo scenarios to represent this distribution, proceeding as follows.


First, we generate J independent scenarios for 1 from the multivariate distribution (3.265). For each
(1)
scenario we generate a return scenario for the first period return X1 according to (3.264), i.e.:

(1)
p
U
X1 = µ + H1 1 . (3.269)

where the matrix H1 is an outcome of the above estimation step. Then for each scenario we update
the next-step scatter matrix H2 according to (3.266). Next, we generate J independent scenarios for 2
from the multivariate distribution (3.265) and we generate return scenarios for the second-period returns
(1)
X2 according to (3.264). We proceed iteratively until the scenarios for all the entries in (3.268) have
been generated. Then the linear return distribution follows from the pricing align R = eX − 1. See the
MATLAB R
script S_ProjectNPriceMvGarch for the implementation. 

E 137 – Equity market: linear vs. compounded returns projection I


Assume that the compounded returns (3.11, AM 2005) of a given stock are market invariants, i.e. they
are i.i.d. across time. Consider an estimation interval of one week τe ≡ 1/52 (time is measured in years).
Assume that the distribution of the returns is normal:

Ct,eτ ∼ N(0, σ 2 τe) , (3.270)



where σ 2 ≡ 0.4. Assume that the stock currently trades at the price PT ≡ 1. Fix a generic horizon τ .
Write a MATLAB R
script in which you compute and plot the analytical pdf of the price PT +τ .
Solution of E 137
As in (3.74, AM 2005):

Ct,τ ∼ N(0, σ 2 τ ) . (3.271)


Therefore, as in (3.87, AM 2005), (3.3.88, AM 2005) and (3.92, AM 2005).

PT +τ ∼ LogN(ln(PT ), σ 2 τ ) . (3.272)
The pdf follows from (1.95, AM 2005). See the MATLAB
R
script S_LinVsLogReturn for the implementa-
tion. 

E 138 – Equity market: linear vs. compounded returns projection II


Write a MATLAB R
script in which you:
• Simulate the compounded return at the investment horizon and map these simulations into simula-
tions of the price PT +τ at the generic horizon τ ;
• Superimpose the rescaled histogram from the simulations of PT +τ to show that they coincide;
• Compute analytically the distribution of the first-order Taylor approximation of the pricing function
around zero and superimpose this pdf to the above plots. Notice how the approximation is good for
short horizons and bad for long horizons.
Solution of E 138
The first order Taylor approximation reads:

PT +τ = PT eCT +τ,τ ≈ PT (1 + CT +τ,τ ) = PT + PT CT +τ,τ . (3.273)


Therefore from (3.271) we obtain:

PT +τ ∼ N(PT , PT2 σ 2 τ ) . (3.274)


See the MATLAB
R
script S_EquityProjectionPricing for the implementation. 

E 139 – Fixed-income market: quest for invariance


Write a MATLAB R
script in which you:
• Upload the time series of realizations of the yield curve in DB_FixedIncome;
• Check whether the changes in the yield curve for a given time to maturity are invariants using the
MATLAB R
function PerformIidAnalysis;
• Check whether the changes in the logarithm of the yield curve for a given time to maturity are
invariants using the same function.
Solution of E 139
Changes in the yield curve and changes in the logarithm of the yield curve are approximately invariants,
whereas the changes in the yield to maturity of a specific bond are not. See the MATLAB R
script
S_FixedIncomeInvariants. 

E 140 – Fixed-income market: projection of normal invariants


Assume that the weekly changes in yield to maturity are fully codependent, i.e. co-monotonic. In other
words, assume that the copula of any pairs of weekly yield changes is (2.106, AM 2005). Also, assume
that they have the following marginal distribution:

 2 !
(υ) (υ) 20 + 1.25υ
Yt − Yt−τ ∼ N 0, , (3.275)
10, 000
where υ denotes the generic time to maturity (measuring time in years) and τ is one week. Restrict your
attention to bonds with times to maturity 1, 5, 10, 52 and 520 weeks, and assume that the current yield
curve, as defined in (3.30, AM 2005) is flat at 4%. Write a MATLAB R
script in which you:
CHAPTER 3. MODELING THE MARKET 101

• Produce joint simulations of the five bond prices at the investment horizon τ of one week;
• Determine what are the analytical marginal distributions of the five bond prices at the investment
horizon τ of one week?
• Produce joint simulations of the five bond linear returns from today to the investment horizon τ of
one week;
• Determine what are the analytical marginal distributions of the five bond linear returns at the in-
vestment horizon τ of one week?
• Comment on why the return on the price of a bond cannot be an invariant.
Hint.
• Since the market is fully codependent you will only need one uniformly generated sample;
• You will need the quantile function to generate simulations. Compute the quantile function using
interp1, the linear interpolation/extrapolation of the cdf.
• For a generic bond with time to maturity υ from the decision date T the expiry date is E ≡ T + υ.
As in (3.81, AM 2005) the price at the investment horizon of that bond reads:

(T +υ) (T +υ−τ )
ZT +τ = ZT exp(−(υ − τ )∆τ Y (υ−τ ) ) . (3.276)

In other words, the price is determined by the market invariant, a random variable, and the known
price of a different bond with shorter time to maturity.
• The distribution of the 4-week-to-maturity bond at the 4-week-horizon is degenerate, i.e. its pdf is
the Dirac delta, because the outcome is deterministic. Make sure that your outcome is consistent
with this statement.
Solution of E 140
From (3.276) the bond price reads:

(T +υ)
ZT +τ = eX , (3.277)

where:

(T +υ−τ )
X ≡ ln(ZT ) − (υ − τ )∆τ Y (υ−τ ) . (3.278)

From (3.275):

∆τ Y (υ) ∼ N(0, συ2 ) , (3.279)

where:

 2
20 + 1.25υ
συ2 ≡ . (3.280)
10, 000
Therefore:

(T +υ−τ )
X ∼ N(ln(ZT ), (υ − τ )2 συ−τ
2
), (3.281)

which with (3.277) implies:


(T +υ) (T +υ−τ )
ZT +τ ∼ LogN(ln(ZT ), (υ − τ )2 συ−τ
2
). (3.282)

From (3.10, AM 2005) the linear return from the current time T to the investment horizon T + τ of a
bond that matures at E ≡ T + υ is defined as:

(T +υ)
(T +υ) ZT +τ
LT +τ,τ ≡ (T +υ)
− 1. (3.283)
ZT

Proceeding as above:

LT +τ,τ = eY − 1 , (3.284)

where:

(T +υ−τ ) (T +υ)
Y ≡ ln(ZT ) − ln(ZT ) − (υ − τ )∆τ Y (υ−τ ) , (3.285)

and thus:

(T +υ) (T +υ−τ ) (T +υ)


1 + LT +τ,τ ∼ LogN(ln(ZT ) − ln(ZT ), (υ − τ )2 συ−τ
2
), (3.286)

(T +υ)
or LT +τ,τ is a shifted lognormal random variable. Notice that for υ ≡ τ the above distribution is
degenerate, i.e. deterministic, whereas any estimation would have yielded a non-degenerate distribution.
See the MATLAB R
script S_BondProjectionPricingNormal for the implementation. 

E 141 – Fixed-income market: projection of Student t invariants


Consider a fixed-income market, where the changes in yield-to-maturity, or rate changes, are the market
invariants. Assume that the weekly changes in yield for all maturities are fully codependent, i.e. co-
monotonic. In other words, assume that the copula of any pairs of weekly yield changes is (2.106, AM
2005). Assume that the marginal distributions of the weekly changes in yield for all maturities are:

∆τe Y (υ) ∼ St(ν, µ, συ2 ) . (3.287)

In this expression υ denotes the time to maturity (in years) and:

 
p 5
ν ≡ 8, µ ≡ 0, συ2 ≡ 20 + υ × 10−4 . (3.288)
4

Consider bonds with current times to maturity 4, 5, 10, 52 and 520 weeks, and assume that the current
yield curve, as defined in (3.30, AM 2005) in is flat at 4% (measuring time in years). Write a MATLAB R

script in which you:


• Use the MATLAB R
function ProjectionStudentT that takes as inputs the estimation parameters
of the t-distributed invariants and the horizon-to-estimation ratio τ /e
τ to compute the cdf of the
invariants at the investment horizon τ . You do not need to know how this function works. Make
sure you properly compute the necessary inputs (see hints below).
CHAPTER 3. MODELING THE MARKET 103

• Use the cdf obtained above to generate a joint simulation of the bond prices at the investment
horizon τ of four weeks.
• Plot the histogram of the linear returns LT +τ,τ of each bond over the investment horizon, where
the linear return is defined consistently with (3.10, AM 2005) as follows:

(E)
Zt
Lt,τ · (E)
− 1. (3.289)
Zt−τ

Notice that the long-maturity (long duration) bonds are much more volatile than the short maturity
(short duration) bonds.
Hint. Suppose today is November 1st, 2006, and we hold a zero-coupon bond that matures in 10 weeks,
i.e., it matures on Jan.15. 2007. We are interested in the value of the bond after 4 weeks, i.e., Dec.1 2006.
Recall from (3.30, AM 2005) that the value of a zero-coupon bond is fully determined by its yield to
maturity. At the 4-week investment horizon (Dec.1 2006) our originally 10-week bond will be a 6-week
bond. Therefore its price will be fully determined by the value of the 6-week yield to maturity on Dec.1
2006. For instance, if the 6-week yield to maturity on Dec.1 2006 is 4.1%, then in (3.30, AM 2005) we
(6/52)
have υ ≡ 6/52 and Y12/1/2006 ≡ 0.041. Therefore the bond price on Dec.1 2006 will be:

1/15/2007 6 (6/52)
Z12/1/2006 = exp(− Y )
52 12/1/2006 (3.290)
6
= e− 52 ×0.041 ≈ 0.99528 .

To summarize, in order to price the 10-week bond at the 4-week investment horizon we need the distribu-
tion of the 6-week yield to maturity on Dec.1 2006. In order to proceed, we recall that in the zero-coupon
bond world, the invariants are the non-overlapping changes in yield to maturity, for any yield to maturity,
see the textbook from pp.109 to pp.113. In particular, from (3.31, AM 2005), the following four random
variables are i.i.d.:

(6/52) (6/52)
X1 ≡ Y11/08/2006 − Y11/1/2006 (3.291)
(6/52) (6/52)
X2 ≡ Y11/15/2006 − Y11/08/2006 (3.292)
(6/52) (6/52)
X3 ≡ Y11/22/2006 − Y11/15/2006 (3.293)
(6/52) (6/52)
X4 ≡ Y12/1/2006 − Y11/22/2006 (3.294)

(6/52)
Notice that we can express the random variable Y12/1/2006 in (3.290) as follows:

(6/52) (6/52)
Y12/1/2006 = Y11/1/2006 + X1 + X2 + X3 + X4 . (3.295)

Substituting this in (3.290) we obtain:

6 (6/52)
1/15/2007
Z12/1/2006 = e− 52 (Y11/1/2006 +X1 +X2 +X3 +X4 )
(3.296)
12/15/2006
= Z11/1/2006 e−6/52(X1 +X2 +X3 +X4 ) ,
12/15/2006
where in the last row we used (a, AM 2005)gain. The term Z11/1/2006 is the current value of a 6-week
zero-coupon bond, which is known. Indeed, using the information that the curve is currently flat at 4%
we obtain:

6 (6/52) 6
12/15/2006
Z11/1/2006 = e− 52 Y11/1/2006 = e− 52 ×0.04 ≈ 0.99540 . (3.297)
We are left with the problem of projecting the invariant, i.e. computing the distribution of X1 + X2 +
X3 + X4 , and pricing it, i.e. computing the distribution of e−6/52(X1 +X2 +X3 +X4 ) in (3.296). To project
the invariant we need to compute the distribution of the sum four independent t variables:

d d d 2
X1 = X2 = X3 = X4 ∼ St(ν, µ, σ6/52 ), (3.298)
where the parameters follow from (3.287). This is the FFT algorithm provided in ProjectionStudentT. The
pricing is then performed by Monte Carlo simulations. As for the linear returns, these are the return on
our bond over the investment horizon. Therefore (3.289) reads:

(1/15/2007)
Z12/1/2006
4 ≡
L12/1/2006, 52 − 1. (3.299)
(1/15/2007)
Z11/1/2006

Solution of E 141
See the MATLAB R
script S_BondProjectionPricingStudentT. 

E 142 – Derivatives market: quest for invariance


Write a MATLAB R
script in which you:
• Upload the time series of daily realizations of the implied volatility surface in DB_Derivatives;
• Check whether the weekly changes in implied volatility for a given level of moneyness and time to
maturity are invariants using the MATLAB R
function PerformIidAnalysis;
• Check whether the weekly changes in the logarithm of the implied volatility for a given level of
moneyness and time to maturity are invariants using the same function;
• Define the vector Zt as the juxtaposition of all the entries of the logarithm of the implied volatility
surface at time t;
• Fit the implied volatility data to a multivariate autoregressive process of order one:

Zt+1 ≡ a
b + BZ
b t +b
t+1 , (3.300)
where time is measured in weeks;
t are invariants using the MATLAB
• Check whether the weekly residuals b R
function PerformIidAnalysis.
Solution of E 142
The weekly changes in (the logarithm of) the implied volatility are not invariants, because they display
significant negative autocorrelation. On the other hand, the weekly residuals et are invariants. See the
MATLAB R
script S_DerivativesInvariants. 

E 143 – Derivatives market: projection of invariants


Consider a market of call options on the S&P 500, with current time to maturity of 100, 150, 200, 250,
and 300 days and strikes equal 850, 880, 910, 940, and 970 respectively. Assume that the investment
horizon is 8 weeks. Write a MATLAB R
script in which you:
CHAPTER 3. MODELING THE MARKET 105

• Upload the time series of the underlying and the implied volatility surface provided in DB_ImplVol;
• Fit a joint normal distribution to the weekly invariants, namely the log-changes in the underly-
ing and the residuals from a vector autoregression of order one in the log-changes in the implied
volatilities surface Σt :

 
ln St+τ − ln St
∼ N(τ µ, τ Σ) ; (3.301)
ln Σt+τ − ln Σt

• Generate simulations for the invariants and jointly project underlying and implied volatility surface
to the investment horizon;
• Price the above simulations through the full Black-Scholes formula at the investment horizon, as-
suming a constant risk-free rate at 4%;
• Compute the joint distribution of the linear returns of the call options, as represented by the sim-
ulations: the current prices of the options can be obtained similarly to the prices at the horizon by
assuming that the current values of underlying and implied volatilities are the last observations in
the database;
• For each call option, plot the histogram of its distribution at the horizon and the scatter-plot of its
distribution against the underlying;
• Verify what happens as the investment horizon shifts further in the future.
Hint. You need to interpolate the surface at the proper strike and time to maturity, which at the horizon
has shortened.

Solution of E 143
See the MATLAB R
script S_CallsProjectionPricing. 

E 144 – Statistical arbitrage: co-integration trading *


Write a MATLAB R
file in which you:
• Upload the database DB_SwapParRates of the daily series of a set of par swap rates;
• Determine the (in-sample) decreasingly most co-integrated combination of the above par swap rates
using principal component analysis;
• Fit an AR(1) process to these combinations and compute the unconditional (long term, equilibrium)
expectation and standard deviation;
• Plot the 1-z-score bands around the long-term mean to generate signals to enter or exit a trade.
Hint. See Meucci (2009).

Solution of E 144
See the MATLAB R
script S_StatArbSwaps. 
Chapter 4

Estimating the distribution of the


market invariants

E 145 – Smallest ellipsoid (www.4.1) *


Show that the sample mean and sample covariance represent the choices of location and scatter param-
eters, respectively, that give rise to the smallest ellipsoid among all those that pass through the cloud of
observations. Formally, prove that:

(E, d = argmin[Vol{Eµ,Σ }] ,
b N Cov) (4.1)
(µ,Σ)∈C

where the set of constraints C imposes that Σ is symmetric and positive definite and that the average
Mahalanobis distance is one, see (4.49, AM 2005).
Solution of E 145 p
From (A.77, AM 2005) the volume of the ellipsoid Eµ,Σ is proportional to |Σ|. Therefore, defining
Ω ≡ Σ−1 , the optimization problem (4.48, AM 2005) (in log) becomes:

(b b ≡ argmin ln |Ω| ,
µ, Ω) (4.2)
(µ,Ω)∈C

where the constraints read:

T
1X
C1 : (xt − µ)0 Ω(xt − µ) = 1
T t=1 (4.3)
C2 : Ω symmetric, positive .

We solve neglecting C2 and we check later that C2 is satisfied. The Lagrangian reads:

"
T
#
1X 0
L ≡ ln |Ω| − λ (xt − µ) Ω(xt − µ) − 1 . (4.4)
T t=1

The first order condition with respect to µ is:

106
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 107

T
∂L 2X
0N ×1 = = Ω(xt − µ) , (4.5)
∂µ T t=1

from which we see that the optimal µ


b is the sample mean:

T
1X
b≡
µ xt ≡ E
b. (4.6)
T t=1

As for the first order condition with respect to Ω, we see from (A.125, AM 2005) that if A is symmetric,
then the following identity holds:

∂ ln |A|
= A−1 . (4.7)
∂A
Therefore:

T
∂L λX
0N ×N = = Ω−1 − (xt − µ)(xt − µ)0 , (4.8)
∂Ω T t=1

from which we see that the optimal Ω


b satisfies:

T
!−1
λX 1 d −1

b = (xt − µ)(xt − µ)0 ≡ Cov . (4.9)
T t=1 λ

To compute the Lagrange multiplier λ we re-write the constraint (4.3) as follows:

 
1 N
1 = tr[ΩCov] = tr
b d IN = , (4.10)
λ λ
from which λ = N . 

E 146 – Ordinary least squares estimator of the regression factor loadings (www.4.1)
Show that the ordinary least squares (OLS) estimator B b in (4.52, AM 2005) provides the best fit to
the observations, in the sense that it minimizes the sum of the square distances between the original
observations ft and the recovered values Bf
b t:
X 2
Bb = argmin kxt − Bft k , (4.11)
B t
where k·k is the standard norm (A.6, AM 2005).
Solution of E 146
We simply write the first order conditions, which read:
T
X
0N ×K = b t )f 0 .
−(xt − Bf (4.12)
t
t=1

The solution to this set of equations are the OLS factor loadings (4.52, AM 2005). 
E 147 – Maximum likelihood estimation for elliptical distributions (www.4.2)
Show that the maximum likelihood (ML) estimators of location and dispersion under the assumption that
the N -dimensional invariants X ∼ El(µ, Σ, g), are given by:

PT
wt xt
b = Pt=1
µ T
s=1 ws
T
(4.13)
b = 1 b )0 ,
X
Σ wt (xt − µ
b ) (xt − µ
T t=1

where wt is given by:

g 0 Mt2

wt ≡ −2 , (4.14)
g (Mt2 )

and:

0
Mt2 ≡ (xt − µ) Ω (xt − µ) , (4.15)

with Ω ≡ Σ−1 .
Hint.
∂Mt2
= −2Ω (xt − µ) (4.16)
∂µ
∂Mt2 0
= (xt − µ) (xt − µ) . (4.17)
∂Ω

Solution of E 147
To compute the ML estimators µ b and Σ
b we have to maximize the likelihood function (4.66, AM 2005)
over the following parameters set:

Θ ≡ RN × {symmetric, positive N × N matrices} . (4.18)

First of all it is equivalent, though easier, to maximize the logarithm of the likelihood function. Secondly
we neglect the constraint that µ and Σ lie in Θ and verify ex-post that the unconstrained solution belongs
to Θ. Third, it is easier to compute the ML estimators of µ and Ω. The ML estimator of Σ is simply the
inverse of the estimator of Ω by the invariance property (4.70, AM 2005) of the ML estimators.
From (4.74, AM 2005) the log-likelihood reads:

T T
X T X
ln g Mt2 .
 
ln (fθ (iT )) = ln fθ (xt ) = ln |Ω| + (4.19)
t=1
2 t=1

The first order conditions with respect to µ read:


CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 109

" T # T T
g 0 Mt2 ∂Mt2

∂ X  2
 X X
0N ×1 = ln g Mt = = wt Ω (xt − µ) , (4.20)
∂µ t=1 t=1
g (Mt2 ) ∂µ t=1

where we used (4.16). The solution to this equations is:

PT
wt xt
b = Pt=1
µ T
. (4.21)
s=1 ws

The first order conditions with respect to Ω reads:

T
T ∂ ln |Ω| X g 0 Mt2 ∂Mt2

0N ×N = +
2 ∂Ω t=1
g (Mt2 ) ∂Ω
(4.22)
T
T 1X 0
= Ω−1 − wt (xt − µ) (xt − µ) ,
2 2 t=1

where in the last row we used (4.17) and the fact that from (A.125, AM 2005) for a symmetric matrix Ω
we have:

∂ ln |Ω|
= Ω−1 . (4.23)
∂Ω
Thus the solution to (4.22) reads:

T
b −1 = 1 b )0 .
X
b ≡Ω
Σ wt (xt − µ
b ) (xt − µ (4.24)
T t=1

This matrix is symmetric and positive definite, and thus the unconstrained optimization is correct. 

E 148 – Maximum likelihood estimation for univariate elliptical distributions (see E 147)
Consider the same setup than in E 147 but assume now that X ∼ El(µ, σ 2 , g), where we know the func-
tional form of g. Compute the maximum likelihood (ML) estimators µ
b and σ b2 of µ and σ 2 respectively.
Hint. Define:

Mt2 ≡ ω 2 (xt − µ)2 , (4.25)

and use:

∂Mt2
= −2ω 2 (xt − µ) (4.26)
∂µ
∂Mt2
= (xt − µ)2 . (4.27)
∂ω 2
Solution of E 148
To compute the ML estimators µ b2 we have to maximize the likelihood function as in (4.66, AM
b and σ
2005), which after (4.74, AM 2005) reads:

T
(xt − µ)2
  
2
X 1
(b b ) ≡ argmax
µ, σ ln √ g , (4.28)
µ,σ 2 ∈Θ t=1 σ2 σ2

where the parameter set is Θ ≡ R × R+ . We neglect the constraint that σ 2 be positive and verify ex-post
that the unconstrained solution satisfies this condition. It is easier to compute the ML estimators of µ
and ω 2 ≡ 1/σ 2 . The ML estimator of σ 2 is simply the inverse of the estimator of ω 2 by the invariance
property (1.70, AM 2005) of the ML estimators. The log-likelihood reads:

T
T 2 X 
ln g(Mt2 ) .

ln(fθ (iT )) = ln ω + (4.29)
2 t=1

The first order conditions with respect to µ read:

" T # " T #
∂ ∂ X ∂ X  2

0= [ln(fθ (iT ))] = ln fθ (xt ) = ln g(Mt )
∂µ ∂µ t=1 ∂µ t=1
(4.30)
T T
X g 0 (M 2 ) ∂M 2
t t
X
= = wt ω 2 (xt − µ) ,
t=1
g(Mt2 ) ∂µ t=1

where we used (4.26) and we defined:

g 0 (Mt2 )
wt ≡ −2 . (4.31)
g(Mt2 )

The solution to this equations is:

PT
wt xt
b = Pt=1
µ T
. (4.32)
s=1 ws

The first order conditions with respect to ω 2 read

PT
∂ ln(fθ (iT )) ∂ t=1 ln fθ (xt )
0= =
∂ω 2 ∂ω 2
T 0
T ∂ ln(ω ) X g (Mt2 ) ∂Mt2
2
= + (4.33)
2 ∂ω 2 t=1
g(Mt2 ) ∂ω 2
T
T 1 1X
= − wt (xt − µ)2 ,
2 ω2 2 t=1

where in the last row we used (4.27). Thus the solution to (4.33) reads:
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 111

T
1 1X
b2 ≡
σ = b)2 .
wt (xt − µ (4.34)
c2 )
(ω T t=1

This number is positive and thus the unconstrained optimization is correct. 


E 149 – Maximum likelihood estimator of explicit factors under conditional ellip-
tical distribution (www.4.2)
Show that the maximum likelihood (ML) estimator of B and Σ of the explicit factor model (4.86, AM
2005) under the assumption that the conditional distribution of the perturbations is elliptical:

Ut |ft ∼ El(0, Σ, g) . (4.35)


are given by the following set of joint implicit equations:

" T #" T #−1


X X
B
b = wt xt ft0 wt ft ft0 (4.36)
t=1 t=1
T
b = 1
X
Σ wt (xt − Bf b )0 .
b )(xt − Bf (4.37)
T t=1

Solution of E 149
From the property (2.270, AM 2005) of elliptical distribution this implies that the conditional distribution
of the invariants is elliptical with the same density generator:

Xt |ft ∼ El (Bft , Σ, g) . (4.38)

To compute the maximum likelihood (ML) estimators B b we define Ω ≡ Σ−1 and we maximize
b and Σ,
the log-likelihood function:

T
T X
ln g Mt2 ,
 
ln (fθ (iT )) ≡ ln |Ω| + (4.39)
2 t=1

where:

0
Mt2 ≡ (xt − Bft ) Ω (xt − Bft ) . (4.40)
The first order conditions with respect to B read:


0N ×K = [ln (fθ (iT ))]
∂B
T
g 0 Mt2 ∂M 2

X
t
= (4.41)
t=1
g (Mt2 ) ∂B
T
X
= wt Ω (xt − Bft ) ft0 ,
t=1
where:

g 0 Mt2

wt ≡ −2 . (4.42)
g (Mt2 )
The solution to (4.41) reads:

" T #" T #−1


X X
B= wt xt ft0 wt ft ft0 . (4.43)
t=1 t=1

The first order conditions with respect to Ω reads:

T
T ∂ ln |Ω| X g 0 Mt2 ∂Mt2

0N ×N = +
2 ∂Ω t=1
g (Mt2 ) ∂Ω
(4.44)
T
T 1X 0
= Ω−1 − wt (xt − µ) (xt − µ) ,
2 2 t=1

where in the last row we used (4.17) and the fact that from (A.125, AM 2005) for a symmetric matrix Ω
we have:

∂ ln |Ω|
= Ω−1 . (4.45)
∂Ω
The solution to (4.22) reads:

T
b −1 = 1 b )0 .
X
b ≡Ω
Σ wt (xt − µ
b ) (xt − µ (4.46)
T t=1

This matrix is symmetric and positive definite, and thus the unconstrained optimization is correct. 

E 150 – Explicit factors: t-test of factor loadings


Consider two jointly normal invariants:

2
     
Xt µX σX ρσX σF
∼N , . (4.47)
Ft µF ρσX σF σF2

Consider a conditional model of the kind (4.88, AM 2005):

Xt = α + βft + Ut , (4.48)

where:

Ut |ft ∼ N(0, σ 2 ) . (4.49)


CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 113

What is the conditional model (4.48)-(4.49) ensuing from (4.47)? Consider the conditional model (4.48)-
(4.49) for the invariants. Compute the ML estimators of the factor loadings (b
α, β)
b given the observations
iT ≡ {x1 , f1 , . . . , xT , fT }.
Hint. Consider ft0 ≡ (1, ft ) and:
T T
b XF ≡ 1 bF ≡ 1
X X
Σ xt ft0 , Σ ft f 0 . (4.50)
T t=1 T t=1 t

Solution of E 150
See (2.173, AM 2005) and/or (3.130, AM 2005)-(3.131, AM 2005) to derive:

σX
α ≡ µX − ρ µF (4.51)
σF
σX
β≡ρ (4.52)
σF
σ ≡ σX (1 − ρ2 ) .
2 2
(4.53)

Follow the proof of (4.126, AM 2005) to derive:

(b
α, β)
b =Σ b −1 .
b XF Σ (4.54)
F

E 151 – Explicit factors: maximum likelihood estimator of the factor loadings (see E 150)
Consider the same setup than in E 150. Compute the joint distribution of the ML estimators of the factor
loadings (b
α, β)
b under the conditional model (4.48)-(4.49).
Solution of E 151
Follow the proof of (4.129, AM 2005) to derive in terms of a (degenerate) matrix-valued normal distribu-
tion:

2
 
(b b ∼ N (α, β), σ , Σ
α, β) b −1 . (4.55)
F
T

From (2.180, AM 2005) we then obtain:

σ 2 b −1
    
α α
∼N
b
, Σ . (4.56)
βb β T F


E 152 – Explicit factors: maximum likelihood estimator of the dispersion parame-
ter (see E 150)
b2 of the dispersion
Consider the same setup than in E 150. Compute the distribution of the ML estimator σ
parameter that appears in (4.49).
Solution of E 152
Follow the proof of (4.130, AM 2005) and use (2.230, AM 2005) to derive:

b2 ∼ Ga(T − 2, σ 2 ) .
Tσ (4.57)

E 153 – Explicit factors: t-test of factor loadings (see E 150)


Consider the same setup than in E 150. Compute the distribution of the t-statistic for α
b:

√ α − α)
(b
tα ≡
b T − 2p , (4.58)
b2 σ
σ bα2

and the distribution of the t-statistic for β:


b

√ (βb − β)
tβ ≡
b T − 2q , (4.59)
bβ2
b2 σ
σ

where σ b −1 and σ
bα2 is the north-west entry of Σ bβ2 is its south-east entry.
F

Solution of E 153
From (4.57), (1.106, AM 2005) and (1.109, AM 2005) it follows:

b2
 
T σ
(T − 2) ∼ χ2T −2 . (4.60)
T − 2 σ2

From (4.56) we obtain:

s
T
α − α) ∼ N(0, 1) ,
(b (4.61)
bα2 σ 2
σ

and similarly for β. Furthermore, from E 155 we derive that (b


α, β) b2 are independent. Using
b and σ
(4.100), we obtain:

q
T
√ α − α)
(b σ
bα2 σ 2 (b
α − α)
tα ≡
b T − 2p = q (4.62)
b2 σ
σ bα2 T σ b2
T −2 σ 2

Then from (4.100) we derive:

d Y1
tα = q
b ∼ St(T − 2, 0, 1) . (4.63)
ZT2 −2


CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 115

E 154 – Explicit factors: hypothesis testing (see E 150)


Consider the same setup than in E 150. You would like to ascertain whether it is possible that:

α = α0 , (4.64)

for an arbitrary value α0 in (4.48), typically α0 ≡ 0. How can you asses if the hypothesis (4.64) is
acceptable?
Solution of E 154
tα0 of (4.58). In the
First, compute the distribution of (4.58) under (4.64). Then compute the realization e
notation (1.87, AM 2005) we obtain:

St

P btα0 ≤ e
tα0 = Fν,0,1 (e
tα0 ) (4.65)
St

P btα0 ≥ e
tα0 = 1 − Fν,0,1 (e tα0 ) . (4.66)

Therefore, if tα is so small or so large that either probabilities are too small, then (4.64) is very unlikely.

E 155 – Independence of the sample mean and the sample covariance (www.4.3) *

Assume that Xt ∼ N(µ, Σ). Prove that the sample mean (4.100, AM 2005) and sample covariance
(4.101, AM 2005) are independent of each other.
Solution of E 155
Consider the following variables:

T
1X
b≡
µ Xt
T t=1
U1 ≡ X 1 − µ
b (4.67)
..
.
UT ≡ X T − µ
b.

The joint characteristic function of {U1 , . . . , UT , µ


b } reads:

φ ≡ φU1 ,...,UT ,µb (ω 1 , . . . , ω T , τ )


n PT 0 0
o
= E ei( t=1 ωt Ut +τ µb )
n PT 0 PT 0 1 PT
o (4.68)
= E ei[ t=1 ωt (Xt − T s=1 Xs )+τ ( T t=1 Xt )]
1

n PT PT 0 o
= E ei( t=1 (ωt + T − T s=1 ωs ) Xt ) .
τ 1

From the independence of the invariants we can factor the characteristic function as follows:

T T T
!
n PT 0 o 1X τ
E ei(ωt + T − T s=1 ω s ) Xt
Y τ 1 Y
φ= = φ Xt ωt − ωs + . (4.69)
t=1 t=1
T s=1 T
Since Xt is normal, from (2.157, AM 2005) we have

0 1 0
φXt (ω) = eiµ ω− 2 ω Σω . (4.70)

Therefore:

µ0 (ω t − T1
PT PT
φ = ei t=1 s=1
τ
ωs + T )
PT PT 0 PT (4.71)
− 12 (ω t − T1 τ
ωs + T ) Σ(ωt − T1 τ
ωs + T )
×e t=1 s=1 s=1 .

A few terms simplify:

T T
!
X
0 1X τ
µ ωt − ωs + = µ0 τ (4.72)
t=1
T s=1
T
T T
!0
X 1X τ
ωt − ωs Σ = 0 . (4.73)
t=1
T s=1
T

Therefore the joint characteristic function factors into the following product:

φU1 ,...,UT ,µb (ω 1 , . . . , ω T , τ ) = ψ (ω 1 , . . . , ω T ) χ (τ ) , (4.74)

where

PT 0 PT
− 21 (ω t − T1 ω s ) Σ(ω t − T1 ωs )
P
ψ (ω 1 , . . . , ω T ) ≡ e s=1 s=1 (4.75)
0 1 0
τ − 2T
χ (τ ) ≡ eiµ τ Στ
. (4.76)

This proves the variables {U1 , . . . , UT } and µ


b are independent. In particular the sample covariance
matrix:

T
1X
Σ≡
b Ut U0t , (4.77)
T t=1

is independent of µ
b. 

E 156 – Distribution of the sample mean (www.4.3) (see E 155)


Consider the same setup than in E 155. Show that the sample mean (4.100, AM 2005) has the following
distribution:

 
Σ
b ∼ N µ,
µ . (4.78)
T
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 117

Solution of E 156
Recall that the characteristic function of the multivariate random normal variable Xt is given by:

0 1 0
φXt (ω) ≡ E{eiωXt } = eiω µ− 2 ω Σω . (4.79)
PT
b≡
Now, using the definition of the sample mean µ t=1 Xt , we have:

1 PT PT Xt 0µ 1 0 Σ 0 1 0 Σ
E{eiω T t=1 Xt
} = E{eiω t=1 T } = eiT ω T − 2 Tω T2 ω
= eiω µ− 2 ω Tω (4.80)

where the second equality follows from independence. This expression is the characteristic function of a
random normal variable with mean µ and covariance Σ/T . 

E 157 – Testing of the sample mean


Consider a time series of independent and identically distributed normal random variables:

Xt ∼ N(µ, σ 2 ), t = 1, . . . , T . (4.81)

Consider the sample mean:

T
1X
b≡
µ Xt . (4.82)
T t=1

Compute the distribution of µ


b and determine what is the probability that µ
b exceed a given value µ
e.
Solution of E 157
We can write:
     σ2 0 ···

X1 µ
 ..   ..  ,  .. 
 .  ∼ N
 .   0
 .  .
 (4.83)
XT µ .. 2
. σ

From (2.163, AM 2005):

X ∼ N(µ, Σ) ⇒ a + BX ∼ N(a + Bµ, BΣB0 ) , (4.84)

for any conformable vector and matrix a and B respectively, it follows:

σ2
 
b ∼ N µ,
µ . (4.85)
T

Regarding P {b e} we have:
µ>µ

( )
b−µ
µ e−µ
µ
P {b e} = 1 − P {b
µ>µ µ≤µ
e} = 1 − P p ≤p . (4.86)
σ 2 /T σ 2 /T
From (4.84) and (4.85) it follows:

b−µ
µ
p ∼ N(0, 1) , (4.87)
σ 2 /T

therefore:

!
e−µ
µ
P {b e} = 1 − Φ
µ>µ p , (4.88)
σ 2 /T

where Φ denotes the cdf of the standard normal distribution. 

E 158 – p-value of the sample mean


Consider a normal invariant:

Xt ∼ N(µ, σ 2 ) , (4.89)

in a time series of length T . Consider the ML estimator µ


b of the location parameter µ. Suppose that you
observe a value µe for the estimator. Assume that you believe that:

µ ≡ µ0 , σ 2 ≡ σ02 . (4.90)

The p-value of µ
b for µ
e under the hypothesis (4.90) is the probability of observing a value as extreme as
the observed value:

p ≡ P {b e} .
µ≶µ (4.91)

Compute the expression of the p-value in terms of the cdf of the estimator.
Solution of E 158
From (4.102, AM 2005):

σ2
 
b ∼ N µ,
µ . (4.92)
T

Therefore in the notation of (1.68, AM 2005) we obtain:

p ≡ P {b e} = FµN0 ,σ2 /T (e
µ≤µ µ) (4.93)
0

or

p ≡ P {b
µ≥µ
e} = 1 − P {b e} = 1 − FµN0 ,σ2 /T (e
µ≤µ µ) . (4.94)
0


CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 119

E 159 – t-test of the sample mean


Consider a normal invariant:

Xt ∼ N(µ, σ 2 ) , (4.95)

in a time series of length T . Consider the ML estimators µ b2 of the location and scatter parameters
b and σ
2
µ and σ respectively. The t-statistic for µb is defined as:

b − µ0
µ
tµ0 ≡ p
b . (4.96)
σb2 /(T − 1)

tµ . You would like to ascertain whether it is possible that


Compute the distribution of b

µ = µ0 , (4.97)

for an arbitrary value µ0 in (4.95). How can you asses if the hypothesis (4.97) is acceptable?
Hint. Recall that if Yσ2 and Zν are independent and such that

Yσ2 ∼ N(0, σ 2 ) (4.98)


νZν2 ∼ χ2ν , (4.99)

then:

Y 2
Xν,σ2 ≡ pσ ∼ St(ν, 0, σ 2 ) . (4.100)
Zν2

Solution of E 159
From (4.103, AM 2005), (1.106, AM 2005) and (1.109, AM 2005) it follows:

b2
 
T σ
(T − 1) ∼ χ2T −1 . (4.101)
T − 1 σ2
From (4.92) we obtain:

r
T
µ − µ) ∼ N(0, 1) .
(b (4.102)
σ2
Furthermore, from E 155 we derive that µ b2 are independent. From (4.100), we obtain:
b and σ

r
b−µ
µ T 1 d Y1
tµ ≡ p
b = 2
µ − µ) q
(b =q . (4.103)
σ 2
b /(T − 1) σ Tσb2
ZT2 −1
(T −1)σ 2

Therefore:
tµ ∼ St(T − 1, 0, 1) .
b (4.104)
Finally, to test µ = µ0 , first, compute the distribution of (4.96) under (4.97). Then compute the realization
tµ0 of (4.96). In the notation (1.87, AM 2005) we obtain:
e

tµ0 = FTSt−1,0,1 (e

P btµ0 ≤ e tµ0 ) (4.105)
St

P btµ0 ≥ e
tµ0 = 1 − FT −1,0,1 (e tµ0 ) . (4.106)
Therefore, if tα is so small or so large that either probabilities are too small, then (4.97) is very unlikely.


E 160 – Distribution of the sample covariance (www.4.3) (see E 155)


Consider the same setup than in E 155. Show that the sample covariance (4.101, AM 2005) has the
following distribution:

b ∼ W(T − 1, Σ) .
TΣ (4.107)

Solution of E 160
First of all we notice that the estimator of the covariance of Xt is the same as the estimator of the
covariance of Yt ≡ Xt + b for any b. Indeed defining:

T
1X
b≡
ν Yt , (4.108)
T t=1

we easily verify that:

µ b − b,
b=ν (4.109)
1
PT
b≡
where µ T t=1 Xt and thus:

T
bY ≡ 1
X
Σ (Yt − ν b )0
b )(Yt − ν
T t=1
T
1X
= (Xt + b − (b µ + b))0
µ + b))(Xt + b − (b
T t=1 (4.110)
T
1 X
= (Xt − µ b )0
b )(Xt − µ
T t=1

≡Σ
bX .

Therefore we can assume here that µ ≡ 0. Now consider:

T
b0 =
X
W ≡ TΣ
b + Tµ
bµ Xt X0t , (4.111)
t=1
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 121

where the last equality follows from substitution of the definitions (4.67) and (4.77). From the indepen-
dence of Σb and µb (see E 155) the characteristic function of W must be the product of the characteristic
function of T Σ
b and the characteristic function of T µ
bµb 0 . Therefore:

φW (Ω)
φT Σ
b (Ω) = . (4.112)
φT µb µb 0 (Ω)

On the one hand from the normal hypothesis N(0, Σ) and (2.223, AM 2005) we obtain that W is Wishart
distributed:

W ∼ W(T, Σ) , (4.113)

and thus from (2.226, AM 2005) its characteristic function reads:

1
φW (Ω) = T /2
. (4.114)
|I − 2iΣΩ|

On the other hand, the characteristic function of T µ


bµb 0 reads:

n 0
o
φT µb µb 0 (Ω) ≡ E ei tr([T µb µb ]Ω)
n 0
o
= E ei tr(µb µb [T Ω]) (4.115)
1
= φµb µb 0 (T Ω) = 1/2
.
|I − 2iΣΩ|

Substituting (4.114) and (4.115) in (4.112) we obtain:

1
φT Σ
b (Ω) = (T −1)/2
, (4.116)
|I − 2iΣΩ|

which from (2.226, AM 2005) shows that:

b ∼ W(T − 1, Σ) .
TΣ (4.117)

E 161 – Estimation error of the sample mean (www.4.3, see E 155)


Consider
PT b ≡
the same setup than in E 155. Determine the estimation error of the sample mean µ
1
T t=1 X t .
Solution of E 161
From (4.102, AM 2005) we have:

 
Σ
b − µ ∼ N 0,
µ , (4.118)
T
and thus from (2.222, AM 2005) and (2.223, AM 2005):

 
Σ
(b µ − µ)0 ∼ W 1,
µ − µ)(b . (4.119)
T
Therefore from (2.227, AM 2005) the estimation error reads:

Err {b µ − µ)0 (b
µ, µ} ≡ E {(b µ − µ)}
= tr(E {(b µ − µ)0 })
µ − µ)(b (4.120)
1
= tr(Σ) .
T


E 162 – Estimation error of the sample covariance (www.4.3) (see E 155) *


Consider the same setup than in E 155. Show that the estimation error (4.23, AM 2005) relative to the
loss (4.118, AM 2005) reads:

   
1 2 1 2
Err2µ,Σ (Σ,
b Σ) = tr(Σ ) + 1 − [tr(Σ)] . (4.121)
T T

Solution of E 162
From (4.103, AM 2005) we have:

b − Σ = T − 1Σ − Σ = − 1 Σ .
b − Σ = 1 E TΣ
n o n o
E Σ (4.122)
T T T
Therefore the bias reads:

b − Σ)2 = 1 tr Σ2 .
n n o o
Bias2 (Σ,

b Σ) ≡ tr (E Σ (4.123)
T 2

As for the error, from its definition we obtain:

n h io
Err2µ,Σ (Σ, b − Σ)2
b Σ) ≡ E tr (Σ
( )
Xh i h i
=E Σb −Σ b −Σ
Σ
mn nm
m,n
X h i2 
= E Σ b −Σ
mn
m,n
X n o (4.124)
= b mn − Σmn )2
E (Σ
m,n
X
= Err2µ,Σ (Σ
b mn , Σmn )
m,n
Xh i
= Bias2µ,Σ (Σ
b mn , Σmn ) + Inef2 (Σ
µ,Σ
b mn ) ,
m,n
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 123

using (4.106, AM 2005) and (4.107, AM 2005) this becomes:

X 1 T −1 T −1 2

Err2µ,Σ (Σ,
b Σ) = Σ 2
+ Σ Σ
mm nn + Σ
m,n
T 2 mn T2 T2 mn

1X 2 T −1X
= Σmn + Σmm Σnn (4.125)
T m,n T 2 m,n
   
1 1 2
= tr(Σ2 ) + 1 − [tr(Σ)] .
T T

E 163 – Maximum likelihood estimator of the conditional factor loadings (www.4.4) *

Consider the conditional linear factor model (4.88, AM 2005) where the perturbations are normally dis-
tributed:

Xt |ft i.i.d. ∼ N(Bft , Σ) . (4.126)


Show that estimator of the factor loading (4.126, AM 2005) and covariance matrix (4.127, AM 2005)
have the following distributions:

 
b ∼ N B, Σ , Σ
B b −1 (4.127)
F
T
b ∼ W(T − K, Σ) ,
TΣ (4.128)

and that B
b and Σ
b are independent to each other.
Note. In the spirit of explicit factors models, the dependent variables Xt are random variables, whereas
the factors ft are considered observed numbers. In other words, we derive all the distributions conditioned
on knowledge of the factors.

Solution of E 163
First of all, a comment on the notation to follow: we will denote here γ1 , γ2 , γ3 , γ4 simple normalization
constants. We derive here the joint distribution of the sample factor loadings:

b ≡Σ
B b −1 ,
b XF Σ (4.129)
F

where:

T T
1X 1X 0
ΣXF ≡
b xt ft0 , ΣF ≡
b ft f , (4.130)
T t=1 T t=1 t

and the sample covariance:

T
b ≡ 1
X
Σ (xt − Bf b t )0 .
b t )(xt − Bf (4.131)
T t=1
Notice that the invariants Xt are random variables, whereas the factors ft are not. From the normal
hypothesis (4.126) the joint pdf of the time series IT ≡ {x1 , . . . , xT |f1 , . . . , fT } in terms of the factor
loadings B and the dispersion parameter Ω ≡ Σ−1 reads:

T 1
PT 0
f (iT ) = γ1 |Ω| 2 e− 2 t=1 (xt −Bft ) Ω(xt −Bft )

T 0
(4.132)
= γ1 |Ω| 2 e− 2 tr{Ω }.
1
PT
t=1 (xt −Bft )(xt −Bft )

The term in curly brackets can be written as:

{· · · } = ΩA , (4.133)

where:

T
X
A≡ (xt − Bft )(xt − Bft )0
t=1
T h
X ih i0
= (xt − Bf b t − Bft ) (xt − Bf
b t ) + (Bf b t − Bft )
b t ) + (Bf
t=1
T T
!
X
0
X (4.134)
= (xt − Bft )(xt − Bft ) + (B − B)
b b b ft ft b − B)0
(B
t=1 t=1
T
X T
X
+ (xt − Bf b t − Bft )0 +
b t )(Bf b t )0
b t − Bft )(xt − Bf
(Bf
t=1 t=1

= TΣ b − B)T Σ
b + (B b − B)0 + 0 + 0 .
b F (B

In this expression the last terms vanish since:

T
X T
X T
X
(xt − Bf b t − Bft )0 =
b t )(Bf xt ft0 B
b0 + b t f 0 B0
Bf t
t=1 t=1 t=1
T
X T
X
− xt ft0 B0 − b tf 0B
Bf t
b0
t=1 t=1
(4.135)
= TΣ b 0 + BT
b XF B b Σb F B0 − T Σ
b XF B0 − T B
bΣ b0
bFB

= TΣ b −1 Σ
b XF Σ b0 + TΣ
b XF B0
F XF

b XF B0 − T Σ
− TΣ b −1 Σ
b XF Σ b0
F XF
= 0.

Substituting (4.134) in the curly brackets (4.133) in (4.132) we obtain:

T 0
f (iT ) = γ1 |Ω| 2 e− 2 tr{T Ω[Σ+(B−B)ΣF (B−B) ]} .
1
(4.136)
b b b b

We can factor the above expression as follows:


CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 125

f (iT ) = f (iT |B,


b T Σ)f
b (B,
b T Σ)
b , (4.137)

where:

− T −K−N
2
−1

f (iT |B, b ≡ γ2 Σ
b T Σ) b , (4.138)

and f (B,
b T Σ)
b factors as follows:

f (B,
b T Σ)
b = f (B)f
b (T Σ)
b , (4.139)

where:

K
N2 0
b F e− 12 tr{(T Ω)(B−B)
b ≡ γ3 |T Ω| 2 Σ
f (B)
b Σb F (B−B)
b } (4.140)

and:

T −K
T −K−N
2
−1
1
b ≡ γ4 |Ω|
f (T Σ) T Σ e− 2 tr(ΩT Σ) . (4.141)
2
b b

Expression (4.140) is of the form (2.182, AM 2005). Therefore the OLS factor loadings have a matrix-
valued normal distribution:

b −1 .
 
b ∼ N B, (T Ω)−1 , Σ
B (4.142)
F

Since Ω ≡ Σ−1 this means:

 
Σ b −1
B ∼ N B, , ΣF
b . (4.143)
T
Also, expression (4.141) is the pdf (2.224, AM 2005) of a Wishart distribution, and thus:

b ∼ W(T − K, Σ) .
TΣ (4.144)

Finally, from the factorization (4.139) we see that T Σ,


b and thus Σ,
b is independent of B.
b 

E 164 – Stein’s lemma (www.4.5) *


Consider an N -dimensional normal variable:

X ∼ N(µ, IN ) , (4.145)

where IN is the N -dimensional identity matrix. Consider a smooth function g of N variables. Prove
Stein’s lemma in this context, that is:
 
∂g(X)
E {g(X)(Xn − µn )} = E . (4.146)
∂xn

Hint. Use:
Z
G(x) ≡ g(x1 , . . . , x, . . . , xN )
RN −1 (4.147)
N −1 1
P 2
× (2π)− 2 e− 2 k6=n (xk −µk ) dx1 · · · dxn−1 dxn+1 · · · dxN .

Solution of E 164
From the definition of expected value for a normal distribution we have:

Z
E {g(X)(Xn − µn )} = g(x1 , . . . , xn , . . . , xN )(xn − µn )
RN
N 1
P 2
× (2π)− 2 e− 2 k (xk −µk ) dx (4.148)
Z +∞ (xn −µn )2
e− 2
= (xn − µn )G(xn ) √ dxn ,
−∞ 2π
where we defined G as follows:

Z
G(x) ≡ g(x1 , . . . , x, . . . , xN )
RN −1 (4.149)
N −1 1
P 2
× (2π)− 2 e− 2 k6=n (xk −µk ) dx1 · · · dxn−1 dxn+1 · · · dxN .

Notice that:

Z
∂g(x) N −1 1
P 2
dG(x) ≡ (2π)− 2 e− 2 k6=n (xk −µk ) dx1 · · · dxn−1 dxn+1 · · · dxN . (4.150)
RN −1 ∂xn

Replacing the variables in the integral (4.148) as follows:

u ≡ G(xn ) (4.151)
2
− (xn −µ n)
v ≡ −e 2 , (4.152)

we get:

Z +∞  Z +∞ 
1 1 +∞
E {g(X)(Xn − µn )} = √ udv = √ uv|−∞ − vdu . (4.153)
2π −∞ 2π −∞

The first term vanishes. Replacing (4.151) and (4.152) in the second term and using (4.150) we obtain:
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 127

Z +∞
1 (xn −µn )2
E {g(X)(Xn − µn )} = − √ −e− 2
2π −∞
Z
∂g(x) N −1 1
P 2
× (2π)− 2 e− 2 k6=n (xk −µk ) dx1 · · · dxn−1 dxn+1 · · · dxN
N −1 ∂xn
Z R
∂g(x) N 1
P 2
= (2π)− 2 e− 2 k (xk −µk ) dx
R N ∂x n
 
∂g(X)
= E .
∂xn
(4.154)


E 165 – Shrinkage estimator of location (www.4.5) *


Consider a set of T i.i.d. multivariate normal random variables Xt ∼ N(µ, Σ), where the dimension of
each random variable is N > 2. Prove that the shrinkage estimator (4.138, AM 2005)-(4.139, AM 2005)
performs better than the sample mean, i.e. it satisfies (4.137, AM 2005).
Solution of E 165
Rewrite estimator (4.138, AM 2005)-(4.139, AM 2005) as:

 
b≡ a a
δ 1− µ
b+ b, (4.155)
µ − b)0 (b
(b µ − b) µ − b)0 (b
(b µ − b)
where µ
b is the sample mean:

 
1X Σ
b≡
µ Xt ∼ N µ, , (4.156)
T t T

where b is any constant vector and where a is any scalar such that:

2
0<a< (tr(Σ) − 2λ1 ) , (4.157)
T
where λ1 is the largest eigenvalue of the matrix Σ. From the definition (4.134, AM 2005) of error, we
have:

2  0
[Err(δ, µ)] = E [δ − µ] [δ − µ]
( 0  )
a(bµ − b) µ − b)
a(b
=E µ b −µ− µb −µ−
µ − b)0 (b
(b µ − b) (bµ − b)0 (b
µ − b) (4.158)
µ − b)0 (b
   
2 1 (b µ − µ)
µ, µ)] + a2 E
= [Err(b − 2a E .
µ − b)0 (b
(b µ − b) µ − b)0 (b
(b µ − b)
We proceed now to simplify the expression of the last expectation in (4.158). Consider the principal
component decomposition (A.70, AM 2005) of the matrix Σ in (4.156):

Σ ≡ EΛE0 , (4.159)
and define the following vector of independent normal variables:

√ 1
Y≡ T Λ− 2 E0 µ
b ∼ N(ν, I) , (4.160)
together with:

√ 1 √ 1
ν≡ T Λ− 2 E0 µ, c≡ T Λ− 2 E0 b . (4.161)
Then the term in curly brackets in the last expectation in (4.158) reads:

h√ i0 h√ i
− 12 0 − 12 0
0
µ − b) (b
(b µ − µ) T Λ E (b
µ − b) Λ T Λ E (b
µ − µ)
= h√ i0 h√
µ − b)0 (b
(b µ − b) 1 1
i
T Λ− 2 E0 (b
µ − b) Λ T Λ− 2 E0 (b µ − b)
(Y − c)0 Λ(Y − ν) (4.162)
=
(Y − c)0 Λ(Y − c)
N
X
= gj (Y)(Yj − νj ) ,
j=1

where:

(yj − cj )λj
gj (y) ≡ . (4.163)
(y − c)0 Λ(y − c)
Applying the rules of calculus we compute:

∂gj (y) λj d 1
= 0
+ (yj − cj )λj 0
∂yj (y − c) Λ(y − c) dyj (y − c) Λ(y − c)
λj 2λ2j (yj − cj )2
= − 2 (4.164)
(y − c)0 Λ(y − c)
[(y − c)0 Λ(y − c)]
0
λj (y − c) Λ(y − c) − 2λ2j (yj − cj )2
= 2 .
[(y − c)0 Λ(y − c)]
Therefore, using Stein’s lemma (see E 164), we obtain for the last expectation in (4.158):

N
µ − b)0 (b
 
(b µ − µ) X
E = E {gj (Y)(Yj − νj )}
µ − b)0 (b
(b µ − b) j=1
N  
X ∂gj (Y)
= E
j=1
∂yj
( ) (4.165)
N
X λj (Y − c)0 Λ(Y − c) − 2λ2j (Yj − cj )2
= E 2
j=1 [(Y − c)0 Λ(Y − c)]
( )
tr(Λ) (Y − c)0 ΛΛ(Y − c)
=E 0
−2 2 .
(Y − c) Λ(Y − c) [(Y − c)0 Λ(Y − c)]
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 129

Since from the definitions (4.160)-(4.161) we obtain:

√ 1
Y−c= T Λ− 2 E0 (b
µ − b) , (4.166)

we can simplify (4.165) as follows:

( 1 1
)
µ − b)0 (b µ − b)EΛ 2 Λ 2 E0 (b
 
(b µ − µ) tr(Λ) 1 1 (b µ − b)
E =E − 2
µ − b)0 (b
(b µ − b) T (b 0
µ − b) (b µ − b) T µ − b)0 (b
[(b µ − b)]
   (4.167)
2 Nλ µ − b)Σ(b
2 (b µ − b)
=E − ,
µ − b)0 (b
(b µ − b) T µ − b)0 (b
T (b µ − b)
where:

tr(Λ)
λ≡ (4.168)
N
is the average of the eigenvalues. From the relation (A.68, AM 2005) on the largest eigenvalue λ1 of Σ
we obtain:

µ − b)Σ(b
(b µ − b)
0
≤ λ1 . (4.169)
µ − b) (b
(b µ − b)
Therefore, substituting (4.167) in (4.158), using (4.169) and recalling (4.157) we obtain the following
relation for the error:

  
2 2 a N µ − b)Σ(b
4 (b µ − b)
[Err(δ, µ)] = [Err(b
µ, µ)] + E a−2 λ+
µ − b)0 (b
(b µ − b) T µ − b)0 (b
T (b µ − b)
( )
2 a(a − T2 (N λ − 2λ1 )) (4.170)
≤ [Err(b
µ, µ)] + E
µ − b)0 (b
(b µ − b)
2
≤ [Err(b
µ, µ)] .
In particular, the lowest upper bound is reached at:

2
a≡ (N λ − 2λ1 ) . (4.171)
T


E 166 – Shrinkage estimator of location


Fix N ≡ 5 and generate a N -dimensional location vector µ and a N × N scatter matrix Σ. Consider a
normal random variable:

X ∼ N(µ, Σ) . (4.172)

Write a MATLAB R
script in which you generate a time series of T ≡ 30 observations from (4.172) and
compute the shrinkage estimator of location (4.138, AM 2005).
Solution of E 166
See the MATLAB R
script S_ShrinkageEstimators. 

E 167 – Singular covariance matrix (www.4.6)


The sample covariance is inefficient because the estimation process tends to scatter the sample eigenvalues
away from the mean value of the true unknown eigenvalues. Show that in the extreme case where the
number of observations T is lower than the number of invariants N , the some eigenvalues become null
and thus the covariance matrix becomes singular.
Solution of E 167
The number of non-zero eigenvalues of the sample covariance Σ
b is its rank. Thus we want to prove:

rank(Σ)
b <T. (4.173)

We re-write the definition of the sample covariance as follows:

 
b = 1 X0
Σ
1
IT − 1T 10T XT ×N , (4.174)
T T ×N T

where XT ×N is the matrix of past observations, I is the identity matrix and 1 is a vector of ones. From
this expression and the property (A.22, AM 2005) of the rank operator we obtain:

     
1 0 1 0
rank(Σ) ≤ min rank IT − 1T 1T , rank(XT ×N ) ≤ rank IT − 1T 1T = T − 1 < T .
b
T T
(4.175)

If T ≤ N , we have that rank(Σ)


b < N , and therefore N − T eigenvalues are null. 

E 168 – Sample covariance and eigenvalue dispersion


Fix N ≡ 50, µ ≡ 0N , Σ ≡ IN . Write a MATLAB
R
script in which you reproduce the surface in Figure
4.15 of Meucci (2005, p.207).
Note. You do not need to superimpose the true spectrum as in the figure.

Hint. Determine a grid of values for the number of observations T in the time series. For each value of T :
a) Generate an i.i.d. time series iT ≡ {x1 , . . . , xT } from X ∼ N(µ, Σ);
b) Compute the sample covariance Σ; b
c) Perform the PC decomposition of Σ b and store the sample eigenvalues (i.e. the sample spectrum);
d) Perform a)-c) a large enough number of times (≈ 100 times);
e) Compute the average sample spectrum.

Solution of E 168
See the MATLAB R
script S_EigenvalueDispersion. 

E 169 – Shrinkage estimator of dispersion (www.4.6)


Show that the shrinkage estimator (4.160, AM 2005) is better conditioned than the sample covariance.
Solution of E 169
We denote as λn (S) the n-th eigenvalue of the symmetric and positive matrix S. We want to prove:
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 131

 S
λN Σ
b
λN (Σ)
b
 S > . (4.176)
λ1 Σ
b λ1 (Σ)
b

First we notice that the highest eigenvalue of the shrinkage estimator satisfies:

 S
λ1 Σ
b < λ1 (Σ)
b . (4.177)

To show this, we first prove that for arbitrary positive symmetric matrices A and B and positive number
α and β we have:

λ1 (αA + βB) ≤ αλ1 (A) + βλ1 (B) . (4.178)

This is true because from (A.68, AM 2005) the largest eigenvalue of a matrix A satisfies:

λ1 (αA + βB) = max


0
v0 (αA + βB)v
v v=1
≤ α max
0
v0 Av + β max
0
v0 Bv (4.179)
v v=1 v v=1
= αλ1 (A) + βλ1 (B) .

Therefore, from (4.160, AM 2005):

 S  
λ1 Σ
b ≡ λ1 (1 − α)Σ
b + αC
b

≤ (1 − α)λ1 (Σ)
b + αλ1 (C)
b (4.180)
h i
b − α λ1 (Σ)
= λ1 (Σ) b − λ1 (C)
b < λ1 (Σ)
b ,

where the last inequality follows from:

N
b ≡ 1
X
λ1 (Σ)
b > λ1 (C) λn (Σ)
b . (4.181)
N n=1

Similarly for the lowest eigenvalue we have:

 S
λN Σ
b > λN (Σ)
b , (4.182)

which follows from the above argument and the reverse identities (A.69, AM 2005) and

N
b ≡ 1
X
λN (Σ)
b < λN (C) λn (Σ)
b . (4.183)
N n=1


E 170 – Shrinkage estimator of scatter
Write a MATLAB
R
function which computes the shrinkage estimator of the scatter (4.160, AM 2005).
Solution of E 170
See the MATLAB R
script S_ShrinkageEstimators. 

E 171 – Maximum likelihood estimator as implicit functional (www.4.7)


Given the maximum likelihood (ML) θ
b of the parameter θ of the distribution fX of the market invariants,
prove (4.194, AM 2005)-(4.195, AM 2005).
Solution of E 171
Consider the estimator θ
e [fi ], which is an implicit functional of the empirical pdf fi defined by the
T T
following equation:

Z
0= ψ(x, θ
e [h])h(x)dx , (4.184)
RN

where h is a generic function. We consider the function h ≡ (1 − )fX + δ (y) . Deriving in zero (4.184)
with respect to  we obtain:

Z
d h
e [h ]) (1 − )fX (x) + δ (y) (x) dx
i
0= ψ(x, θ
d =0 RN
Z Z
∂ψ(x, θ) dθe [h ] h i
e [fX ]) −fX (x) + δ (y) (x) dx
= fX (x)dx + ψ(x, θ (4.185)
∂θ θ[f d

RN e X] RN
=0
Z
∂ψ(x, θ) dθ
e [h ]
= f (x)dx + ψ(y, θe [fX ]) .
∂θ θ[f d

RN e X]
=0

On the other hand, from the definition (4.185, AM 2005) of the influence function we have:


1 e  dθ
e [h ]
IF(y, fX , θ) ≡ lim
b θ [h ] − θ [h0 ] =
e . (4.186)
→0  d

=0

Therefore:

"Z #−1
b =− ∂ψ(x, θ)
IF(y, fX , θ) f (x)dx ψ(y, θ
e [fX ]) . (4.187)
RN ∂θ θ[f e X]

E 172 – Influence function of the sample mean I (www.4.7)


Compute the influence function (4.185, AM 2005) of the sample mean (4.196, AM 2005).
Solution of E 172
Sample estimators of the unknown quantity G[fX ] are by definition explicit functionals of the empirical
pdf:

e [fi ] ≡ G [fi ] .
G (4.188)
T T
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 133

Therefore from its definition (4.185, AM 2005) the influence function reads:

1 h i 
b ≡ lim
IF(y, fX , G) G (1 − )fX + δ (y) − G [fX ] , (4.189)
→0 

where y is an arbitrary point. Now consider the function h ≡ (1 − )fX + δ (y) . The influence function
can be written:


b ≡ lim 1 dG [h ]
IF(y, fX , G) (G [h ] − G [h0 ]) = . (4.190)
→0  d =0

Consider the functional associated with the sample mean µ


b , which reads:

Z
e [h] ≡
µ xh(x)dx . (4.191)
RN

From (4.190) the influence function reads:


de
µ [h ]
b) ≡
IF(y, f, µ . (4.192)
d =0

First we compute:

Z
e [h ] ≡
µ xh (x)dx
N
ZR  
= x (1 − )fX (x) + δ (y) (x) dx
RN
Z (4.193)
= (1 − ) xfX (x)dx + y
RN
= E {X} + (− E {X} + y) .

From this and (4.192) we derive:

b ) = −E {X} + y .
IF(y, fX , µ (4.194)

E 173 – Influence function of the sample mean II (see E 172)


Adapt the solution of E 172 to the univariate case to compute the influence function of the sample mean.
Solution of E 173
Sample estimators of the unknown quantity G [fX ] are by definition explicit functionals of the empirical
pdf:

e [fi ] ≡ G [fi ] .
G (4.195)
T T

Therefore from its definition (4.185, AM 2005) the influence function reads:
1 h i 
b ≡ lim
IF(y, fX , G) G (1 − )fX + δ (y) − G [fX ] , (4.196)
→0 

where y is an arbitrary point. Now consider the function:

h ≡ (1 − )fX + δ (y) . (4.197)

The influence function can be written:


1 dG [h ]
IF(y, fX , G) ≡ lim (G [h ] − G [h0 ]) =
b . (4.198)
→0  d =0

Consider the functional associated with the sample mean µ


b, which reads:

Z
e [h] ≡
µ xh(x)dx . (4.199)
R

From (4.198) the influence function reads:


de
µ [h ]
b) ≡
IF(y, f, µ . (4.200)
d =0
First we compute:

Z
e [h ] ≡
µ xh (x)dx
ZR  
= x (1 − )f (x) + δ (y) (x) dx
R
Z (4.201)
= (1 − ) xf (x)dx + y
R
= E {X} + (− E {X} + y) .

From this and (4.200) we derive:

b) = − E {X} + y .
IF(y, f, µ (4.202)

E 174 – Influence function of the sample covariance (www.4.7)


Compute the influence function (4.185, AM 2005) of the sample covariance (4.197, AM 2005).
Solution of E 174
Sample estimators of the unknown quantity G[fX ] are by definition explicit functionals of the empirical
pdf:

e [fi ] ≡ G [fi ] .
G (4.203)
T T
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 135

Therefore from its definition (4.185, AM 2005) the influence function reads:

b ≡ lim 1 G (1 − )fX + δ (y) − G [fX ] ,


 h i 
IF(y, fX , G) (4.204)
→0 

where y is an arbitrary point. Now consider the function h ≡ (1 − )fX + δ (y) . The influence function
can be written:


1 dG [h ]
IF(y, fX , G) ≡ lim (G [h ] − G [h0 ]) =
b . (4.205)
→0  d =0

Consider now the functional associated with the sample covariance Σ,


b which reads:

Z
e [h] ≡
Σ (x − µ e [h])0 h(x)dx .
e [h])(x − µ (4.206)
RN

From (4.198) the influence function reads:


1
b ≡ lim (Σe [h ] − Σ dΣe [h ]
IF(y, fX , Σ) e [h0 ]) = . (4.207)
→0  d

=0

First we compute:

Z
e [h ] ≡
Σ (x − µ e [h ])0 h (x)dx
e [h ])(x − µ
RN
Z  
= (x − µe [h ])(x − µe [h ])0 (1 − )fX (x) + δ (y) (x) dx (4.208)
RN
Z
= (1 − ) (x − µ e [h ])(x − µe [h ])0 fX (x)dx + (y − µ e [h ])0 .
e [h ])(y − µ
RN

Deriving this expression with respect to  we obtain:


dΣe [h ]
IF(y, f, Σ) =
b
d

=0
Z
= − (x − µ e [h0 ])0 fX (x)dx
e [h0 ])(x − µ
RN

(4.209)
Z
d
+ (1 − 0) (x − µ e [h ])0 fX (x)dx
e [h ])(x − µ
RN d =0

+ (y − µ e [h0 ])0
e [h0 ])(y − µ

d
+0× (y − µ e [h ])0 .
e [h ])(y − µ
d =0

e [h0 ] = E {X} this means:


Using µ
Z
b = − Cov {X} − de
µ [h ]
IF(y, fX , Σ) 2 (x − E {X})fX (x)dx
RN d =0 (4.210)
0
+ (y − E {X})(y − E {X}) .
Now using (4.194) we obtain:

Z
b = − Cov {X} − 2
IF(y, fX , Σ) (y − E {X})(x − E {X})0 fX (x)dx
RN (4.211)
0
+ (y − E {X})(y − E {X})
The term in the middle is null:

Z Z
(y − E {X})(x − E {X})0 fX (x)dx = y (x − E {X})0 fX (x)dx
RN RN
Z
(4.212)
− E {X} (x − E {X})0 fX (x)dx
RN
=0
Therefore:

b = − Cov {X} + (y − E {X})(y − E {X})0 .


IF(y, fX , Σ) (4.213)


E 175 – Influence function of the sample variance (see E 174)


Adapt the solution of E 174 to the univariate case to compute the influence function of the sample vari-
ance.
Solution of E 175
b2 , which reads:
Consider the functional associated with the sample variance σ

Z
2
e [h] ≡
σ e [h])2 h(x)dx .
(x − µ (4.214)
R

From (4.198) the influence function reads:

σ 2 [h ]

2 1 2 2 de
b ) ≡ lim (e
IF(y, fX , σ σ [h ] − σ
e [h0 ]) = . (4.215)
→0  d =0
First we compute:

Z
2
e [h ] ≡
σ e [h ])2 h (x)dx
(x − µ
R
Z
= e [h ])2 ((1 − )fX (x) + δ (y) (x))dx
(x − µ (4.216)
R
Z
= (1 − ) (x − µ e [h ])2 fX (x)dx + (y − µ
e [h ])2 .
R
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 137

Deriving this expression with respect to  we obtain:

σ 2 [h ]

2 de
IF(y, fX , σ
b )=
d =0
Z
= − (x − µ e [h0 ])2 fX (x)dx
R
Z (4.217)
d
+ (1 − 0) (x − µ e [h ])2 fX (x)dx
R d =0


2 d
+ (y − µ e [h0 ]) + 0 × (y − µ e [h ])2 .
d =0

e [h0 ] = E {X} this means:


Using µ

Z
de
µ [h ]
b2 ) = − Var {X} −
IF(y, fX , σ 2 (x − E {X})fX (x)dx (4.218)
R d =0
2
+ (y − E {X}) . (4.219)

Now using (4.202) we obtain:

Z
2
b ) = − Var {X} − 2
IF(y, fX , σ (y − E {X})(x − E {X})fX (x)dx
R (4.220)
+ (y − E {X})2 .

The term in the middle is null. Therefore:

b2 ) = − Var {X} + (y − E {X})2 .


IF(y, f, σ (4.221)

E 176 – Influence function of the ordinary least squares estimator (www.4.7)


Derive the expression (4.212, AM 2005) of the influence function (4.185, AM 2005) of the ordinary least
squares (OLS) estimator (4.211, AM 2005).
Solution of E 176
b define z ≡ (x, f ) the set of invariants and factors. We have:
For the OLS factor loadings B

Z  Z −1
G [fZ ] = xf 0 fZ (z)dz ff 0 fZ (z)dz . (4.222)

Consider a point w ≡ (e
x, e
f ). We have:

h i
G fZ + (δ (w) − fZ ) = (A + B)(C + D)−1 , (4.223)

where:
Z
A≡ xf 0 fZ dz = E {XF0 } (4.224)
Z
B≡ xf 0 (δ (w) − fZ )dz = x
eef 0 − E {XF0 } (4.225)
Z
C≡ ff 0 fZ dz = E {FF0 } (4.226)
Z
D≡ ff 0 (δ (w) − fZ )dz = ef 0 − E {FF0 } .
fe (4.227)

Since:

(C + D)−1 = (C(I + C−1 D))−1


= (I + C−1 D)−1 C−1 (4.228)
−1 −1
≈ (I − C D)C ,

we have:

h i
G fZ + (δ (w) − fZ ) ≈ (A + B)(C−1 − C−1 DC−1 )
(4.229)
≈ AC−1 + (BC−1 − AC−1 DC−1 ) .

Therefore:

b = lim 1 G fZ + (δ (w) − fZ ) − G [fZ ]


 h i 
IF(y, fX , B)
→0 
= (BC−1 − AC−1 DC−1 )
h i
−1
= x f 0 − E {XF0 } E {FF0 }
ee (4.230)
h i
−1 ee0 −1
− E {XF0 } E {FF0 } f f − E {FF0 } E {FF0 }
−1
= (e
xef 0 − Bef 0 ) E {FF0 } .
fe


E 177 – Expectation-Maximization algorithm for missing data: formulas (www.4.8) *

Explain and detail the steps of the EM algorithm for missing data in Meucci (2005, section 4.6.2). In
particular prove (4.262, AM 2005), (4.263, AM 2005) and (4.264, AM 2005).
Solution of E 177
Suppose we are at iteration step u (cycle of the EM algorithm). The invariants are normally distributed
with the following parameters:

Xt ∼ N(µ(u) , Σ(u) ) . (4.231)

Consider the first non-central moment of Xt conditional on the observations:


CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 139

n o
(u)
µt,n ≡ E Xt,n |xt,obs(t) , µ(u) , Σ(u) . (4.232)

From (2.65, AM 2005), for the observed values we have:

(u)
µt,obs(t) = xt,obs(t) (4.233)

and for the missing values we have:

(u) (u) (u) (u) (u)


µt,mis(t) = µmis(t) + Σmis(t),obs(t) (Σobs(t),obs(t) )−1 (xt,obs(t) − µobs(t) ) . (4.234)

Consider now the second non-central conditional moment:

n o
(u)
St ≡ E Xt X0t |xt,obs(t) , µ(u) , Σ(u) (4.235)

This matrix consists of three sub-components:

n o
(u)
St,obs(t),obs(t) ≡ E Xt,obs(t) X0t,obs(t) |xt,obs(t) , µ(u) , Σ(u)
h ih i0 (4.236)
(u) (u)
= xt,obs(t) x0t,obs(t) = µt,obs(t) µt,obs(t) ,

n o
(u)
St,mis(t),obs(t) ≡ E Xt,mis(t) X0t,obs(t) |xt,obs(t) , µ(u) , Σ(u)
n o
= E Xt,mis(t) |xt,obs(t) , µ(u) , Σ(u) x0t,obs(t) (4.237)
h ih i0
(u) (u) (u)
= µt,mis(t) x0t,obs(t) = µt,mis(t) µt,obs(t) ,

and:

n o
(u)
St,mis(t),mis(t) ≡ E Xt,mis(t) X0t,mis(t) |xt,obs(t) , µ(u) , Σ(u)
n o n o0
= E Xt,mis(t) |xt,obs(t) , µ(u) , Σ(u) E Xt,mis(t) |xt,obs(t) , µ(u) , Σ(u)
n o
+ Cov Xt,mis(t) |xt,obs(t) , µ(u) , Σ(u)
h ih i0
(u) (u) (u) (u) (u) (u)
= µt,mis(t) µt,mis(t) + Σmis(t),mis(t) − Σmis(t),obs(t) (Σobs(t),obs(t) )−1 Σobs(t),mis(t) .
(4.238)

In other words, defining the matrix C as:

(u) (u)
Ct,obs(t),mis(t) ≡ 0 , Ct,obs(t),obs(t) ≡ 0 , (4.239)

and otherwise:
(u) (u) (u) (u) (u)
Ct,mis(t),mis(t) ≡ Σmis(t),mis(t) − Σmis(t),obs(t) (Σobs(t),obs(t) )−1 Σobs(t),mis(t) , (4.240)
we can write:

h ih i0
(u) (u) (u) (u)
St = µt µt + Ct . (4.241)

Now we can update the estimate of the unconditional first moment as the sample mean of the conditional
first moments:

T
(u+1) 1 X (u)
µ ≡ x . (4.242)
T t=1 t

Similarly we can update the estimate of the unconditional second moment as the sample mean of the
conditional second moments:

T
1 X (u)
S(u+1) ≡ S . (4.243)
T t=1 t

The estimate of the covariance then follows from (2.92, AM 2005):

h ih i0 h ih i0
Σ(u+1) ≡ S(u+1) − µ(u+1) µ(u+1) ≈ S(u+1) − µ(u) µ(u) . (4.244)

From the definition (4.242) and (4.243) this is equivalent to

T
1 X h (u) (u) (u)
i
Σ(u+1) ≡ Ct + (xt − µ(u) )(xt − µ(u) )0 . (4.245)
T t=1

E 178 – Expectation-Maximization algorithm for missing data: example


Write a MATLAB R
script in which you:
• Upload the database DB_HighYieldIndices of the daily time series of high-yield bond indices. As
you will see, some observations are missing;
• Compute the time series of the daily compounded returns, replacing NaN for the missing observa-
tions;
• Assume that the distribution of the daily compounded returns is normal:

Xt ∼ N(µ, Σ) , (4.246)
and estimate the parameters (µ, Σ) by means of the EM algorithm.
Note. There is a typo in (4.266, AM 2005), which should read:
T
1 X h (u) (u) (u)
i
Σ(u+1) ≡ Ct + (xt − µ(u) )(xt − µ(u) )0 . (4.247)
T t=1
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 141

Solution of E 178
See the MATLAB R
script S_ExpectationMaximizationHighYield. 

E 179 – Mixture distribution


Assume that the invariants Xt are distributed as a two-component mixture. In other words, the pdf reads:

fX ≡ αfY + (1 − α)fZ , (4.248)

where α ∈ (0, 1) and:

fY ≡ N(µY , σY2 ) (4.249)


2
fZ ≡ LogN(µZ , σZ ). (4.250)

Consider the variable:

V ≡ αY + (1 − α)Z , (4.251)

where Y and Z are independent and:

Y ∼ N(µY , σY2 ) (4.252)


2
Z∼ LogN(µZ , σZ ). (4.253)

Determine if (4.248) is the pdf of (4.251)? If not, how do you compute the pdf of (4.251)?
Solution of E 179
Formula (4.248) is not the pdf of (4.251). You can see this in simulation. Alternatively, you can prove it
by showing that the moments of X and the moments of V are different. For instance, denote:

s2Y ≡ E Y 2 , s2Z ≡ E Z 2 .
 
(4.254)

Then:

Z
E X2 ≡ u2 fX (u)du


Z Z
= α u fY (u)du + (1 − α) u2 fZ (u)du
2 (4.255)

= αs2Y + (1 − α)s2Z .

On the other hand:

E V 2 ≡ E (αY + (1 − α)Z)2
 

= E α2 Y 2 + 2α(1 − α)Y Z + (1 − α)2 Z 2



(4.256)
= α2 E Y 2 + 2α(1 − α) E {Y } E {Z} + (1 − α)2 E Z 2
 
2
= α2 s2Y + µY + eµZ +σZ /2 + (1 − α)2 s2Z .
Therefore (4.248) is not the pdf of (4.251). However, (4.248) is the pdf of a random variable, defined in
distribution as follows:

d
X ≡ BY + (1 − B)Z , (4.257)

where in B is a Bernoulli variable:

B ∼ Ber(α) , (4.258)

a discrete random variable that can only assume two values:


1 with probability α
B≡ (4.259)
0 with probability 1 − α .

Therefore, the pdf of B reads:

fB = αδ (1) + (1 − α)δ (0) , (4.260)

where δ (s) is the Dirac delta centered in s. When B = 1 in (4.257) the variable X will be normal as in
(4.252), when B = 0 the variable X will be lognormal as in (4.253). Therefore, the pdf of X conditioned
on B reads:

fX|B (x|B = 0) = fZ (x) , fX|B (x|B = 1) = fY (x) . (4.261)

This two-step method gives rise to the pdf (4.248). To see this, as in (2.22, AM 2005) the pdf of X can
be written as the marginalization of the joint pdf of X and B:

Z
fX (x) = fX,B (x, b)db . (4.262)

As in (2.43, AM 2005) the joint pdf of X and B can be written as the product of the conditional and the
marginal:

fX,B (x, b) = fX|B (x|b)fB (b) . (4.263)

Therefore:

Z
fX (x) = fX|B (x|b)fB (b)db
Z h i
= fX|B (x|b) αδ (1) (b) + (1 − α)δ (0) (b) db
Z Z (4.264)
(1)
= α fX|B (x|b)δ (b)db + (1 − α) fX|B (x|b)δ (0) (b)db

= αfX|B (x|B = 1) + (1 − α)fX|B (x|B = 0)


= αfY (x) + (1 − α)fZ (x) .
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 143

As for the pdf of (4.251), it can be obtained as follows. First we use (1.13) with (1.67, AM 2005) and
(1.95, AM 2005) to compute the pdf of αY and (1 − α)Z:

(x/α − µY )2
 
1
fαY (x) = exp − (4.265)
2σY2
p
α 2πσY2
(ln(x/(1 − α)) − µZ )2
 
1
f(1−α)Z (x) = p exp − 2 . (4.266)
2
x 2πσZ 2σZ

Then we compute the characteristic functions of αY and (1 − α)Z as in (1.14, AM 2005) as the Fourier
transform of the respective pdf’s:

 
φαY = F [fαY ] , φ(1−α)Z = F f(1−α)Z . (4.267)
Then we compute the characteristic function of V :

φV (ω) ≡ E eiωV

n o
= E eiω[αY +(1−α)Z]
n o
(4.268)
= E eiωαY E eiω(1−α)Z


= φαY (ω)φ(1−α)Z (ω)


 
= F [fαY ] (ω)F f(1−α)Z (ω) .
Using (B.45, AM 2005) we can express the characteristic function of V in terms of the convolution (B.43,
AM 2005) of the pdf’s and the Fourier transform:

 
φV (ω) = F fαY ∗ f(1−α)Z (ω) . (4.269)
Then we compute the pdf of V as in (1.15, AM 2005) as the inverse Fourier transform of the characteristic
function:

fV = F −1 [φV ] . (4.270)
Substituting (4.269) in (4.270) we finally obtain:

fV = F −1 F fαY ∗ f(1−α)Z = fαY ∗ f(1−α)Z .


  
(4.271)


E 180 – Moment-based functional of a mixture I (see E 179)


Consider the same setup than in E 179. Assume that we are interested in the following moment-based
functional:

Z
G[fX ] ≡ (x2 − x)fX (x)dx . (4.272)
R

Compute (4.272) analytically as a function of the inputs α, µY , σY , µZ and σZ .


Solution of E 180
Z
G[fX ] ≡ (x2 − x)fX (x)dx
R
Z Z
= α (x − x)fY (x)dx + (1 − α) (x2 − x)fZ (x)dx
2 (4.273)
R R
= α(Var {Y } + (E {Y })2 − E {Y }) + (1 − α)(Var {Z} + (E {Z})2 − E {Z}) .

Using (1.71, AM 2005)-(1.72, AM 2005) and (1.98, AM 2005)(1.99, AM 2005) we have:

 2

2 σZ
G[fX ] = α(µ2Y + σY2 − µY ) + (1 − α) e2µZ +2σZ − eµZ + 2 . (4.274)

E 181 – Moment-based functional of a mixture II (see E 179 and E 180)


Consider the same setup than in E 179 and E 180. Consider the following estimators:

b a ≡ (x1 − xT )x22
G (4.275)
T
bb ≡ 1
X
G xt (4.276)
T t=1
bc ≡ 5 .
G (4.277)

Write a MATLAB R
script in which you evaluate the performance of the three estimators above with
respect to (4.272) as in the MATLAB R
script S_Estimator by assuming:

α ≡ 0.8, σY ≡ 0.2 , µZ ≡ 0, σZ ≡ 0.15 , (4.278)

and by stress-testing the parameter µY in the range [0, 0.2].


Solution of E 181
See the MATLAB R
script S_EstimateMomentsComboEvaluation. 

E 182 – Moment-based functional of a mixture III (see E 179 and E 180)


Consider the same setup than in E 179 and E 180. Determine analytically the non-parametric estimator
b d of (4.272) defined by (4.36, AM 2005). Write a MATLAB
G R
script in which you assume:

α ≡ 0.8, σY ≡ 0.2 , µZ ≡ 0, σZ ≡ 0.15 , (4.279)

and evaluate the performance of Gb d with respect to (4.272) as in the MATLAB


R
script S_EstimateExpectedValueEvaluation
by stress-testing the parameter µY in the range [0, 0.2].
Solution of E 182
The non-parametric estimator of:

Z
G[fX ] ≡ (x2 − x)fX (x)dx (4.280)
R
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 145

follows from (4.36, AM 2005):

Z Z Z
bd ≡
G (x2 − x)fiT (x)dx = x2 fiT (x)dx − xfiT (x)dx . (4.281)
R R R

The second term is the sample mean (1.126, AM 2005):

Z T
1X
b ≡
m xfiT (x)dx = xt . (4.282)
R T t=1

The first term is the sample non-central second moment:

Z T
2 1X 2
cs ≡
n x fiT (x)dx = x . (4.283)
R T t=1 t

By applying (1.48) to (1.126, AM 2005) and (1.127, AM 2005) we obtain

cs = sb2 + m
n b2 , (4.284)

where sb2 is the sample variance (1.127, AM 2005):

T
1X
sb2 ≡ b 2.
(xt − m) (4.285)
T t=1

Therefore:

G
bd = n b = sb2 + m
cs − m b2 − m
b. (4.286)

See the MATLAB


R
script S_EstimateMomentsComboEvaluation for the implementation. 

E 183 – Moment-based functional of a mixture IV (see E 179)


Consider the same setup than in E 179. Write a MATLAB R
script in which you evaluate the performance
of the estimator (4.276) with respect to (4.288) as in the script S_Estimator by stress-testing the parameter
µY in the range [0, 0.2].
Hint. Use the MATLAB
R
function QuantileMixture.

Solution of E 183
See the MATLAB R
script S_EstimateQuantileEvaluation. 

E 184 – Estimation of a quantile of a mixture I (see E 179)


Consider the same setup than in E 179. Write a MATLAB R
function QuantileMixture that computes
the quantile of (4.248) by linear interpolation/extrapolation of the respective cdf on a fine set of equally
spaced points for generic values of α, µY , σY , µZ , σZ . In order to use this function in the sequel, make
sure the function can accept a vector of values u in (0, 1) as input, not just one value, thereby outputting
the respective vector of values x ≡ QX (u) in the domain of X.
Hint. Use the built-in cdfs that correspond to (4.249) and (4.250).
Then, assume knowledge of the following parameters:

α ≡ 0.8, σY ≡ 0.2 , µZ ≡ 0, σZ ≡ 0.15 . (4.287)

Set µY ≡ 0.1 and generate a sample of T ≡ 52 i.i.d. observations from the distribution (4.248).
Hint. Feed a uniform sample into the MATLAB
R
function QuantileMixture.

Solution of E 184
See the MATLAB R
function QuantileMixture and the script S_GenerateMixtureSample. 

E 185 – Estimation of a quantile of a mixture II (see E 179)


Consider the same setup than in E 179. Assume that we are interested in this functional:

G[fX ] ≡ (I [fX ])−1 (p) , (4.288)

where I [·] is the integration operator and p ≡ 0.5. Notice that the above is simply the quantile with
confidence p, see (1.8, AM 2005) and (1.17, AM 2005):

G[fX ] ≡ QX (p) . (4.289)

Compute the non-parametric estimator qbp of (4.288) defined by (4.36, AM 2005) in Meucci (2005). Write
a MATLAB R
script in which you assume:

α ≡ 0.8, σY ≡ 0.2 , µZ ≡ 0, σZ ≡ 0.15 . (4.290)

and evaluate the performance of qbp with respect to (4.288) as in the script S_Estimator by stress-testing
the parameter µY in the range [0, 0.2].
Hint. Use the MATLAB
R
function QuantileMixture.

Solution of E 185
From (4.39, AM 2005) in Meucci (2005), the non-parametric estimator of the median is the sample
median (1.130, AM 2005):

b e ≡ x[T /2]:T .
G (4.291)

See the MATLAB


R
script S_EstimateQuantileEvaluation for the implementation. 

E 186 – Maximum likelihood estimation


Write a MATLAB R
script in which you:
• Upload the time series of realizations of a random variable X in the database DB_TimeSeries;
• Check that the provided series represents the realizations of an invariant using the MATLAB R

function PerformIidAnalysis;
• Compute numerically the maximum likelihood estimator θbM L of θ, where you assume that X is an
invariant, fX denotes the unknown pdf that represents the unknown distribution of each realization
in the time series, and make the following assumption on the generating process for X, where we
use the notation of (1.79, AM 2005) and (1.95, AM 2005):
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 147

(
Ca
fθ,θ 2 for θ ∈ [−0.04, −0.01]
fX ≈ fθ ≡ LogN (4.292)
fθ,(θ−0.01)2 for θ ∈ {0.02} ∪ {0.03} .

Hint. Approximate the continuum [−0.04, −0.01] with a fine set of equally spaced points; evaluate the
(log-)likelihood for every value of θ.

Solution of E 186
See the MATLAB R
script S_MaximumLikelihood. 

E 187 – Quantile estimation: maximum likelihood vs. non-parametric (see E 186)


Consider the same setup than in E 186. Assume now that you are interested in the p-quantile of X for
p ≡ 1%, as defined in (1.17, AM 2005). Use the result in E 186 to compute the ML estimator qbpM L and
compare this ML estimate with the non-parametric estimate of the quantile for the same confidence level.
Hint. As in (4.38, AM 2005), the true quantile is a functional of the unknown distribution of X:

Qp (X) ≡ qp [fX ] . (4.293)

Therefore, the ML estimator of the quantile is the functional applied to the ML-estimated distribution:

h i
qbpM L ≡ qp fθbM L . (4.294)

On the other hand, as in (4.36, AM 2005) the non-parametric quantile is the functional applied to the
empirical pdf:

qbpN P ≡ qp [fiT ] . (4.295)

Solution of E 187
See the MATLAB R
script S_MaximumLikelihood. 
E 188 – Maximum likelihood estimation of a multivariate Student t distribution *

Consider Student t invariants X ∼ St(ν, µ, Σ). Assume ν known and use (4.80, AM 2005)-(4.82, AM
2005). Write a MATLAB R
script in which you:
• Upload the database DB_UsSwapRates of the daily time series of par 2yr, 5yr and 10yr swap rates;
• Compute the invariants relative to a daily estimation interval;
• Estimate the expectation and the covariance relative to the 2yr and the 5yr rates under the assump-
tion that ν ≡ 3 and ν ≡ 100 respectively;
• Represent the two sets of expectations and the covariances in one figure in terms of the ellipsoid;
• Scatter-plot the observations.
Hint. First compute the generator g that appears in the weighting function (4.79, AM 2005). Under the
Student t assumption the pdf is (2.188, AM 2005) and the generator follows accordingly.
Solution of E 188
First we have to compute the generator g that appears in the weighting function (4.79, AM 2005). Under
the Student t assumption the pdf is (2.188, AM 2005). Thus, as in (2.188, AM 2005) the generator reads:

Γ( ν+N
2 )
 z −
ν+N
2
g(z) ≡ N 1+ . (4.296)
Γ( ν2 )(νπ) 2 ν
Hence the weighting function (4.79, AM 2005) reads:

g 0 (z) ν+N
w(z) ≡ −2 = . (4.297)
g(z) ν+z
Therefore the weights (4.80, AM 2005) read:

ν+N
wt ≡ . (4.298)
ν + (xt − µ b −1 (x − µ
b )0 Σ b)
For the implementation, see the MATLAB
R
function MleRecursionForStudentT and the script S_FitSwapToStudentT.


E 189 – Random matrix theory: semi-circular law


Consider a N × N matrix X where for all m, n = 1, . . . , N the entries are i.i.d. Xmn ∼ fX , where fX
is a univariate distribution with expectation zero and standard deviation one. Consider the symmetrized
and rescaled matrix:

1
Y≡√ (X + X0 ) . (4.299)
8N
Consider the eigenvalues λ1 , . . . , λN of Y and the density that they define:

N
1 X (λn )
h≡ δ , (4.300)
N n=1
where δ is the Dirac delta (B.18, AM 2005). Notice that, since (4.299) is random, so is the function
(4.300). According to random matrix theory, in some topology the following limit for the random function
h holds

lim h = g , (4.301)
N →∞

where g is the rescaled upper semicircle function, defined for λ ≥ 0 as follows

2p
g(λ) ≡ 1 − λ2 . (4.302)
π
Write a MATLAB R
script that shows (4.301) when the distribution fX is standard normal, shifted/rescaled
normal, and shifted/rescaled exponential.
Hint. Choose a large N and simulate (4.299) once. This is a realization of (4.299). Compute the realized
eigenvalues and the respective realization of h defined in (4.300). Approximate h with a histogram. Show
that the histogram looks similar to g defined in (4.302).
CHAPTER 4. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 149

Solution of E 189
See the MATLAB R
script S_SemiCircular. 

E 190 – Random matrix theory: Marchenko-Pastur limit


Consider a T × N matrix X where for all m = 1, . . . , T , n = 1, . . . , N the entries are i.i.d. Xmn ∼ fX ,
where fX is a univariate distribution with expectation zero and standard deviation one. Consider the
sample covariance estimator (4.42, AM 2005):

1 0
Y≡ X X. (4.303)
T
Consider the eigenvalues λ1 , . . . , λN of Y and the density that they define:

N
1 X (λn )
h≡ δ , (4.304)
N n=1

where δ is the Dirac delta (B.18, AM 2005). Notice that, since (4.303) is random, so is the function
(4.304). According to random matrix theory, in some topology the following limit for the random function
h holds:

lim h = gq , (4.305)
N ≡qT →∞

where the function gq is defined as:

1
q
gq (λ) ≡ (λq − λ)(λ − λq ) , (4.306)
2qπλ
for λmin ≤ λ ≤ λmax where:

√ √
λq ≡ (1 − q)2 , λq ≡ (1 + q)2 . (4.307)

Write a MATLAB R
script that shows (4.306) when the distribution fX is standard normal, shifted/rescaled
normal, and shifted/rescaled exponential.
Solution of E 190
See the MATLAB R
script S_PasturMarchenko. 

E 191 – Non-parametric estimators of regression parameters


Consider a joint model for the invariants. For t = 1, . . . , T . The marginals are:

2
Xt ∼ LogN(µX , σX )
(4.308)
Ft ∼ Ga(νF , σF2 ) ,

and the copula is the copula of the diagonal entries of Wishart distribution:

Wt ∼ W(νW , ΣW ) . (4.309)
Consider the coefficients that define the regression line (3.127, AM 2005):

et ≡ α + βFt .
X (4.310)

Compute the non-parametric estimators (b


α, β)
b of the regression coefficients.
Solution of E 191
From (4.52, AM 2005) they read as in (4.54). 
E 192 – Maximum likelihood vs. non-parametric estimators of regression parame-
ters (see E 191)
Consider the same setup than in E 191. Are (b
α, β)
b the maximum-likelihood estimators of the regression
coefficients?
Solution of E 192
No, because the regression model ensuing from (4.308)-(4.309) is not conditionally normal as in (4.48)-
(4.49). 

E 193 – Simulation of the distribution of statistics of regression parameters (see E 191)


Consider the same setup than in E 191. Write a MATLAB R
script in which you:
• Generate arbitrary values for the parameters in (4.308)-(4.309) and for the number of observations
T;
• Compute in simulation the distribution of the statistic:

√ α − α)
(b
bα ≡
G T − 2p , (4.311)
b2 σ
σ bα2

and the distribution of the statistic:

√ (βb − β)
bβ ≡
G T − 2q ; (4.312)
bβ2
b2 σ
σ

• Compare the empirical distribution of (4.311) with the analytical distribution of (4.58) as well as
the empirical distribution of (4.312) with the analytical distribution of (4.59) and comment.
Solution of E 193
See the MATLAB R
script S_TStatApprox. The distribution of (4.311) is very similar to that of (4.58) even
for relatively small values of T . The same holds for the distribution of (4.312) as compared to that of
(4.59). 
Chapter 5

Evaluating allocations

E 194 – Gamma approximation of the investor’s objective (www.5.1) **


Determine the characteristic function of the approximate objective (5.25, AM 2005).
Solution of E 194
Consider the generic second-order approximation (3.108, AM 2005) for the N prices of the securities in
terms of the underlying K-dimensional market invariants X, which we report here:

(n)
1
PT +τ ≈ g (n) (0) + X0 ∂x g (n) + X0 ∂xx
2
g (n) X, (5.1)

x=0 2 x=0

where n = 1, . . . , N . From (5.11, AM 2005) the market is an invertible affine transformation of the
prices, i.e.:

N
X N
X
M (n)
≈ an + Bnm g (m)
(0) + Bnm X0 ∂x g (m)

x=0
m=1 m=1
(5.2)
N
1 X
+ Bnm X0 ∂xx
2
g (m) X.

2 m=1 x=0

In turn, from (5.10, AM 2005) the objective is a linear combination of the market:

N
X
Ψα ≡ αn M (n)
n=1
N
X N
X N
X
≈ αn an + αn Bnm g (m) (0)
n=1 n=1 m=1
(5.3)
N
X N
X h i
+ αn Bnm X0 ∂x g (m)

x=0
n=1 m=1
N N
1X X h i
+ αn Bnm X0 ∂xx
2
g (m) X ... .

2 n=1 m=1
x=0

151
In other words:

1
Ψα ≈ Ξα ≡ θ + ∆0α X + X0 Γα X , (5.4)
2
where:

N
X N
X
θ≡ αn an + αn Bnm g (m) (0) (5.5)
n=1 n,m=1
N
X
∆α ≡ αn Bnm ∂x g (m) (5.6)

x=0
n,m=1
N
X
2
Γα ≡ αn Bnm ∂xx g (m) . (5.7)

x=0
n,m=1

Assume now that the K-dimensional invariants X are normally distributed as in (5.29, AM 2005). Then
we can compute explicitly the characteristic function of the approximate objective (5.4). Defining:

Z ≡ X − µ ∼ N(0, Σ) , (5.8)

from (5.4) we have:

1
Ξα = θ + ∆0α (µ + Z) + (µ + Z)0 Γα (µ + Z)
2
0 0 1 1
= θ + ∆α µ + ∆α Z + µ0 Γα µ + µ0 Γα Z + Z0 Γα Z (5.9)
2 2
0 1 0
= bα + wα Z + Z Γα Z ,
2
where:

1
bα ≡ θ + ∆0α µ + µ0 Γα µ (5.10)
2
wα ≡ ∆α + Γα µ . (5.11)

We perform the Cholesky decomposition of the covariance:

Σ ≡ BB0 , (5.12)

and the principal component decomposition of the following symmetric matrix:

B0 Γα B = EΛE0 , (5.13)

where EE0 = I and Λ is the diagonal matrix of the eigenvalues. We define:


CHAPTER 5. EVALUATING ALLOCATIONS 153

C ≡ BE , (5.14)

and we introduce the multivariate standard normal variable:

Y ≡ C−1 Z ∼ N 0, E0 B−1 Σ(B0 )−1 E = N(0, IK ) .



(5.15)

Finally we define:

∆ ≡ C0 w . (5.16)

In these terms and dropping the dependence on α from the notation, (5.9) becomes:

1
Ξα = b + w0 CC−1 Z + Z0 (C0 )−1 C0 ΓCC−1 Z
2
0 1 0 0
= b + ∆ Y + YE B ΓBEY
2
0 1 (5.17)
= b + ∆ Y + YE0 EΛE0 EY
2
K
X 1
=b+ (δk Yk + λk Yk2 ) .
2
k=1

As in Feuerverger and Wong (2000), we compute analytically the characteristic function of Ξα :

Z h P
λk 2
i
 iΞω
iω b+ K
k=1 (δk yk + 2 yk )
φΞ (ω) ≡ E e = e f (y)dy , (5.18)
RN

where f is the standard normal density (2.156, AM 2005), which factors into the product of the marginal
densities:

K
Y √ 1 2
f (y) = 2πe− 2 yk . (5.19)
k=1

Therefore the characteristic function (5.18) becomes:

K
Y
φΞ (ω) = eiωb G(δk , λk ) , (5.20)
k=1

where:

Z +∞
1 λ 2 y 2
G(δ, λ) ≡ √ eiω[δy+ 2 y ] e− 2 dy . (5.21)
2π −∞

Since:
!
1 − iωλ 2 1 − iωλ iωδ
iωδy − y = − y2 − 1−iωλ
y
2 2 2
" #2
1 − iωλ iωδ
= − y − 1−iωλ
2 2 2
!2 (5.22)
1 − iωλ iωδ
+
2 2 1−iωλ
2
2
(ωδ)2

1 − iωλ iωδ
= − y− − ,
2 1 − iωλ 2(1 − iωλ)

we obtain:

Z +∞
1 1−iωλ
[y− 1−iωλ
iωδ
]
2 (ωδ) 2

G(δ, λ) = √ e− 2 − 2(1−iωλ)
dy
2π −∞
+∞
r Z
1 (ωδ)2 1 1−iωλ
[y− 1−iωλ
iωδ 2
] dy
= e− 2(1−iωλ) q e− 2
(5.23)
1 − iωλ −∞ 2π
1−iωλ
1 δ2 ω2
=√ e− 2(1−iλω) .
1 − iλω
Substituting this back into (5.20) we finally obtain the expression of the characteristic function:

eiωb − 21
PK 2 ω2
δk
φΞ (ω) = qQ e k=1 (1−iλk ω)

K
k=1 (1 − iωλk ) (5.24)
− 12 − 12 ∆0 (I−iωΛ)−1 ω 2
= |IK − iωΛ| eiωb e .

Notice that substituting (5.13) and (5.12) we obtain:

|IK − iωΛ| = |E(IK − iωΛ)E0 | = |IK − iωB0 ΓB|


= (B0 )−1 (IK − iωB0 ΓB)B0

(5.25)
= |IK − iωΓΣ| .

On the other hand, substituting (5.16) and (5.14) we obtain:

∆0 (IK − iωΛ)−1 ∆ = w0 C(IK − iωΛ)−1 C0 w


= w0 BE(IK − iωΛ)−1 E0 B0 w (5.26)
0 0 −1 0
= w B(E(IK − iωΛ)E ) B w.

Substituting again (5.13) and (5.12) this reads:


CHAPTER 5. EVALUATING ALLOCATIONS 155

∆0 (IK − iωΛ)−1 ∆ = w0 B(IK − iωB0 ΓB)−1 B0 w


= w0 BB0 (B0 )−1 (IK − iωB0 ΓB)−1 B0 w
= w0 Σ((IK − iωB0 ΓB)B0 )−1 B0 w
(5.27)
= w0 Σ(B0 − iωB0 ΓΣ)−1 B0 w
= w0 Σ(IK − iωΓΣ)−1 (B0 )−1 B0 w
= w0 Σ(IK − iωΓΣ)−1 w .

Therefore, substituting (5.25) and (5.27) in (5.24) we obtain the characteristic function of the approximate
objective:

− 21 1 0 −1
wω 2
φΞ (ω) = |IK − iωΓΣ| eiωb e− 2 w Σ(IK −iωΓΣ) . (5.28)

Finally, substituting (5.10) and (5.11) we obtain:

− 21 0 1 0
φΞ (ω) = |IK − iωΓΣ| eiω(θ+∆ µ+ 2 µ Γµ)
0 −1
(5.29)
1
(∆+Γµ)ω 2
× e− 2 (∆+Γµ) Σ(IK −iωΓΣ) .

E 195 – Moments of the approximation of the investor’s objective (www.5.1)


Compute the moments of the approximate objective Ξα in (5.25, AM 2005).
Solution of E 195
To compute the moments of the approximate objective Ξα we use (1.44). In order to do this, we write the
characteristic function as follows:

1
φΞα (ω) = v − 2 eu , (5.30)

where:

1
u(ω) ≡ iωb − w0 Σ(I − iωV)−1 w
2 (5.31)
v(ω) ≡ |I − iωV| ,

and:

w ≡∆+Γ
(5.32)
V ≡ ΓΣ .

To show how this works we explicitly compute the first three derivatives. It is easy to implement this
approach systematically up to any order with by programming a software package such as Mathematica R
.
The first three derivatives of the characteristic function read:
1 3 1
φ0Ξ (ω) = − v − 2 v 0 eu + v − 2 eu u0
2
3 5 1 3 3 1 1
φ00Ξ (ω) = v − 2 (v 0 )2 eu − v − 2 v 00 eu − v − 2 v 0 eu u0 + v − 2 eu (u0 )2 + v − 2 eu u00
4 2
15 − 7 0 3 u 3 − 5 0 00 u 3 − 5 0 2 u 0
φ000
Ξ (ω) = − v 2 (v ) e + v 2 2v v e + v 2 (v ) e u
8 4 4
3 − 5 0 00 u 1 − 3 000 u 1 − 3 00 u 0
+ v 2v v e − v 2v e − v 2v e u (5.33)
4 2 2
3 −5 0 2 u 0 3 3 3
+ v 2 (v ) e u − v − 2 v 00 eu u0 − v − 2 v 0 eu (u0 )2 − v − 2 v 0 eu u00
2
1 3 1 1
− v − 2 v 0 eu (u0 )2 + v − 2 eu (u0 )3 + 2v − 2 eu u0 u00
2
1 3 1 1
− v − 2 v 0 eu u00 + v − 2 eu u0 u00 + v − 2 eu u000 .
2
These expressions depend on the first three derivatives of u and v, which we obtain by applying the
following generic rules that apply for any conformable matrices M, A, B:

dM−1 (ω) dM(ω) −1


= M−1 M (5.34)
dω dω
d(AM(ω)B) d(M(ω))
=A B (5.35)
dω dω
d |A + ωB|
= |A + ωB| tr (A + ωB)−1 B ,
 
(5.36)

where (5.34) follows from (A.126, AM 2005), (5.35) follows from a term by term expression of the
product AMB and (5.36) follows from (A.124, AM 2005). Using these formulas in (5.31) we obtain:

1
u(ω) ≡ iωb − w0 Σ(I − iωV)−1 w
2
1
u0 (ω) = ib − w0 Σ(I − iωV)−1 [−iV] (I − iωV)−1 w
2
u (ω) = −w Σ(I − iωV)−1 [−iV] (I − iωV)−1 [−iV] (I − iωV)−1 w
00 0

u000 (ω) = −3w0 Σ(I − iωV)−1 [−iV] (I − iωV)−1 [−iV] (I − iωV)−1 [−iV] (I − iωV)−1 w ,
(5.37)

and:
CHAPTER 5. EVALUATING ALLOCATIONS 157

v(ω) ≡ |I − iωV|
v(ω)0 = |I + iωV| tr (I + iωV)−1 (iV)
 

v 00 (ω) = |I + iωV| tr (I + iωV)−1 (iV) tr (I + iωV)−1 (iV)


   

+ |I + iωV| tr (I − iωV)−1 (−iV)(I − iωV)−1 (iV)


 

v 000 (ω) = |I + iωV| (tr (I + iωV)−1 (iV) )3


 
(5.38)
+ 3 |I + iωV| tr (I + iωV)−1 (iV)
 

× tr (I − iωV)−1 (−iV)(I − iωV)−1 (iV)


 

+ |I + iωV| tr (I − iωV)−1 [−iV] (I − iωV)−1 (−iV)(I − iωV)−1 (iV)




+ (I − iωV)−1 (−iV)(I − iωV)−1 [−iV] (I − iωV)−1 (iV) .




Evaluating these derivatives in ω = 0 we obtain:

1
u ≡ − w0 Σw
2
1
u = i(b + w0 ΣVw)
0
(5.39)
2
u00 = w0 ΣV2 w
u000 = −i3w0 ΣV3 w ,

and:

v≡1
v 0 = i tr(V)
2 (5.40)
v 00 = − [tr(V)] + tr(V2 )
3
v 000 = −i [tr(V)] + 3i tr(V) tr(V2 ) − 2i tr(V3 ) .

These values must be substituted in (5.33) to yield the expressions of the first three non-central moments
as in E 18. For example, the first moment is:

 
1 3 1
E {Ξα } = i−1 φ0Ξα (0)
=i −1
− v − 2 v 0 eu + v − 2 eu u0
2
  (5.41)
1 0
− 2 w Σw 1 0 1
=e (b + w ΣVw) − tr(V) .
2 2

Finally, the explicit dependence on allocation comes from substituting in the final expression (5.10),
(5.11) and (5.32). 

E 196 – Estimability and sensibility imply consistence with weak dominance (www.5.2)
Show that estimability and sensibility imply consistence with weak dominance.
Solution of E 196
Assume that Ψα weakly dominates Ψβ . From the definition (5.36, AM 2005), this means that for all
u ∈ (0, 1) the following inequality holds:
QΨα (u) ≥ QΨβ (u) . (5.42)

We want to prove that if S is estimable and sensible, then:

S(α) ≥ S(β) . (5.43)

From the definition of estimability (5.52, AM 2005), the index must be a function of the distribution of
the objective, as represented, say, by the cdf:

S(α) = G [FΨα ] . (5.44)

From (2.27, AM 2005) the random variable X defined below has the same distribution as the objective:

d
Xα ≡ QΨα (U ) = Ψα , U ∼ U([0, 1]) . (5.45)

Therefore both variables share the same cdf:

FΨα (ψ) = FXα (ψ), ψ ∈ R. (5.46)

Thus:

S(α) = G [FΨα ] = G [FXα ] . (5.47)

A similar result holds for the second allocation:

   
S(β) = G FΨβ = G FXβ . (5.48)

On the other hand, from (5.42) in all scenarios Xα ≥ Xβ , i.e. Xα strongly dominates Xβ . Therefore,
from the sensibility of S we must have:

 
G [FXα ] ≥ G FXβ . (5.49)

This and (5.47)-(5.48) in turn imply the desired result:

 
S(α) = G [FXα ] ≥ G FXβ = S(β) . (5.50)

E 197 – Translation invariance and positive homogeneity imply constancy (www.5.2)


Show that if an index of satisfaction is translation invariant (5.72, AM 2005) and positive homogeneous
(5.64, AM 2005), it is a constant index of satisfaction (5.62, AM 2005).
CHAPTER 5. EVALUATING ALLOCATIONS 159

Solution of E 197
Assume that an index of satisfaction is translation invariant:

Ψg ≡ 1 ⇒ S(α + λg) = S(α) + λ , (5.51)


and positive homogeneous:

S(λα) = λS(α) , for all λ ≥ 0 . (5.52)


Then it displays the constancy feature. Indeed assume that B is a deterministic allocation ΨB ≡ ψB then:

    
α b α b
S(α + λb) = S ψb +λ = ψb S +λ
ψb ψb ψb ψb
      (5.53)
α α
= ψb S + λ = S ψb + λψb = S(α) + λψb .
ψb ψb
In particular:

S(λb) = S(0 + λb) = S(0) + λψb = λψb . (5.54)


From the homogeneity S(0) ≡ 0. Therefore, setting λ ≡ 1 we obtain:

S(b) = ψ b , (5.55)
which is the constancy property (5.62, AM 2005). 

E 198 – Consistence with weak dominance (www.5.3)


Show that the certainty-equivalent (5.93, AM 2005) is a sensible index of satisfaction for increasing utility
functions. This also implies that the certainty-equivalent is consistent with weak dominance.
Solution of E 198
With a change of variable we write expected utility as follows:

Z +∞ Z 1
E {u(Ψ)} = u(ψ)fψ (ψ)dψ = u(QΨ (s))ds . (5.56)
−∞ 0

Now, assume that the following inequality holds:

QΨα (s) ≥ QΨβ (s), for all s ∈ (0, 1) . (5.57)


Then:

E {u(Ψα )} ≥ E {u(Ψβ )} . (5.58)


Due to (5.99, AM 2005) this also implies that:

CE(α) ≥ CE(β) , (5.59)


which shows that (5.109, AM 2005) holds true. 
E 199 – Positive homogeneity of the certainty-equivalent and utility functions (www.5.3)
Show that the class of utility functions that give rise to a positive homogeneous certainty-equivalent is the
power class.
Solution of E 199
From its definition:

CE(α) ≡ u−1 (E {u(Ψα )}) , (5.60)

the certainty-equivalent is positive homogeneous if it satisfies:

u−1 (E {u(Ψλα )}) = λu−1 (E {u(Ψα )}) . (5.61)

Since from (5.16, AM 2005) the objective is positive homogeneous:

Ψλα = λΨα , (5.62)

we obtain an align that does not depend on the allocation:

u−1 (E {u(λΨ)}) = λu−1 (E {u(Ψ)}) . (5.63)

Assume the utility function is of the power type:

u(ψ) ≡ ψ β . (5.64)

Then, using 1.13 and the change of variable y ≡ λψ, we obtain:

Z Z Z
1 y
E {u(λΨ)} = y β fλΨ (y)dy = y β fΨ dy = λβ ψ β fΨ (ψ)dψ = λβ E {u(Ψ)} . (5.65)
R R λ λ R

Since the inverse of the power utility function (5.64) reads:

1
u−1 (z) = z β , (5.66)

from (5.65) we obtain:

1 1 1
u−1 (E {u(λΨ)}) = [E {u(λΨ)}] β = λβ E {u(Ψ)} β = λ [E {u(Ψ)}] β = λu−1 (E {u(Ψ)}) . (5.67)


E 200 – Translation invariance of the certainty-equivalent and utility functions (www.5.3)


Show that the certainty-equivalent index of satisfaction (5.93, AM 2005) is translation invariant for expo-
nential utility functions.
CHAPTER 5. EVALUATING ALLOCATIONS 161

Solution of E 200
From its definition:

CE(α) ≡ u−1 (E {u(Ψα )}) , (5.68)

the certainty-equivalent is translation invariant if it satisfies:

Ψb ≡ 1 ⇒ u−1 (E {u(Ψα+λb )}) = u−1 (E {u(Ψα )}) + λ . (5.69)

Since from (5.17, AM 2005) the objective is additive:

Ψα+λb = Ψα + λ , (5.70)

we obtain an align that does not depend on the allocation:

u−1 (E {u(Ψ + λ)}) = u−1 (E {u(Ψ)}) + λ . (5.71)

Assume the utility function is exponential:

u = −e−βψ . (5.72)

Then, using 1.13 and the change of variable y ≡ ψ + λ we obtain:

Z Z
E {u(Ψ + λ)} = −e−βy fΨ+λ (y)dy = −e−βy fΨ (y − λ)dy
Z (5.73)
= e−βλ −e−βψ fΨ (ψ)dψ = e−βλ E {u(Ψ)} .

On the other hand the inverse of the exponential utility function reads:

ln(−z)
u−1 (z) = − . (5.74)
β
Therefore:

1
u−1 (E {u(Ψ + λ)}) = − ln(− [E {u(Ψ + λ)}])
β
1
= − ln(e−βλ [− E {u(Ψ)}])
β (5.75)
1
= λ − [ln([− E {u(Ψ)}])]
β
= λ + u−1 (E {u(Ψ)}) .


E 201 – Risk aversion/propensity of the certainty-equivalent and utility functions
(www.5.3)
Show that the certainty-equivalent index of satisfaction is a risk averse index of satisfaction if and only if
the utility function is concave, i.e. show (5.120, AM 2005).
Solution of E 201
Since we only deal with increasing utility functions from (5.99, AM 2005) to prove risk aversion we can
prove equivalently the following implication:

Ψb = ψ b , E {Ψf } = 0 ⇒ E {u(Ψb )} ≥ E {u(Ψb+f )} . (5.76)

On the one hand, we have the following chain of identity:

E {u(Ψb )} = u(ψb ) = u(E {Ψb }) = u(E {Ψb + Ψf }) = u(E {Ψb+f }) . (5.77)

On the other hand, Jensen’s inequality states that for any random variable Ψ the following is true if and
only if u is concave:

u(E {Ψ}) ≥ E {u(Ψ)} . (5.78)

Therefore if and only if u is concave we obtain the following result:

E {u(Ψb )} ≥ E {u(Ψb+f )} . (5.79)

Note. A similar solution links convexity of the utility function with risk propensity and linearity of the
utility function with risk neutrality. 

E 202 – Risk premium in the case of small bets (www.5.3)


Show that if an allocation gives rise to an objective function which is not too volatile, we have (5.122,
AM 2005).
Solution of E 202
From a second-order Taylor expansion and using the assumptions

Ψb = ψ b , E {Ψf } = 0 , (5.80)

we obtain:

Var {Ψf } 00
u(CE(b + f )) ≡ E {u(Ψb+f )} = E {u(ψb + Ψf )} ≈ u(ψb ) + u (ψb ) . (5.81)
2
On the other hand from the definition of risk premium (5.85, AM 2005), which we report here:

RP(b, f ) ≡ CE(b) − CE(b + f ) . (5.82)

and the constancy of the certainty-equivalent:


CHAPTER 5. EVALUATING ALLOCATIONS 163

CE(b) = ψb , (5.83)

we obtain:

CE(b + f ) = ψb − RP(b, f ) , (5.84)

where RP(b, f ) is a small quantity. Therefore:

u(CE(b + f )) = u(ψb − RP(b, f )) ≈ u(ψb ) − u0 (ψb ) RP(b, f ) . (5.85)

Thus from (5.81) and (5.85) we obtain:

u00 (ψb ) Var {Ψf }


RP(b, f ) ≈ − . (5.86)
u0 (ψb ) 2

E 203 – Dependence on allocation: approximation in terms of the moments of the
objective (www.5.3)
Derive the expression (5.146, AM 2005) of the Arrow-Pratt approximation.
Solution of E 203
We first expand the utility function around an arbitrary value ψ:
e

e + u0 (ψ)(ψ
u(ψ) = u(ψ) e e + 1 u00 (ψ)(ψ
− ψ) e e 2 + 1 u000 (ψ)(ψ
− ψ) e e 3 + ··· .
− ψ) (5.87)
2 3!
Taking expectations and pivoting the expansion around the objective’s expected value

ψe ≡ E {Ψ} , (5.88)

we obtain:

u00 (E {Ψ})
E {u(Ψ)} ≈ u(E {Ψ}) + Var {Ψ} , (5.89)
2
where the term in the first derivative cancels out. On the other hand, another Taylor expansion yields:

1
u−1 (z + ) ≈ u−1 (z) + . (5.90)
u0 (u−1 (z))
Substituting (5.89) in (5.90) we obtain:

u00 (E {Ψ})
u−1 (E {u(Ψ)}) ≈ u−1 (u(E {Ψ})) + Var {Ψ}
2u0 (u−1 (u(E {Ψ})))
(5.91)
u00
= E {Ψ} + 0 (E {Ψ}) Var {Ψ} ,
2u
so that the first-order approximation reads:

A(E {Ψα })
CE(α) ≈ E {Ψα } − Var {Ψα } . (5.92)
2


E 204 – First-order sensitivity analysis of the certainty-equivalent I (www.5.3)


Derive the expression (5.148, AM 2005) of the first-order derivative of the certainty-equivalent index of
satisfaction.
Solution of E 204
First we derive the following result using the chain rule of calculus:

Z 
∂α E {u(Ψα )} = ∂α u(ψα )fM (m)dm
RN
Z
(5.93)
= ∂α (ψα )u0 (ψα )fM (m)dm
RN
= E {∂α (Ψα )u0 (Ψα )} .

From this and the chain rule we obtain:

∂α CE(α) = ∂α u−1 (E {u(Ψα )})


 

du−1
= (E {u(Ψα )})∂α E {u(Ψα )}
dz
1 (5.94)
= 0 −1 ∂α E {u(Ψα )}
u (u (E {u(Ψα )}))
E {u0 (Ψα )∂α (Ψα )}
= .
u0 (CE(α))
For example consider the case where the objective are the net gains:

Ψα ≡ α0 (PT +τ − pT ) . (5.95)

Then the market vector (5.10, AM 2005) reads:

M ≡ PT +τ − pT , (5.96)

and the partial derivative of the objective (5.95) reads:

∂α (Ψα ) = M . (5.97)

E 205 – First-order sensitivity analysis of the certainty-equivalent II (see E 204)


Consider the same setup than in E 204. Assume that the markets are normally distributed. Prove the
expression of the sensitivity of the certainty-equivalent in (5.151, AM 2005).
CHAPTER 5. EVALUATING ALLOCATIONS 165

Solution of E 205
We have:

PT +τ ∼ N(µ, Σ) . (5.98)

Then the market vector (5.10, AM 2005) is normally distributed:

M ∼ N(ν, Σ) , ν ≡ µ − pT . (5.99)

Also, assume that the utility is the error function:

 
ψ
u(ψ) ≡ erf √ . (5.100)

Then the first derivative reads:

r
2 − 2η
1
ψ2
u0 (ψ) = e . (5.101)
πη
Thus the numerator in (5.94) reads:

r
2 n (− 2η1
(α0 M)2 )
o
E {u0 (Ψα )∂α (Ψα )} = E e M
πη
r −1 Z
2 |Σ| 2 1 0 αα0 1 0 −1
= N me− 2 m ( η )m e− 2 (m−ν) Σ (m−ν) dm (5.102)
πη (2π) 2 RN
r −1 Z
2 |Σ| 2 1
= N me− 2 D(m) dm ,
πη (2π) 2 RN

where:

αα0
 
D(m) ≡ m 0
m + (m − ν)0 Σ−1 (m − ν)
η (5.103)
= (m − ξ)0 Φ−1 (m − ξ) + ν 0 Σ−1 ν − ξ 0 Φ−1 ξ ,

with:

−1 −1
αα0 αα0
 
ξ≡ + Σ−1 Σ−1 ν , Φ≡ + Σ−1 . (5.104)
η η

Therefore from (5.94) we obtain:


E {u0 (Ψα )∂α (Ψα )}
∂α CE(α) =
u0 (CE(α))
−1
|Σ| 2 η CE(α)2
Z
1
= N e
2 me− 2 D(m) dm
(2π) 2 R N

− 12 N − 12
|Σ| |Φ|
Z
CE(α)2 − 12 [ν 0 Σ−1 ν−ξ0 Φ−1 ξ] (2π)
η 2 1 0 −1
= N e 2 e − 21
m N e− 2 (m−ξ) Φ (m−ξ)
dm
(2π) 2 |Φ| RN (2π) 2

= γ(α)ξ ,
(5.105)

where from (5.104) we obtain:

− 12
|Σ| η 2 0
Σ−1 ν−ξ0 Φ−1 ξ]
e 2 CE(α) e− 2 [ν
1
γ(α) ≡ − 12
|Φ|
− 12 (5.106)
|Σ|
h −1
i
CE(α) η 2 − 21 ν 0 (Σ−1 −Σ−1 [ η1 αα0 +Σ−1 ] Σ−1 )ν
= 12 e 2 e .
1 0 −1
η αα + Σ

Using again (5.104) and (5.99) we finally obtain:

 −1
1
∂α CE(α) = γ(α) αα0 + Σ−1 Σ−1 (µ − pT ) . (5.107)
η

E 206 – Second-order sensitivity analysis of the certainty-equivalent (www.5.3) (see E 204)


Compute the second-order derivative of the certainty-equivalent and discuss its convexity.
Solution of E 206
First we derive the following result:

Z 
0 0
∂α {u (Ψα )∂α0 (Ψα )} = ∂α u (ψα )∂α0 (ψα )fM (m)dm
RN
Z
(5.108)
fM (m) u0 (ψα )∂αα
2 00

= 0 (ψα ) + u (ψα )∂α (ψα )∂α0 (ψα )] dm
R N

= E u0 (Ψα )∂αα
2 00

0 (Ψα ) + u (Ψα )∂α (Ψα )∂α0 (Ψα ) .

From this, (5.94) and the chain rule of calculus we obtain:


CHAPTER 5. EVALUATING ALLOCATIONS 167

E {u0 (Ψα )∂α0 (Ψα )}


 
2
∂αα 0 CE(α) = ∂α
u0 (CE(α))
 
1
= ∂α 0 E {u0 (Ψα )∂α0 (Ψα )}
u (CE(α))
1
+ 0 ∂α E {u0 (Ψα )∂α0 (Ψα )} (5.109)
u (CE(α))
" #
u00 (CE(α)) E {u0 (Ψα )∂α (Ψα )}
= − 2 E {u0 (Ψα )∂α0 (Ψα )}
[u0 (CE(α))] u0 (CE(α))
E u0 (Ψα )∂αα 00
 2

0 (Ψα ) + u (Ψα )∂α (Ψα )∂α0 (Ψα )
+ .
u0 (CE(α))
Since the market is linear in the allocation:

Ψα = α 0 M , (5.110)

we obtain:

2 E {u00 (α0 M)MM0 } − u00 (CE(α))ww0


∂αα 0 CE(α) = , (5.111)
u0 (CE(α))
where:

u0 (α0 M)
 
w≡E M . (5.112)
u0 (CE(α))
The denominator in (5.111) is always positive. On the other hand, the numerator in (5.111) can take
on any sign, depending on the local curvature of the utility function. Therefore the convexity of the
certainty-equivalent is not determined. 

E 207 – Interpretation of the certainty-equivalent


Express the meaning/intuition of the certainty-equivalent of an allocation.
Hint. See Meucci (2005, p.262).

Solution of E 207
The certainty-equivalent of an allocation is the risk-free amount of money that would make the investor
as satisfied as the given risky allocation. 

E 208 – Certainty-equivalent computation I (see E 236)


Consider the copula in E 236, but replace the marginal distributions as follows:

P1 ∼ N µ1 , σ12

(5.113)
µ2 , σ22

P2 ∼ N . (5.114)

Consider the case where the objective is final wealth. Consider an exponential utility function:
ψ
u (ψ) ≡ a − be− ζ , (5.115)
where b > 0. Compute analytically the certainty equivalent as a function of a generic allocation vector
(α1 , α2 ). What is the effect of a and b?
Solution of E 208
Consider the utility function (5.115). As in (5.92, AM 2005) expected utility reads:

 
n Ψα o i
E {u (Ψα )} ≡ a − b E e− ζ = a − bφΨα , (5.116)
ζ
where φ denotes the characteristic function (1.12, AM 2005) of the objective. The inverse of (5.115) is:

 
a−u
ψ ≡ u−1 (e
u) = −ζ ln
e
. (5.117)
b
Therefore the certainty equivalent reads:

  
i
CE (α) ≡ u−1 (E {u (Ψα )}) = −ζ ln φΨα , (5.118)
ζ
as in (5.94, AM 2005). The certainty equivalent is not affected by a and b. In other words, the certainty
equivalent is not affected by positive affine transformations of the utility function.
To compute the certainty equivalent as a function of the allocation vector we recall that lognormal and
normal copulas are the same, and we notice that normal marginals with a normal copula give rise to a
normal joint distribution:

P ∼ N (µ, Σ) , (5.119)
where:

σ12
   
µ1 ρσ1 σ2
µ≡ , Σ≡ . (5.120)
µ2 ρσ1 σ2 σ22
Therefore as in (5.144, AM 2005) we obtain:
1 0
CE (α) = α0 µ − α Σα . (5.121)



E 209 – Certainty-equivalent computation II (see E 208)


Consider the same setup than in E 208. Is the certainty equivalent corresponding to (5.115) positive
homogeneous? If so, compute the contribution to the certainty equivalent from the two securities as
defined by Euler’s formula.
Solution of E 209
The certainty equivalent corresponding to (5.115) is not positive homogeneous. Indeed the class of utility
functions that give rise to positive homogeneous certainty equivalents is the power class, see (5.114, AM
2005). 
CHAPTER 5. EVALUATING ALLOCATIONS 169

E 210 – Constancy of the quantile-based index of satisfaction (www.5.4)


Prove that the quantile-based index of satisfaction (5.159, AM 2005) satisfies the constancy requirement.
Hint. Smooth the quantile-based index of satisfaction.

Solution of E 210
Assume that an allocation b gives rise to a deterministic objective ψb . Then from (B.22, AM 2005) the
pdf of the objective is the Dirac delta centered at ψb and from (B.53, AM 2005) the cdf is the Heaviside
function (B.74, AM 2005) with step at ψb , which is not invertible. Thus the quantile is not defined.
Nonetheless, we can obtain the quantile using the smoothing technique (1.20, AM 2005). Indeed from
(B.18, AM 2005) the regularized pdf of the objective reads:

1 (ψ−ψb )2
fΨb ; (ψ) ≡ (δ (ψb ) ∗ δ(0) )(ψ) = √ e− 22 . (5.122)
2π
The respective regularized cdf reads:

Z ψ (x−ψb )2
1
FΨb ; (ψ) = √ e− 22 dx
2π −∞
ψ−ψb !
Z √
1 2 2
−y 2
= √ e dy (5.123)
2 π −∞
  
1 ψ − ψb
= 1 + erf √ ,
2 2

where we used the change of variable y ≡ (x − ψb )/ 2. The regularized quantile of the objective is
the inverse of the regularized cdf:


QΨb ; (s) ≡ FΨ−1
b ;
(s) = ψb + 2 erf −1 (2s − 1) . (5.124)

For small  the regularized quantile satisfies:

QΨb ; (s) ≈ ψb , for all s ∈ (0, 1) , (5.125)

and the approximation becomes exact in the limit  → 0. Thus the quantile (5.159, AM 2005) satisfies:

Ψb = ψb ⇒ Qc (b) ≡ QΨb (1 − c) = ψb , (5.126)

which is the constancy property (5.62, AM 2005) in this context. 

E 211 – Homogeneity of the quantile-based index of satisfaction (www.5.4)


Show that the quantile-based index of satisfaction is positive homogeneous (5.65, AM 2005).
Solution of E 211
Consider the s-quantile of the variable X, defined implicitly as in (1.18, AM 2005) by

P {X ≤ QX } = s . (5.127)
If h is an increasing function then (5.127) is equivalent to the following identity:

P {h(X) ≤ h(QX )} = s . (5.128)


On the other hand, the s-quantile Qh(X) (s) of the variable h(X) is defined implicitly by:


P h(X) ≤ Qh(X) = s . (5.129)
Since (5.128) and (5.129) hold for any s we obtain the general result for any increasing function h:

Qh(X) (s) = h(QX (s)) . (5.130)


As special cases, consider h(X) ≡ λX, where λ > 0. Then (5.130) implies:

QλX (s) = λQX (s) . (5.131)


Expression (5.131) and the positive homogeneity of the objective (5.16, AM 2005) prove the positive
homogeneity of the quantile-based index of satisfaction:

Qc (λα) ≡ QΨλα (1 − c) = QλΨα (1 − c) = λQΨα (1 − c) ≡ λ Qc (α) . (5.132)



E 212 – Translation invariance of the quantile-based index of satisfaction (www.5.4)
(see E 211)
Consider the same setup than in E 211. Show that the quantile-based index of satisfaction is positive
translation invariant (5.72, AM 2005).
Solution of E 212
Consider h(X) ≡ X + λ. Then (5.130) implies:

QX+λ (s) = QX (s) + λ . (5.133)


Expression (5.133) and the additivity of the objective (5.17, AM 2005) prove the translation-invariance
of the quantile-based index of satisfaction:

Qc (α + λb) ≡ QΨα+λb (1 − c) = QΨα +λ (1 − c) = QΨα (1 − c) + λ ≡ Qc (α) + λ . (5.134)




E 213 – Example of strong dominance


Consider a bivariate market M. Define a market distribution and two portfolios such that one portfolio
strongly dominates the other.
Solution of E 213
Consider the market M1 ≡ 1 and:

2 with probability 0.3
M2 = (5.135)
3 with probability 0.7 .
The allocation α ≡ (0, 1) strongly dominates the allocation α ≡ (1, 0). 
CHAPTER 5. EVALUATING ALLOCATIONS 171

E 214 – Example of weak dominance (see E 213)


Consider a bivariate market M. Define a market distribution and two portfolios such that one portfolio
weakly dominates the other.
Solution of E 214
Since strong dominance implies weak dominance, see E 213. 
E 215 – Additive co-monotonicity of the quantile-based index of satisfaction (www.5.4)
(see E 211)
Consider the same setup than in E 211. Show that the quantile-based index of satisfaction is additive
co-monotonicity.
Solution of E 215
Consider h(X) ≡ X + g(X) where g is an increasing function. Then (5.130) implies:

QX+g(X) (s) = QX (s) + g(QX (s)) = QX (s) + Qg(X) (s) . (5.136)

Expression (5.136) and the additivity of the objective (5.17, AM 2005) prove the additive co-monotonicity
of the quantile-based index of satisfaction:

Qc (α + ∆) ≡ QΨα+∆ (1 − c) = QΨα +Ψ∆ (1 − c)


= QΨα (1 − c) + QΨ∆ (1 − c) (5.137)
≡ Qc (α) + Qc (∆) .


E 216 – Cornish-Fisher approximation of the quantile-based index of satisfaction
(www.5.4)
Prove the expression (5.180, AM 2005)-(5.181, AM 2005) of the Cornish-Fisher approximation of the
quantile-based index of satisfaction.
Solution of E 216
The Cornish-Fisher expansion (5.179, AM 2005) states that the quantile of the objective Ψα can be
approximated in terms of the quantile z(s) of the standard normal distribution and the first three moments
as follows:

 
CM3 {Ψα } CM3 {Ψα } 2
QΨα (s) ≈ E {Ψα } − + Sd {Ψα } z(s) + z (s) , (5.138)
6 Var {Ψα } 6 Var {Ψα }

where CM3 is the third central moment. Using (1.48) to express the central moments in terms of the raw
moments, we obtain the approximate expression of the quantile of the objective:

Qc (α) ≡ QΨα (1 − c) ≈ A(α) + B(α)z(1 − c) + C(α)z 2 (1 − c) , (5.139)

where:
  3
E Ψ3α − 3 E Ψ2α E {Ψα } + 2 E {Ψα }
A ≡ E {Ψα } − 2 (5.140)
6(E {Ψ2α } − E {Ψα } )
q
2
B≡ E {Ψ2α } − E {Ψα } (5.141)
 3  3
E Ψα − 3 E Ψ2α E {Ψα } + 2 E {Ψα }
C≡ 2 . (5.142)
6(E {Ψ2α } − E {Ψα } )

Note. To obtain the explicit analytical expression of these coefficients as functions of the allocation α we
use the derivatives of the characteristic function of the objective as discussed in E 194. 

E 217 – First-order sensitivity analysis the quantile-based index of satisfaction (www.5.4)


Prove the expression (5.188, AM 2005) of the first-order derivatives of the quantile-based index of satis-
faction:

∂ Q(α)
= E {M|α0 M = Q(α)} . (5.143)
∂α

Hint. See Gourieroux et al. (2000).

Solution of E 217
From the definition of quantile (1.18, AM 2005), the quantile-based index of satisfaction (5.159, AM
2005) is defined implicitly as follows:

1 − c = P {Ψα ≤ Qc (α)} = P {α0 M ≤ Qc (α)} . (5.144)

Defining:

X
Xn ≡ αj Mj , (5.145)
j6=n

we see that Q(α) is defined implicitly as follows in terms of the joint pdf f of (Xn , Mn ):

Z "Z Q −αn mn
#
1 − c = P {Xn + an Mn ≤ Q} = f (xn , mn )dxn dmn . (5.146)
−∞

Since in general:

dg
Z g(a) Z g(a)+ da δa
∂ 1 dg(a)
f (x)dx = lim f (x)dx = f (g(a)) , (5.147)
∂a −∞ δa→0 δa g(a) da

differentiating both sides of (5.146) with respect to αn we obtain:

Z  
∂Q
0= f (Q −αn Mn , mn ) − mn dmn , (5.148)
∂αn
CHAPTER 5. EVALUATING ALLOCATIONS 173

or:

R
∂Q m f (Q −αn Mn , mn )dmn
= R n = E {Mn |Xn = Q(α) − αn Mn } . (5.149)
∂αn f (Q −αn Mn , mn )dmn

Therefore, substituting back the definition (5.145) we obtain:

∂ Q(α)
= E {M|α0 M = Q(α)} . (5.150)
∂α

E 218 – Second-order sensitivity analysis of the quantile-based index of satisfaction
I (www.5.4) **
Prove the expression (5.191, AM 2005) of the second-order cross-derivatives of the quantile-based index
of satisfaction.
Solution of E 218
Consider now a small perturbation of the allocation α in the direction of the j-th security:

β = α + ∆(j) . (5.151)

We derive the second derivatives from the definition:

2 1
∂ij Q(α) ≡ lim [∂i Q(β) − ∂i Q(α)] . (5.152)
→0 
From (5.143) and (5.151) we see that:

n o
∂i Q(β) = E Mi |α0 M + Mj = Q(α + ∆(j) )
≈ E {Mi |α0 M + Mj = Q(α) + ∂j Q(α)} (5.153)
= E {Mi |α0 M − Q(α) +  [Mj − ∂j Q(α)] = 0}
= E {Mi |α0 M − Q(α) +  [Mj − E {Mj |α0 M . = Q(α)}] = 0}

In other words, defining the variables:

Z ≡ α0 M − Q(α) , Y ≡ Mj − E {Mj |Z = 0} , X ≡ Mi , (5.154)

we can write:

∂i Q(β) ≈ E {X|Z + Y = 0} . (5.155)

Also notice that in this notation:

∂i Q(α) = E {X|Z = 0} . (5.156)


Consider the joint pdf f of (X, Y, Z). The conditional expectation in (5.155) can be computed in terms
of the conditional pdf, which reads:

f (x, y, −y)
f (x, y|Z + Y = 0) = f (x, y|z = −y) = R . (5.157)
f (x, y, −y)dxdy

Therefore (5.155) becomes:

RR
xf (x, y, −y)dxdy
∂i Q(β) ≈ R R
f (x, y, −y)dxdy
RR RR
xf (x, y, 0)dxdy −  xy∂z f (x, y, 0)dxdy
≈ RR RR
f (x, y, 0)dxdy −  y∂z f (x, y, 0)dxdy
Z Z Z Z 
= xf (x, y, 0)dxdy −  xy∂z f (x, y, 0)dxdy
Z Z  RR −1
y∂z f (x, y, 0)dxdy
× f (x, y, 0)dxdy 1− R R
f (x, y, 0)dxdy
Z Z Z Z 
≈ xf (x, y, 0)dxdy −  xy∂z [ln f (x, y, 0)] f (x, y, 0)dxdy (5.158)
Z Z −1
× f (x, y, 0)dxdy
 RR 
y∂z [ln f (x, y, 0)] f (x, y, 0)dxdy
× 1+ RR
f (x, y, 0)dxdy
RR RR
xf (x, y, 0)dxdy xy∂z [ln f (x, y, 0)] f (x, y, 0)dxdy
≈ RR − RR
f (x, y, 0)dxdy f (x, y, 0)dxdy
RR RR
y∂z [ln f (x, y, 0)] f (x, y, 0)dxdy xf (x, y, 0)dxdy
+ RR RR .
f (x, y, 0)dxdy f (x, y, 0)dxdy

Thus:

∂i Q(β) ≈ E {X|Z = 0} −  [E {XY ∂z [ln f (X, Y, 0)] |Z = 0}


− E {X|Z = 0} E {Y ∂z [ln f (X, Y, 0)] |Z = 0}]
= E {X|Z = 0} −  [Cov {X, Y ∂z [ln f (X, Y, 0)] |Z = 0}]
(5.159)
= E {X|Z = 0} −  [Cov {X, Y ∂z [ln f (X, Y |0) + ln fZ (0)] |Z = 0}]
= E {X|Z = 0} −  [Cov {X, Y ∂z [ln f (X, Y |0)] |Z = 0}
+ ∂z [ln fZ (0)] Cov {X, Y |Z = 0}] .

On the other hand:


CHAPTER 5. EVALUATING ALLOCATIONS 175

∂z [Cov {X, Y |Z = z}] = ∂z [E {XY |Z = z} − E {X|Z = z} E {Y |Z = z}]


Z Z
= ∂z xyf (x, y|z)dxdy
Z Z Z Z 
− xf (x, y|z)dxdy yf (x, y|z)dxdy
Z Z
= xy∂z f (x, y|z)dxdy

− E {Y |Z = z} ∂z [E {X|Z = z}]
Z Z
− E {X|Z = z} y∂z f (x, y|z)dxdy
Z Z (5.160)
= xy∂z [ln f (x, y|z)] f (x, y|z)dxdy

− E {Y |Z = z} ∂z [E {X|Z = z}]
Z Z
− E {X|Z = z} y∂z [ln f (x, y|z)] f (x, y|z)dxdy

= E {XY ∂z [ln f (X, Y |z)] |Z = z}


− E {X|Z = z} E {Y ∂z [ln f (X, Y |z)] |Z = z}
− E {Y |Z = z} ∂z [E {X|Z = z}]
= Cov {X, Y ∂z [ln f (X, Y |z)] |Z = z}
− E {Y |Z = z} ∂z [E {X|Z = z}] ,

which shows that:

Cov {X, Y ∂z [ln f (X, Y |z)] |Z = z} = ∂z [Cov {X, Y |Z = z}]


(5.161)
+ E {Y |Z = z} ∂z [E {X|Z = z}] .

Therefore (5.159) becomes:

∂i Q(β) ≈ E {X|Z = 0}
−  [∂z [Cov {X, Y |Z = 0}] + E {Y |Z = 0} ∂z [E {X|Z = 0}] (5.162)
+ ∂z [ln fZ (0)] Cov {X, Y |Z = 0}] .

In this expression, from (5.154):

E {Y |Z = 0} = E {Mj − E {Mj |Z = 0} |Z = 0} = 0 . (5.163)

Therefore:

∂i Q(β) ≈ E {X|Z = 0} −  [∂z [Cov {X, Y |z = 0}]


(5.164)
+ ∂z [ln fZ (0)] Cov {X, Y |z = 0}] ,

and finally, from (5.156) we obtain:


2
∂ij Q(α) ≡ − ∂z [Cov {X, Y |z = 0}]
(5.165)
− ∂z [ln fZ (0)] Cov {X, Y |z = 0} .

Substituting again the definitions (5.154) in this formula we obtain:

∂ 2 Q(α)
= − ∂z [Cov {M, M − E {M|α0 M = Q(α)} |z = 0}]
∂α0 ∂α
∂ ln fZ (0)
− Cov {M, M − E {M|α0 M = Q(α)} |z = 0}
∂z
∂ ln fZ (0)
= − ∂z [Cov {M|z = 0}] − Cov {M|z = 0} (5.166)
∂z
∂ Cov {M|α0 M = z}

= −
∂z
z=Q(α)
∂ ln fα0 M (Q(α))
− Cov {M|α0 M = Q(α)} .
∂z

E 219 – Second-order sensitivity analysis of the quantile-based index of satisfaction
II (www.5.4)
Discuss the sign of the matrix of the second-order cross-derivatives in the case of normal markets (5.192,
AM 2005).
Solution of E 219
To discuss the sign of the second derivative in the normal case we need the following result:

αα0 Σ β 0 Σαα0 Σβ
 
Σ I− 0 ≥ 0 ⇔ β 0 Σβ ≥
α Σα α0 Σα (5.167)
2
⇔ hα, αi hβ, βi ≥ |hα, βi|

where:

hα, βi ≡ α0 Σβ . (5.168)

The last row in (5.167) is true because of the Cauchy-Schwartz inequality (A.8, AM 2005). 

E 220 – Value-at-Risk in elliptical markets I


Consider an N -dimensional market that as in (2.144, AM 2005) is uniformly distributed on an ellipsoid
(surface and internal points):

M ∼ U(Eµ,Σ ) . (5.169)

Write the quantile index Qc (α) of the objective (5.10, AM 2005) as defined in (5.159, AM 2005) as a
function of the allocation.
CHAPTER 5. EVALUATING ALLOCATIONS 177

Solution of E 220
We can represent (5.169) in the notation (2.268, AM 2005) as follows:

U

M ∼ El µ, Σ, gN , (5.170)
U
where gN is provided in (2.263, AM 2005). From (2.270, AM 2005) we obtain:

Ψα ≡ α0 M ∼ El α0 µ, α0 Σα, g1U .

(5.171)
Therefore:

d √
Ψα = α0 µ + α0 ΣαX , (5.172)
where:

X ≡ El 0, 1, g1U ,

(5.173)
for some generator g1U induced by the N -dimensional uniform distribution. Therefore:

Qc (α) ≡ QΨα (1 − c) = Qα0 µ+√α0 ΣαX (1 − c) . (5.174)


Using 1.17 we obtain:


Qc (α) = α0 µ + α0 Σαγc , (5.175)
where the scalar γc ≡ QX (1 − c) can be evaluated numerically. 

E 221 – Value-at-Risk in elliptical markets II (see E 220)


Consider the same setup than in E 220. Factor Qc (α) in terms of its marginal contributions.
Hint. Compare with (5.189, AM 2005).

Solution of E 221
Deriving (5.175) we obtain:

∂ Qc (α) γc
=µ+ √ Σα . (5.176)
∂α α0 Σα
Therefore the marginal contributions C read:

∂ Qc (α) γc
C ≡ diag (α) = diag (α) µ + √ diag (α) Σα . (5.177)
∂α α0 Σα
It is immediate to check that:

N
X
Qc (α) ≡ Cn , (5.178)
n=1

see (5.67, AM 2005) and (5.190, AM 2005). 


E 222 – Value-at-Risk in elliptical markets III (see E 220) *
Consider the same setup than E 220. Consider the case N ≡ 3. Write a MATLAB R
script in which you:
• Generate randomly the parameters µ and Σ;
• Generate a sample of J ≡ 1,000 simulations of the market (5.169);
• Generate a random allocation vector α. Set c ≡ 0.95 and compute Qc (α) as the sample counter-
part of (5.159, AM 2005);
• Compute the marginal contributions to Qc (α) from each security in terms of the empirical deriva-
tive of Qc (α):

 
∂ Qc (α) Qc α + δ (n) − Qc (α)
≈ , (5.179)
∂αn 

where Qc (X) is calculated as in the previous point, δ (n) is the Kronecker delta (A.15, AM 2005),
and  is a small number, as compared with the average size of the entries of α;
• Display the result using the built-in plotting function bar;
• Use the result above to compute Qc (α) in a different way, i.e. semi-analytically;
• Use the previous results to compute the marginal contributions to Qc (α) from each security;
• Display the result using the built-in plotting function bar.
Hint. You will have to compute the quantile of the standardized univariate generator, use the simulations
generated above.

Solution of E 222
To generate J scenarios from(5.181) you can use the following approach. Consider the uniform distribu-
tion on the N -dimensional hypercube:

X ∼ U ([−1, 1] × · · · × [−1, 1]) . (5.180)

The entries of X are independent and therefore (5.180) can easily be simulated. Now consider the uniform
distribution on the N -dimensional unit hypersphere:

Y ∼ U (E0,I ) . (5.181)

To generate a sample of size J from (5.181) generate a sample of size Je from (5.180). Then use

d
Y = X/ kXk ≤ 1 . (5.182)

To set the number of simulations Je use (A.78, AM 2005). To generate a sample of size J from (5.169)
apply (2.270, AM 2005) to the sample from (5.181). To generate a sample of size J from (5.181) more ef-
ficiently you can proceed as follows (courtesy Xiaoyu Wang, CIMS-NYU). In this function, we represent
(5.181) as in (2.259, AM 2005)-(2.260, AM 2005):

d
Y = RU . (5.183)

In this expression U is uniform on the surface of the unit sphere and R is a suitable radial distribution
independent of U.
CHAPTER 5. EVALUATING ALLOCATIONS 179

To generate J scenarios of U, you can use:

d
U = Z/ kZk , (5.184)

where:

Z ∼ N (0N ×1 , IN ×N ) , (5.185)

this follows from the last expression in (2.260, AM 2005) and the fact that the normal distribution is
elliptical. To generate J scenarios of R, notice that, for a given radius r, the radial density must be
proportional to rN −1 . Indeed, the infinitesimal volume surrounding the surface of the sphere of radius r
is proportional to rN −1 . Therefore, pinning down the normalization constant, we obtain:

rN −1
fR (r) = . (5.186)
N −1
From (5.186), the radial cdf reads:

FR (r) = rN . (5.187)

Inverting the cdf, we obtain the quantile function:

QR (u) = u1/N . (5.188)

Hence from (2.25, AM 2005)-(2.26, AM 2005) we obtain:

d
R = W 1/N , (5.189)

where W ∼ U ([0, 1]) is uniform on the unit interval and is independent of U.


To generate J scenarios from (5.183) it now suffices to multiply the scenarios for U by the respective
scenarios for R. See the MATLAB R
script S_VaRContributionsUniform for the implementation. 

E 223 – Cornish-Fisher approximation of the Value-at-Risk


Assume that the investor’s objective is lognormally distributed:

2

Ψα ∼ LogN µα , σα , (5.190)

where µα ≡ 0.05 and σα ≡ 0.05. Write a MATLAB R


script in which you plot the true quantile-based
index of satisfaction Qc (α) against the Cornish-Fisher approximation (5.179, AM 2005) as a function of
the confidence level c ∈ (0, 1).
Solution of E 223
See the MATLAB R
script S_CornishFisher. 

E 224 – Spectral representation (www.5.5)


Show that the expected shortfall can be used to generate other spectral indices of satisfaction.
Solution of E 224
We consider weighted averages of the expected shortfall for different confidence levels. From the defini-
tion (5.207, AM 2005) of expected shortfall this means:

Z 1 Z 1 Z 1−c 
1
Spc(α) ≡ ESc (α)w(c)dc = QΨα (s)ds w(c)dc , (5.191)
0 0 1−c 0

where:

Z 1
w(c) ≥ 0 , w(c)dc = 1 . (5.192)
0

Equivalently:

Z 1  Z 1 Z c
w(c)
ESc (α)w(c)dc = QΨα (s)ds dc
0 0 0 c
Z 1 Z c 
w(c)
= QΨα (s) ds dc
0 0 c
Z 1 Z 1  (5.193)
w(c)
= QΨα (s) dc ds
0 s c
Z 1
= QΨα (s)φ(s)ds ,
0

where:

Z 1
w(x)
φ(s) ≡ dx . (5.194)
s x
On the one hand, from:

w(s)
φ0 (s) = − , (5.195)
s
we obtain:

Z 1 Z 1 Z 1 Z 1 Z 1
0
[sφ(s)] ds = φ(s)ds + sφ0 ds = φ(s)ds − w(s)ds . (5.196)
0 0 0 0 0

On the other hand, from (5.194) we obtain φ(1) = 0 and thus:

Z 1
0 1
[sφ(s)] ds = sφ(s)|0 = 0 . (5.197)
0

Therefore:

Z 1
φ(s)ds = 1 . (5.198)
0

Finally, from (5.195) we also obtain φ0 ≤ 0. 


CHAPTER 5. EVALUATING ALLOCATIONS 181

E 225 – Spectral indices of satisfaction and risk aversion


Consider a fair game, i.e. an allocation f such that:

E {Ψf } = 0 . (5.199)

Then a fortiori, for any s ∈ (0, 1) the following is true:

E {Ψf |Ψf ≤ QΨf (s)} ≤ 0 . (5.200)

Solution of E 225
Thus from the definition of expected shortfall (5.208, AM 2005) for any confidence level ESc (α) ≤ 0.
Since the expected shortfall generates the spectral indices of satisfaction, the satisfaction derived from
any fair game is negative whenever satisfaction is measured with a spectral index. 

E 226 – Cornish-Fisher approximation of the spectral index of satisfaction (www.5.5)


Prove the expression (5.222, AM 2005) of the Cornish-Fisher approximation of the spectral index of
satisfaction.
Note. There is a typo in (5.232, AM 2005) which should be I[φ](1).

Solution of E 226
The Cornish-Fisher expansion (5.179, AM 2005) states that the quantile of the approximate objective Ξα
can be approximated in terms of the quantile z(s) of the standard normal distribution and the first three
moments as follows:

 
CM3 {Ξα } CM3 {Ξα } 2
QΞα (s) ≈ E {Ξα } − + Sd {Ξα } z(s) + z (s) , (5.201)
6 Var {Ξα } 6 Var {Ξα }

where CM3 is the third central moment. Using (1.48) to express the central moments in terms of the raw
moments we obtain the approximate expression of the quantile of the objective:

QΨα (s) ≈ QΞα (s) ≈ A(α) + B(α)z(s) + C(α)z 2 (s) , (5.202)

where (A, B, C) are defined in (5.181, AM 2005). To obtain the spectral index of satisfaction we apply
(5.202) to its definition (5.223, AM 2005), obtaining:

Z 1
Spcφ (α) ≡ φ(s)QΨα (s)ds
0
Z 1 Z 1
(5.203)
2
≈ A(α) + B(α) φ(s)z(s)ds + C(α) φ(s)z (s)ds .
0 0

E 227 – Extreme value theory I (www.5.5)


Prove the expression (5.233, AM 2005) of the expected shortfall approximation.
Solution of E 227
Define the variable:

Z ≡ Qc (α) − Ψα . (5.204)

From (5.182, AM 2005) we obtain:

1 − LQc (α) (z) = 1 − P {Ψα − Qc (α) ≤ −z|Ψα ≤ Qc (α)}


= 1 − P {Qc (α) − Ψα ≥ z|Ψα ≤ Qc (α)}
(5.205)
= P {Qc (α) − Ψα ≤ z|Ψα ≤ Qc (α)}
= P {Z ≤ z|Z ≥ 0} .

This is the cdf of Z conditioned on Z ≥ 0. If the confidence level c is high, from (5.184, AM 2005) this
cdf is approximated by Gξ,v . Thus:

Z ∞
dGξ,v (z) v
E {Z|Z ≥ 0} ≈ z dz = , (5.206)
0 dz 1−ξ
where the last result can be found in Embrechts et al. (1997). On the other hand, from the definition
(5.208, AM 2005) of expected shortfall we derive:

ESc (α) = E {Ψα |Ψα ≤ Qc (α)}


= Qc (α) + E {Ψα − Qc (α)|Ψα ≤ Qc (α)} (5.207)
= Qc (α) − E {Z|Z ≥ 0} .

E 228 – Extreme value theory II


Describe how to estimate the parameters ξ and v of a generalized Pareto distribution in MATLAB
R
.
Solution of E 228
To estimate the parameters ξ and v using the MATLAB
R
function gpfit proceed as follows. Define the
excess as the following random variable:

Z ≡ ψe − Ψα |Ψα ≤ ψe . (5.208)

Notice that the cdf of Z satisfies:

FZ (z) ≡ P {Z ≤ z}
n o
= P ψe − Ψα ≤ z|Ψα ≤ ψe
n o
= P Ψα ≥ ψe − z|Ψα ≤ ψe (5.209)
n o
= 1 − P Ψα ≤ ψe − z|Ψα ≤ ψe
≡ 1 − Lψe (z) ,
CHAPTER 5. EVALUATING ALLOCATIONS 183

where in the last row we used (5.182, AM 2005). From (5.183, AM 2005) we obtain:

FZ (z) ≈ Gξ,v (z) . (5.210)

The function xi_v = gpfit(Excess) attempts to fit (5.210), where Excess are the realizations of the random
variable (5.208). 

E 229 – Extreme value theory approximation of Value-at-Risk


Assume that the objective is Student t distributed:

2

Ψα ∼ St ν, µα , σα , (5.211)

where ν ≡ 7, µα ≡ 1, σα 2
≡ 4. Write a MATLAB R
script in which you:
• Plot the true quantile-based index of satisfaction Qc (α) for c ∈ [0.950, 0.999];
• Generate Monte Carlo simulations from (5.211) and superimpose the plot of the sample counterpart
of Qc (α) for c ∈ [0.950, 0.999];
• Consider the threshold:

ψe ≡ Q0.95 (α) ; (5.212)

• Superimpose the plot of the EVT fit (5.186, AM 2005) for c ∈ [0.950, 0.999].
Hint. Estimate the parameters ξ and v using the built-in function xi_v = gpfit(Excess), where Excess are
the realizations of the random variable:

Z ≡ ψe − Ψα |Ψα ≤ ψe . (5.213)

Indeed the cdf of Z satisfies:

FZ (z) ≡ P {Z ≤ z}
n o
= P ψe − Ψα ≤ z|Ψα ≤ ψe
n o
= P Ψα ≥ ψe − z|Ψα ≤ ψe (5.214)
n o
= 1 − P Ψα ≤ ψe − z|Ψα ≤ ψe
≡ 1 − Lψe (z) ,

where in the last row we used (5.182, AM 2005). From (5.184, AM 2005) we obtain:

FZ (z) ≈ Gξ,v (z) , (5.215)

which is the expression that the MATLAB


R
function gpfit attempts to fit.

Solution of E 229
See the MATLAB R
script S_ExtremeValueTheory. 
E 230 – First-order sensitivity analysis of the expected shortfall (www.5.5)
Prove the expression (5.235, AM 2005) of the first-order derivatives of the expected shortfall.
Note. The result for a generic spectral measure follows from (5.191) and the definition (5.195) of the
weights in terms of the spectrum.

Hint. Adapt from Bertsimas et al. (2004).

Solution of E 230
First we define:

X
Xn ≡ αj M j . (5.216)
j6=n

From the definition (5.208, AM 2005) of expected shortfall we obtain:

 Z +∞ Z +∞
∂ ESc (α) ∂ 1
= (x + αn m)Ix≤Qc −αn m (x, m)
∂αn ∂αn 1 − c −∞ −∞
fXn ,Mn (x, m)dxdm] (5.217)
Z +∞ Z Qc −αn m
1 ∂
= (x + αn m)fXn ,Mn (x, m)dxdm .
1 − c −∞ ∂αn −∞
Using (5.147) this becomes:

Z +∞  
∂ ESc (α) 1 ∂ Qc (α)
= − m Qc (α)fXn ,Mn (Qc (α) − αn m, m)dm
∂αn 1−c −∞ ∂αn
Z +∞ Z Qc −αn m (5.218)
1
+ mfXn ,Mn (x, m)dxdm .
1 − c −∞ −∞
On the other hand:

Z +∞ Z Qc −αn m
∂(1 − c) ∂
0= = fXn ,Mn (x, m)dxdm
∂αn ∂αn −∞ −∞
Z +∞ (5.219)
∂ Qc (α)
× ( − m)fXn ,Mn (Qc (α) − αn m, m)dm .
−∞ ∂αn
Therefore:

Z +∞ Z Qc −αn m
∂ ESc (α) 1
= mfXn ,Mn (x, m)dxdm
∂αn 1 − c −∞ −∞
Z Z (5.220)
1
= mfXn ,Mn (x, m)dxdm .
1−c Ψα ≤Qc

Note. The result for a generic spectral measure follows from (5.191) and the definition (5.195) of the
weights in terms of the spectrum. 
CHAPTER 5. EVALUATING ALLOCATIONS 185

E 231 – Second-order sensitivity analysis of the expected shortfall (www.5.5)


Compute the expression of the second derivative of the expected shortfall.
Hint. Adapt the solution from Rau-Bredow (2004).

Solution of E 231
First we define:

X
Xn ≡ αj M j . (5.221)
j6=n

With this, the second derivative is:

∂ 2 ESc (α) ∂
= E {M0 |Xn + αn Mn ≤ Qc (α)}
∂αn ∂α0 ∂αn
Z  (5.222)

= m0 fM (m|Xn + αn Mn ≤ Qc (α))dm .
∂αn

In this expression the conditional density reads:

R Qc −αn mn
fXn ,M (x, m)dx
fm (m|Xn + αn Mn ≤ Qc ) = R R Q−∞−αn mn
c
−∞
fXn ,M (x, m)dxdm
R Qc −αn mn
−∞
fXn ,M (x, m)dx (5.223)
=R
xn +αn mn ≤Qc
fXn ,M (x, m)dxdm
R Qc −αn mn
−∞
fXn ,M (x, m)dx
= .
1−c
Therefore using (5.147) we obtain:

"Z Z Qc −αn mn #
∂ 2 ESc (α) 1 ∂
= m0 fXn ,M (x, m)dxdm
∂αn ∂α0 1−c ∂αn −∞
Z    (5.224)
1 ∂ Qc (α)
= m0 − mn fXn ,m (Qc (α) − αn mn , m)dm .
1−c ∂αn

Using Bayes’ rule:

fXn ,m (Q −αn mn , m) = fXn +αn mn ,M (Q, m)


(5.225)
= fm|Xn +αn mn (m|Xn + αn mn = Q)fXn +αn mn (Q)

and recalling that Xn + αn mn = Ψα , the above expression becomes:


∂ 2 ESc (α)
Z  
1 0 ∂ Qc (α)
0
= m − mn
∂αn ∂α 1−c ∂αn

fM|Ψα (m|Ψα = Qc (α))fΨα (Qc (α))dm
fΨα (Qc (α)) ∂ Qc (α) (5.226)
= E {M0 |Ψα = Qc (α)}
1−c ∂αn
fΨ (Q (α))
− α c E {Mn M0 |Ψα = Qc (α)} .
1−c
Recalling (5.188, AM 2005) and using vector notation we obtain:

∂ 2 ESc (α) fΨα (Qc (α))


0
= E {M|α0 M = Qc (α)} E {M0 |α0 M = Qc (α)}
∂α∂α 1−c
fΨ (Q (α))
− α c E {MM0 |α0 M = Qc (α)} (5.227)
1−c
fΨ (Q (α))
= − α c Cov {M|α0 M = Qc (α)} .
1−c


E 232 – Expected shortfall in elliptical markets I


Assume that the market is multivariate Student t distributed:

M ∼ St(ν, µ, Σ) . (5.228)

Write the expected shortfall ESc (α) defined in (5.207, AM 2005) as a function of the allocation.
Solution of E 232
From (5.228) and (2.195, AM 2005) in we obtain:

Ψα ≡ α0 M ∼ St (ν, α0 µ, α0 Σα) , (5.229)

or:

d √
Ψα = α0 µ + α0 ΣαX , (5.230)

where:

X ∼ St (ν, 0, 1) . (5.231)

From (5.207, AM 2005) we obtain:

1
Z 1−c
1
Z 1−c h √ i
ESc (α) = QΨα (s) ds = α0 µ + α0 ΣαQX (s) ds . (5.232)
1−c 0 1−c 0

and thus:
CHAPTER 5. EVALUATING ALLOCATIONS 187


ESc (α) = α0 µ + α0 Σαζc , (5.233)

where:

Z 1−c
1
ζc ≡ QX (s) ds . (5.234)
1−c 0

This scalar can be evaluated as the numerical integral of the quantile function of the standard univariate t
distribution. 

E 233 – Expected shortfall in elliptical markets II (see E 232)


Consider the same setup than in E 232. Factor ESc (α) in terms of its marginal contributions.
Hint. Compare with (5.236, AM 2005).

Solution of E 233
Deriving (5.233) we obtain:

∂ ESc (α) ζc
=µ+ √ Σα . (5.235)
∂α α0 Σα
Therefore the marginal contributions C read:

∂ ESc (α) ζc
C ≡ diag (α) = diag (α) µ + √ diag (α) Σα . (5.236)
∂α α0 Σα
It is immediate to check that:

N
X
ESc (α) ≡ Cn , (5.237)
n=1

see (5.67, AM 2005). 

E 234 – Expected shortfall in elliptical markets III (see E 232)


Consider the same setup than in E 232. Assume N ≡ 40 and ν ≡ 5. Write a MATLAB R
script in which
you:
• Generate randomly the parameters (µ, Σ) and the allocation α;
• Generate J ≡ 10,000 Monte Carlo scenarios from the market distribution (5.228);
• Set c ≡ 0.95 and compute ESc (α) as the sample counterpart of (5.208, AM 2005);
• Compute the marginal contributions to ESc (α) from each security as the sample counterpart of
(5.238, AM 2005);
• Display the result in a subplot using the built-in plotting function bar;
• Use the previous results to compute ESc (α) in a different way, i.e. semi-analytically. Never at any
stage use simulations;
• Compute the marginal contributions to ESc (α) from each security using previous results. Never at
any stage use simulations. Display the result in a second subplot using the built-in plotting function
bar.
Hint. Use the built-in MATLAB
R
numerical integration function quad applied to the quantile function
tinv.

Solution of E 234
See the MATLAB R
script S_ESContributionsStudentT. 

E 235 – Expected shortfall and linear factor models


Assume a linear factor model for the market:

M ≡ bF + U , (5.238)

where B is a N × K matrix with entries of the order of the unit, F is a K-dimensional vector, U is a
N -dimensional vector and:

 
ln F
∼ St (ν, µ, Σ) , (5.239)
ln (U + a)

where µ ≡ 0, a is such that E {U} ≡ 0 and:

Σf
 
0
Σ≡ , (5.240)
0 2 Σu

with Σf a correlation matrix and Σu a Toepliz correlation matrix:

Σun,m ≡ e−γ|n−m| , (5.241)

with   1 and γ arbitrary. Assume N ≡ 30, K ≡ 10 and ν ≡ 10. Write a MATLAB R


script in which
you:
• Generate randomly the parameters in Σ and the allocation α;
• Generate J ≡ 10,000 Monte Carlo scenarios from the market distribution (5.238);
• Set c ≡ 0.95 and compute ESc (α) as the sample counterpart of (5.208, AM 2005);
• Compute the K marginal contributions to ESc (α) from each factor and the one aggregate contri-
bution from all the residuals, as the sample counterpart of (5.238, AM 2005) adapted to the factors;
• Display the result in a subplot using the built-in plotting function bar.
Hint. Represent the objective as a linear function:

Ψ ≡ βF + u . (5.242)

Solution of E 235
See the MATLAB R
script S_ESContributionsFactors. 

E 236 – Simulation of the investor’s objectives


Assume a bivariate market, where the prices at the investment horizon (P1 , P2 ) have the following
marginal distributions:
CHAPTER 5. EVALUATING ALLOCATIONS 189

P1 ∼ Ga(ν1 , σ12 ) (5.243)


P2 ∼ LogN(µ2 , σ22 ) . (5.244)

Assume that the copula is lognormal, i.e. the grades (U1 , U2 ) of (P1 , P2 ) have the following joint distri-
bution (not a typo, why?):

Φ−1 (U1 )
     
0 1 ρ
∼N , , (5.245)
Φ−1 (U2 ) 0 ρ 1

where Φ denotes the cdf of the standard normal distribution. Assume that the current prices are p1 ≡
E {P1 } and p2 ≡ E {P2 }.
Write a MATLAB R
script in which you:
• Fix arbitrary values for the parameters (ν1 , σ12 , µ2 , σ22 ) and compute the current prices;
• Consider the following allocation α1 ≡ 1, α2 ≡ 2 and simulate the distribution of the objective of
an investor who is interested in final wealth;
• Consider the previous allocation. Simulate the distribution of the objective of an investor who is
interested in the P&L;
• Consider the previous allocation and the following benchmark β1 ≡ 2, β2 ≡ 1 and simulate the
distribution of the objective of an investor who is interested in beating the benchmark.
Solution of E 236
See the MATLAB R
script S_InvestorsObjective. 

E 237 – Arrow-Pratt aversion and prospect theory


Consider the prospect-theory utility function:

 
ψ − ψ0
u (ψ) ≡ a + b erf √ , (5.246)

where b > 0. Plot the utility function for different values of η and ψ0 . Compute the Arrow-Pratt risk
aversion (5.121, AM 2005) implied by the utility (5.246).
Solution of E 237
Deriving (B.75, AM 2005), we obtain:

d 2 2
erf (x) = √ e−x . (5.247)
dx π
Hence:

r 2
2 −

ψ−ψ0

u0 (ψ) ≡ b e 2η
, (5.248)
πη
and:

2  
2b 1 − ψ − ψ0

ψ−ψ0

u00 (ψ) ≡ − √ e 2η √ . (5.249)
η π 2η
Therefore:

−u00 (ψ) ψ − ψ0
A (ψ) ≡ 0
= . (5.250)
u (ψ) η

For the interpretation of this result see (5.124, AM 2005) and comments thereafter. 
Chapter 6

Optimizing allocations

E 238 – Feasible set of the mean-variance efficient frontier (www.6.1) *


Show that in the plane (6.29, AM 2005), the budget constraint (6.24, AM 2005) is satisfied by all the
points in the region to the right of the hyperbola (6.30, AM 2005)-(6.31, AM 2005)
Solution of E 238
See E 242. 

E 239 – Maximum achievable certainty-equivalent with exponential utility I (www.6.1)


Prove the expression (6.39, AM 2005) of the optimal allocation leading to the maximum achievable
certainty-equivalent index of satisfaction with exponential utility.
Solution of E 239
From the expression (6.21, AM 2005) of the satisfaction index, which we report here:

1 0
CE(α) ≡ ξ 0 α − α Φα , (6.1)

and the constraint (6.24, AM 2005) we obtain the Lagrangian:

1 0
L ≡ ξ0 α − α Φα − λ(α0 pT − wT ) . (6.2)

We neglect in the Lagrangian the second constraint (6.26, AM 2005), which from (6.22, AM 2005) and
(6.24, AM 2005) reads:


ξ 0 α − erf −1 (c) α0 Φα ≥ (1 − γ)wT . (6.3)

We verify ex-post that the constraint is automatically satisfied. From the first-order conditions on the
Lagrangian we obtain:

α = ζΦ−1 ξ + γΦ−1 pT , (6.4)

where γ is a suitable scalar. To compute γ we notice that the maximization of (6.2) is the same as (6.70,
AM 2005), where the objective is given by M ≡ PT +τ and the constraint is (6.94, AM 2005), with

191
d ≡ pT and c ≡ wT . Thus the solution must be of the form (6.97, AM 2005). Recalling the definitions
(6.99, AM 2005) of αM V and (6.100, AM 2005) of αSR respectively, and defining the scalar:

e − E {ΨαM V }
θ≡ , (6.5)
E {ΨαSR } − E {ΨαM V }

we rewrite (6.97, AM 2005) as follows:

wT Φ−1 ξ wT Φ−1 pT
α=θ + (1 − θ) . (6.6)
p0T Φ−1 ξ p0T Φ−1 pT

By comparing (6.4) with (6.6) we obtain:

ζ 0 −1
θ= p Φ ξ, (6.7)
wT T
and thus:

wT wT − ζp0T Φ−1 ξ
γ = (1 − θ) −1 = . (6.8)
p0T Φ pT p0T Φ−1 pT

Substituting this expression back into (6.4) we obtain the optimal allocation:

wT − ζp0T Φ−1 ξ −1
α∗ = ζΦ−1 ξ + Φ pT . (6.9)
p0T Φ−1 pT

Note. Notice that the optimal allocation (6.9), lies on the efficient frontier. When the risk propensity
ζ is zero we obtain the minimum variance portfolio αM V . As the risk propensity ζ tends to infinity,
the solution departs from the "belly" of the hyperbola along the upper branch of the hyperbola, passing
through the maximum Sharpe ratio portfolio αSR . The VaR constraint (6.3) is satisfied automatically
if two the confidence required c is not too high and the margin γ is not too small. Indeed consider the
following align:


ξ 0 α − erf −1 (c) α0 Φα = (1 − γ)wT . (6.10)

This is a straight line through the origin in Figure 6.1 in Meucci (2005). If erf −1 (c) is not larger than
the maximum Sharpe ratio, i.e. the slope of the line through the origin and the portfolio αSR , and if γ
is large enough, then all the portfolios above the straight line on the frontier satisfy the VaR constraint.
These portfolios correspond to the choice (6.7, AM 2005) for suitable choices of the extremes. 

E 240 – Maximum achievable certainty-equivalent with exponential utility II (www.6.1)


(see E 239)
Consider the same setup than in E 239. Prove the expression (6.39, AM 2005) of the maximum level of
satisfaction.
CHAPTER 6. OPTIMIZING ALLOCATIONS 193

Solution of E 240
We replace (6.9) in (6.1):

 
∗ 0 ∗ 1 ∗0 ∗
CE(α ) ≡ ξ α − α Φα

wT − ζp0T Φ−1 ξ −1
 
= ξ 0 ζΦ−1 ξ + Φ p T
p0T Φ−1 pT
0
wT − ζp0T Φ−1 ξ −1

1
− ζΦ−1 ξ + Φ pT Φ
2ζ p0T Φ−1 pT
wT − ζp0T Φ−1 ξ −1
 
−1
ζΦ ξ + Φ pT (6.11)
p0T Φ−1 pT
wT − ζp0T Φ−1 ξ
 
= ζξ 0 Φ−1 ξ + ξ 0 Φ−1 pT
p0T Φ−1 pT
2
1 wT − ζp0T Φ−1 ξ

ζ
− ξ 0 Φ−1 ξ − p0T Φ−1 pT
2 2ζ p0T Φ−1 pT
1 wT − ζp0T Φ−1 ξ
 
− p0T Φ−1 ξ .
2 p0T Φ−1 pT

Therefore:

wT − ζp0T Φ−1 ξ
 
ζ 1
CE(α ) = ξ 0 Φ−1 ξ +

ξ 0 Φ−1 pT
2 2 p0T Φ−1 pT
(6.12)
1 (wT − ζp0T Φ−1 ξ)2
− .
2ζ p0T Φ−1 pT


E 241 – Results on constrained optimization: QCQP as special case of SOCP (www.6.2) *

Show that the QCQP problem (6.57, AM 2005) can be written as (6.59, AM 2005), a problem of the
SOCP form (6.55, AM 2005).
Solution of E 241
From the spectral decomposition, the original quadratic programming problem:

n o
z∗ ≡ argmin z0 S(0) z + 2u0(0) z + v(0)
z
 (6.13)
Az = a
s.t.
z0 S(j) z + 2u0(j) z + v(j) ≤ 0 ,

for j = 1, . . . , J, can be written equivalently as follows:


 2 
∗ 1/2 0 −1/2 0 −1
z ≡ argmin Λ(0) E(0) z + Λ(0) E(0) u(0) + v(0) − u(0) S(0) u(0)

z
(
Az = a (6.14)
s.t. 2
1/2 0 −1/2
Λ(j) E(j) z + Λ(j) E0(j) u(j) ≤ u(j) S−1
(j) u(j) − v(j) ,

for j = 1, . . . , J. This problem in turn is equivalent to:

 2 
∗ 1/2 0 −1/2 0
z ≡ argmin Λ(0) E(0) z + Λ(0) E(0) u(0)

z
(
Az = a (6.15)
s.t. 2
1/2 0 −1/2
Λ(j) E(j) z + Λ(j) E0(j) u(j) ≤ u(j) S−1
(j) u(j) − v(j) ,

for j = 1, . . . , J. Introducing a new variable t this problem is equivalent to:

(z∗ , t∗ ) ≡ argmin {t}


(z,t)


 Az = a

1/2 0 −1/2
Λ(0) E(0) z + Λ(0) E0(0) u(0) ≤ t




(6.16)

 q
1/2 0 −1/2
Λ(1) E(1) z + Λ(1) E0(1) u(1) ≤ u(1) S−1

(1) u(1) − v(1)

s.t.

 ..
.



 q
1/2 0 −1/2
Λ(J) E(J) z + Λ(J) E0(J) u(J) ≤ u(J) S−1

(J) u(J) − v(J) .


E 242 – Feasible set of the mean-variance problem in the space of moments (www.6.3) *

Prove that the feasible set of the mean-variance problem (6.96, AM 2005) in the coordinates (6.101, AM
2005) is the region to the right of the parabola (6.102, AM 2005)-(6.103, AM 2005).
Solution of E 242
Consider the general case where E {M} and d are not collinear. First we prove that any level of expected
value e ∈ R is attainable. This is true if for any value e there exists an α such that:

e = E {Ψα } = α0 E {M}
(6.17)
c = α0 d .
In turn, this is true if we can solve the following system for an arbitrary value of e:

    P 
E {Mj } E {Mk } αj e − n6=j,k αn E {Mk }
= P . (6.18)
dj dk αk c − n6=j,k αn dn

Since E {M} and d are not collinear we can always find two indices (j, k) such that the matrix on the
left-hand side of (6.18) is invertible. Therefore, we can fix arbitrarily e and all the entries of α that appear
on the right hand side of (6.18) and solve for the remaining two entries on the left-hand side of (6.18).
CHAPTER 6. OPTIMIZING ALLOCATIONS 195

Now we prove that if a point (v, e) is feasible, so is any point (v + γ, e), where γ is any positive number.
Indeed, if we make any of the entries on the right hand side of (6.18) go to infinity and solve for the
remaining two entries on the left-hand side of (6.18) the variance of the ensuing allocations satisfies the
constraints and tends to infinity. For continuity, all the points between (v, e) and (+∞, e) are covered.
Therefore the feasible set can only be bounded on the left of the (v, e) plane. To find out if that boundary
exists, we fix a generic expected value e and compute the minimum variance achievable that satisfies the
affine constraint. Therefore, we minimize the following unconstrained Lagrangian:

L(α, λ, µ) ≡ Var {Ψα } − λ(α0 d − c) − µ(E {Ψα } − e)


(6.19)
= α0 Cov {M} α − λ(α0 d − c) − µ(α0 E {M} − e) .

The first-order conditions yield:

∂L
0= = 2 Cov {M} α − λd − µ E {M} , (6.20)
∂α
in addition to the two constraints:

∂L
0= = α0 d − c
∂λ
(6.21)
∂L
0= = α0 E {M} − e ,
∂µ
From (6.20) the solution reads:

λ −1 µ −1
α= Cov {M} d + Cov {M} E {M} . (6.22)
2 2
The Lagrange multipliers can be obtained as follows. First, we define four scalar constants:

−1
A ≡ d0 Cov {M} d (6.23)
−1
B ≡ d0 Cov {M} E {M} (6.24)
0 −1
C ≡ E {M} Cov {M} E {M} (6.25)
2
D ≡ AC − B . (6.26)

Left-multiplying the solution (6.22) by d0 and using the first constraint in (6.21) we obtain:

λ 0 −1 µ −1 λ µ
c = d0 α = d Cov {M} d + d0 Cov {M} E {M} = A + B . (6.27)
2 2 2 2
0
Similarly, left-multiplying the solution (6.22) by E {M} and using the second constraint in (6.21) we
obtain:

0 λ 0 −1 µ 0 −1 λ µ
e = E {M} α = E {M} Cov {M} d + E {M} Cov {M} E {M} = B + C . (6.28)
2 2 2 2
Now we can invert (6.28) and (6.27) obtaining:
2cC − 2eB 2eA − 2cB
λ= , µ= . (6.29)
D D
Finally, left-multiplying (6.20) by α0 we obtain:

0 = 2α0 Cov {M} α − λα0 d − µα0 E {M}


= 2 Var {Ψα } − λc − µe
  (6.30)
cC − eB eA − cB
= 2 Var {Ψα } − c− e .
D D

This shows that the boundary v(e) ≡ Var {Ψα } exists. Collecting the terms in e we obtain its align:

A 2 2cB c2 C
v= e − e+ , (6.31)
D D D
which shows that the feasible set is bounded on the left by a parabola. In the space of the coordinates
(d, e) = (Sd {Ψα } , E {Ψα }) the parabola (6.31) becomes a hyperbola:

A 2 2cB c2 C
d2 = e − e+ . (6.32)
D D D
The allocations α that give rise to the boundary parabola (6.31) are obtained from (6.22) by substituting
the Lagrange multipliers (6.29):

cC − eB −1 eA − cB −1
α= Cov {M} d + Cov {M} E {M}
D D
−1 −1 (6.33)
(cC − eB)A Cov {M} d (eA − cB)B Cov {M} E {M}
= −1 + −1 .
D d0 Cov {M} d D d0 Cov {M} E {M}
If c 6= 0 we can write (6.33) as:

α = (1 − γ(α))αM V + γ(α)αSR , (6.34)

where the scalar γ is defined as:

(E {Ψα } A − cB)B
γ(α) ≡ , (6.35)
cD
and (αM V , αSR ) are two specific portfolios defined as follows:

−1
c Cov {M} d
αM V ≡ −1 (6.36)
d0 Cov {M} d
−1
c Cov {M} E {M}
αSR ≡ −1 . (6.37)
d0 Cov {M} E {M}
CHAPTER 6. OPTIMIZING ALLOCATIONS 197

As for the expression of the scalar γ in (6.35), since:

cC cB cD
E {ΨαSR } − E {ΨαM V } = − = (6.38)
B A AB
we can simplify it as follows:

(E {Ψα } A − cB)B E {Ψα } AB B2


γ≡ = −
cD cD D
E {Ψα } ( cB
A )
= − cD (6.39)
E {ΨαSR } − E {ΨαM V } ( AB )
E {Ψα } − E {ΨαM V }
= ,
E {ΨαSR } − E {ΨαM V }

which shows that the upper (lower) branch of the boundary parabola is spanned by the positive (negative)
values of γ.
Note. To consider the case c = 0 we take the limit c → 0 in the above results. The boundary (6.31) of the
feasible set in the coordinates (v, e) = (Var {Ψα } , E {Ψα }) is still a parabola:

A 2
v= e , (6.40)
D
whereas in the space of coordinates (s, e) = (Sd {Ψα } , E {Ψα }) the boundary degenerates from the
hyperbola (6.32) into two straight lines:

r
A
d(e) = ± e. (6.41)
D
As for the allocations that generate this boundary, taking the limit c → 0 in (6.34) and recalling the
definitions (6.35), (6.36) and (6.37) we obtain:

α = lim [αM V + γ(α)(αSR − αM V )]


c→0
= lim [γ(α)(αSR − αM V )]
c→0
−1 (6.42)
Cov {M}
= E {Ψα } (A E {M} − Bd)
D
−1
= ζ(α) Cov {M} (A E {M} − Bd) ,

where the scalar ζ is defined as follows:

E {Ψα }
ζ(α) ≡ . (6.43)
D
The upper (lower) branch of the boundary parabola is spanned by the positive (negative) values of ζ. 
E 243 – Reformulation of the efficient frontier with affine constraints (www.6.3)
(see E 242)
Consider the same setup than in E 242. Show that the problem (6.96, AM 2005) can be more easily
parametrized as in (6.97, AM 2005)-(6.100, AM 2005).
Solution of E 243
With the geometry of the feasible set in E 242, we can move on to compute the mean-variance curve:
fixing a level of variance v and maximizing the expected value in the feasible set means hitting the upper
branch of the parabola (6.31). Therefore if c 6= 0 the mean-variance curve reads:

α ≡ (1 − γ)αM V + γαSR γ > 0. (6.44)

E 244 – Least-possible variance allocation (www.6.3) (see E 242)


Consider the same setup than in E 242. Show that αM V in (6.99, AM 2005) is the allocation that displays
the least possible variance.
Solution of E 244
Portfolio (6.36) corresponds to the case γ = 0. From the expression for γ in (6.35) and from the ex-
pression for the Lagrange multipliers in (6.29) we see that αM V is the allocation that corresponds to the
case where the Lagrange multiplier µ is zero in (6.22). From the original Lagrangian (6.19), if µ = 0 the
ensuing allocation is the minimum-variance portfolio. From (6.31), or by direct computation we derive
the coordinates of αM V in the space of moments:

c2 cB
vM V ≡ Var {ΨαM V } = , eM V ≡ E {ΨαM V } = . (6.45)
A A


E 245 – Highest-possible Sharpe ratio allocation (www.6.3) (see E 242)


Consider the same setup than in E 242. Show that αSR in (6.100, AM 2005) is the allocation that displays
the highest possible Sharpe ratio.
Solution of E 245
Portfolio (6.37) corresponds to the case γ = 1. This is the allocation on the feasible boundary that
corresponds to the highest Sharpe ratio. Indeed, by direct computation we derive the coordinates of αSR
in the space of moments:

c2 C cC
vSR ≡ Var {ΨαSR } = , eSR ≡ E {ΨαSR } = , (6.46)
B2 B
On the other hand the highest Sharpe ratio is the steepness of the straight line tangent to the hyperbola
(6.32), which we obtain by maximizing its analytical expression as a function of the expected value:

e e
SR(e) ≡ =q . (6.47)
d(e) A 2 2cB c2 C
De − D e + D

The first-order conditions with respect to e show that the maximum of the Sharpe ratio is reached at
(6.46). 
CHAPTER 6. OPTIMIZING ALLOCATIONS 199

E 246 – Geometry of the mean-variance efficient frontier (www.6.3) (see E 242)


Consider the same setup than in E 242. Show that in the risk/reward plane (6.101, AM 2005), the allo-
cation αSR represents the intersection of the efficient frontier with the straight line though the origin and
the minimum variance portfolio.
Solution of E 246
It is immediate to check that the ratio e/v is the same for both portfolio (6.45) and portfolio (6.46), and
thus the two allocations lie on the same radius from the origin in the (v, e) plane. 
E 247 – Reformulation of the efficient frontier with linear constraints (www.6.3)
(see E 242)
Consider the same setup than in E 242. Show that the solutions of (6.107, AM 2005) are more easily
parametrized as in (6.109, AM 2005)-(6.110, AM 2005).
Solution of E 247
If c = 0 the mean-variance curve (6.97, AM 2005) reads:

−1
Cov {M} (E {M} − d)
α≡ζ −1 ζ sign(B) > 0 . (6.48)
d0 Cov {M} E {M}


E 248 – Effect of correlation on the mean-variance efficient frontier: total correla-
tion case (www.6.4)
Show that, in the case of a bivariate market with total correlation, the mean-variance efficient frontier
degenerates into a straight line that joins the two coordinates of the two assets in the plane (6.114, AM
2005), i.e. show (6.116, AM 2005).
Hint. In the case of N = 2 assets, the (N − 1)-dimensional affine constraint (6.94, AM 2005) determines
a line:

c b2
α1 = − α2 , (6.49)
b1 b1
which corresponds to the feasible set. Defining:

c eb ≡ b2 .
α ≡ α2 , c≡
e , (6.50)
b1 b1
The investor’s objective reads:

c − αeb)M1 + αM2 = e
Ψα = α1 M1 + α2 M2 = (e cM1 + α(M2 − ebM1 ) . (6.51)

Its expected value reads:

e ≡ E {Ψα } = e
c E {M1 } + α(E {M2 } − eb E {M1 }) . (6.52)

For the standard deviation we have the general expression:


2
d2 ≡ [Sd {Ψα }] = α0 Cov {M} α
2 2
(6.53)
c − αeb)2 [Sd {M1 }] + α2 [Sd {M2 }] + 2α(e
= (e c − αeb)ρ Sd {M1 } Sd {M2 } ,

where ρ ≡ Corr {M1 , M2 }. From (6.52) and (6.53) we derive the coordinates of a full allocation in the
first asset, which corresponds to α = 0:

e(1) = e
c E {M1 } , d(1) = e
c Sd {M1 } (6.54)

and a full allocation in the second asset, which corresponds to α = e


c/eb:

c c
e(2) = E {M2 } , d(2) = Sd {M2 } .
e e
(6.55)
eb eb
Without loss of generality, we make the assumption:

e(1) < e(2) , d(1) < d(2) . (6.56)

In this notation we can more conveniently re-express the expected value (6.52) of a generic allocation as
follows:

αeb (2)
e = e(1) + (e − e(1) ) . (6.57)
c
e
As for the standard deviation (6.53) we obtain:

!2 !2 !
αeb h i2 αeb h i2 αeb αeb (1) (2)
2
d = 1− d(1) + d(2) + 2 1 − ρ d d , (6.58)
c
e c
e c
e c
e

Solution of E 248
If ρ = 1, (6.58) simplifies to:

" ! #2
2 αeb (1) αeb (2)
d = 1− d + d , (6.59)
c
e c
e

which as long as:

d(1) c
α≥−
e
, (6.60)
d(2) − d(1) eb
in turn simplifies to:

!
αeb αeb (2)
d= 1− d(1) + d . (6.61)
c
e c
e
CHAPTER 6. OPTIMIZING ALLOCATIONS 201

This expression coupled with (6.57) yield the allocation curve:

e(2) − e(1)
e = e(1) + (d − d(1) ) , (6.62)
d(2) − d(1)
which is a line through the coordinates of the two securities.
Note. When the allocation α is such that (6.60) holds as an equality, we obtain a zero-variance portfolio
whose expected value from (6.57) reads:

e(2) − e(1)
e = e(1) − d(1) < e(1) . (6.63)
d(2) − d(1)
From (6.60) that this situation corresponds to a negative position in the second asset. 

E 249 – Effect of correlation on the mean-variance efficient frontier: total anti-


correlation case (www.6.4) (see E 248)
Consider the same setup than in 248. Show that, in the case of a bivariate market with total anti-
correlation, the mean-variance efficient frontier degenerates into a straight line that joins the two co-
ordinates of the two assets in the plane (6.114, AM 2005), i.e. show (6.118, AM 2005).
Solution of E 249
If ρ = −1, (6.58) simplifies to:

" ! #2
2 αeb (1) αeb (2)
d = 1− d − d , (6.64)
c
e c
e

which as long as:

d(1) c
α≥
e
(1) (2)
, (6.65)
d +d b e

in turn simplifies to:

αeb (1)
d = −d(1) + (d + d(2) ) . (6.66)
c
e
This expression coupled with (6.57) yield the allocation curve in the case ρ = −1:

e(2) − e(1)
e = e(1) + (d + d(1) ) . (6.67)
d(2) + d(1)
When the allocation α is such that (6.65) holds as an equality, we obtain a zero-variance portfolio whose
expected value from (6.57) reads:

e(2) − e(1)
e = e(1) + d(1) > e(1) . (6.68)
d(1) + d(2)
Note. From (6.65) the allocation in the second asset is positive and from (6.49) so is the allocation in the
first asset:

d(1)
 
c 1−
α1 = e . (6.69)
d(1) + d(2)


E 250 – Total return efficient allocations in the plane of relative coordinates (www.6.5)
Show that the benchmark-relative efficient allocation (6.190, AM 2005) give rise to the portions of the
parabola (6.193, AM 2005) above the coordinate of the benchmark. Show that the hyperbolas are the
same if the benchmark is mean-variance efficient from a total-return point of view.
Solution of E 250
From (6.193, AM 2005) the generic portfolio (6.175, AM 2005) on the efficient frontier satisfies:

A 2 2wT B w2 C
Var {Ψαe } = E {Ψαe } − E {Ψαe } + T (6.70)
D D D
which can be re-written as follows:

A 
+ E {Ψβ })2

Var Ψα−β − Var {Ψβ } + 2 Cov {Ψαe , Ψβ } = (E Ψα−β
D
e e
(6.71)
2wT B  wT2 C
− (E Ψα−β + E {Ψ β }) + .
D D
e

Expanding the products and rearranging, we obtain:

 A  2
Var Ψα−β = − 2 Cov {Ψαe , Ψβ } + E Ψα−β
D
e e
 
 2A 2wT B
+ E Ψα−β E {Ψβ } − (6.72)
D D
e

A 2 2wT B w2 C
+ E {Ψβ } − E {Ψβ } + T + Var {Ψβ } .
D D D
From (6.94, AM 2005), (6.99, AM 2005) and (6.100, AM 2005) we obtain for a generic allocation α:

wT E{PT +τ }0 Cov{PT +τ }−1 pT


E {Ψα } − E {ΨαM V } E {Ψα } − p0T Cov{PT +τ }−1 pT
=
E {ΨαSR } − E {ΨαM V } wT E{PT +τ }0 Cov{PT +τ }−1 E{PT +τ } wT E{PT +τ }0 Cov{PT +τ }−1 pT
p0T Cov{PT +τ }−1 E{PT +τ }
− p0T Cov{PT +τ }−1 pT
wT B
E {Ψα } − A (E {Ψα } − wTAB )BA
= wT C wT B
=
B − A
wT D
(E {Ψα−β } + E {Ψβ })BA − wT B 2
= .
wT D
(6.73)

Using this result, from (6.175, AM 2005) and the budget constraint β 0 pT = wT the covariance reads:
CHAPTER 6. OPTIMIZING ALLOCATIONS 203

 
0 E {Ψαe } − E {ΨαM V }
Cov {Ψβ , Ψαe } = β Cov {PT +τ } αM V + (αSR − αM V )
E {ΨαSR } − E {ΨαM V }
wT β 0 pT wT β 0 E {PT +τ } wT β 0 pT
 
E {Ψαe } − E {ΨαM V }
= + − (6.74)
A E {ΨαSR } − E {ΨαM V } B A
 2 
2 {Ψ })BA −

w (E Ψ α−β + E β wT B E {Ψβ } wT
= T + − .
e
A D B A

Substituting (6.73) in (6.74) we obtain:

"  #
wT2 + E {Ψβ })BA − wT B 2 E {Ψβ } wT

 (E Ψα−β
Var Ψα−β = −2 + −
e
A D B A
e

 
A  2  2A 2wT B
+ E Ψα−β + E Ψα−β E {Ψβ } −
D D D
e e

2
A 2 2wT B w C
+ E {Ψβ } − E {Ψβ } + T + Var {Ψβ }
D  D D
2wT2
 
2 E Ψα−β BA E {Ψβ } wT (6.75)
= − − −
e
A D B A
2wT B 2 E {Ψβ } wT
   
2 E {Ψβ } BA E {Ψβ } wT
− − + −
D B A D B A
 
A  2  2A 2wT B
+ E Ψα−β + E Ψα−β E {Ψβ } −
D D D
e e

2
A 2 2wT B w C
+ E {Ψβ } − E {Ψβ } + T + Var {Ψβ } .
D D D

The first-degree terms in E Ψα−βe cancel, and other terms simplify to yield the following expression:

2B 2
 
 A  2 2 C 2
Var Ψα−β = E Ψ α−β + w T − −
D D A DA
e e
(6.76)
A 2 2wT B
− E {Ψβ } + E {Ψβ } + Var {Ψβ } .
D D
From the definition of D in (6.194, AM 2005) this simplifies further into:

 A  2 wT2 C A 2
Var Ψα−β = E Ψα−β − − E {Ψβ }
D D D
e e
(6.77)
2wT B
+ E {Ψβ } + Var {Ψβ } ,
D
or:

 A  2
Var Ψα−β = E Ψα−β + δβ , (6.78)
D
e e

where:
A 2 2wT B w2 C
δβ ≡ Var {Ψβ } − E {Ψβ } + E {Ψβ } − T . (6.79)
D D D
Since the benchmark is not necessarily mean-variance efficient from (6.193, AM 2005) we have that
δβ ≥ 0 and the equality holds if and only if the benchmark is mean-variance efficient. 
E 251 – Benchmark-relative efficient allocation in the plane of absolute coordinates
(www.6.5)
Show that the total-return mean-variance efficient allocation (6.175, AM 2005) give rise to the portion of
the parabola above the coordinate of the global minimum-variance portfolio, as illustrated in Figure 6.21
of Meucci (2005).
Solution of E 251
From the align of the relative frontier (6.199, AM 2005) which we re-write here:

A 2
Var {Ψα−β } = E {Ψα−β } , (6.80)
D
and the linearity of the objective Ψα−β = Ψα − Ψβ we obtain:

Var {Ψα } = 2 Cov {Ψα , Ψβ } − Var {Ψβ }


A 2 2
(6.81)
+ (E {Ψα } + E {Ψβ } − 2 E {Ψα } E {Ψβ }) ,
D
From (6.194, AM 2005), (6.99, AM 2005) and (6.100, AM 2005) we obtain for a generic allocation α:

E {Ψα } − E {Ψβ } E {Ψα } − E {Ψβ }


=
E {ΨαSR } − E {ΨαM V } wT E{PT +τ }0 Cov{PT +τ }−1 E{PT +τ } 0
T +τ } Cov{PT +τ }
−1

p0T Cov{PT +τ }−1 E{PT +τ }


− wT E{P
p0T Cov{PT +τ }−1 pT
pT

E {Ψα } − E {Ψβ }
= wT C wT B
B − A
(E {Ψα } − E {Ψβ })BA
= .
wT D
(6.82)

Using this result, from (6.190, AM 2005) and the budget constraint β 0 pT = wT the covariance reads:

 
E {Ψα } − E {Ψβ }
Cov {Ψβ , Ψα } = β 0 Cov {PT +τ } β + (αSR − αM V )
E {ΨαSR } − E {ΨαM V }
= Var {Ψβ }
wT β 0 E {pT +τ } wT β 0 pT (6.83)
 
E {Ψα } − E {Ψβ }
+ −
E {ΨαSR } − E {ΨαM V } B A
 
(E {Ψα } − E {Ψβ })BA E {Ψβ } wT
= Var {Ψβ } + − .
D B A

Substituting this into (6.82) and simplifying we obtain:


CHAPTER 6. OPTIMIZING ALLOCATIONS 205

A 2 2BwT w2 C
Var {Ψα } = E {Ψα } − E {Ψα } + T + δβ , (6.84)
D D D
where δβ is defined in (6.79). 

E 252 – Formulation of mean-variance in terms of returns I (www.6.6)


Show that, under assumption (6.82, AM 2005)-(6.83, AM 2005), the mean-variance frontier (6.68, AM
2005) can be expressed as (6.85, AM 2005).
Solution of E 252
If the investor has a positive initial budget wT > 0, then maximizing E {Ψα } in the original mean-
variance problem is equivalent to maximizing E {Ψα } /wT . On the other hand, as Var {WT +τ } spans
all the real numbers v, so does Var {Ψα } /wT2 . Therefore, given that initial wealth wT is not a random
variable and given the definition of linear return on wealth (6.81, AM 2005), the original mean-variance
problem is equivalent to (6.85, AM 2005) 

E 253 – Formulation of mean-variance in terms of returns II (www.6.6) (see E 252)


Consider the same setup than in E 252. Show that (6.85, AM 2005) can be expressed as (6.88, AM 2005).
Solution of E 253
First notice that the linear return on wealth is a function of relative weights and linear returns on securities:

PN (n)
WT +τ αn PT +τ
1 + LΨα ≡ = n=1
wT wT
N (n) (n) N
X αn P
T
PT +τ X 
(n)
 (6.85)
= (n)
= wn 1 + L
n=1
wT pT n=1
= 1 + w0 L ,

where we have used the budget constraint α0 pT = wT and the following identity:

N N (n)
X X αn pT
wn = = 1. (6.86)
n=1 n=1
α0 pT

Therefore for the expected value we have:

E LΨα = E {w0 L} = w0 E {L} .



(6.87)

Similarly, for the variance we obtain:

Var LΨα = Var {w0 L} = w0 Cov {L} w .



(6.88)

Therefore, due to (6.87) and (6.88) problem (6.85, AM 2005) reads:

α(v) ≡ argmax w0 (α) E {L} , (6.89)


α∈C
w0 (α) Cov{L}w(α)=v
where w as a function of α is obtained by inverting (6.86, AM 2005). On the other hand, it is easier to
convert the constraints C that hold for α into constraints that hold for w (for ease of exposition we keep
denoting them as C) and then maximize (6.89) with respect to w:

w(v) ≡ argmax w0 E {L} , (6.90)


w∈C
w0 Cov{L}w=v

The original mean-variance curve is simply α(v) ≡ α(w(v)) obtained from (6.86, AM 2005). 

E 254 – Mean-variance pitfalls: two-step approach I


Assume a market of N ≡ 4 stocks and all possible zero-coupon bonds. The weekly compounded returns
of the stocks are market invariants with the following distribution:

Ct,eτ ∼ N(µ, Σ) . (6.91)

Write a MATLAB R
script in which you estimate the matrix Σ and the vector µ from the time series of
weekly prices in the attached database DB_StockSeries. To do this, shrink the sample mean as in (4.138,
AM 2005), where the target is the null vector and the shrinkage factor is set as α ≡ 0.1. Similarly, shrink
as in (4.160, AM 2005) the sample covariance to a suitable multiple of the identity by a factor α ≡ 0.1.
Solution of E 254
See the MATLAB R
script S_MeanVarianceOptimization. 

E 255 – Mean-variance pitfalls: two-step approach II (see E 254)


Consider the same setup than in E 254. Assume that the weekly changes in yield to maturity for the
bond market are fully codependent, i.e. co-monotonic. In other words, assume that the copula of any
pairs of weekly yield changes is (2.106, AM 2005). Also, assume that they have the following marginal
distribution:

 2 !
(υ) 20 + 1.25υ
∆τe Y ∼ N 0, , (6.92)
10, 000

where υ denotes the generic time to maturity (measuring time in years). Assume that the bonds and the
stock market are independent. Assume that the current stock prices are the last set of prices in the time
series. Restrict your attention to bonds with times to maturity 4, 5, 10, 52 and 520 weeks, and assume that
the current yield curve, as defined in (3.30, AM 2005) in Meucci (2005) is flat at 4%. Write a MATLAB R

script in which you:


• Produce joint simulations of the four stock and five bond prices at the investment horizon τ of four
weeks;
• Assume that the investor considers as his market one single bond with time to maturity υ ≡ five
weeks and all the stocks;
• Determine numerically the mean-variance inputs, namely expected prices and covariance of prices
(not returns);
• Determine analytically the mean-variance inputs, namely expected prices and covariance of prices
(not returns) and compare with their numerical counterpart;
• Assume that the investor’s objective is final wealth. Suppose that his budget is wT ≡ 100. Assume
that the investor cannot short-sell his securities, i.e. the allocation vector cannot include negative
entries. Compute the mean-variance efficient frontier as represented by a grid of 40 portfolios
CHAPTER 6. OPTIMIZING ALLOCATIONS 207

whose expected values are equally spaced between the expected value of the minimum variance
portfolio and the largest expected value among the portfolios composed of only one security;
• Assume that the investor’s satisfaction is the certainty equivalent associated with an exponential
function:

1
u(ψ) ≡ −e− ζ ψ , (6.93)

where ζ ≡ 10 and compute the optimal allocation according to the two-step mean-variance frame-
work.
Hint. Do not use portfolio weights and returns. Instead, use number of securities and prices. Given the
no-short-sale constraint, the minimum variance portfolio cannot be computed analytically, as in (6.99,
AM 2005): use the MATLAB R
function quadprog to compute it numerically. Given the no-short-sale
constraint, the frontier cannot be computed analytically, as in (6.97, AM 2005)-(6.100, AM 2005): use
quadprog to compute it numerically.

Solution of E 255
See the MATLAB R
script S_MeanVarianceOptimization. 

E 256 – Mean-variance pitfalls: horizon effect (see E 255)


Consider the stock market described in E 255 and the investment horizon τ of one day. Write a MATLAB R

script in which you:


• Determine analytically the mean-variance inputs in terms of weights and returns, namely expected
linear returns and covariance of linear returns and compare with their numerical counterpart;
• Assume that the investor’s objective is final wealth. Suppose that the budget is b ≡ 100. Assume
that the investor cannot short-sell the securities, i.e. the allocation vector cannot include negative
entries. Compute the mean-variance efficient frontier in terms of portfolio weights as represented
by a grid of 40 portfolios whose expected linear returns are equally spaced between the expected
value of the linear return on the minimum variance portfolio and the largest expected value among
the linear returns of all the securities;
• Assume that the investor’s satisfaction is the certainty equivalent associated with an exponential
function:

1
u(ψ) ≡ −e− ζ ψ , (6.94)

where ζ ≡ 10. Compute the optimal allocation according to the two-step mean-variance frame-
work;
• Repeat the above steps an the investment horizon τ of four years.
Solution of E 256
See the MATLAB R
script S_MeanVarianceHorizon. 

E 257 – Benchmark driven allocation I (see E 255)


Consider the same market than in E 255, namely one single bond with time to maturity υ ≡ five weeks
and all the stocks. Write a MATLAB R
script in which you:
• Produce joint simulations of the four stock and the one bond prices at the investment horizon τ of
four weeks;
• Determine numerically the mean-variance inputs in terms of weights and returns, namely expected
linear returns and covariance of linear returns;
• Determine analytically the mean-variance inputs in terms of weights and returns, namely expected
linear returns and covariance of linear returns and compare with their numerical counterpart.
Solution of E 257
For the benchmark-driven investor, the objective is (6.170, AM 2005) or:

Φα ≡ α0 KPT +τ , (6.95)

where:

pT β 0
K≡I− , (6.96)
β 0 pT
and β is the benchmark. In particular, notice that K is singular: the columns of K span a vector space of
dimension N − 1. Any vector orthogonal to all the column of K is spanned by the benchmark. Therefore
Φβ = β 0 KPT +τ ≡ 0, which implies that the benchmark has zero expected outperformance and zero
tracking error, see Figure (6.21, AM 2005). For a budget b, the return-based objective is defined as:

Φα α0 KPT +τ α0 PT +τ α0 pT β 0 PT +τ
= = −
b α0 pT α0 pT (α0 pT )(β 0 pT )
 0   0 
α PT +τ β PT +τ (6.97)
= −1 − −1
α0 pT β 0 pT
= Lα − Lβ ,

where Lα and Lβ are the linear returns of the portfolio and the benchmark, respectively. Given that the
constraints are linear, we resort to the dual formulation of the return-based mean-variance problem, which
reads:

α(e) ≡ argmin {Var{Lα − Lβ }}


α0 pT ≡b
α≥0
E{Lα −Lβ }=e

≡ argmin {Var{Lα } + Var{Lβ } − 2 Cov{Lα , Lβ }}


α0 pT ≡b
α≥0 (6.98)
E{Lα −Lβ }=e
1
≡ argmin { Var{Lα } − 2 Cov{Lα , Lβ }} .
0
α pT ≡b 2
α≥0
E{Lα −Lβ }=e

Using 6.85 we obtain in terms of the portfolio weights w, the benchmark weights wb , and the securities
returns L:

 
1 0
w(e) ≡ argmin w Cov{L}w − wb0 Cov{L}w . (6.99)
w0 1≡1 2
w≥0
0
w E{L}=e

This is the input for the MATLAB


R
script S_MeanVarianceBenchmark. 
CHAPTER 6. OPTIMIZING ALLOCATIONS 209

E 258 – Benchmark driven allocation II (see E 255)


Consider the same setup than in E 255. Write a MATLAB R
script in which you:
• Assume first that the investor’s objective is final wealth. Suppose that the budget is b ≡ 100.
Assume that the investor cannot short-sell the securities, i.e. the allocation vector cannot include
negative entries;
• Compute the mean-variance efficient frontier in terms of portfolio weights as represented by a grid
of 40 portfolios whose expected linear returns are equally spaced between the expected value of the
linear return on the minimum variance portfolio and the largest expected value among the linear
returns of all the securities;
• Now assume that the investor’s objective is wealth relative to an equal-weight benchmark, i.e. a
benchmark that invests an equal amount of money in each security in the market;
• Compute the mean-variance efficient frontier in terms of portfolio weights as represented by a grid
of 40 portfolios whose expected linear returns are equally spaced between the expected value of the
linear return on the minimum variance portfolio and the largest expected value among the linear
returns of all the securities;
• Project the two efficient frontiers computed above in the expected outperformance/tracking error
plane.
Solution of E 258
See the MATLAB R
script S_MeanVarianceBenchmark. 

E 259 – Mean-variance for derivatives


Consider a market of at-the-money call options on the underlyings whose daily time series are provided
in the database DB (30, 91 and 182 are the time to expiry). Assume that the investment horizon is two
days. Write a MATLAB R
script in which you:
• Fit a normal distribution to the invariants, namely the log-changes in the underlying in and the
log-changes in the respective at-the-money implied volatilities;
• Project this distribution analytically to the horizon;
• Generate simulations for the sources of risk, namely underlying prices and implied volatilities at
the horizon;
• Price the above simulations through the full Black-Scholes formula, assuming no skewness correc-
tion for the implied volatilities and a constant risk-free rate at 4%;
• Compute the distribution of the linear returns, as represented by the simulations: the current prices
of the options can be obtained similarly to the prices at the horizon by assuming that the current
values of underlying and implied volatilities are the last observations in the database;
• Compute numerically the mean-variance inputs;
• Compute the mean-variance efficient frontier in terms of relative weights, assuming the standard
long-only and full investment constraints;
• Plot the efficient frontier in the plane of weights and standard deviation.
Solution of E 259
See the MATLAB R
script S_MeanVarianceCalls. 

E 260 – Dynamic strategies


Assume there are two securities: a risk free asset whose value evolves deterministically with an exponen-
tial growth at a constant rate r:

ln Dt+δt = ln Dt + rδt , (6.100)

and a risky asset whose value Pt follows a geometric Brownian motion with drift µ and volatility σ:
σ2 √
 
ln Pt+δt = ln Pt + µ − δt + σ δtZt , (6.101)
2

where Zt ∼ N(0, 1) are independent across non-overlapping time steps. Assume the current time is t ≡ 0
and the investment horizon is t ≡ τ . Assume there is an initial budget:

S0 given . (6.102)

Consider a strategy that rebalances between the two assets throughout the investment period [0, τ ]:

(αt , βt )t∈[0,τ ] , (6.103)

where αt denotes the number of units of the risky asset and βt denotes the number of units of the risk-free
asset. The value of the strategy is:

St = αt Pt + βt Dt , (6.104)

and the strategy must be self-financing, i.e. whenever a rebalancing occurs:

(αt , βt ) 7→ (αt+δt , βt+δt ) , (6.105)

the following must hold true:

St+δt ≡ αt Pt+δt + βt Dt+δt ≡ αt+δt Pt+δt + βt+δt Dt+δt , (6.106)

The strategy (6.103) determined equivalently by the weights:

αt Pt βt Dt
wt ≡ , ut ≡ , (6.107)
St St
Prove that the self-financing constraint (6.106) is equivalent to the weight of the risk-free asset being
equal to:

ut ≡ 1 − wt , (6.108)

and that therefore the whole strategy if fully determined by the free evolution of the weight wt .
Note. See Meucci (2010d).

Solution of E 260
We denote by (wt , ut ) the pre-trade weights and by (w
et , u
et ) the post-trade weights. Dividing both sides
of (6.106) by the value of the strategy we obtain:

αt Pt+δt + βt Dt+δt αt Pt+δt + βt Dt+δt


wt+δt + ut+δt = = = 1, (6.109)
St+δt αt Pt+δt + βt Dt+δt
CHAPTER 6. OPTIMIZING ALLOCATIONS 211

and:

αt+δt Pt+δt + βt+δt Dt+δt αt+δt Pt+δt + βt+δt Dt+δt


w
et+δt + u
et+δt = = = 1. (6.110)
St+δt αt+δt Pt+δt + βt+δt Dt+δt


E 261 – Buy and hold


Consider the buy & hold strategy, that invests the budget (6.102) in the two securities and never reallocates
throughout the investment period [0, τ ]:

αt ≡ α , βt ≡ β . (6.111)
Write a MATLAB R
script in which you:
• Generate the deterministic exponential growth dynamics (6.100) at equally spaced time intervals τ ;
• Generate a large number of Monte Carlo paths from the geometric Brownian motion (6.101) at
equally spaced time intervals [0, δt, 2δt, . . . , τ ];
• Plot one path for the value of the risky asset {Pt }t=0,δt,...,τ , and overlay the respective path
{St }t=0,δt,...,τ for the value of the buy & hold strategy (6.111);
• Plot the evolution of the portfolio weight (6.107) of the risky asset {wt }t=0,δt,...,τ on that path;
• Scatter-plot the final payoff of the buy & hold strategy (6.111) over the payoff of the risky asset,
and verify that the profile is linear.
Hint. See Meucci (2010d).

Solution of E 261
See the MATLAB R
script S_BuyNHold. 

E 262 – Utility maximization I


Consider the constant weight strategy, that invests the budget (6.102) in the two securities and keeps the
weight of the risky security constant throughout the investment period [0, τ ]:

wt ≡ w . (6.112)
Prove that this strategy maximizes the expected final utility:


w(·) ≡ argmax (E {u(Sτ )}) , (6.113)
S0 ,w(·) ∈C

where u is the power utility function:


u(s) = , (6.114)
γ
with γ < 1.
Hint. The strategy evolves as:

dSt
= (r + wt (µ − r))dt + wt σdBt . (6.115)
St
and the final value is lognormally distributed:

Yw(·)
Sτ = S0 e , (6.116)

where Y is a normal:

Yw(·) ∼ N(mw(·) , s2w(·) ) , (6.117)

with expected value:

τ
σ2 2
Z  
mw(·) ≡ rτ + (µ − r)wt − w dt (6.118)
0 2 t

and variance:

Z τ
s2w(·) = σ 2 wt2 dt . (6.119)
0

Hint. See Meucci (2010d).

Solution of E 262
From (6.116) we obtain:

S0γ γY
E {u(Sτ )} = E{e w(·) } . (6.120)
γ

Since Yw(·) is normally distributed with expected value (6.118) and variance (6.119), it follows that eγY
is lognormally distributed and thus from (1.98, AM 2005) we obtain:

 
γYw(·) γ mw(·) + γ2 s2w
E{e }=e (·)
. (6.121)

Therefore, substituting (6.118) and (6.119), the optimal strategy (6.113) solves:

τ
σ2
Z   

w(·) ≡ argmax wt (µ − r) − wt2 (1 − γ) dt . (6.122)
w(·) 0 2

The solution to this problem is the value that maximizes the integrand at each time. Therefore, the solution
is the constant:

∗ 1 µ−r
w(·) ≡w≡ . (6.123)
1 − γ σ2

CHAPTER 6. OPTIMIZING ALLOCATIONS 213

E 263 – Utility maximization II (see E 262)


Consider the same setup than in E 262. Write a MATLAB R
script in which you:
• Generate the deterministic exponential growth dynamics (6.100) at equally spaced time intervals τ ;
• Generate a large number of Monte Carlo paths from the geometric Brownian motion (6.101) at
equally spaced time intervals [0, δt, 2δt, . . . , τ ];
• Plot one path for the value of the risky asset {Pt }t=0,δt,...,τ , and overlay the respective path
{St }t=0,δt,...,τ for the value of the constant weight strategy (6.112);
• Plot the (non) evolution of the portfolio weight (6.107) of the risky asset {wt }t=0,δt,...,τ on that
path;
• Scatter-plot the final payoff of the constant weight strategy (6.112) over the payoff of the risky
asset, and verify that the profile is concave.
Solution of E 263
See the MATLAB R
script S_UtlityMax. 

E 264 – Constant proportion portfolio insurance


Consider the CPPI strategy, that invests the budget (6.102) as follows. First we specify a deterministically
increasing floor Ft that satisfies the budget constraint:

F0 ≤ S0 , (6.124)

and grows to a guaranteed value H at the horizon:

Ft ≡ He−r(τ −t) , t ∈ [0, τ ] . (6.125)

At all times t, for any level of the strategy St there is an excess cushion:

Ct ≡ max(0, St − Ft ) . (6.126)

According to the CPPI, a constant multiple m of the cushion is invested in the risky asset, therefore
obtaining the dynamic strategy’s weight for the risky asset:

mCt
w ≤ wt ≡ ≤ w. (6.127)
St
Write a MATLAB R
script in which you:
• Generate the deterministic exponential growth dynamics (6.100) at equally spaced time intervals τ ;
• Generate a large number of Monte Carlo paths from the geometric Brownian motion (6.101) at
equally spaced time intervals [0, δt, 2δt, . . . , τ ];
• Plot one path for the value of the risky asset {Pt }t=0,δt,...,τ , and overlay the respective path
{St }t=0,δt,...,τ for the value of the CPPI strategy (6.127);
• Plot the evolution of the portfolio weight (6.107) of the risky asset {wt }t=0,δt,...,τ on that path;
• Scatter-plot the final payoff of the CPPI strategy (6.127) over the payoff of the risky asset, and
verify that the profile is convex.
Hint. See Meucci (2010d).

Solution of E 264
See the MATLAB R
script S_CPPI. 
E 265 – Option based portfolio insurance I
Consider an arbitrary payoff at the investment horizon as a function of the risky asset:

Sτ = s(Pτ ) . (6.128)

and assume that you can compute the solution G(t, p) of the following partial differential align:

∂G ∂G 1 ∂2G 2 2
+ r+ σ p − Gr = 0 , (6.129)
∂t ∂p 2 ∂p2
with boundary condition:

G(τ, p) ≡ s(p) p > 0 , (6.130)

Prove that a strategy that invests an initial budget:

S0 ≡ G(0, P0 ) (6.131)

and allocates dynamically the following weight in the risky asset:

Pt ∂G(t, Pt )
wt ≡ , (6.132)
St ∂Pt
provides the desired payoff (6.128).
Hint. The strategy evolves as:

dSt
= (r + wt (µ − r))dt + wt σdBt . (6.133)
St

Solution of E 265
We want to prove that the following identity holds at all times, and in particular at t ≡ τ :

St ≡ G(t, Pt ) t ∈ [0, τ ] . (6.134)

Indeed, using Ito’s rule on G((t, Pt ), where Pt follows the geometric Brownian motion (6.101) yields:

∂G ∂G 1 ∂2G
dGt = dt + dPt + (dPt )2
∂t ∂Pt 2 ∂Pt2
∂G ∂G 1 ∂2G 2 2
= dt + (µPt dt + σPt dB) + σ Pt dt (6.135)
∂t ∂Pt 2 ∂Pt2
1 ∂2G 2 2
 
∂G ∂G ∂G
= + µPt + 2 σ Pt dt + σPt dBt .
∂t ∂Pt 2 ∂Pt ∂Pt
CHAPTER 6. OPTIMIZING ALLOCATIONS 215

Also, from (6.133) and (6.132) we obtain:

 
dPt
dSt = St rdt + St wt − rdt
Pt
 
∂G dPt
= St rdt + Pt − rdt (6.136)
∂Pt Pt
∂G
= St rdt + (µPt dt + σPt dBt − Pt rdt) .
∂Pt
Therefore:

1 ∂2G 2 2
 
∂G ∂G ∂G
d(Gt − St ) = + µPt + σ Pt dt + σPt dBt
∂t ∂Pt 2 ∂Pt2 ∂Pt
∂G
− St rdt − (µPt dt + σPt dBt − Pt rdt) (6.137)
∂Pt
∂G 1 ∂ 2 G 2 2
 
∂G
= + σ P t − S t r + P t r dt .
∂t 2 ∂Pt2 ∂Pt

Using (6.129) we finally obtain:

d(Gt − St )
= rdt , (6.138)
(Gt − St )

Which means:

(Gτ − Sτ ) = (G0 − S0 )erτ . (6.139)

Since from (6.131) we have G0 − S0 = 0, it follows that (6.134) holds true. 

E 266 – Option based portfolio insurance II (see E 265)


Consider the same setup than in E 265. Assume that the payoff (6.128) is that of a call option with strike
K:

s(p) ≡ max(0, p − K) . (6.140)

In this context the partial differential align (6.129) was solved in Black and Scholes (1973):

G(t, p) = pΦ(d1 ) − e−r(τ −t) KΦ(d2 ) , (6.141)

where Φ is the cdf for the standard normal distribution and:

σ2
 
1 p
d1 (t, p) ≡ √ ln( ) + (r + )(τ − t)
σ τ −t K 2 (6.142)

d2 (t, p) ≡ d1 (t, p) − σ τ − t .
From the explicit analytical expression (6.141) we can derive the expression for the weight (6.132) of the
risky asset:

Pt
wt = Φ(d1 (t, Pt )) . (6.143)
St
Write a MATLAB R
script in which you:
• Generate the deterministic exponential growth dynamics (6.100) at equally spaced time intervals τ ;
• Generate a large number of Monte Carlo paths from the geometric Brownian motion (6.101) at
equally spaced time intervals [0, δt, 2δt, . . . , τ ];
• Plot one path for the value of the risky asset {Pt }t=0,δt,...,τ , and overlay the respective path
{St }t=0,δt,...,τ for the value of the option replication strategy (6.143);
• Plot the evolution of the portfolio weight of the risky asset {wt }t=0,δt,...,τ on that path;
• Scatter-plot the final payoff of the option replication strategy (6.143) over the payoff of the risky
asset, and verify that it matches the option payoff.
Solution of E 266
See the MATLAB R
script S_OptionReplication. 
Chapter 7

Estimating the distribution of the


market invariants

E 267 – Mahalanobis square distance of normal random variables (www.7.1) *


Show that when X ∼ N(µ, Σ), we have:

n p o
qN
P X ∈ Eµ,Σ = p. (7.1)

p
where qN is the square root of the quantile of the chi-square distribution with N degrees of freedom
relative to a confidence level p:

q
p
qN ≡ Qχ2N (p) . (7.2)

Solution of E 267
Consider the spectral decomposition (3.149, AM 2005) of the covariance matrix:

Σ ≡ EΛE0 , (7.3)

where Λ is the diagonal matrix of the respective eigenvalues sorted in decreasing order:

Λ ≡ diag(λ1 , . . . , λN ) . (7.4)

and the matrix E is the juxtaposition of the eigenvectors, which represents a rotation:

E ≡ (E(1) , . . . , E(N ) ) . (7.5)

Now consider the new random variable:

1
Y ≡ Λ− 2 E0 (X − µ) . (7.6)

217
From (2.163, AM 2005) we obtain:

Y ∼ N(0, I) . (7.7)
Therefore from (1.106, AM 2005) and (1.109, AM 2005) it follows:

N
X
Yn2 ∼ χ2N . (7.8)
n=1

On the other hand:

N
X
Yn2 = Y0 Y
n=1
h 1
i0 h 1
i
= Λ− 2 E0 (X − µ) Λ− 2 E0 (X − µ) (7.9)

= (X − µ)0 EΛ−1 E0 (X − µ)
= (X − µ)0 Σ−1 (X − µ) .
Therefore for the Mahalanobis distance (2.61, AM 2005) of the variable X from the point µ through the
metric Σ we obtain:

Ma2 (X, µ, Σ) ≡ (X − µ)0 Σ−1 (X − µ) ∼ χ2N , (7.10)


From the definition (1.7, AM 2005) of cdf:

Fχ2N (q) ≡ P Ma2 (X, µ, Σ) ≤ q



(7.11)
= P (X − µ)0 Σ−1 (X − µ) ≤ q .


By applying the quantile function (1.17, AM 2005) to both sides of the above equality we obtain:

p 2
p = P (X − µ)0 Σ−1 (X − µ) ≤ (qN

) , (7.12)
p
where qN is the square root of the quantile of the chi-square distribution with N degrees of freedom
relative to a confidence level p:
q
p
qN ≡ Qχ2N (p) . (7.13)

Therefore, from the definition of the ellipsoid:

q
≡ X such that (X − µ)0 Σ−1 (X − µ) ≤ q 2 ,

Eµ,Σ (7.14)
we obtain:
n p o
qN
P X ∈ Eµ,Σ = p. (7.15)


CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 219

E 268 – Normal-inverse-Wishart location-dispersion: posterior distribution (www.7.2) **

Show (7.32, AM 2005)-(7.33, AM 2005), i.e. that the posterior is, like the prior, a normal-inverse-Wishart
(NIW) distribution.
Solution of E 268
First of all, a comment on the notation to follow: we will denote here γ1 , γ2 , . . . simple normalization
constants. By the NIW (normal-inverse-Wishart) assumption (7.20, AM 2005)-(7.21, AM 2005) on the
prior:

Ω ≡ Σ−1 ∼ W(ν0 , (ν0 Σ0 )−1 ) , (7.16)

and:

µ|Ω ∼ N(µ0 , (T0 Ω)−1 ) . (7.17)

Thus from (2.156, AM 2005) and (2.224, AM 2005) the joint prior pdf of µ and Ω is:

fpr (µ, Ω) = fpr (µ|Ω)fpr (Ω)


1 1 0 ν0 ν0 −N −1 1
(7.18)
= γ1 |Ω| 2 e− 2 (µ−µ0 ) (T0 Ω)(µ−µ0 ) |Σ0 | 2
|Ω| 2
e− 2 tr(ν0 Σ0 Ω) .
As for the pdf of current information (7.13, AM 2005), from (4.102, AM 2005) the sample mean is
normally distributed:

b ∼ N(µ, [T Ω]−1 ) ,
µ (7.19)

and from (4.103, AM 2005) the distribution of the sample covariance is:

b ∼ W(T − 1, Σ) ,
TΣ (7.20)

and these variables are independent. Therefore from (2.156, AM 2005) and (2.224, AM 2005) the pdf
of current information from time series f (iT |µ, Ω) as summarized by iT ≡ (b
µ, T Σ)
b conditioned on
knowledge of the parameters (µ, Ω) reads:

1 1 0 T −1
T −N2 −2 1
f (iT |µ, Ω) = γ2 |Ω| 2 e− 2 (µ−µ) (T Ω)(µ−µ)
|Ω| Σ e− 2 tr(T ΩΣ) . (7.21)
b b 2
b b

Thus, after trivial regrouping and simplifications, the joint pdf of current information and the parameters
reads:

f (iT , µ, Ω) = f (iT |µ, Ω)fpr (µ, Ω)


0
T −N2 −2 ν0 T +ν0 −N
b 0 (T Ω)(µ−µ)
= γ3 e− 2 {(µ−µ0 ) (T0 Ω)(µ−µ0 )+(µ−µ) b } b
1 1
Σ |Σ0 | 2 |Ω| 2 e− 2 tr(T ΣΩ+ν0 Σ0 Ω) .
b

(7.22)
After expanding and rearranging, the terms in the curly brackets in the second row can be re-written as
follows:
{· · · } = (µ − µ1 )0 T1 Ω(µ − µ1 ) + tr(ΦΩ) , (7.23)
where:

T1 ≡ T0 + T (7.24)
T0 µ0 + T µ
µ1 ≡
b
(7.25)
T0 + T
T T0
Φ≡ µ − µ0 )0 .
µ − µ0 )(b
(b (7.26)
T0 + T
Therefore, defining:


b + ν0 Σ0 + Φ
Σ1 ≡ , (7.27)
ν1
where ν1 is a number yet to be defined, we can re-write the joint pdf (7.22) as follows:

1 0
T −N2 −2 ν0 T +ν0 −N 1
f (iT , µ, Ω) = γ3 e− 2 (µ−µ1 ) T1 Ω(µ−µ1 ) Σ |Σ0 | 2 |Ω| 2 e− 2 tr(ν1 Σ1 Ω) . (7.28)
b

At this point we can perform the integration over (µ, Ω) to find the marginal pdf f (iT ):

Z
f (iT ) = f (iT , µ, Ω)dµdΩ
Z Z 
1
− 21 (µ−µ1 )0 T1 Ω(µ−µ1 )
= γ4 γ5 |Ω| e
2

T −N2 −2 (7.29)
ν0 T +ν0 −N −1 1
Σ |Σ0 | 2 |Ω| 2
e− 2 tr(ν1 Σ1 Ω) dΩ
b
Z T −N −2 ν0 T +ν0 −N −1
b 2 1
= γ4 Σ |Σ0 | 2 |Ω| 2
e− 2 tr(ν1 Σ1 Ω) dΩ ,

where we have used the fact that the term in curly brackets is the integral of a normal pdf (2.156, AM
2005) over the entire space and thus sum to one. Defining now:

ν1 ≡ T + ν0 , (7.30)
we write (7.29) as follows:

T −N2 −2 ν0 ν
Z
ν1 ν1 −N −1

− 21 − 21 tr(ν1 Σ1 Ω)
f (iT ) = γ6 Σ |Σ0 | |Σ1 |
2
γ7 |Σ1 | |Ω|
2 2
e dΩ
b

T −N2 −2 (7.31)
ν0 ν
− 1
= γ6 Σ |Σ0 | 2 |Σ1 | 2 ,
b

where we have used the fact that the term in curly brackets is the integral of a Wishart pdf (2.224, AM
2005) over the entire space and thus sum to one. Finally, we obtain the posterior pdf (7.15, AM 2005) by
dividing the joint pdf (7.28) by the marginal pdf (7.31):
CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 221

f (iT , µ, Ω)
fpo (µ, Ω) ≡
f (iT ) (7.32)
1 ν1 ν1 −N −1
− 12 (µ−µ1 )0 T1 Ω(µ−µ1 ) − 12 tr(ν1 Σ1 Ω)
= γ7 |Ω| e
2
|Σ1 | 2
|Ω| 2
e .

From (2.156, AM 2005) and (2.224, AM 2005) we see that this means:

−1
µ|Ω ∼ N(µ1 , [T1 Ω] ), (7.33)

and:

Ω ∼ W(ν1 , (ν1 Σ1 )−1 ) . (7.34)

In other words:

 
Σ
µ|Σ ∼ N µ1 , , (7.35)
T1
and:

Σ−1
 
−1
Σ ∼ W ν1 , 1 . (7.36)
ν1


E 269 – Normal-inverse-Wishart location-dispersion: mode (www.7.3) *


Compute the mode (7.6, AM 2005) of the posterior distribution of θ in (7.46, AM 2005).
Solution of E 269
First of all, a comment on the notation to follow: we will denote here γ1 , γ2 , . . . simple normalization
constants. We consider the notation for the NIW (normal-inverse-Wishart) assumptions (7.32, AM 2005)-
(7.33, AM 2005) on the posterior, although of course the solution applies verbatim to the prior, or any
NIW distribution. Thus assume:

Σ−1 ≡ Ω ∼ W(ν1 , (ν1 Σ1 )−1 ) . (7.37)

and:

−1
µ|Ω ∼ N(µ1 , [T1 Ω] ). (7.38)

The parameter in this context are:

0
θ ≡ (µ0 , vech [Ω] )0 . (7.39)

From (2.156, AM 2005) and (2.144, AM 2005) the joint NIW (normal-inverse-Wishart) pdf of µ and Ω
reads:
ν1 −N T1
1
(µ−µ1 )0 Ω(µ−µ1 )
f (θ) = f (µ|Ω)f (Ω) = γ1 |Ω| 2
e− 2 tr(ν1 Σ1 Ω) e− 2 . (7.40)

To determine the mode of this distribution:

 h i0 0
e≡
θ e 0 , vech Ω
µ e , (7.41)

we impose the first-order conditions on the logarithm of the joint pdf (7.40):

ν1 − N 1
ln f ≡ γ2 + ln |Ω| − tr {ν1 Σ1 Ω + T1 (µ − µ1 )(µ − µ1 )0 Ω} . (7.42)
2 2
Computing the first variation and using (A.124, AM 2005) we obtain:

1 
tr (−(ν1 − N )Ω−1 + ν1 Σ1 + T1 (µ − µ1 )(µ − µ1 )0 )dΩ

d ln f ≡ −
2 (7.43)
− tr {T1 (µ − µ1 )0 Ωdµ} .

Therefore:

d ln f ≡ tr {GΩ dΩ} + tr {Gµ dµ} , (7.44)

where:

1
(ν1 − N )Ω−1 − ν1 Σ1 − T1 (µ − µ1 )(µ − µ1 )0

GΩ ≡ (7.45)
2
Gµ ≡ −T1 (µ − µ1 )0 Ω . (7.46)

Using (A.120, AM 2005) and the duplication matrix (A.113, AM 2005) to get rid of the redundancies of
dΩ in (7.44) we obtain:

0 0
d ln f = vec [G0Ω ] DN vech [dΩ] + vec G0µ vec [dµ] .

(7.47)

Therefore from (A.116, AM 2005) and (A.118, AM 2005) we obtain:

∂ ln f
= vec G0µ = −T1 Ω(µ − µ1 ) .
 
(7.48)
∂µ
Similarly, from (A.116, AM 2005) and (A.118, AM 2005) we obtain:

∂ ln f
= D0N vec [G0Ω ]
∂ vech [Ω]
(7.49)
1
= D0N vec (ν1 − N )Ω−1 − ν1 Σ1 − T1 (µ − µ1 )(µ − µ1 )0 .
 
2
CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 223

Applying the first-order conditions to (7.48) and (7.49) we obtain the mode of the location parameter:

e ≡ µ1 ,
µ (7.50)

and the mode of the dispersion parameter:

e −1 = ν1
Ω Σ1 . (7.51)
ν1 − N

E 270 – Normal-inverse-Wishart location-dispersion: modal dispersion (www.7.3)
(see E 269) *
Consider the same setup than in E 269. Compute the modal dispersion (7.8, AM 2005) of the posterior
distribution of θ in (7.46, AM 2005).
Solution of E 270
To compute the modal dispersion we differentiate (7.43). Using (A.126, AM 2005) the second differential
reads:

1 
tr ((ν1 − N )Ω−1 (dΩ)Ω−1 + 2T1 dµ(µ − µ1 )0 )dΩ

d(d ln f ) = −
2
− tr {T1 dµ0 Ωdµ} − tr {T1 (µ − µ1 )0 dΩdµ}
(7.52)
ν1 − N  −1
tr Ω (dΩ)Ω−1 dΩ

= −
2
− T1 dµ0 Ωdµ − 2T1 tr {(µ − µ1 )0 dΩdµ} .

The first term can be expressed using (A.107, AM 2005), (A.106, AM 2005) the duplication matrix
(A.113, AM 2005) to get rid of the redundancies of dΩ as follows:

0
tr Ω−1 (dΩ)Ω−1 dΩ = vec [dΩ] vec Ω−1 (dΩ)Ω−1
  

= vec [dΩ] (Ω−1 ⊗ Ω−1 ) vec [dΩ]


(7.53)
= vec [dΩ] (Ω−1 ⊗ Ω−1 ) vec [dΩ]
= vech [dΩ] D0N (Ω−1 ⊗ Ω−1 )DN vech [dΩ] .

We are interested in the Hessian evaluated in the mode, where (7.50) holds and thus the last term in (7.52)
cancels:

(ν1 − N )  −1
e −1 DN vech [dΩ]

d(d ln f )|µ,
e Ωe = − vech [dΩ] D0N Ω
e ⊗Ω
2 (7.54)
− T1 dµ0 Ωdµ
e .

Therefore from (A.117, AM 2005) and (A.121, AM 2005) and substituting back (7.51) we obtain:
∂ 2 ln f

ν1 − N −1
0
= −T1 Σ1 (7.55)
∂µ∂µ µ,
e Ω
e ν1
∂ 2 ln f


0
= 0(N (N +1)/2)2 ×N 2 (7.56)
∂ vech [Ω] ∂µ µ, e Ω
e

∂ 2 ln f 1 ν12

D0 (Σ1 ⊗ Σ1 )DN .

= − (7.57)
∂ vech(Ω)∂ vech(Ω)0 µ, e Ω
e 2 ν1 − N N

Finally the modal dispersion reads:

!−1
∂ 2 ln f
MDis {θ} ≡ − 0

∂(µ, vech(Ω))∂(µ, vech(Ω)) µ, e Ω

e
 (7.58)
Sµ 0N 2 ×(N (N +1)/2)2
= ,
0(N (N +1)/2)2 ×N 2 SΣ

where:

1 ν1
Sµ ≡ Σ1 (7.59)
T1 ν1 − N
2 ν1 − N −1
SΣ ≡ [D0N (Σ1 ⊗ Σ1 )DN ] . (7.60)
ν1 ν1


E 271 – Inverse-Wishart dispersion: mode (www.7.4) *


Prove the expression (7.38, AM 2005) for the mode of Σ.
Solution of E 271
First of all, a comment on the notation to follow: we will denote here γ1 , γ2 , . . . simple normalization
constants. We consider the notation for the IW (inverse-Wishart) assumptions (7.33, AM 2005) on the
posterior, although of course the solution applies verbatim to the prior, or any IW distribution. Thus
assume

Σ ∼ IW(ν1 , ν1 Σ1 ) . (7.61)

From (2.233, AM 2005) the pdf of Σ reads:

1 ν1 ν +N +1
− 1 2 1 −1
f (Σ) = |ν1 Σ1 | 2 |Σ| e− 2 tr(ν1 Σ1 Σ ) . (7.62)
κ
To determine the mode of this distribution we impose the first-order conditions on the logarithm of the
joint pdf (7.62).

ν1 + N + 1 1 
ln |Σ| − tr ν1 Σ1 Σ−1 .

ln f ≡ γ2 − (7.63)
2 2
Computing the first variation and using (A.124, AM 2005) and (A.126, AM 2005):
CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 225

ν1 + N + 1
d ln f = − tr(Σ−1 dΣ)
2
1 
+ tr ν1 Σ1 Σ−1 (dΣ)Σ−1

(7.64)
2
 
1 −1 −1 −1
= tr (ν1 Σ Σ1 Σ − (ν1 + N + 1)Σ )dΣ
2
where:

1
ν1 Σ−1 Σ1 Σ−1 − (ν1 + N + 1)Σ−1 .

G≡ (7.65)
2
Using (A.120, AM 2005) and the duplication matrix (A.113, AM 2005) to get rid of the redundancies of
dΣ we obtain:

0
d ln f = vec [G0 ] DN vech [dΣ] . (7.66)

Therefore from (A.116, AM 2005) and (A.118, AM 2005) we obtain:

∂ ln f 1
= D0N vec [G0 ] = D0N vec ν1 Σ−1 Σ1 Σ−1 − (ν1 + N + 1)Σ−1 .
 
(7.67)
∂ vech [Σ] 2
Applying the first-order conditions to (7.67) we obtain the mode:

ν1
vech [ModiT ,eC ] = vech [Σ1 ] . (7.68)
ν1 + N + 1


E 272 – Inverse-Wishart dispersion: modal dispersion (www.7.4) (see E 271) *


Consider the same setup than in E 271. Prove the expression (7.39, AM 2005) for the modal dispersion
of vech[Σ].
Solution of E 272
To compute the modal dispersion we differentiate (7.64). Using (A.126, AM 2005) we obtain:

1
d(d ln f ) = − tr(ν1 Σ−1 (dΣ)Σ−1 Σ1 Σ−1 dΣ)
2
1
− tr(ν1 Σ−1 Σ1 Σ−1 (dΣ)Σ−1 dΣ)
2
1 (7.69)
+ tr((ν1 + N + 1)Σ−1 (dΣ)Σ−1 dΣ)
2
= − ν1 tr((dΣ)Σ−1 (dΣ)Σ−1 Σ1 Σ−1 )
ν1 + N + 1
+ tr((dΣ)Σ−1 (dΣ)Σ−1 ) .
2
Using (A.107, AM 2005) and (A.106, AM 2005) and the duplication matrix (A.113, AM 2005) to get rid
of the redundancies of dΣ we can write:
a ≡ tr((dΣ)Σ−1 (dΣ)Σ−1 )
0
= vec [dΣ] vec Σ−1 (dΣ)Σ−1
 
0 (7.70)
= vec [dΣ] (Σ−1 ⊗ Σ−1 ) vec [dΣ]
0
= vech [dΣ] D0N (Σ−1 ⊗ Σ−1 )DN vech [dΣ] .

Similarly, using (A.107, AM 2005) and (A.106, AM 2005) and the duplication matrix (A.113, AM 2005)
to get rid of the redundancies of dΣ we can write:

b ≡ tr((dΣ)Σ−1 (dΣ)Σ−1 Σ1 Σ−1 )


0
= vec [dΣ] vec Σ−1 (dΣ)Σ−1 Σ1 Σ−1
 
0 (7.71)
= vec [dΣ] ((Σ−1 Σ1 Σ−1 ) ⊗ Σ−1 ) vec [dΣ]
0
= vech [dΣ] D0N ((Σ−1 Σ1 Σ−1 ) ⊗ Σ−1 )DN vech [dΣ] .

Therefore, substituting (7.70) and (7.71) in (7.69) we obtain:

ν1 + N + 1 0
d(d ln f ) = −ν1 b + a = vech [dΣ] H vech [dΣ] , (7.72)
2
where:

ν1 + N + 1 0
H ≡ −ν1 D0N ((Σ−1 Σ1 Σ−1 ) ⊗ Σ−1 )DN + DN (Σ−1 ⊗ Σ−1 )DN . (7.73)
2
We are interested in the Hessian evaluated in the mode, where (7.68) holds, i.e. in the point

ν1
Σ≡ Σ1 . (7.74)
ν1 + N + 1
In this point:

0
d(d ln f )|Mod = vech [dΣ] H|Mod vech [dΣ] , (7.75)

where:

 3
ν1 + N + 1
H|Mod ≡ − ν1 D0N (Σ−1 −1
1 ⊗ Σ1 )DN
ν1
 2
ν1 + N + 1 ν1 + N + 1
+ D0N (Σ−1 −1
1 ⊗ Σ1 )DN
(7.76)
2 ν1
1 (ν1 + N + 1)3 0
= − DN (Σ−1 −1
1 ⊗ Σ1 )DN .
2 ν12

Therefore:
CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 227

∂ 2 ln f [Σ] 1 (ν1 + N + 1)3 0



DN (Σ−1 −1

0
= − 1 ⊗ Σ1 )DN . (7.77)
∂ vech [Σ] ∂ vech [Σ] Mod 2 ν12
From the definition of modal dispersion (2.65, AM 2005):

−1
∂ 2 ln f [Σ]


MDis ≡ − 0

∂ vech [Σ] ∂ vech [Σ] Mod
(7.78)
2ν12
= (D0 (Σ−1 ⊗ Σ−1
1 )DN )
−1
.
(ν1 + N + 1)3 N 1

E 273 – Normal-inverse-Wishart location-dispersion: marginal distribution of lo-
cation (www.7.5) **
Show (7.22, AM 2005), i.e. that the unconditional (marginal) prior on µ is a multivariate Student t
distribution.
Solution of E 273
First of all, a comment on the notation to follow: we will denote here γ1 , γ2 , . . . simple normalization
constants. We consider the notation for the NIW normal-inverse-Wishart) assumptions (7.20, AM 2005)-
(7.21, AM 2005) on the prior, although of course the solution applies verbatim to the posterior, or any
NIW distribution. Thus we assume:

Ω ≡ Σ−1 ∼ W(ν0 , (ν0 Σ0 )−1 ) , (7.79)


and:

µ|Ω ∼ N(µ0 , (T0 Ω)−1 ) , (7.80)


From (2.156, AM 2005) and (2.224, AM 2005) the joint prior pdf of µ and Ω is:

f (µ, Ω) = f (µ|Ω)f (Ω)


1 1 0 ν0 ν0 −N −1 1
(7.81)
= γ1 |Ω| 2 e− 2 (µ−µ0 ) (T0 Ω)(µ−µ0 ) |Σ0 | 2
|Ω| 2
e− 2 tr(ν0 Σ0 Ω) .
To determine the unconditional pdf of µ we have to compute the marginal in (1.101, AM 2005). Defining:

Σ2 ≡ ν0 Σ0 + T0 (µ − µ0 )(µ − µ0 )0 , (7.82)
we obtain:
Z
f (µ) ≡ f (µ, Ω)dΩ
Z ν0 ν0 −N 1
= γ1 |Σ0 | 2
|Ω| 2
e− 2 tr(Σ2 Ω) dΩ
Z  (7.83)
ν0 ν0 +1 ν0 +1 ν0 −N
− 1
= γ2 |Σ0 | 2
|Σ2 | 2
γ3 |Σ2 | 2 |Ω| 2 e− 2 tr(Σ2 Ω) dΩ
ν0 ν0 +1

= γ2 |Σ0 | 2
|Σ2 | 2
,
where we have used the fact that the term in curly brackets is the integrals of the Wishart pdf (2.224, AM
2005) over the entire space and thus it sums to one. Thus substituting again (7.82) we obtain that the
marginal pdf (7.83) reads:

ν0 ν0 +1

f (µ) = γ2 |Σ0 | 2
|ν0 Σ0 + T0 (µ − µ0 )(µ − µ0 )0 | 2
. (7.84)
From (A.91, AM 2005) we obtain the following identity:

ν0

ν0 +1 ν0 − ν02+1
|Σ + vv0 | |Σ| I + Σ−1 vv0

|Σ| 2 2
= |Σ| 2

1 − ν0 +1 (7.85)
= |Σ| 2 I + Σ−1 vv0 2
ν +1
− 12 − 02
= |Σ| (1 + v0 Σ−1 v) .
Applying this result to:

p
v ≡ (µ − µ0 ) T0 (7.86)
Σ ≡ ν0 Σ0 , (7.87)
we reduce (7.84) to the following expression:

1 − ν02+1
Σ0 − 2

1 + 1 (µ − µ0 )0 ( Σ0 )−1 (µ − µ0 )

f (µ) = γ4
. (7.88)
T0 ν0 T0

By comparison with (2.188, AM 2005) we see that this is a multivariate Student t distribution with the
following parameters:

 
Σ0
µ ∼ St ν0 , µ0 , . (7.89)
T0

E 274 – Normal-inverse-Wishart factor loadings-dispersion: posterior distribution
(www.7.6) **
Show (7.71, AM 2005)-(7.72, AM 2005), i.e. that the posterior distribution of B and Σ is, like the prior,
a normal-inverse-Wishart (NIW) distribution.
Solution of E 274
First of all, a comment on the notation to follow: we will denote here γ1 , γ2 , . . . simple normalization
constants. By the NIW (normal-inverse-Wishart) assumptions (7.58, AM 2005)-(7.59, AM 2005) on the
prior we have:

Ω ≡ Σ−1 ∼ W(ν0 , (ν0 Σ0 )−1 ) , (7.90)


and:

 
Σ
B|Σ ∼ N B0 , , Σ−1 , (7.91)
T0 F,0
CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 229

or, in terms of Ω ≡ Σ−1 :

 
B|Ω ∼ N B0 , (T0 Ω)−1 , Σ−1
F,0 . (7.92)

Thus from (2.182, AM 2005) and (2.224, AM 2005) the joint prior pdf of B and Ω is:

fpr (B, Ω) = fpr (B|Ω)fpr (Ω)


K N 0 ν0 ν0 −N −1
= γ1 |Ω| 2 |ΣF,0 | 2 e− 2 tr{(T0 Ω)(B−B0 )ΣF,0 (B−B0 ) } |Σ0 |
1 1
2
|Ω| 2
e− 2 tr(ν0 Σ0 Ω) .
(7.93)

The current information conditioned on the parameters B and Ω is summarized by the OLS factor load-
ings and sample covariance:

n o
iT ≡ B,
b Σ
b . (7.94)

In (4.129, AM 2005) we show that B


b is distributed as follows:

 
Σ b −1
B ∼ N B, , ΣF
b , (7.95)
T

and in (4.130, AM 2005) we show that T Σ


b is distributed as follows:

b ∼ W(T − K, Σ) .
TΣ (7.96)

Furthermore, we show that B


b and T Σ
b are independent. Therefore, from (2.182, AM 2005) and (2.224,
AM 2005) we have:

f (iT |B, Ω) = f (B|B,


b Ω)f (T Σ|B,b Ω)
N T −K−N −1
K
= γ2 |T Ω| 2 Σb F 2 e− 12 tr{(T Ω)(B−B)
b Σ
b F (B−B)
b 0
} |Ω| T −K
2
T Σ
b 2 1
e− 2 tr(ΩT Σ) .
b

(7.97)

Thus, after trivial regrouping and simplifications, the joint pdf of current information and the parameters
reads:

f (iT , B, Ω) = f (iT |B, Ω)fpr (B, Ω)


N2 T −K−N2
−1
N ν0 T +K+ν0 −N −1
= γ3 Σ F Σ |ΣF,0 | 2 |Σ0 | 2 |Ω| 2
b b
(7.98)
0 0
× e− 2 tr{Ω(B−B0 )T0 ΣF,0 (B−B0 ) +Ω(B−B)T ΣF (B−B) }
1 b b b

1
× e− 2 tr(Ω(T Σ+ν0 Σ0 )) .
b

We show below that the terms in curly brackets in (7.98) can be re-written as follows:
{· · · } = T1 Ω(B − B1 )ΣF,1 (B − B1 )0 + ΩΦ , (7.99)
where:

T1 ≡ T0 + T (7.100)
T0 ΣF,0 + T Σ
bF
ΣF,1 ≡ (7.101)
T1
B1 ≡ (B0 T0 ΣF,0 + BT
b Σ b F )−1
b F )(T0 ΣF,0 + T Σ (7.102)
and:

Φ ≡ B0 T0 ΣF,0 B00 + BT
b ΣbFBb0
(7.103)
− (B0 T0 ΣF,0 + BTb Σ b F )−1 (T0 ΣF,0 B0 + T Σ
b F )(T0 ΣF,0 + T Σ b 0) .
bFB
0

Indeed, defining D ≡ T0 ΣF,0 and C ≡ T Σ


b F we can write the expression in curly brackets (7.99) as
ΩA, where:

a ≡ (B − B0 )D(B − B0 )0 + (B − B)C(B
b b 0
− B)
= BDB0 + B0 DB0 − 2BDB0 + BCB0 + BC
0 0
b B b 0 − 2BCB
b0
0
= B(D + C)B + B0 DB00 − 2BDB00 + BC
b Bb 0 − 2BCB
b0
= B(D + C)B + B1 (D + C)B01 − 2B(D + C)B01
0

+ B0 DB0 − 2BDB0 + BC
b Bb 0 − 2BCB
b0 (7.104)
0 0
− B1 (D + C)B01 + 2B(D + C)B01
= (B − B1 )(D + C)(B − B1 )0
+ B0 DB00 + BC
b Bb 0 − 2BDB0 − 2BCB
0
b0
− B1 (D + C)B01 + 2B(D + C)B01 ,
defining:

B1 ≡ (B0 D + BC)(D
b + C)−1 , (7.105)
the above simplifies to:

a = (B − B1 )(D + C)(B − B1 )0
(7.106)
+ B0 DB0 + BC
0
b Bb 0 − (B0 D + BC)(D
b + C)−1 (B0 D + BC)
b 0,

which proves the result. Substituting (7.99) in (7.98) and defining:

ν1 ≡ T + ν0 (7.107)
TΣb + ν0 Σ0 + Φ
Σ1 ≡ , (7.108)
ν1
CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 231

we obtain:

f (iT , B, Ω) = f (iT |B, Ω)fpr (B, Ω)


N2 T −K−N2
−1
N ν0 T +K+ν0 −N −1
= γ3 Σ F Σ |ΣF,0 | 2 |Σ0 | 2 |Ω| 2 (7.109)
b b
0
× e− 2 tr{T1 Ω(B−B1 )ΣF,1 (B−B1 ) } e− 2 tr(Ων1 Σ1 ) .
1 1

At this point we can perform the integration over (B, Ω) to determine the marginal pdf f (iT ):

Z
f (iT ) = f (iT , B, Ω)dBdΩ
Z Z 
K N 0
γ5 |Ω| 2 |ΣF,1 | 2 e− 2 tr{T1 Ω(B−B1 )ΣF,1 (B−B1 ) } dB
1
= γ4
N2 T −K−N −1
2 −N N
× Σ Σ |ΣF,1 | 2 |ΣF,0 | 2
b b
F (7.110)
ν0 ν1 −N −1
− 21 tr(Ων 1 Σ1 )
× |Σ0 | |Ω| 2
e 2
dΩ
Z N T −K−N −1
b 2 b 2 −N N
= γ4 Σ F Σ |ΣF,1 | 2 |ΣF,0 | 2
ν0 ν1 −N −1 1
× |Σ0 | 2
|Ω| 2
e− 2 tr(Ων 1 Σ1 ) dΩ ,

where we used the fact that the expression in curly brackets is the integral of the pdf of a matrix-valued
normal distribution (2.182, AM 2005) over the entire space and thus sums to one. Thus we can write
(7.110) as follows:

Z 
ν1 ν1 −N −1 1
f (iT ) = γ5 γ6 |Σ1 | 2
|Ω| 2
e− 2 tr(ν1 Σ1 Ω) dΩ
N2 T −K−N −1
ν0 ν
2 −N N
− 1 (7.111)
× Σ Σ |ΣF,1 | 2 |ΣF,0 | 2 |Σ0 | 2 |Σ1 | 2
b b
F
N2 T −K−N −1
ν0 ν
2 −N N
− 1
= γ5 Σ Σ |ΣF,1 | 2 |ΣF,0 | 2 |Σ0 | 2 |Σ1 | 2 ,
b b
F

where we used the fact that the term in curly brackets is the integral of the pdf of a Wishart distribution
(2.224, AM 2005) over the entire space and thus sums to one. Finally, we obtain the posterior pdf (7.15,
AM 2005) by dividing the joint pdf by the marginal pdf:

f (iT , B, Ω)
fpo (B, Ω) ≡
f (iT )
N ν1 K+ν1 −N −1
= γ7 |ΣF,1 | 2 |Σ1 | 2
|Ω| 2

0 (7.112)
× e− 2 tr{T1 Ω(B−B1 )ΣF,1 (B−B1 ) } e− 2 tr(Ων1 Σ1 )
1 1

K N 0
= γ8 |Ω| 2 |ΣF,1 | 2 e− 2 tr{T1 Ω(B−B1 )ΣF,1 (B−B1 ) }
1

ν1 ν1 −N −1 1
× γ9 |Σ1 | 2
|Ω| 2
e− 2 tr(Ων1 Σ1 ) .

From (2.182, AM 2005) and (2.224, AM 2005) this proves that:


 
B|Ω ∼ N B1 , (ΩT1 )−1 , Σ−1
F,1 , (7.113)

and:

Ω ∼ W ν1 , (ν1 Σ1 )−1 .

(7.114)

Recalling that Σ−1 ≡ Ω this means:

Σ−1
 
−1 1
Σ ∼ W ν1 , , (7.115)
ν1

and:

 
Σ
B|Σ ∼ N B1 , , Σ−1 . (7.116)
T1 F,1

E 275 – Normal-inverse-Wishart factor loadings-dispersion: mode (www.7.7) *


Prove the expression (7.81, AM 2005) for the mode (7.6, AM 2005) of the posterior distribution of θ.
Solution of E 275
First of all, a comment on the notation to follow: we will denote here γ1 , γ2 , . . . simple normalization
constants. We consider the notation for the NIW (normal-inverse-Wishart) assumptions (7.71, AM 2005)-
(7.72, AM 2005) on the posterior, although of course the solution applies verbatim to the prior, or any
NIW distribution. The parameter in this context are:

0 0
θ ≡ (vec [B] , vech [Ω] )0 . (7.117)

Assume that B and Σ are joint NIW (normal-inverse-Wishart) distributed, i.e.:

Σ−1 ≡ Ω ∼ W(ν1 , (ν1 Σ1 )−1 ) . (7.118)

and:

B|Ω ∼ N(B1 , (T1 Ω)−1 , Σ−1


F,1 ) . (7.119)

From (2.182, AM 2005) and (2.224, AM 2005) the joint NIW (normal-inverse-Wishart) pdf of B and Ω
reads:

f (B, Ω) = f (B|Ω)f (Ω)


N ν1 ν1 +K−N −1 0 (7.120)
e− 2 tr{Ω[(B−B1 )T1 ΣF,1 (B−B1 ) +ν1 Σ1 ]} .
1
= γ1 |ΣF,1 | 2 |Σ1 | 2
|Ω| 2

To determine the mode of this distribution:


CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 233

 h i0 h i0 0
e≡
θ vec B
e , vech Ω
e , (7.121)

we impose the first-order condition on the logarithm of the joint pdf (7.120):

ν1 + K − N − 1
ln f ≡ γ2 + ln |Ω|
2 (7.122)
1
− tr {[(B − B1 )T1 ΣF,1 (B − B1 )0 + ν1 Σ1 ] Ω} .
2
To compute the first variation we use (A.124, AM 2005) obtaining:

1 
tr (ν1 + K − N − 1)Ω−1 − a dΩ

d ln f ≡
2 (7.123)
− tr {T1 ΣF,1 (B − B1 )0 ΩdB} ,

where:

a ≡ (B − B1 )T1 ΣF,1 (B − B1 )0 + ν1 Σ1 . (7.124)

Therefore:

d ln f ≡ tr {GΩ dΩ} + tr {GB dB} , (7.125)

where:

1
(ν1 + K − N − 1)Ω−1 − a

GΩ ≡ (7.126)
2
GB ≡ −T1 ΣF,1 (B − B1 )0 Ω . (7.127)

Using (A.120, AM 2005) and the duplication matrix (A.113, AM 2005) to get rid of the redundancies of
dΩ in (7.125) we obtain:

0 0
d ln f = vec [G0Ω ] DN vech [dΩ] + vec [G0B ] vec [dB] . (7.128)

Therefore from (A.116, AM 2005) and (A.118, AM 2005) we obtain:

∂ ln f
= vec [G0B ] = −T1 vec [Ω(B − B1 )ΣF,1 ] . (7.129)
∂ vec [B]

Similarly, from (A.116, AM 2005) and (A.118, AM 2005) we obtain:

∂ ln f 1
= D0N vec [G0Ω ] = D0N vec (ν1 + K − N − 1)Ω−1 − a .
 
(7.130)
∂ vech [Ω] 2
Applying the first-order conditions to (7.129) and (7.130) and re-substituting (7.124) we obtain the mode
of the factor loadings:

e ≡ B1 ,
B (7.131)

and the mode of the dispersion parameter:

e −1 = ν1
Ω Σ1 . (7.132)
ν1 + K − N − 1

E 276 – Normal-inverse-Wishart factor loadings-dispersion: modal dispersion (www.7.7)
(see E 275) *
Consider the same setup than in E 275. Prove the expression (7.82, AM 2005) for the modal dispersion
(7.8, AM 2005) of the posterior distribution of θ.
Solution of E 276
To compute the modal dispersion we differentiate (7.123). Using (A.126, AM 2005) the second differen-
tial reads:

1 
tr (ν1 + K − N − 1)Ω−1 (dΩ)Ω−1 + 2T1 dBΣF,1 (B − B1 )0 dΩ

d(d ln f ) = −
2
− tr {T1 ΣF,1 dB0 ΩdB} − tr {T1 ΣF,1 (B − B1 )0 dΩdB}
(7.133)
ν1 + K − N − 1  −1
tr Ω (dΩ)Ω−1 dΩ

= −
2
− T1 tr {ΣF,1 dB0 ΩdB} − 2T1 tr {ΣF,1 (B − B1 )0 dΩdB} .

The first term in (7.133) can be expressed using (A.107, AM 2005), (A.106, AM 2005) the duplication
matrix (A.113, AM 2005) to get rid of the redundancies of dΩ as follows:

0
tr Ω−1 (dΩ)Ω−1 dΩ = vec [dΩ] vec Ω−1 (dΩ)Ω−1
  

= vec [dΩ] (Ω−1 ⊗ Ω−1 ) vec [dΩ]


(7.134)
= vec [dΩ] (Ω−1 ⊗ Ω−1 ) vec [dΩ]
= vech [dΩ] D0N (Ω−1 ⊗ Ω−1 )DN vech [dΩ] .

Similarly, the second term in (7.133) can be expressed using (A.107, AM 2005), (A.106, AM 2005),
(A.108, AM 2005) and (A.109, AM 2005):

tr {ΣF,1 dB0 ΩdB} = tr {dBΣF,1 dB0 Ω}


0
= vec [dB0 ] vec [ΣF,1 dB0 Ω]
(7.135)
= (KKN vec [dB])0 (Ω ⊗ ΣF,1 )(KKN vec [dB])
0
= vec [dB] KN K (Ω ⊗ ΣF,1 )KKN vec [dB] .

Since we are interested in the Hessian evaluated in the mode, where (7.131) holds. Therefore the last
term in (7.133) cancels and we can express the second differential (7.133) as follows:
CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 235

ν1 + K − N − 1  −1
e −1 DN vech [dΩ]

d(d ln f )|B,
e Ωe = − vech [dΩ] D0N Ω
e ⊗Ω
2 (7.136)
0
− T1 vec [dB] KN K (Ω
e ⊗ ΣF,1 )KKN vec [dB] .

Therefore from (A.117, AM 2005) and (A.121, AM 2005) and substituting back (7.132) we obtain:

∂ 2 ln f

ν1 + K − N − 1
KN K (Σ−1


0 = −T1 1 ⊗ ΣF,1 )KKN
∂ vec [B] ∂ vec [B] B,e Ω
e ν1
∂ 2 ln f



0 = 0(N (N +1)/2)2 ×(N K)2 (7.137)
∂ vech [Ω] ∂ vec [B] B, e Ω
e

∂ 2 ln f ν12

1
D0 (Σ1 ⊗ Σ1 )DN .

= −
∂ vech(Ω)∂ vech(Ω)0 B, e Ω
e 2 ν1 + K − N − 1 N

Finally the modal dispersion reads:

−1 
∂ 2 ln f
 
SB 0(N K)2 ×(N (N +1)/2)2
MDis {θ} ≡ − = , (7.138)
∂θ∂θ 0 θe 0(N (N +1)/2)2 ×(N K)2 SΣ

where using (A.109, AM 2005) and (A.101, AM 2005) we have:

1 ν1
SB ≡ KN K (Σ1 ⊗ Σ−1
F,1 )KKN (7.139)
T1 ν1 + K − N − 1
2 ν1 + K − N − 1 0 −1
SΣ ≡ [DN (Σ1 ⊗ Σ1 )DN ] . (7.140)
ν1 ν1

E 277 – Normal-inverse-Wishart factor loadings-dispersion: marginal distribution
of factor loadings (www.7.8) *
Prove the expression (7.60, AM 2005) for the unconditional (marginal) prior on B.
Solution of E 277
First of all, a comment on the notation to follow: we will denote here γ1 , γ2 , . . . simple normalization
constants. We consider the notation for the NIW (normal-inverse-Wishart) assumptions (4.129, AM
2005)-(7.59, AM 2005) on the prior, although of course the solution applies verbatim to the posterior, or
any NIW distribution. Thus we assume:

Ω ≡ Σ−1 ∼ W(ν0 , (ν0 Σ0 )−1 ) , (7.141)

and:

B|Ω ∼ N(B0 , (T0 Ω)−1 , Σ−1


F,0 ) . (7.142)

From (A.182, AM 2005) and (A.224, AM 2005) the joint prior pdf of B and Ω is:
f (B, Ω) = f (B|Ω)f (Ω)
K N 0
= γ1 |Ω| 2 |ΣF,0 | 2 e− 2 tr{(T0 Ω)(B−B0 )ΣF,0 (B−B0 ) }
1

ν0 ν0 −N −1 1
× |Σ0 | 2
|Ω| 2
e− 2 tr(ν0 Σ0 Ω) (7.143)
N ν0 ν0 +K−N −1
= γ1 |ΣF,0 | 2
|Σ0 | 2
|Ω| 2

− 12 tr{Ω((B−B0 )T0 ΣF,0 (B−B0 )0 +ν0 Σ0 )}


×e .
To determine the unconditional pdf of B we have to compute the marginal in (7.143). Defining:

Σ2 ≡ (B − B0 )T0 ΣF,0 (B − B0 )0 + ν0 Σ0 , (7.144)

we obtain:

Z
f (B) ≡ f (B, Ω)dΩ
Z ν0 ν0 +K−N −1
N 1
= γ1 |ΣF,0 | 2 |Σ0 | 2
|Ω| 2
e− 2 tr{ΩΣ2 } dΩ
Z  (7.145)
N ν0 ν0 +K ν0 +K ν0 +K−N −1
− − 12 tr{ΩΣ2 }
= γ2 |ΣF,0 | 2
|Σ0 | 2
|Σ2 | 2
γ3 |Σ2 | 2
|Ω| 2
e dΩ
N ν0 ν0 +K

= γ2 |ΣF,0 | 2 |Σ0 | 2
|Σ2 | 2
,
where we have used the fact that the term in curly brackets is the integrals of the Wishart pdf (2.224, AM
2005) over the entire space and thus it sums to one. Thus substituting again (7.144) we obtain that the
marginal pdf (7.145) reads:

N ν0 ν0 +K

f (B) = γ2 |ΣF,0 | 2 |Σ0 | 2
|ν0 Σ0 + (B − B0 )T0 ΣF,0 (B − B0 )0 | 2
. (7.146)

From (A.91, AM 2005) we obtain the following general identity:

ν0

ν0 +K ν0 − ν0 +K
|Σ + vv0 | |Σ| IN + Σ−1 vv0

|Σ| 2 2
= |Σ| 2 2

−K − ν0 +K
= |Σ| 2 IN + Σ−1 vv0 2 (7.147)
−K − ν0 +K
= |Σ| 2 IK + v0 Σ−1 v 2
.
Applying this result to:

v ≡ (B − B0 )pF,0 (7.148)
Σ ≡ ν0 Σ0 , (7.149)

where pF,0 satisfies:

T0 ΣF,0 ≡ pF,0 p0F,0 , (7.150)


CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 237

we reduce (7.145) to the following expression:

ν0 +K
IN + (ν0 Σ0 )−1 (B − B0 )T0 ΣF,0 (B − B0 )0 − 2 .
N
−K
f (B) = γ4 |ΣF,0 | 2 |ν0 Σ0 | 2
(7.151)

Applying again (A.91, AM 2005) we obtain:

− N2
−K
f (B) = γ4 Σ−1 |ν0 Σ0 | 2

F,0
− ν0 +K
× IK + T0 ΣF,0 (B − B0 )0 (ν0 Σ0 )−1 (B − B0 )
2

− N2 K (7.152)

= γ5 Σ−1
(ν0 + K − N )−1 ν0 Σ0 − 2
F,0
− ν0 +K
−1 2
 
(ν0 + K − N )(ν0 Σ0 )
× IK + T0 ΣF,0 (B − B0 )0 (B − B0 ) .

(ν0 + K − N )

Comparing with (2.199, AM 2005) we see that this is the pdf of a matrix-variate Student t distribution
with the following parameters:

 
ν0
B ∼ St ν0 + K − N, B0 , Σ0 , (T0 ΣF,0 )−1 . (7.153)
ν0 + K − N


E 278 – Allocation-implied parameters (www.7.9) *


Prove the expression (7.99, AM 2005).
Solution of E 278
Consider the constraints:

C1 : α0 pT = wT , (7.154)

and:

C2 : g ≤ Gα ≤ g , (7.155)

where G is a K × N matrix and (g , g) are K-dimensional vectors. From (7.91, AM 2005) we obtain the
allocation function:

 
1 0
α(µ, Σ) ≡ argmax α0 diag(pT )(1 + µ) − α diag(pT )Σ diag(pT )α . (7.156)
α0 pT =wT

g≤Gα≤g

We can solve this problem by means of Lagrange multipliers. We define the Lagrangian:

1 0
L ≡ α0 diag(pT )(1 + µ) − α diag(pT )Σ diag(pT )α
2ζ (7.157)
− λα0 pT − (γ − γ)0 Bα ,
where λ is the multiplier relative to the equality constraint α0 pT = wT and (Λ, Λ) are the multipliers
relative to the additional inequality constraints (7.155) and satisfy the Kuhn-Tucker conditions:

γ, γ ≥ 0 (7.158)
N
X N
X
γ k Gkn g n = γ k Gkn g n = 0, k = 1, . . . , K . (7.159)
n=1 n=1

Therefore, defining:

e ≡ µ − [diag(pT )]−1 G0 (γ − γ) ,
µ (7.160)

we can write the Lagrangian as follows:

1 0
L = α0 diag(pT )(1 + µ
e ) − λα0 − α diag(pT )Σ diag(pT )α . (7.161)

This is the Lagrangian of the optimization (7.156) with the constraints (7.154) but without the constraints
(7.155). Its solution is (6.39, AM 2005). After substituting (7.90, AM 2005) in that expression we obtain
the respective allocation function:

wT − ζ10 Σ−1 µ
 
−1
µ, Σ) 7→ α(e
µ, Σ) ≡ [diag(pT )] Σ−1 ζ µ
e
(e e+ 1 . (7.162)
10 Σ−1 1

This can be inverted, by pinning down specific values Σ for the covariance matrix and solving the ensuing
implicit align:

−1
10 Σ
 
1 µ wT
e− Σ diag(pT )α −
e
µ −1 1 = ζ −1 1 . (7.163)
0
1Σ 1 10 Σ 1
From the inverse function:

α 7→ µ
e (α) , (7.164)

and from (7.160) the implied returns that include the constraints (7.155) read:

−1
µc = µ
e (α) + [diag(pT )] G0 (γ − γ) . (7.165)

E 279 – Likelihood maximization (www.7.9) *


Show that the allocation of example (7.91, AM 2005) with constraint (7.105, AM 2005)-(7.106, AM
2005) give rise to the constraint (7.107, AM 2005).
CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 239

Solution of E 279
In our example (7.91, AM 2005), consider an investor who has no risk propensity, i.e. such that ζ →
0 in his exponential utility function. Then the quadratic term becomes overwhelming in the index of
satisfaction, which becomes independent of the expected returns:

1 0
CEΣ (α) ≈ − α diag(pT )Σ diag(pT ) . (7.166)

Assume there exists a budget constraint:

C1 : α0 pT = wT , (7.167)

And consider the no-short-sale constraint:

C2 : α ≥ 0 . (7.168)

The allocation function α(Σ) follows in terms of the Lagrangian:

α(Σ), λ∗ , Λ∗ = argmin L(α, λ, Λ) , (7.169)


α,λ,Λ

where:

L(α, λ, Λ) ≡ α0 diag(pT )Σ diag(pT )α − λα0 pT − α0 Λ . (7.170)

From the first-order conditions on the Lagrangian we obtain:

α = λ diag(pT )−1 Σ−1 1 + diag(pT )−1 Σ−1 diag(pT )−1 Λ , (7.171)

together with the Kuhn-Tucker conditions:

Λ ≥ 0, λn = 0 ⇐⇒ αn > 0 . (7.172)

Since prices are positive, the allocation is positive if:

Σ−1 1 ≥ 0 , (7.173)

where the inequality is meant entry by entry. 

E 280 – Markov chain Monte Carlo


We recall that according to Bayesian theory, first we must specify a flexible parametric family for the
market, which might include fat tails and skewness, as represented by its pdf:

X|θ ⇔ fX (Xt |θ) . (7.174)


Then as in (7.13, AM 2005) the likelihood of the data:

iT ≡ {X1 , . . . , XT } , (7.175)

reads:

T
Y
l(iT |θ) ≡ fX (Xt |θ) . (7.176)
t=1

Assume a prior for the parameters f0 (θ). Then posterior distribution of the parameters reads:

l(iT |θ)f0 (θ)


π(θ|iT ) ≡ R , (7.177)
l(iT |θ)f0 (θ)dθ

see (7.15, AM 2005). To generate samples from the posterior distribution we use the Metropolis-Hastings
algorithm.
R First we select a one-parameter family of candidate-generating densities q(ξ, θ), which satis-
fies q(ξ, θ)dθ = 1. Then we define the function:

 
l(iT |ξ)f0 (ξ)q(ξ, θ)
α(θ, ξ) ≡ min ,1 . (7.178)
l(iT |θ)f0 (θ)q(θ, ξ)

In particular, if we choose a symmetric function q(ξ, θ) = q(θ, ξ), this function simplifies to:

 
l(iT |ξ)f0 (ξ)
α(θ, ξ) ≡ min ,1 . (7.179)
l(iT |θ)f0 (θ)
A convenient rule of thumb is to pick q to be the multivariate normal density:

q(z, B) ≡ N(B, κ diag(B)) , (7.180)

where κ ≈ 10−2 . Then the algorithm proceeds as follows:


Step 0 Set j ≡ 0 and generate a starting point for the parameters θ (j) ;
Step 1 Generate ξ from q(θ (j) , ·) and u from U([0, 1]);
Step 2 If u ≤ α(θ (j) , ξ) set θ (j+1) ≡ ξ, else set θ (j+1) ≡ θ (j) ;
Step 3 If convergence is achieved go to Step 4, else go to Step 1;
Step 4 Disregard the first samples and return the remaining θ (j) .
Write a MATLAB R
script in which you:
• Use the above algorithm to generate draws from a univariate density;
• Display the draws over time; what can you say?
Hint. See Chib and Greenberg (1995).

Solution of E 280
See the MATLAB R
script S_MarkovChainMonteCarlo 

E 281 – Bayesian: prior on correlation


Assume that the returns Xt ≡ (Xt,1 , Xt,2 , Xt,3 )0 on three stocks are jointly normal:
CHAPTER 7. ESTIMATING THE DISTRIBUTION OF THE MARKET INVARIANTS 241

Xt ∼ N(µ, Σ) , (7.181)

with null expectations and unit standard deviations:


  
0 1 θ12 θ13
µ≡ 0 , Σ ≡  θ12 1 θ23  . (7.182)
0 θ13 θ23 1

In this situation the joint distribution of the returns is fully determined by three parameters:

θ ≡ (θ12 , θ13 , θ23 )0 . (7.183)

These parameters are constrained on a domain:

θ ∈ Θ ⊂ (−1, 1) × (−1, 1) × (−1, 1) . (7.184)

Since Σ is positive definite, the domain Θ must be a proper subset of (−1, 1) × (−1, 1) × (−1, 1). For
instance, Θ ≡ −(0.9, 0.9, 0.9)0 is not a feasible value. Assume an uninformative uniform prior for the
correlations. In other words, assume that θ is uniformly distributed on its domain:

θ ∼ U(Θ) . (7.185)

Write a MATLAB R
script in which you generate 10,000 simulations from (7.185). In three subplots
plot the histograms of θ12 , θ13 and θ23 respectively, showing how the uniform prior implies non-uniform
marginal distributions on each of the correlations.
Hint. Generate a uniform distribution on (−1, 1)3 then discard the simulations such that Σ is not positive
definite.
Solution of E 281
See the MATLAB R
script S_CorrelationPriorUniform. 

E 282 – Bayesian: normal-inverse-Wishart posterior


Write a MATLAB R
function RandNIW that takes as inputs a generic N -dimensional vector µ0 , a generic
positive and symmetric N × N matrix Σ0 , two positive scalars T0 and ν0 and the number of simulations
J and outputs J independent simulations of the normal-inverse-Wishart distribution, as defined in (7.20,
AM 2005)-(7.21, AM 2005). Then, write a MATLAB R
script in which you:
• Upload the database DB_UsSwapRates of daily USD swap rates and compute the daily rate changes
from. Then compute T , µ b and Σ
b (see Chapter 7 for the notation);
• Set ν0 ≡ T0 ≡ 52 and define the prior parameters µ0 and Σ0 arbitrarily. Use the function randNIW
to generate J ≡ 104 scenarios of the prior (7.20, AM 2005)-(7.21, AM 2005);
• Compute the parameters of the posterior distribution and use the function randNIW to generate J ≡
104 scenarios of the posterior;
• Specialize the script to the case N ≡ 1, i.e. only consider the first swap rate change;
• Subplot the histogram of the marginal distribution of the prior of µ and superimpose the profile of
its analytical pdf. Then, subplot the histogram of the marginal distribution of the prior of 1/σ 2 and
superimpose the profile of its analytical pdf;
• Subplot the histogram of the marginal distribution of the posterior of µ and superimpose the profile
of its analytical pdf. Then subplot the histogram of the marginal distribution of the posterior of
1/σ 2 and superimpose the profile of its analytical pdf;
• Check that (7.4, AM 2005) holds by changing the relative weights of ν0 , T0 with respect to T .
Solution of E 282
See the MATLAB R
script S_AnalyzeNormalInverseWishart. 
Chapter 8

Evaluating allocations

E 283 – Optimal allocation as function of invariant parameters (www.8.1)


Prove the expressions (8.33, AM 2005)-(8.34, AM 2005).
Solution of E 283
Replacing the market parameters (8.21, AM 2005) in the certainty-equivalent (8.25, AM 2005) we obtain:

1 0
S = α0 diag(pT )(1 + µ) − α diag(pT )Σ diag(pT )α . (8.1)

Substituting in this expression the optimal allocation (8.32, AM 2005), which we report here:

−1 wT − ζ10 Σ−1 µ −1
α = ζ [diag(pT )] Σ−1 µ + [diag(pT )] Σ−1 1 , (8.2)
10 Σ−1 1
we obtain:

wT − ζ10 Σ−1 µ −1
 
0 −1
S = (1 + µ) ζΣ µ + Σ 1
10 Σ−1 1
wT − ζ10 Σ−1 µ 0 wT − ζ10 Σ−1 µ −1
   
1 0 −1
− ζµ + 1 ζΣ µ + Σ 1 (8.3)
2ζ 10 Σ−1 1 10 Σ−1 1
wT − ζ10 Σ−1 µ
= ζ(1 + µ)0 Σ−1 µ + (1 + µ)0 Σ−1 1 .
10 Σ−1 1
Defining:

A ≡ 10 Σ−1 1 , B ≡ 10 Σ−1 µ , C ≡ µ0 Σ−1 µ , (8.4)

the above expression simplifies as follows:

243
wT − ζB wT − ζB
S = ζB + ζC + A+ B
 A A 
1 2 wT − ζB wT − ζB wT − ζB 2
− ζ C +ζ B+ζ B+( ) A
2ζ A A A
wT − ζB
= ζB + ζC + wT − ζB + B (8.5)
A
−2BwT + ζB 2 1 wT2
 
1 wT − ζB
− ζC + 2 B+ −
2 A A 2ζ A
B2
   
1 B 1 wT
= ζ C− + wT 1 + − .
2 A A 2ζ A


E 284 – Statistical significance of sample allocation (www.8.2)


Prove that the distributions of the estimators (8.100, AM 2005)-(8.101, AM 2005) are given by (8.102,
AM 2005).
Solution of E 284
Consider the independent sample estimators (8.85, AM 2005) and (8.86, AM 2005):

 
1
b ∼ N µ, Σ ,
µ b ∼ W(T − 1, Σ) .
TΣ (8.6)
T
where W denotes the Wishart distribution. Define:

vb ≡ α0 diag(pT )Σ
b diag(pT )α . (8.7)

From (2.230, AM 2005) the distribution of this random variable satisfies:

T vb ∼ Ga(T − 1, α0 diag(pT )Σ diag(pT )α) , (8.8)

where Ga denotes the gamma distribution. Thus from (1.113, AM 2005) the expected value of vb reads:

T −1 0
E {b
v} = α diag(pT )Σ diag(pT )α , (8.9)
T
and from (1.114, AM 2005) the inefficiency of vb reads:

r
T −1 0
Sd {b
v} = 2 α diag(pT )Σ diag(pT )α . (8.10)
T2
Similarly, define:

eb ≡ α0 diag(pT )(1 + µ
b) . (8.11)

From (2.163, AM 2005) we obtain:


CHAPTER 8. EVALUATING ALLOCATIONS 245

α0 diag(pT )Σ diag(pT )α
 
0
eb ∼ N α diag(pT )(1 + µ), . (8.12)
T

Therefore, from (2.163, AM 2005) the expected value of eb reads:

e} = α0 diag(pT )(1 + µ) ,
E {b (8.13)

and from (2.159, AM 2005) the inefficiency of eb reads:

r
α0 diag(pT )Σ diag(pT )α
Sd {b
e} = . (8.14)
T

Furthermore, since µ
b and Σ
b are independent, so are vb and eb. 

E 285 – Estimation risk and opportunity cost


Replicate in a MATLAB R
script the evaluation of the best performer allocation (8.42, AM 2005) and
described in Figure 8.2 in Meucci (2005). You do not need to draw the figure, as long as you correctly
compute the number S(θ), as well as the distributions Sθ (α([ITθ ])), Cθ+ (α([ITθ ])) and OCθ (α([ITθ ])), as
functions of θ ∈ θ.
Solution of E 285
See the MATLAB R
script S_EvaluationGeneric. 
Chapter 9

Optimizing allocations

E 286 – Allocation of the resampled allocation (www.9.1) *


Prove expression (9.92, AM 2005) for the resampled allocation.
Solution of E 286
We can express the resampled allocation as:

n h io
µ[i ],Σ[i
b T]
αrs [iT ] ≡ E αs IT T
b

n o n w o
−1 T −1
= E ζ [diag(pT )] Vu + E 0
[diag(pT )] V1
 0 1V1
ζ1 Vu −1
−E [diag(pT )] V1
10 V1
 
−1 −1 V1
= ζ [diag(pT )] E {V} E {u} + wT [diag(pT )] E
10 V1 (9.1)
 
−1 0 V1
− ζ [diag(pT )] E {u} E V1
10 V1
 
−1 −1 V1
= ζ [diag(pT )] E {V} µ b + wT [diag(pT )] E
10 V1
 
−1 0 V1
− ζ [diag(pT )] µ b E V1 .
10 V1

Therefore:

   0   
−1 1 Vbµ V1
αrs [iT ] = [diag(pT )] ζ E {Vb
µ} − E V1 + wT E . (9.2)
10 V1 10 V1

E 287 – Probability bounds for the sample mean (www.9.2)


Prove the expression (9.109, AM 2005) of the probability that the range (9.108, AM 2005) captures the
true expected values.
Solution of E 287

246
CHAPTER 9. OPTIMIZING ALLOCATIONS 247

From (8.85, AM 2005) the sample estimator is distributed as follows:

Σt
 
b ∼ N µt ,
µ , (9.3)
T

where µt and Σt are the true underlying parameters. Therefore from (9.53, AM 2005) we have:

−1
Σt

µ − µt )0
(b µ − µt ) ∼ χ2N .
(b (9.4)
T

From the definition (1.7, AM 2005) of the cdf:

( −1 )
Σt

t 0 t
Fχ2N (T γ) ≡ P (b
µ−µ ) µ − µ ) ≤ Tγ
(b
T (9.5)
b )0 (Σt )−1 (µt − µ
= P (µt − µ

b) ≤ γ .

By applying the quantile function (1.17, AM 2005) to both sides of the above equality we obtain:

Qχ2N (p)
 
t 0 t −1 t

p = P (µ − µ
b) Σ (µ − µ
b) ≤ . (9.6)
T

Therefore, considering the set:

Qχ2N (p)
 
Θ≡ b , Σt ) ≤
µ ∈ RN | Ma2 (µt , µ , (9.7)
T

the following result holds:

P µt ∈ Θ = p .

(9.8)

E 288 – Bayes’ rule (www.9.3)


Prove the general Bayes’ rule (9.30, AM 2005).
Solution of E 288
By the definition of the conditional density we have:

fX,V (X, V)
fX|v (X|V) ≡ , (9.9)
fV (V)

where fX,V is the joint distribution of X and V and:

Z
fV (v) ≡ fX,V (x, v)dx , (9.10)
is the marginal pdf of V. On the other hand, by the definition of the conditional density we also have:

fX,V (x, v) = fV|g(x) (v|x)fX (x) . (9.11)

Thus:

fX,V (x, v) fV|g(x) (v|x)fX (x)


fX|v (x|v) ≡ R =R . (9.12)
fX,V (x, v)dx fV|g(x) (v|x)fX (x)dx

E 289 – Black-Litterman posterior distribution (www.9.3) **


Prove the expression (9.44, AM 2005)-(9.46, AM 2005) for the Black-Litterman posterior distribution.
Solution of E 289
In the Black-Litterman setting, the marginal pdf of X is assumed normal:

− 21
|Σ| 1 0 −1
fX (x) ≡ N e− 2 (x−µ) Σ (x−µ)
, (9.13)
(2π) 2

and the conditional pdf of V given PX = Px is:

− 12
|Ω| 1 0 −1
fV|Px (v|x) ≡ K e− 2 (v−Px) Ω (v−Px)
. (9.14)
(2π) 2

Thus the joint pdf of V and X reads:

fX,V (x, v) = fV|Px (v|x)fX (x)


− 12 − 12 0 −1
(x−µ)+(v−Px)0 Ω−1 (v−Px)]
(9.15)
e− 2 [(x−µ) Σ
1
∝ |Σ| |Ω| .

Expanding the expression in square brackets in (9.15) we obtain:

[· · · ] = (x − µ)0 Σ−1 (x − µ) + (v − Px)0 Ω−1 (v − Px)


= x0 Σ−1 x − 2x0 Σ−1 µ + µ0 Σ−1 µ + v0 Ω−1 v − 2x0 P0 Ω−1 v + x0 P0 Ω−1 Px (9.16)
= x0 (Σ−1 + P0 Ω−1 P)x − 2x0 Σ−1 µ + P0 Ω−1 v + µ0 Σ−1 µ + v0 Ω−1 v .
 

We define µ
e in such a way that the following holds:

 −1
Σ µ + P0 Ω−1 v ≡ (Σ−1 + P0 Ω−1 P)e

µ. (9.17)

This implies:

e (v) ≡ (Σ−1 + P0 Ω−1 P)−1 (Σ−1 µ + P0 Ω−1 v) .


µ (9.18)

Using (9.17) we easily re-write (9.16) as follows:


CHAPTER 9. OPTIMIZING ALLOCATIONS 249

[· · · ] = x0 (Σ−1 + P0 Ω−1 P)x − 2x0 (Σ−1 + P0 Ω−1 P)e


µ
e 0 (Σ−1 + P0 Ω−1 P)e
+µ µ + µ0 Σ−1 µ + v0 Ω−1 v
(9.19)
e 0 (Σ−1 + P0 Ω−1 P)e
−µ µ
e )0 (Σ−1 + P0 Ω−1 P)(x − µ
= (x − µ e) + α .

where:

e 0 (Σ−1 + P0 Ω−1 P)e


α ≡ µ0 Σ−1 µ + v0 Ω−1 v − µ µ. (9.20)

Substituting the definition (9.18) in this expression we obtain:

α = µ0 Σ−1 µ + v0 Ω−1 v
− (µ0 Σ−1 + v0 Ω−1 P)(Σ−1 + P0 Ω−1 P)−1 (Σ−1 µ + P0 Ω−1 v)
= µ0 Σ−1 µ + v0 Ω−1 v − µ0 Σ−1 (Σ−1 + P0 Ω−1 P)−1 Σ−1 µ
− v0 Ω−1 P(Σ−1 + P0 Ω−1 P)−1 P0 Ω−1 v
(9.21)
+ 2µ0 Σ−1 (Σ−1 + P0 Ω−1 P)−1 P0 Ω−1 v
= v0 Ω−1 − Ω−1 P(Σ−1 + P0 Ω−1 P)−1 P0 Ω−1 v


+ 2v0 Ω−1 P(Σ−1 + P0 Ω−1 P)−1 Σ−1 µ


+ µ0 (Σ−1 − Σ−1 (Σ−1 + P0 Ω−1 P)−1 Σ−1 )µ .

Using the identity (A.90, AM 2005) we write the expression in curly brackets as follows:

Ω−1 − Ω−1 P(Σ−1 + P0 Ω−1 P)−1 P0 Ω−1 = (Ω + PΣP0 )−1 . (9.22)

Also, we define v
e in such a way that:

e = −Ω−1 P(Σ−1 + P0 Ω−1 P)−1 Σ−1 µ .


(Ω + PΣP0 )−1 v (9.23)

Therefore:

α = v0 (Ω + PΣP0 )−1 v − 2v0 (Ω + PΣP0 )−1 v


e
e + µ0 (Σ−1 − Σ−1 (Σ−1 + P0 Ω−1 P)−1 Σ−1 )µ
e 0 (Ω + PΣP0 )−1 v
+v
(9.24)
e 0 (Ω + PΣP0 )−1 v
−v e
e )0 (Ω + PΣP0 )−1 (v − v
= (v − v e) + φ ,

where:

φ ≡ µ0 (Σ−1 − Σ−1 (Σ−1 + P0 Ω−1 P)−1 Σ−1 )µ − v


e 0 (Ω + PΣP0 )−1 v
e. (9.25)

From (9.23) we see that:


e = −(Ω + PΣP0 )Ω−1 P(Σ−1 + P0 Ω−1 P)−1 Σ−1 µ .
v (9.26)

does not depend on either V or X. Therefore neither does φ in (9.25). Substituting (9.24) back in (9.19)
the expression in square brackets in (9.15) reads:

e (v))0 (Σ−1 + P0 Ω−1 P)(x − µ


[· · · ] = (x − µ e (v))
(9.27)
e )0 (Ω + PΣP0 )−1 (v − v
+ (v − v e) + φ .

Therefore (9.15) becomes:

− 21 − 21 1 0 −1
+P0 Ω−1 P)(x−µ(v))
fX,V (x, v) ∝ |Σ| |Ω| e− 2 (x−µ(v))
e (Σ e

1 0 0 −1
× e− 2 (v−ev) (Ω+PΣP ) (v−ev)
1 0
(9.28)
1
(Σ−1 +P0 Ω−1 P)(x−µ(v))
= Σ−1 + P0 Ω−1 P 2 e− 2 (x−µ(v))
e e

− 12 1 0 0 −1
× |Ω + PΣP0 | e− 2 (v−ev) (Ω+PΣP ) (v−e
v)
,

where the last equality follows from:

|Ω + PΣP0 |
= 1, (9.29)
|Σ| |Ω| Σ−1 + P0 Ω−1 P

which in turn follows from an application of (A.91, AM 2005):

|Σ| |Ω| Σ−1 + P0 Ω−1 P = Σ(Σ−1 + P0 Ω−1 P) |Ω|


= I + ΣP0 Ω−1 P |Ω|


= I + Ω−1 PΣP0 |Ω|



(9.30)
= Ω(I + Ω−1 PΣP0 )

= |Ω + PΣP0 | .

To summarize, from (9.28) we see that:

fX,V (x, v) ∝ fX|v (x|v)fV (v) , (9.31)

where:

1 1 0
(Σ−1 +P0 Ω−1 P)(x−µ(v))
fX|v (x|v) ∝ Σ−1 + P0 Ω−1 P 2 e− 2 (x−µ(v))
e e
, (9.32)

and:

− 12 1 0 0 −1
fV (v) ∝ |Ω + PΣP0 | e− 2 (v−ev) (Ω+PΣP ) (v−e
v)
. (9.33)

Since (9.32) and (9.33) are normal pdfs, it follows that the random variable X conditioned on V = v is
normally distributed:
CHAPTER 9. OPTIMIZING ALLOCATIONS 251

X|v = v ∼ N(e
µ, Σ)
e , (9.34)

and so is the marginal distribution of V:

V ∼ N(e
v, Ω)
e , (9.35)

The expected value µ


e (v) in (9.34) is defined in (9.18) and, using (A.90, AM 2005), it reads:

e (v) ≡ (Σ−1 + P0 Ω−1 P)−1 (Σ−1 µ + P0 Ω−1 v)


µ
= (Σ − ΣP0 (PΣP0 + Ω)−1 PΣ)(Σ−1 µ + P0 Ω−1 v) (9.36)
= µ + ΣP0 (Ω−1 − (PΣP0 + Ω)−1 PΣP0 Ω−1 )v − ΣP0 (PΣP0 + Ω)−1 Pµ .

Noticing that:

Ω−1 − (PΣP0 + Ω)−1 PΣP0 Ω−1 = (PΣP0 + Ω)−1 , (9.37)

which can be easily checked by left-multiplying both sides by (PΣP0 + Ω), the expression for the
expected value µ
e (v) in (9.34) can be further simplified as follows:

e (v) = µ + ΣP0 (PΣP0 + Ω)−1 (v − Pµ) .


µ (9.38)

Similarly, from (9.32) and using (A.90, AM 2005) the covariance matrix in (9.34) reads:

e ≡ (Σ−1 + P0 Ω−1 P)−1 = Σ − ΣP0 (PΣP0 + Ω)−1 PΣ .


Σ (9.39)

On the other hand, the expected value v


e in (9.35) is defined in (9.26) and from (9.33) the covariance
matrix in (9.35) reads:

e ≡ Ω + PΣP0 .
Ω (9.40)

E 290 – Black-Litterman conditional distribution (www.9.4) **


Prove the expression (9.61, AM 2005), i.e. that the conditional distribution of the market is normal.
Solution of E 290
First of all we complete the K × N matrix P to a non-singular N × N matrix:

 
Q
S≡ , (9.41)
P

where Q is an arbitrary full-rank (N − K) × N matrix. It will soon become evident that the choice of
Q is irrelevant. Then we compute the pdf of the following random variable:
   
QX YA
Y ≡ SX = ≡ . (9.42)
PX YB

It is immediate to check that Y is normal:

Y ∼ N(ν, T) , (9.43)

where:

   
νA Qµ
ν≡ = , (9.44)
νB Pµ

and:

QΣQ0 QΣP0
   
TAA TAB
T≡ ≡ . (9.45)
TBA TBB PΣQ0 PΣP0

At this point we can compute the conditional pdf. From (2.164, AM 2005) we obtain:

YA |yB ∼ N(ξ, Φ) , (9.46)

where the expected values and covariance read explicitly:

ξ ≡ ν A + TAB T−1
BB (yB − ν B ) (9.47)
Φ ≡ TAA − TAB T−1
BB TBA . (9.48)

E 291 – Black-Litterman conditional expectation (www.9.4) (see E 290) **


Prove the expression (9.61, AM 2005) for the conditional expectation of the Black-Litterman approach.
Solution of E 291
Substituting the investor’s opinion YB = Px = v in (9.48) we obtain therefore that the expected value
of the whole vector Y is:

 
E {YA |YB = v}
E {Y|YB = v} =
v
(9.49)
Qµ + QΣP0 (PΣP0 )−1 (v − Pµ)
 
= .
v

Recalling that Y = SX and rewriting v as Pµ + PΣP0 (PΣP0 )−1 (v − Pµ) we can express (9.49) as
follows:

S E {X|PX = v} = S(µ + ΣP0 (PΣP0 )−1 (v − Pµ)) . (9.50)


CHAPTER 9. OPTIMIZING ALLOCATIONS 253

Since S is invertible we finally obtain:

E{X|PX = v} = µ + ΣP0 (PΣP0 )−1 (v − Pµ) , (9.51)

which is the expression of the conditional expectation that we were looking for. 

E 292 – Black-Litterman conditional covariance (www.9.4) (see E 290) *


Prove the expression (9.46, AM 2005) for the conditional covariance matrix of the Black-Litterman ap-
proach.
Solution of E 292
As for the covariance matrix, substituting the investor’s opinion YB = PX = v in (9.48) we obtain
therefore that the expected value of the whole vector Y is

 
Cov {YA |YB = v} 0
Cov {Y|YB = v} =
0 0
 
Φ 0
= (9.52)
0 0
QΣQ0 − QΣP0 (PΣP0 )−1 PΣQ0
 
0
= .
0 0

Recalling that Y = SX we can write:

a ≡ S Cov {X|PX = v} S0 , (9.53)

as follows:

a = Cov {SX|PX = v}
Q(Σ − ΣP0 (PΣP0 )−1 PΣ)Q0 0
 
=
0 0
Q(Σ − ΣP (PΣP ) PΣ)Q Q(Σ − ΣP0 (PΣP0 )−1 PΣ)P0
0 0 −1 0
 
(9.54)
=
P(Σ − ΣP0 (PΣP0 )−1 PΣ)Q0 P(Σ − ΣP0 (PΣP0 )−1 PΣ)P0
 Q 0
   
Q
= Σ − ΣP0 (PΣP0 )−1 PΣ .
P P

Since S is invertible we can pre- and post- multiply (9.53) by S−1 and finally obtain:

Cov {X|PX = v} = Σ − ΣP0 (PΣP0 )−1 PΣ , (9.55)

which is the expression of the conditional covariance that we were looking for. 
E 293 – Computations for the robust version of the leading example (www.9.5) *

Show that using the uncertainty set (9.108, AM 2005) in (9.105, AM 2005) the ensuing robust allocation
decision solves problem (9.111, AM 2005).
Solution of E 293
From (8.33, AM 2005), (8.25, AM 2005) and (8.29, AM 2005) we obtain:

0 −1
ζ
µ − A1 (10 Σ−1 µ)2 )
  
  2 (µ Σ 
α∗ ≡ argmin max +wT (1 + A1 10 Σ−1 µ − wζT 2A
1
)
α µ∈θb p  0 1 0
−α diag(pT )(1 + µ) + 2ζ α Φα

(9.56)
0

α pT = wT √
s.t.
(1 − γ)wT − α0 diag(pT )(1 + µ) + 2α0 Φαλ ≤ 0, for all µ ∈ Θ
bp,

where:

A ≡ 10 Σ−1 1 (9.57)
−1
λ ≡ erf (2c − 1) (9.58)
Φ ≡ diag(pT )Σ diag(pT ) , (9.59)

and:

 
QN (p)
bp ≡
Θ b )0 Σ−1 (µ − µ
µ | (µ − µ b) ≤ . (9.60)
T
Using the budget constraint this becomes:

( )
ζ 0 −1 ζ
(10 Σ−1 µ)2 + wAT (10 Σ−1 µ)

2µ Σ µ − 2A
α∗ ≡ argmin max 0
α µ∈Θ
cp −α diag(pT )µ + 2ζ1
α0 Φα
(9.61)
α0 pT = wT

s.t. √
α0 diag(pT )µ ≥ 2α0 Φαλ − γwT , for all µ ∈ Θ
bp,

or:

( )
ζ 0 −1 ζ
(10 Σ−1 µ)2 + wAT (10 Σ−1 µ)

2µ Σ µ − 2A
α∗ ≡ argmin max 0
α µ∈Θ
cp −α diag(pT )µ + 2ζ1
α0 Φα
(9.62)
α0 pT = wn
(
T
s.t. √ o
maxµ∈Θcp 2α0 Φαλ − α0 diag(pT )µ ≤ γwT ,

The second maximization:

n√ o
max 2α0 Φαλ − α0 diag(pT )µ ≤ γwT . (9.63)
µ∈Θ
cp

is a maximization constrained on an ellipsoid of contour surfaces that describe parallel hyperplanes. The
tangency condition is achieved when the gradients are parallel. For the gradient of the ellipsoid we have

−1
cp ∝ Σ
gΘ (µ − µ
b) . (9.64)
CHAPTER 9. OPTIMIZING ALLOCATIONS 255

For the gradient of the hyperplane we have:

gH ∝ diag(pT )α . (9.65)

Therefore the maximum is achieved when there exists a ρ such that:

Σ−1 (µ − µ
b ) = ρ diag(pT )α . (9.66)

Since µ ∈ Θ
b p we have:

QN (p)
b )0 Σ−1 (µ − µ
= (µ − µ b)
T
b )0 Σ−1 ΣΣ−1 (µ − µ
= (µ − µ b) (9.67)

= ρ2 α0 diag(pT )Σ diag(pT )α .

Therefore:

s
QN (p) 1
ρ=± . (9.68)
T α0 diag(pT )Σ diag(pT )α

Substituting in (9.66) we obtain:

s
QN (p)/T
b−
µ=µ Σ diag(pT )α , (9.69)
α0 diag(pT )Σ diag(pT )α

where the choice of the sign follows from the maximization (9.63). Therefore the original problem (9.62)
reads:

(  )
wT 0 −1 1
α∗ ≡ argmin max µ0 Tµ + 1 Σ µ − α0 diag(pT )µ + α0 Φα
α µ∈Θ
cp A 2ζ
(9.70)
α0 pT = wT q
(
s.t. √
2α0 Φαλ + Qα
N (p)/T
0 Φα − α0 Φα − α0 diag(pT )b
µ ≤ γwT ,

where:

ζ −1 ζ −1 0 −1
T≡ Σ − Σ 11 Σ . (9.71)
2 2A


E 294 – Computations for the robust mean-variance problem I (www.9.6) *


Show that the robust mean-variance problem (9.117, AM 2005) under the specification (9.118, AM 2005)-
(9.119, AM 2005) for the robustness sets can be written equivalently as (9.130, AM 2005).
Solution of E 294
Taking into account the elliptical/certain specifications (9.118, AM 2005)-(9.119, AM 2005), the robust
mean-variance problem (9.117, AM 2005) can be written as follows:

( )
0
α(i)
r = argmax min {α µ}
α µ∈Θ

 (9.72)
α∈C
s.t.
α0 Σα
b ≤ v (i) ,

where:

b µ ≡ µ | (µ − m)0 T−1 (µ − m) ≤ q 2 .

Θ (9.73)

Consider the spectral decomposition (A.70, AM 2005) of the shape parameter:

T ≡ EΛ1/2 Λ1/2 E0 . (9.74)

Then:

n o
b µ ≡ µ | (µ − m)0 EΛ−1/2 Λ−1/2 E0 (µ − m) ≤ q 2 .
Θ (9.75)

Define the variable:

1 −1/2 0
u≡ Λ E (µ − m) , (9.76)
q
which implies:

µ ≡ m + qEΛ1/2 u . (9.77)

Then:

n o
b µ ≡ m + qEΛ1/2 u | u0 u ≤ 1 .
Θ (9.78)

We can express the minimization in (9.72) as follows:

n o
min {α0 µ} = min
0
α0 (m + qEΛ1/2 u)
µ∈Θ
cµ u u≤1
n o
= α0 m + q min
0
α0 EΛ1/2 u (9.79)
u u≤1
D E
= α0 m + q min
0
Λ 1/2 0
E α, u ,
u u≤1

where h·, ·i denotes the standard scalar product (A.5, AM 2005). This scalar product reaches a minimum
when the vector u is opposite to the other term in the product:
CHAPTER 9. OPTIMIZING ALLOCATIONS 257

Λ1/2 E0 α
e ≡ −
u 1/2 0 , (9.80)

Λ E α
and the respective minimum reads:
D E D E
min
0
Λ1/2 E0 α, u = Λ1/2 E0 α, u
e
u u≤1
* +
1/2 0 Λ1/2 E0 α
= Λ E α, − 1/2 0

Λ E α
1 D E
= − Λ1/2 E0 α, Λ1/2 E0 α (9.81)
1/2 0
Λ E α
1 2
1/2 0
= − 1/2 0
Λ E α
Λ E α

= − Λ1/2 E0 α .

Substituting (9.81) in (9.79), the original problem (9.72) reads:


n o
0 1/2 0
α(i)
r = argmax α m − q Λ E α
α
 (9.82)
α∈C
s.t.
α0 Σα
b ≤ v (i) .
Equivalently, from (9.74) we can write:
n
0
√ o
α(i)
r = argmax α m − q α 0 Tα
α
 (9.83)
α∈C
s.t.
α0 Σα
b ≤ v (i) .

E 295 – Computations for the robust mean-variance problem II (www.9.6) (see E 294) *

Show that if the investment constraint are regular enough, the problem (9.130, AM 2005) can be cast in
the form of a second-order cone programming problem.
Solution of E 295
To put the problem (9.130, AM 2005) in the SOCP form (6.55, AM 2005) we introduce an auxiliary
variable z:

0
(α(i) (i)
r , zr ) = argmax {α m − z}
α,z

 α ∈ C
 (9.84)
s.t. q Λ1/2 E0 α ≤ z


 0b
α Σα ≤ v (i) .
Furthermore, considering the spectral decomposition (A.70, AM 2005) of the estimate of the covariance:

b ≡ FΓ1/2 Γ1/2 F0 ,
Σ (9.85)

we can write:

D E
α0 Σα
b = Γ1/2 F0 α, Γ1/2 F0 α . (9.86)

Therefore the mean-variance problem (9.84) can be written as follows:

0
(α(i) (i)
r , zr ) = argmax {α m − z}
α,z

 α ∈ C
 (9.87)
q Λ1/2 E0 α ≤ z

s.t.
 1/2 0 √ (i)

 Γ F α ≤ v .

If the investment constraints C are regular enough, this problem is in the SOCP form (6.55, AM 2005). 

E 296 – Restating the robust mean-variance problem in SeDuMi format *


Show that the robust mean-variance (9.117, AM 2005) can be restated in SeDuMi format.
Solution of E 296
Let us define:

x ≡ (α0 , z)0 , (9.88)

and let us assume that C represents the full-budget constraint and the long-only constraints:

N
X
xn = 1 (9.89)
n=1
xn ≥ 0 , n = 1, . . . , N . (9.90)

We redefine the following quantities to re-express our problem


• Target:

b ≡ (−m0 , 1)0 ; (9.91)

• Long-only and budget constraints:


CHAPTER 9. OPTIMIZING ALLOCATIONS 259

Dlo ≡ [IN |0N ]


flo ≡ 0N
Db1 ≡ [10N |0]
fb1 ≡ −1
Db2 ≡ [−10N |0]
fb2 ≡ 1 (9.92)
 0
Dlo
D ≡  Db1 
Db2
 
flo
f ≡  fb1  ;
fb2
• Estimation error:

h i
A01 ≡ qΛ1/2 E0 |0N
B01 ≡ [00N |1] (9.93)
d1 ≡ 0
C1 ≡ 0N ;
• Variance:

h i
A02 ≡ Γ1/2 F0 |0N
B02 ≡ 00N +1
 
√ (9.94)
d2 ≡ vi
C2 ≡ 0N .
Then our problem (9.87) reads:

x∗ = argmin {b0 x} , (9.95)


x

subject to:

D0 x + f ≥ 0
kA01 x + C1 k ≤ b01 x + d1 (9.96)
kA02 x + C2 k ≤ b02 x + d2 .
This problem is in the standard SeDuMi format. 

E 297 – Normal predictive distribution (www.9.7) **


Prove the expression (9.11, AM 2005), i.e. that the predictive distribution of the normal market (9.5, AM
2005) with the normal posterior for the parameters (9.10, AM 2005) is also normal.
Solution of E 297
Consider:

Z
fM (m) ≡ fµ,Σ (m)fν,Φ (µ)dµ
1 0 −1 1 0 −1
e− 2 (m−µ) Σ (m−µ) e− 2 (µ−ν) Φ (µ−ν)
Z
= N p N p dµ (9.97)
(2π) 2 |Σ| (2π) 2 |Φ|
(2π)−N
Z
1
=p p e− 2 a dµ ,
|Σ| |Φ|

where:

a ≡ (m − µ)0 Σ−1 (m − µ) + (µ − ν)0 Φ−1 (µ − ν)


= m0 Σ−1 m + µ0 Σ−1 µ − 2m0 Σ−1 µ + µ0 Φ−1 µ + ν 0 Φ−1 ν − 2µ0 Φ−1 ν (9.98)
0 −1 −1 0 −1 −1 0 −1 0 −1
= µ (Σ +Φ )µ − 2µ (Σ m+Φ ν) + m Σ m+ν Φ ν.

Defining:

b ≡ (Σ−1 + Φ−1 )−1 (Σ−1 m + Φ−1 ν) , (9.99)

we can write:

a = (µ − b)0 (Σ−1 + Φ−1 )(µ − b)


(9.100)
− b0 (Σ−1 + Φ−1 )b + m0 Σ−1 m + ν 0 Φ−1 ν .

Therefore (9.97) becomes:

(2π)−N − 12 [−b0 (Σ−1 +Φ−1 )bm0 Σ−1 m+ν 0 Φ−1 ν ]


fM (m) = p p e
|Σ| |Φ|
Z − 1 (µ−b)0 (Σ−1 +Φ−1 )(µ−b)
N − 1 e 2 (9.101)
× (2π) 2 Σ−1 + Φ−1 2 − 1 dµ
(2π) 2 Σ−1 + Φ−1 2
N

1
= γ2 e− 2 c ,

where γ2 is a normalization constant and:


CHAPTER 9. OPTIMIZING ALLOCATIONS 261

c ≡ − b0 (Σ−1 + Φ−1 )bm0 Σ−1 m + ν 0 Φ−1 ν


= − (m0 Σ−1 + ν 0 Φ−1 )(Σ−1 + Φ−1 )−1 (Σ−1 m + Φ−1 ν)
+ m0 Σ−1 m + ν 0 Φ−1 ν
= − (m + ΣΦ−1 ν)0 Σ−1 (Σ−1 + Φ−1 )−1 Σ−1 (m + ΣΦ−1 ν)
+ m0 Σ−1 m + ν 0 Φ−1 ν
(9.102)
= − m0 Σ−1 (Σ−1 + Φ−1 )−1 Σ−1 m − ν 0 Φ−1 (Σ−1 + Φ−1 )−1 Φ−1 ν
− 2m0 Σ−1 (Σ−1 + Φ−1 )−1 Φ−1 ν + m0 Σ−1 m + ν 0 Φ−1 ν
= m0 Σ−1 − Σ−1 (Σ−1 + Φ−1 )−1 Σ−1 m
 

− 2m0 Σ−1 (Σ−1 + Φ−1 )−1 Φ−1 ν


− ν 0 Φ−1 (Σ−1 + Φ−1 )−1 Φ−1 ν + ν 0 Φ−1 ν .

Defining:

T ≡ Σ−1 − Σ−1 (Σ−1 + Φ−1 )−1 Σ−1


Tg ≡ Σ−1 (Σ−1 + Φ−1 )−1 Φ−1 ν (9.103)
0 −1 0 −1 −1 −1 −1 −1
h≡νΦ ν −ν Φ (Σ +Φ ) Φ ν,

we obtain:

c = m0 Tm − 2m0 Tg + h
= m0 Tm − 2m0 Tg + G0 Tg − G0 Tg + h (9.104)
0 0
= (m − G) T(m − g) − g Tg + h .

Since:

−1 −1 −1
g = Σ−1 − Σ−1 (Σ−1 + Φ−1 )−1 Σ−1 Σ (Σ + Φ−1 )−1 Φ−1 ν ,

(9.105)

the term h − g0 Tg cancels:

h − g0 Tg = ν 0 Φ−1 ν − ν 0 Φ−1 (Σ−1 + Φ−1 )−1 Φ−1 ν


0
− Σ−1 (Σ−1 + Φ−1 )−1 Φ−1 ν

−1
× Σ−1 − Σ−1 (Σ−1 + Φ−1 )−1 Σ−1


× Σ−1 (Σ−1 + Φ−1 )−1 Φ−1 ν


(9.106)
= ν 0 Φ−1 ν − ν 0 Φ−1 (Σ−1 + Φ−1 )−1 Φ−1 ν
− ν 0 Φ−1 Σ−1 (Σ−1 + Φ−1 )−1
−1
× Σ−1 − Σ−1 (Σ−1 + Φ−1 )−1 Σ−1


× Σ−1 (Σ−1 + Φ−1 )−1 Φ−1 ν .

Therefore:
1 0
fM (m) = γ2 e− 2 (m−g) T(m−g) . (9.107)

or in other words:

M ∼ N(g, T−1 ) . (9.108)

In our example:

Σ
Φ≡ . (9.109)
T
Therefore:

−1 −1 −1
g = Σ−1 − Σ−1 (Σ−1 + T Σ−1 )−1 Σ−1 Σ (Σ + T Σ−1 )−1 T Σ−1 ν

 −1
1 T
= Σ−1 − Σ−1 Σ−1 ν
1+T 1+T (9.110)
1+T T
= Σ Σ−1 ν
T 1+T
=ν,
and:

T = Σ−1 − Σ−1 (Σ−1 + T Σ−1 )−1 Σ−1


1
= Σ−1 − Σ−1 (9.111)
1+T
T
= Σ−1 .
1+T


E 298 – The robustness uncertainty set for the mean vector (www.9.8) *
Show that the optimization step in (9,139, AM 2005):

min {w0 µ} (9.112)


µ∈Θ

where:

 
1 ν1
bµ ≡
Θ µ | (µ − µ1 )0 Σ−1
1 (µ − µ1 ) ≤ q2 , (9.113)
T1 ν1 − 2 µ
can be expressed as:

 1/2 !
0 1 ν1
1/2 0
min w µ1 − q2 Γ F w , (9.114)
µ∈Θ
cµ T1 ν1 − 2 µ
CHAPTER 9. OPTIMIZING ALLOCATIONS 263

where:

Σ1 ≡ FΓ1/2 Γ1/2 F0 , (9.115)

where F is the juxtaposition (A.62, AM 2005) of the eigenvectors and Γ is the diagonal matrix (A.65,
AM 2005) of the eigenvalues.
Solution of E 298
We can write (9.113) as follows:

 
0 −1/2 −1/2 0 1 ν1
bµ ≡
Θ µ | (µ − µ1 ) FΓ Γ F (µ − µ1 ) ≤ q2 . (9.116)
T1 ν1 − 2 µ

Define the new variable:

 −1/2
1 ν1
u≡ q2 Γ−1/2 F0 (µ − µ1 ) , (9.117)
T1 ν1 − 2 µ

which implies:

 1/2
1 ν1
µ = µ1 + q2 FΓ1/2 u , (9.118)
T1 ν1 − 2 µ

we can write (9.116) as follows:

(  1/2 )
1 ν1 1/2 0
bµ ≡
Θ µ1 + q2 FΓ u|u u ≤ 1 . (9.119)
T1 ν1 − 2 µ

Since:

* 1/2 +
0 1 ν1 2 1/2
w µ = w, µ1 + q FΓ u (9.120)
T1 ν1 − 2 µ
* 1/2 +
1 ν1 2 1/2 0
hw, µ1 i q Γ F w, u , (9.121)
T1 ν1 − 2 µ

we have:

* 1/2 +
0 1 ν1 2 1/2 0
min {w µ} = hw, µ1 i + min q Γ F w, u
µ∈Θ
cµ 0 u u≤1 T1 ν1 − 2 µ
 1/2 (9.122)
0 1 ν1 2 1/2 0

= w µ1 − qµ Γ F w .
T1 ν1 − 2


E 299 – The robustness uncertainty set for the covariance matrix (www.9.8) **
Show that the optimization step in (9,139, AM 2005):

max {w0 Σw} , (9.123)


Σ∈Θ

where:

 h i0 h i 
bΣ ≡
Θ b CE S−1 vech Σ − Σ
Σ | vech Σ − Σ b CE ≤ q 2 , (9.124)
Σ Σ

with:

ν1
Σ
b CE = Σ1 , (9.125)
ν1 + N + 1
and:

2ν12
SΣ = (D0 (Σ−1 ⊗ Σ−1
1 )DN )
−1
. (9.126)
(ν1 + N + 1)3 N 1
can be expressed as:

" 1/2 #
2ν12 qΣ
2

ν1 1/2 0 2

0
max {w Σw} = + Γ F w . (9.127)
Σ∈ΘΣ
c ν 1 + N +1 (ν1 + N + 1)3

Solution of E 299
Consider the spectral decomposition of the rescaled dispersion parameter (7.78):

(D0N (Σ1−1 ⊗ Σ−1


1 )DN )
−1
≡ EΛE0 , (9.128)

where E is the juxtaposition (A.62, AM 2005) of the eigenvectors:

E ≡ (e(1) , . . . , e(N (N +1)/2) ) , (9.129)

and Λ is the diagonal matrix (A.65, AM 2005) of the eigenvalues:

Λ ≡ diag(λ1 , . . . , λN (N +1)/2 ) . (9.130)

We can write (9.124) as follows:

2
2ν12 qΣ
 h i0 h i 
bΣ ≡
Θ b CE EΛ−1/2 Λ−1/2 E0 vech Σ − Σ
vech Σ − Σ b CE ≤ . (9.131)
(ν1 + N + 1)3
Define the new variable:
CHAPTER 9. OPTIMIZING ALLOCATIONS 265

−1/2
2ν12 qΣ
2
 h i
u≡ Λ−1/2 E0 vech Σ − Σ
b CE , (9.132)
(ν1 + N + 1)3

which implies:

1/2
h i  2ν12 qΣ
2
vech [Σ] ≡ vech ΣCE +
b EΛ1/2 u . (9.133)
(ν1 + N + 1)3

we can write (9.131) as follows:

( 1/2 )
2ν12 qΣ
2
h i 
bΣ ≡
Θ vech Σ
b CE + EΛ 1/2
u | u0 u ≤ 1
(ν1 + N + 1)3

N (N +1)/2  1/2
 (9.134)
 h i X 2ν12 qΣ
2
λs 
= vech Σ
b CE + e(s) us | u0 u ≤ 1 .

s=1
(ν1 + N + 1)3 

Each eigenvector e(s) represents the non-redundant entries of a matrix. To consider all the elements we
simply multiply by the duplication matrix (A.113, AM 2005). Then from (9.133) we obtain:

w0 Σw = (w0 ⊗ w0 ) vec [Σ]


= (w0 ⊗ w0 )DN vech [Σ]
* 1/2 +
h i  2ν12 qΣ
2
= D0N (w0 0 0
⊗ w ) , vech Σb CE + EΛ 1/2
u
(ν1 + N + 1)3
D h iE
= D0N (w0 ⊗ w0 )0 , vech Σ b CE
* + (9.135)
1/2
2ν12 qΣ
2

0 0 0 0 1/2
+ DN (w ⊗ w ) , EΛ u
(ν1 + N + 1)3
= w0 Σ
b CE w
1/2 D
2ν12 qΣ
2
 E
+ 3
Λ1/2 E0 D0N (w0 ⊗ w0 )0 , u .
(ν1 + N + 1)

Therefore:

max {w0 Σw} = w0 Σ


b CE w
Σ∈Θ

1/2
2ν12 qΣ
2
 D E
+ max Λ1/2 E0 D0N (w0 ⊗ w0 )0 , u
(ν1 + N + 1)3 0
u u≤1
(9.136)
0b
= w ΣCE w
1/2
2
2ν12 qΣ

1/2 0 0
+ Λ E DN (w0 ⊗ w0 )0 .

(ν1 + N + 1) 3
Substituting (9.125) this becomes:

ν1
max w0 Σw = w0 Σ1 w
Σ∈Θ
cΣ ν1 + N + 1
1/2 (9.137)
2ν12 qΣ
2

1/2 0 0 0 0
+ E DN (w ⊗ w ) .
(ν1 + N + 1)3
Λ

To simplify this expression, consider the pseudo inverse D


e of the duplication matrix:

D
e N DN = IN (N +1)/2 . (9.138)
It is possible to show that:

(D0N (Σ−1 −1
1 ⊗ Σ1 )DN )
−1 e N (Σ−1 ⊗ Σ−1 )−1 D
=D 1 1
e0 ,
N (9.139)
and:

(w0 ⊗ w0 )DN D
e N = (w0 ⊗ w0 ) , (9.140)
see Magnus and Neudecker (1999). Now consider the square of the norm in (9.137). Using (9.139) and
(9.140) we obtain:

2
a ≡ Λ1/2 E0 D0N (w0 ⊗ w0 )0

= (w0 ⊗ w0 )DN EΛ1/2 Λ1/2 E0 D0N (w0 ⊗ w0 )0


= (w0 ⊗ w0 )DN (D0N (Σ−1 −1
1 ⊗ Σ1 )DN )
−1 0
DN (w0 ⊗ w0 )0
(9.141)
= (w0 ⊗ w0 )DN D e 0 D0 (w0 ⊗ w0 )0
e N (Σ1 ⊗ Σ1 )D
N N
h i0
= (w ⊗ w )DN DN (Σ1 ⊗ Σ1 ) (w0 ⊗ w0 )(DN D
0 0 e e N)

= (w0 ⊗ w0 )(Σ1 ⊗ Σ1 )(w0 ⊗ w0 )0 .


Using (A.100, AM 2005) this becomes:

a = (w0 ⊗ w0 )(Σ1 ⊗ Σ1 )(w0 ⊗ w0 )0


= (w0 Σ1 w) ⊗ (w0 Σ1 w) (9.142)
0 2
= (w Σ1 w) .
Therefore (9.137) yields:

ν1
max w0 Σw = w0 Σ1 w
Σ∈Θ
cΣ ν1 + N + 1
1/2
2
2ν12 qΣ

+ (w0 Σ1 w) (9.143)
(ν1 + N + 1)3
" 1/2 #
2
2ν12 qΣ

ν1
= + (w0 Σ1 w) .
ν1 + N + 1 (ν1 + N + 1)3
CHAPTER 9. OPTIMIZING ALLOCATIONS 267

Equivalently, recalling (9.115) we can write (9.137) as follows:

" 1/2 #
2ν12 qΣ
2

ν1 1/2 0 2

max {w0 Σw} = + Γ F w . (9.144)
Σ∈ΘΣ
c ν 1 + N +1 (ν1 + N + 1)3

E 300 – Robust Bayesian mean-variance problem (www.9.8) *


Show that the robust Bayesian mean-variance problem (9.139, AM 2005) with the robustness uncertainty
sets specified as in (9.149, AM 2005) and (9.152, AM 2005) can be expressed as in (9.155, AM 2005)-
(9.157, AM 2005).
Solution of E 300
Substituting (9.114) and (9.127) in (9.139, AM 2005), and defining:

!1/2
2
1 qµ ν1
γµ ≡ (9.145)
T1 ν1 − 2

(i) v (i)
γΣ ≡  1/2 , (9.146)
ν1 2ν12 qΣ
2

ν1 +N +1 + (ν1 +N +1)3

the Bayesian robust mean-variance problem reads:

n o
(i)
wrB = argmax w0 µ1 − γµ Γ1/2 F0 w

w
q (9.147)
1/2 0 (i)
s.t. Γ F w ≤ γΣ .

This is equivalent to:

(i)
(wrB , z ∗ ) = argmax {w0 µ1 − z} , (9.148)
w∈C,z

subject to:


1/2 0
Γ F w ≤ z/γµ (9.149)
q
1/2 0 (i)
Γ F w ≤ γΣ . (9.150)

This problem is in the SOCP form (6.55, AM 2005). 

E 301 – Robust mean-variance for derivatives (see E 259)


Consider the market of call options in E 259. Consider a small ellipsoidal neighborhood of the expected
linear returns, as determined by reasonable T, M, and q 2 , see (9.118, AM 2005), and assume no uncer-
tainty in the estimation of the covariance of the linear returns, see (9.119, AM 2005), and set up the robust
optimization problem (9.117, AM 2005) in the form of SOCP, see comments after (9.130, AM 2005).
Write a MATLAB R
script in which you:
• Compute the robust mean-variance efficient frontier in terms of relative weights, assuming the
standard long-only and full investment constraints;
• Plot the efficient frontier in the plane of weights and standard deviation.
Hint. Use the CVX package available at http://cvxr.com/cvx/.

Solution of E 301
See the MATLAB R
script S_MeanVarianceCallsRobust. 

E 302 – Black-Litterman and beyond I


Assume as in Black-Scholes that the compounded returns are normally distributed:

ln(PT +τ ) − ln(PT ) ∼ N(µ, Σ) . (9.151)

Compute the inputs of the mean-variance approach, namely expectations and covariances of the linear
returns.
Solution of E 302
Also from (2.219, AM 2005)-(2.220, AM 2005) for a log-normal variable:

Y ∼ LogN(µ, Σ) . (9.152)

Then:

1
E{Y} = eµ+ 2 diag(Σ)
1 1
(9.153)
E{YY0 } = (eµ+ 2 diag(Σ) (eµ+ 2 diag(Σ) )0 ) ◦ eΣ ,

where ◦ denotes the term-by-term Hadamard product. Since:

1 + R ∼ LogN(µ, Σ) , (9.154)

using (9.153) and the property:

E{(Y − 1)} = E{Y} − 1 (9.155)


E{(Y − 1)(Y − 1)0 } = E{YY0 } + 110 − E{Y10 } − E{1Y0 } . (9.156)

we can easily compute the expectations E{R} and the second moments E{RR0 }. The covariance then
follows from:

Cov{R} = E{RR0 } − E{R} E{R0 } . (9.157)

E 303 – Black-Litterman and beyond II (see E 302)


Consider the same setup than in E 302. Write a MATLAB R
script in which you:
• Upload the database DB_CovNRets that contains estimates for µ and Σ;
• Use the results from E 302 to compute and plot the efficient frontier under the constraints that the
weights sum to one and that they are non-negative;
CHAPTER 9. OPTIMIZING ALLOCATIONS 269

• Construct a pick matrix that sets views on the spread between the compounded return of the first
and the last security;
• Set a one-standard deviation bullish view on that spread;
• Use the market-based Black-Litterman formula (9.44, AM 2005) to compute the normal parameters
that reflect those views;
• Map the results into expectations and covariances for the linear returns;
• Compute and plot the efficient frontier under the same constraints as above.
Solution of E 303
See the MATLAB R
script S_BlackLittermanBasic. 

E 304 – Entropy pooling


Consider the market prior:

d
X = BZ−1 + (1 − B)Z1 , (9.158)

where:

Z−1 ∼ N(−1, 1) , Z1 ∼ N(1, 1) , (9.159)

B is Bernoulli with P{B = 1} ≡ 1/2, and all the variables are independent. Write a MATLAB R
script
in which you compute and plot the posterior market distribution that is the most consistent with the view:

E{X}
e ≡ 0.5 . (9.160)

Hint. Use the MATLAB


R
package Entropy Pooling available at www.mathworks.com/matlabcentral/
fileexchange/21307.

Solution of E 304
See the MATLAB R
script S_EntropyView. 
Bibliography

Abramowitz, M., Stegun, I. A., 1974. Handbook of Mathematical Functions with Formulas, Graphs, and
Mathematical Tables. Dover.
Albanese, C., Jackson, K., Wiberg, P., 2004. A new Fourier transform algorithm for value at risk. Quan-
titative Finance 4 (3), 328–338.
Bertsimas, D., Lauprete, G. J., Samarov, A., 2004. Shortfall as a risk measure: Properties, optimization
and applications. Journal of Economic Dynamics and Control 28, 1353–1381.
Black, F., Scholes, M. S., 1973. The pricing of options and corporate liabilities. Journal of Political
Economy 81, 637–654.
Chib, S., Greenberg, E., 1995. Understanding the Metropolis-Hastings algorithm. The American Statisti-
cian 49, 327–335.

Dickey, J. M., 1967. Matrix-variate generalizations of the multivariate t distribution and the inverted
multivariate t distribution. Annals of Mathematical Statistics 38, 511–518.
Embrechts, P., Klueppelberg, C., Mikosch, T., 1997. Modelling Extremal Events. Springer.
Fang, K. T., Kotz, S., Ng, K. W., 1990. Symmetric Multivariate and Related Distributions. CRC Press.

Feuerverger, A., Wong, A. C., 2000. Computation of value at risk for nonlinear portfolios. Journal of Risk
3, 37–55.
Gourieroux, C., Laurent, J. P., Scaillet, O., 2000. Sensitivity analysis of values at risk. Journal of Empiri-
cal Finance 7, 225–245.

Kendall, M., Stuart, A., 1969. The Advanced Theory of Statistics, Volume, 3rd Edition. Griffin.
Ledoit, O., Santa-Clara, P., Wolf, M., 2003. Flexible multivariate GARCH modeling with an application
to international stock markets. Review of Economics and Statistics 85, 735–747.
Magnus, J. R., Neudecker, H., 1999. Matrix Differential Calculus with Applications in Statistics and
Econometrics, Revised Edition. Wiley.
Merton, R. C., 1976. Option pricing when underlying stocks are discontinuous. Journal of Financial
Economics 3, 125–144.
Meucci, A., 2005. Risk and Asset Allocation. Springer.
URL http://symmys.com

270
BIBLIOGRAPHY 271

Meucci, A., 2009. Review of statistical arbitrage, cointegration, and multivariate Ornstein-Uhlenbeck.
Working Paper.
URL http://symmys.com/node/132
Meucci, A., 2010a. Annualization and general projection of skweness, kurtosis, and all summary statis-
tics. GARP Risk Professional August, 55–56.
URL http://symmys.com/node/136
Meucci, A., 2010b. Common misconceptions about ’beta’ - hedging, estimation and horizon effects.
GARP Risk Professional June, 42–45.
URL http://symmys.com/node/165

Meucci, A., 2010c. Factors on Demand - building a platform for portfolio managers risk managers and
traders. Risk 23 (7), 84–89.
URL http://symmys.com/node/164
Meucci, A., 2010d. Review of dynamic allocation strategies: Convex versus concave management. Work-
ing Paper.
URL http://symmys.com/node/153
Meucci, A., 2010e. Review of linear factor models: Unexpected common features and the systematic-
plus-idiosyncratic myth. Working paper.
URL http://www.symmys.com/node/336
Rau-Bredow, H., 2004. Value at risk, expected shortfall, and marginal risk contribution. In: Szego, G.
(Ed.), Risk Measures for the 21st Century. Wiley, pp. 61–68.
Rudin, W., 1976. Principles of Mathematical Analysis, 3rd Edition. McGraw-Hill.

Potrebbero piacerti anche