Professional Documents
Culture Documents
Covariance Matrix:
Assets: Rate of Return: Upper Bound: GOOGLE YAHOO CISCO
GOOGLE 1.3 0.75 3 1 -0.5
YAHOO 1.2 0.75 1 2 -0.4
CISCO 1.08 0.75 -0.5 -0.4 1
Efficient Frontier
1.3
Return
1.25
1.2
1.15
1.1
1.05
0 0.5 1 1.5 2 2.5
Risk
Efficient Frontier:
Risk: Return:
0.417375 1.144097
0.417375 1.144097
0.417375 1.144097
0.417375 1.144097
0.417375 1.144097
0.417375 1.144096
0.417375 1.144138
0.420756 1.149828
0.430807 1.155517
0.447528 1.161207
0.470919 1.166897
0.500979 1.172586
0.537708 1.178276
0.581108 1.183965
0.631177 1.189655
0.687916 1.195345
0.751324 1.201034
0.821403 1.206724
0.89815 1.212414
0.981568 1.218103
1.071655 1.223793
1.168412 1.229483
1.271839 1.235172
1.381935 1.240862
1.498701 1.246552
1.622136 1.252241
1.752241 1.257931
1.889016 1.263621
2.03246 1.26931
2.1875 1.275
SET ECHOIN 1
MODEL:
! Solves the generic Markowitz portfolio
model in a loop to generate the points
on the efficient frontier;
SETS:
ASSETS: RATE, UB, X;
COVMAT( ASSETS, ASSETS): COV;
POINTS: RET, VAR;
ENDSETS
DATA:
! Number of points on the
efficient frontier graph;
NPOINTS = 30;
POINTS = 1..NPOINTS;
! The stocks;
ASSETS = @OLE();
! Expected growth rate of each asset;
RATE = @OLE();
! Upper bound on investment in each;
UB = @OLE();
! Covariance matrix;
COV = @OLE();
ENDDATA
SUBMODEL SUB_RET_MIN:
[OBJ_RET_MIN] MIN = RETURN;
ENDSUBMODEL
SUBMODEL SUB_MIN_VAR:
[OBJ_MIN_VAR] MIN =
@SUM( COVMAT( I, J): COV( I, J) * X( I) * X( J));
ENDSUBMODEL
CALC:
! Set some parameters;
! Reset all params;
@SET( 'DEFAULT');
! Output error messages only;
@SET( 'TERSEO', 2);
! Suppress status window;
@SET( 'STAWIN', 0);
DATA:
@OLE() = VAR, RET;
ENDDATA
END
GO
QUIT