Académique Documents
Professionnel Documents
Culture Documents
covariance de l'échantillon
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 67
Exemple
• Nous utilisons les données de rendement de mois pour les actions de .
A B C D E F G H I J K L
1 FIVE YEARS OF PRICES FOR 10 STOCKS AND THE SP500
Microsof J.P. ExxonMobi Procter & Bank of
2 t Apple Amazon Disney Cisco Morga Google l Gamble America SP500
3 Date MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC ^GSPC
4 01-Jan-19 103.60 165.09 1,718.73 111.52 46.63 101.89 1,116.37 71.65 95.04 28.33 2,704.10
5 01-Dec-18 100.77 156.46 1,501.97 108.81 42.73 96.10 1,035.61 66.68 90.56 24.38 2,506.85
6 01-Nov-18 109.54 176.52 1,690.17 114.60 47.20 109.46 1,094.43 76.96 93.11 28.10 2,760.17
7 01-Oct-18 105.51 216.33 1,598.01 113.95 44.81 106.57 1,076.77 77.13 86.60 27.21 2,711.74
61 01-Apr-14 35.81 74.26 304.13 73.91 19.55 48.55 523.78 84.71 69.76 14.07 1,883.95
62 01-Mar-14 36.33 67.54 336.37 74.59 18.97 52.65 555.45 80.80 68.11 15.97 1,872.34
63 01-Feb-14 33.70 63.46 362.10 75.28 18.44 49.28 603.90 79.07 66.47 15.35 1,859.45
64 01-Jan-14 33.29 60.37 358.69 67.64 18.40 47.70 586.67 75.70 64.26 15.56 1,782.59
2 Date MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC
3 1-Jan-19 2.78% 5.37% 13.48% 2.46% 8.75% 5.85% 7.51% 7.20% 4.83% 15.01%
4 1-Dec-18 -8.35% -12.06% -11.81% -5.19% -9.96% -13.02% -5.52% -14.34% -2.78% -14.20%
5 1-Nov-18 3.75% -20.34% 5.61% 0.57% 5.20% 2.67% 1.63% -0.23% 7.25% 3.22%
6 1-Oct-18 -6.84% -3.10% -22.59% -1.82% -6.15% -3.44% -10.29% -6.49% 6.34% -6.40%
7 1-Sep-18 2.18% -0.48% -0.48% 4.30% 1.83% -1.53% -2.05% 6.90% 0.34% -4.87%
58 1-Jun-14 2.54% 6.69% 3.84% 2.04% 0.93% 3.62% 2.71% 0.83% -2.76% 1.51%
59 1-May-14 1.33% 7.02% 2.73% 5.72% 7.18% -0.11% 6.12% -1.85% -1.36% 0.00%
60 1-Apr-14 -1.45% 9.48% -10.08% -0.92% 3.03% -8.11% -5.87% 4.73% 2.39% -12.70%
61 1-Mar-14 7.51% 6.23% -7.37% -0.92% 2.80% 6.62% -8.36% 2.16% 2.44% 3.97%
62 1-Feb-14 1.23% 5.00% 0.95% 10.70% 0.26% 3.26% 2.89% 4.36% 3.38% -1.32%
63
64 Mean 1.89% 1.68% 2.61% 0.83% 1.55% 1.26% 1.07% -0.09% 0.65% 1.00% <--=AVERAGE(K3:K62)
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 68
Exemple (suite)
• Nous calculons ci-dessous les rendements excédentaires et la matrice de
variance-covariance
66
A B : C D EExcess returns:
F
r -r
G H I J K L
ij i
67 Date MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC
68 1-Jan-19 0.88% 3.69% 10.87% 1.63% 7.20% 4.58% 6.44% 7.29% 4.18% 14.01% <--=K3-K$64
69 1-Dec-18 -10.24% -13.74% -14.42% -6.02% -11.51% -14.28% -6.60% -14.25% -3.43% -15.20% <--=K4-K$64
70 1-Nov-18 1.86% -22.02% 3.00% -0.26% 3.65% 1.40% 0.55% -0.13% 6.59% 2.22% <--=K5-K$64
71 1-Oct-18 -8.73% -4.77% -25.20% -2.65% -7.70% -4.71% -11.36% -6.40% 5.69% -7.40% <--=K6-K$64
124 1-May-14 -0.56% 5.34% 0.12% 4.89% 5.63% -1.37% 5.05% -1.76% -2.01% -1.00%
125 1-Apr-14 -3.34% 7.80% -12.69% -1.75% 1.48% -9.38% -6.94% 4.82% 1.74% -13.70%
126 1-Mar-14 5.62% 4.55% -9.98% -1.75% 1.25% 5.36% -9.44% 2.25% 1.78% 2.97%
127 1-Feb-14 -0.66% 3.32% -1.67% 9.87% -1.29% 1.99% 1.82% 4.45% 2.73% -2.32%
128
129 Variance-Covariance Matrix
130 MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC
131 MSFT 0.0034 0.0017 0.0024 0.0010 0.0016 0.0016 0.0019 0.0009 0.0005 0.0021
132 AAPL 0.0017 0.0052 0.0018 0.0008 0.0020 0.0006 0.0012 0.0002 0.0004 0.0007
133 AMZN 0.0024 0.0018 0.0069 0.0014 0.0023 0.0014 0.0032 0.0008 -0.0003 0.0022
134 DIS 0.0010 0.0008 0.0014 0.0024 0.0011 0.0014 0.0007 0.0010 0.0005 0.0016
135 CSCO 0.0016 0.0020 0.0023 0.0011 0.0033 0.0014 0.0009 0.0005 0.0004 0.0017
136 JPM 0.0016 0.0006 0.0014 0.0014 0.0014 0.0032 0.0008 0.0009 0.0002 0.0039
137 GOOG 0.0019 0.0012 0.0032 0.0007 0.0009 0.0008 0.0032 0.0003 0.0001 0.0015
138 XOM 0.0009 0.0002 0.0008 0.0010 0.0005 0.0009 0.0003 0.0023 0.0004 0.0010
139 PG 0.0005 0.0004 -0.0003 0.0005 0.0004 0.0002 0.0001 0.0004 0.0016 0.0001
140 BAC 0.0021 0.0007 0.0022 0.0016 0.0017 0.0039 0.0015 0.0010 0.0001 0.0058
141
142 {=MMULT(TRANSPOSE(B68:K127),B68:K127)/59}
Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-
Benninga & Mofkadi 69
covariance
Utilisation de R pour calculer la matrice de variance-
covariance
• R est un excellent outil pour calculer la matrice de variance-covariance :
• Le cœur du code est une ligne composée de "cov(assets_ret)".
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 70
La matrice de corrélation
• Utilisation de VBA :
A B C D E F G H I J K L
1 ESTIMATING THE CORRELATION MATRIX WITH VBA
2 Correlation matrix (user defined 'CorrMatrix' function)
3 MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC
4 MSFT 1.0000 0.3974 0.4888 0.3565 0.4689 0.4770 0.5682 0.3061 0.2084 0.4642 <--{=CorrMatrix('5y 10
5 AAPL 0.3974 1.0000 0.3084 0.2189 0.4747 0.1367 0.2891 0.0545 0.1316 0.1240 stocks Returns'!B3:K62)}
6 AMZN 0.4888 0.3084 1.0000 0.3425 0.4822 0.2913 0.6773 0.1956 -0.0959 0.3486
7 DIS 0.3565 0.2189 0.3425 1.0000 0.3786 0.5170 0.2682 0.4046 0.2423 0.4387
8 CSCO 0.4689 0.4747 0.4822 0.3786 1.0000 0.4297 0.2767 0.1961 0.1875 0.3834
9 JPM 0.4770 0.1367 0.2913 0.5170 0.4297 1.0000 0.2494 0.3445 0.0774 0.9181
10 GOOG 0.5682 0.2891 0.6773 0.2682 0.2767 0.2494 1.0000 0.1284 0.0315 0.3415
11 XOM 0.3061 0.0545 0.1956 0.4046 0.1961 0.3445 0.1284 1.0000 0.1856 0.2762
12 PG 0.2084 0.1316 -0.0959 0.2423 0.1875 0.0774 0.0315 0.1856 1.0000 0.0312
13 BAC 0.4642 0.1240 0.3486 0.4387 0.3834 0.9181 0.3415 0.2762 0.0312 1.0000
• Utilisation de R :
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 73
I. Le modèle à indice unique (Excel)
A B C D E F G H I J K L
1 COMPUTING THE SINGLE-INDEX VARIANCE-COVARIANCE MATRIX
2 Using the user defined 'SIM_VarCov' function
3 MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC
4 MSFT 0.0034 0.0013 0.0019 0.0011 0.0013 0.0013 0.0012 0.0010 0.0004 0.0017 <--{=SIM_VarCov(B16:K75,L16:L75)}
5 AAPL 0.0013 0.0052 0.0018 0.0011 0.0013 0.0013 0.0011 0.0010 0.0004 0.0017
6 AMZN 0.0019 0.0018 0.0069 0.0016 0.0019 0.0018 0.0017 0.0015 0.0006 0.0024
7 DIS 0.0011 0.0011 0.0016 0.0024 0.0011 0.0011 0.0010 0.0009 0.0004 0.0015
8 CSCO 0.0013 0.0013 0.0019 0.0011 0.0033 0.0013 0.0012 0.0010 0.0004 0.0018
9 JPM 0.0013 0.0013 0.0018 0.0011 0.0013 0.0032 0.0012 0.0010 0.0004 0.0017
10 GOOG 0.0012 0.0011 0.0017 0.0010 0.0012 0.0012 0.0032 0.0009 0.0004 0.0016
11 XOM 0.0010 0.0010 0.0015 0.0009 0.0010 0.0010 0.0009 0.0023 0.0003 0.0014
12 PG 0.0004 0.0004 0.0006 0.0004 0.0004 0.0004 0.0004 0.0003 0.0016 0.0006
13 BAC 0.0017 0.0017 0.0024 0.0015 0.0018 0.0017 0.0016 0.0014 0.0006 0.0058
14
15 Date MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC ^GSPC
16 1-Jan-19 2.8% 5.4% 13.5% 2.5% 8.7% 5.8% 7.5% 7.2% 4.8% 15.0% 7.6%
17 1-Dec-18 -8.3% -12.1% -11.8% -5.2% -10.0% -13.0% -5.5% -14.3% -2.8% -14.2% -9.6%
18 1-Nov-18 3.7% -20.3% 5.6% 0.6% 5.2% 2.7% 1.6% -0.2% 7.2% 3.2% 1.8%
73 1-Apr-14 -1.4% 9.5% -10.1% -0.9% 3.0% -8.1% -5.9% 4.7% 2.4% -12.7% 0.6%
74 1-Mar-14 7.5% 6.2% -7.4% -0.9% 2.8% 6.6% -8.4% 2.2% 2.4% 4.0% 0.7%
75 1-Feb-14 1.2% 5.0% 0.9% 10.7% 0.3% 3.3% 2.9% 4.4% 3.4% -1.3% 4.2%
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 74
I. Le modèle à indice unique (R)
• L'implémentation de la méthode en R dans notre exemple ressemble à ceci :
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 75
II. Modèle de corrélation constante
• Le modèle de corrélation constante d'Elton et Gruber (1973) calcule la matrice de
variance-covariance en supposant que :
• Les variances des rendements des actifs sont les rendements de l'échantillon,
• Les covariances sont toutes liées par le même coefficient de corrélation,
• Puisque , nous obtenons :
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 76
II. Modèle de corrélation constante (Excel)
A B C D E F G H I J K L
1 COMPUTING THE CONSTANT CORRELATION VARIANCE-COVARIANCE MATRIX
2 Using the user defined 'ConstantCorVarCov' function
3 Correlation 0.25
4 MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC
5 MSFT 0.0034 0.0010 0.0012 0.0007 0.0008 0.0008 0.0008 0.0007 0.0006 0.0011 <--{=ConstantCorVarCov(B17:K76,B3)}
6 AAPL 0.0010 0.0052 0.0015 0.0009 0.0010 0.0010 0.0010 0.0009 0.0007 0.0014
7 AMZN 0.0012 0.0015 0.0069 0.0010 0.0012 0.0012 0.0012 0.0010 0.0008 0.0016
8 DIS 0.0007 0.0009 0.0010 0.0024 0.0007 0.0007 0.0007 0.0006 0.0005 0.0009
9 CSCO 0.0008 0.0010 0.0012 0.0007 0.0033 0.0008 0.0008 0.0007 0.0006 0.0011
10 JPM 0.0008 0.0010 0.0012 0.0007 0.0008 0.0032 0.0008 0.0007 0.0006 0.0011
11 GOOG 0.0008 0.0010 0.0012 0.0007 0.0008 0.0008 0.0032 0.0007 0.0006 0.0011
12 XOM 0.0007 0.0009 0.0010 0.0006 0.0007 0.0007 0.0007 0.0023 0.0005 0.0009
13 PG 0.0006 0.0007 0.0008 0.0005 0.0006 0.0006 0.0006 0.0005 0.0016 0.0008
14 BAC 0.0011 0.0014 0.0016 0.0009 0.0011 0.0011 0.0011 0.0009 0.0008 0.0058
15
16 Date MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC
17 1-Jan-19 2.8% 5.4% 13.5% 2.5% 8.7% 5.8% 7.5% 7.2% 4.8% 15.0%
18 1-Dec-18 -8.3% -12.1% -11.8% -5.2% -10.0% -13.0% -5.5% -14.3% -2.8% -14.2%
19 1-Nov-18 3.7% -20.3% 5.6% 0.6% 5.2% 2.7% 1.6% -0.2% 7.2% 3.2%
74 1-Apr-14 -1.4% 9.5% -10.1% -0.9% 3.0% -8.1% -5.9% 4.7% 2.4% -12.7%
75 1-Mar-14 7.5% 6.2% -7.4% -0.9% 2.8% 6.6% -8.4% 2.2% 2.4% 4.0%
76 1-Feb-14 1.2% 5.0% 0.9% 10.7% 0.3% 3.3% 2.9% 4.4% 3.4% -1.3%
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 77
II. Modèle de corrélation constante (R)
• La mise en œuvre de cette méthode dans R pour notre exemple se présente
comme suit :
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 78
III. Méthodes de retrait
• Les méthodes de rétrécissement supposent que la matrice de variance-
covariance est une combinaison convexe de la matrice de covariance de
l'échantillon et d'une autre matrice :
Shrinkage
•
variance−covariance matrix var−cov
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 79
III. Méthodes de retrait (Excel)
• La matrice "autre" est une
A B C D E F G H I J K L
ESTIMATING THE VARIANCE-COVARIANCE MATRIX USING THE SHRINKAGE APPROACH
1 Gives weight 0.30 (the shrinkage factor) to sample var-cov and weight 0.70 to a diagonal matrix of only variances
• L'estimateur de rétrécissement
14
15 Other matrix = diagonal matrix of only variances and zero elsewhere
16 MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC
17 MSFT 0.0034 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 0.0000 <--=IF($A17=K$16,K4,0)
,
, ,
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 81
IV. Matrice Var-Cov des informations sur les options
(Excel)
• Nous utilisons les données de volatilité implicite des marchés d'options pour
chacune des 10 actions et une matrice de variance-covariance à corrélation
constante (où ρ=0,25) :
A B C D E F G H I J K L
1 CONSTANT CORRELATION MATRIX WITH IMPLIED VOLATILITIES
2 MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC
3 Implied volatility 33.99% 31.79% 23.54% 23.98% 21.19% 54.98% 22.76% 21.68% 17.12% 21.78% Extracted from options prices
4
5 Correlation 0.25
6 MSFT AAPL AMZN DIS CSCO JPM GOOG XOM PG BAC
7 MSFT 0.1155 0.0270 0.0200 0.0204 0.0180 0.0467 0.0193 0.0184 0.0145 0.0185 <--{=ImpliedVolvarcov(B3:K3,B5)}
8 AAPL 0.0270 0.1011 0.0187 0.0191 0.0168 0.0437 0.0181 0.0172 0.0136 0.0173
9 AMZN 0.0200 0.0187 0.0554 0.0141 0.0125 0.0324 0.0134 0.0128 0.0101 0.0128
10 DIS 0.0204 0.0191 0.0141 0.0575 0.0127 0.0330 0.0136 0.0130 0.0103 0.0131
11 CSCO 0.0180 0.0168 0.0125 0.0127 0.0449 0.0291 0.0121 0.0115 0.0091 0.0115
12 JPM 0.0467 0.0437 0.0324 0.0330 0.0291 0.3023 0.0313 0.0298 0.0235 0.0299
13 GOOG 0.0193 0.0181 0.0134 0.0136 0.0121 0.0313 0.0518 0.0123 0.0097 0.0124
14 XOM 0.0184 0.0172 0.0128 0.0130 0.0115 0.0298 0.0123 0.0470 0.0093 0.0118
15 PG 0.0145 0.0136 0.0101 0.0103 0.0091 0.0235 0.0097 0.0093 0.0293 0.0093
16 BAC 0.0185 0.0173 0.0128 0.0131 0.0115 0.0299 0.0124 0.0118 0.0093 0.0474
Benninga & Mofkadi Modélisation financière 5ème éd. Chapitre 12 - Matrice de variance-covariance 84