The solution is not restricted to positive weights. It may be that the mean variance optimal portfolio requires shorting some of the assets. These shorted assets will have negative weights.
]]>On another note, I am using means (u_j), s.d.’s (s_j), covariance matrix based on 5 years of log[S(t+1)/S(t)] for daily price returns of 8 stocks (assets). For CAPM, I am regressing these 8 returns on the log return of the SP500 index to obtain the beta_j (j=1,1,…,8) for each. Then I set the expected excess annual return to 10%, or E(u)=0.000397 for the per/day return (0.1/sqrt(252) = 0.000397). The individual u_j’s for the stock then set to u_j = 0.000397 * beta_j
On the efficient frontier plot, the expected return (y-value) for each stock is determined as 0.000397 * beta_j, while the x-axis volatility or s.d. is simply the s_j for the stock’s 5-year log return. The efficient frontier line (efficient portfolios) is determined by incrementing E(u)=min(u_j) + i*delta, (delta= [max(u_j)-min(u_j)]/100), calculating w* for each increment using the Lagrangians, and then determining u_p and s_p via the matrix-vector and vector-matrix-vector operations on w*.
Thus far I can obtain the efficient frontier curve, and there is agreement between the greatest y-value for the curve and the stock with the greatest y=0.000397 * beta_j. However, the x-values of all of the stocks are shifted to the right and the frontier line is to the left. I have observed in the literature that for a CAPM model, the y-value plotted for each stock should be set to the fixed expected excess return you call “u” times the beta_j for each stock. Under this model, the only question becomes: how far back in the matrix algebra do you have to go for the s_j calculations when using the y=E(u)*beta_j approach to get the right values of s_j on the x-axis, that is, so the s_j’s for the frontier line directly overshadow the s_j’s for the set of stocks. There is one final point noticed on most EF plots: both the x- and y-values of the EF curve and the stock with the greatest excess return (on the far right) are always the same. So it begs, the question, when transforming u_j to u_j=E(u)*beta_j, what changes are needed to the matrix algebra above to ensure that at least both the x- and y-value for the max(y) of the EF curve and the x- and y-value for the stock with the greatest u_j are the same?
For some reason, plotting y=u*beta_j for each stock and the straightforward s_j for each stock’s 5 year log returns, the matrix algebra for w* and Lagrangians for obtaining u_p and s_p for each increment of fixed excess u
]]>The program and formulas will work for any range of data. You can use the decimal values for the means and variances/covariances, and the results will be valid.
]]>