Efficient frontier in Matlab

7 次查看(过去 30 天)
Philippe
Philippe 2014-10-5
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

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Portfolio Optimization and Asset Allocation 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by