Max Sharpe ratio errors

9 ビュー (過去 30 日間)
Mengxi Li
Mengxi Li 2017 年 11 月 14 日
コメント済み: Mengxi Li 2017 年 11 月 14 日
p = Portfolio('AssetMean',[0.3, 0.1, 0.5], 'AssetCovar',... [0.01, -0.010, 0.004; -0.010, 0.040, -0.002; 0.004, -0.002, 0.023] );
p = setDefaultConstraints(p);
plotFrontier(p, 20);
weights = estimateMaxSharpeRatio(p);
[risk, ret] = estimatePortMoments(p, weights);
hold on
plot(risk,ret,'*r');
The expression to the left of the equals sign is not a valid target for an assignment. This is the output.
Many thanks
  1 件のコメント
Mengxi Li
Mengxi Li 2017 年 11 月 14 日
Many thanks. One more question, in terms of assetcovar, is order matters? I got a 6*6 mean-covariance matrix, but don't really know how to put into the assetcovar.

サインインしてコメントする。

回答 (1 件)

Guillaume
Guillaume 2017 年 11 月 14 日
Remove the ... on the first line.
It looks like that line was originally on two lines and you made it just one line without bothering to remove the ellipsis.
  2 件のコメント
Mengxi Li
Mengxi Li 2017 年 11 月 14 日
Can you please comment my variance-covariance matrix?
Mengxi Li
Mengxi Li 2017 年 11 月 14 日
Also can we see weights for each stock in the portfolio?
Many thanks!!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangePortfolio 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