Portfolio optimization - quad prog function

Hi,
I have a function mean_var_portopt1 (here attached). I am trying to call the function by writing:
targetreturn=0.07
% Determine the efficient portfolio weights given the target return.
[Weff]= mean_var_portopt1(targetreturn, Rets);
Rets is a 3740x5 matrix of asset returns. As a result, I should get a 5-element column vector with asset weights but instead I get a 5x5 matrix, why is that?
Thanks!

댓글 수: 3

Matt J
Matt J 2014년 7월 18일
When I run your code, I do get a 5x1 columns vector.
civs
civs 2014년 7월 18일
You do? how come? ...
Matt J
Matt J 2014년 7월 18일
편집: Matt J 2014년 7월 18일
There's no apparent reason that I should not. My guess is that you did not actually input targetreturn=0.07, but rather some non-scalar value.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Portfolio Optimization and Asset Allocation에 대해 자세히 알아보기

질문:

2014년 7월 17일

편집:

2014년 7월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by