Hello,
I am working on portfolio analysis and tried the following example of the Financial Toolbox documentation, but get just an error message. The code is exactly the one from the documentation and all other examples are working well.
The code describes the portfolio optimization to find the max. sharp ratio. (link to the documentaion: http://www.mathworks.de/help/toolbox/finance/bswmb3d-1.html#bs3z4e7-1)
---------------------------------------
r0 = 0.03;
m = [ 0.05; 0.1; 0.12; 0.18 ];
C = [ 0.0064 0.00408 0.00192 0;
0.00408 0.0289 0.0204 0.0119;
0.00192 0.0204 0.0576 0.0336;
0 0.0119 0.0336 0.1225 ];
p = Portfolio('RiskFreeRate', r0);
p = p.setAssetMoments(m, C);
p = p.setDefaultConstraints;
pwgt = p.estimateMaxSharpeRatio;
display(pwgt);
---------------------------------------
When I run the code I get this error message:
Error in ==> SharpTest at 11 pwgt = p.estimateMaxSharpeRatio;
Thank you in advance for your help.
Dominik
No products are associated with this question.
It appears that tool was not present in R2011a. It is not shown in the R2011a documentation http://www.mathworks.com/help/releases/R2011a/toolbox/finance/bswmb3d-1.html#bswwlv8-1
4 Comments
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/47174#comment_97047
Please post the full error message. For example is it complaining about unknown method "estimateMaxSharpeRatio" ?
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/47174#comment_97052
That's the full error message:
??? No appropriate method, property, or field estimateMaxSharpeRatio for class Portfolio.
Error in ==> SharpTest at 11 pwgt = p.estimateMaxSharpeRatio;
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/47174#comment_97055
Please set a breakpoint at that line, and ask
Also, which MATLAB version are you using?
Direct link to this comment:
http://www.mathworks.com/matlabcentral/answers/47174#comment_97061
I use R2011a.
please could you give me more information (code) of your suggestion.
Thank you
Ok... I asked for methods(p)
estimateMaxSharpeRatio is not in the list. Does it depend on the version?