Efficient frontier in Matlab

7 visualizaciones (últimos 30 días)
Philippe
Philippe el 5 de Oct. de 2014
Editada: per isakson el 5 de Oct. de 2014
I'm trying to define the efficient frontier and the efficient portfolio using these lines of code:
%Variance,Covariance matrix and expected return matrix are defined bellow.
%The investment universe contains 4 assets
for r = 0.01:0.002:0.2;
P = [0.0845 0.0466 0.0711 0.0834
0.0466 0.1190 0.0530 0.1140
0.0711 0.0530 0.1410 0.0930
0.0834 0.1140 0.0930 0.1723];
PI = inv(P);
R = [ 0.0725 0.1005 0.1240 0.1425];
RT = R';
UN = ones(4,1);
UNT = UN';
A = R*PI*UN;
B = R*PI*RT;
C = UNT*PI*UN;
L = (C*r-A)/(B*C-A^2);
%Lamda
U = (B-A*r)/(B*C-A^2);
%Mu
X = [PI*((L*RT)+(U*UN))]
%X is giving the asset allocation for each iteration
VarOptimum = L*r + U
end
Now how do I find the mimumum variance asset allocation and how do I "draw" the efficient frontier graph.
Thanks

Respuestas (0)

Categorías

Más información sobre Portfolio Optimization and Asset Allocation en Help Center y File Exchange.

Productos

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by