% Code Matlab de génération de frontière efficace % Illustration du thm de Black (1972): On peut générer % la frontière efficace à partir de deux portefeuilles efficients % arbitraires. % auteur: Pascal St-Amour, aut. 1999 % cours 3, 6-203-79, TMC % changer lignes 31 et 37. V = [ ... 0.40 0.03 0.02 0.01; 0.03 0.20 -0.4 -0.06; 0.02 -0.4 0.30 0.03; 0.01 -0.06 0.03 0.10; ] rbar = [ ... 0.06; 0.05; 0.07; 0.08; ] iota = ones(4,1) V_inv = inv(V) % B = rbar'*V_inv*rbar A = rbar'*V_inv*iota C = iota'*V_inv*iota % g = (B*V_inv*iota - A*V_inv*rbar)/(B*C-A^2) h = (C*V_inv*rbar - A*V_inv*iota)/(B*C-A^2) % % Rendement espéré constant 1 et portefeuille 1 % r_1 = 0.25; % Changer w_1 = g + h*r_1 w_1'*rbar % % Rendement espéré constant 2 et portefeuille 2 % r_2 = 0.80; % Changer w_2 = g + h*r_2 w_2'*rbar % % Frontière efficiente % alpha = [-5:0.1:5]'; w = []; r = []; sig = []; w = alpha*w_1' + (1-alpha)*w_2'; r = w*rbar; for j = 1:length(alpha); sig(j,1) = w(j,:)*V*w(j,:)'; end; plot(sig,r,'-') %Utiliser '*' xlabel('\it{\sigma_p}') ylabel('\it{E( r_p )}') % Résultats: % V = % % 0.4000 0.0300 0.0200 0.0100 % 0.0300 0.2000 -0.4000 -0.0600 % 0.0200 -0.4000 0.3000 0.0300 % 0.0100 -0.0600 0.0300 0.1000 % % % rbar = % % 0.0600 % 0.0500 % 0.0700 % 0.0800 % % % iota = % % 1 % 1 % 1 % 1 % % % V_inv = % % 2.4505 0.4235 0.4127 -0.1148 % 0.4235 -2.8902 -3.8187 -0.6308 % 0.4127 -3.8187 -1.6005 -1.8523 % -0.1148 -0.6308 -1.8523 10.1887 % % % B = % % 0.0113 % % % A = % % -0.0284 % % % C = % % -3.0124 % % % g = % % -1.1811 % 2.5973 % 2.5702 % -2.9864 % % % h = % % 13.6130 % -32.0205 % -31.1644 % 49.5719 % % % w_1 = % % 2.2222 % -5.4078 % -5.2209 % 9.4065 % % % ans = % % 0.2500 % % % w_2 = % % 9.7093 % -23.0191 % -22.3613 % 36.6711 % % % ans = % % 0.8000