Fmincon - Value-at-Risk Minimization - Incorrect values returned
Mostrar comentarios más antiguos
Hi all,
I'm having troubles using fmincon. A little help would be reaally appreciated.
So i'm trying to minimize the following function (Semi-Parametric Conditional Value-at-Risk) over w, the weight between two assets return series :
function adjcvar=adjcvar(rets,alpha,w)
%Portfolio return
rp=w*rets(:,1)+(1-w)*rets(:,2);
%Mean return and StDev
mu=mean(rp);
sig=std(rp);
%Skewness and Kurtosis
S=skewness(rp);
K=kurtosis(rp);
%Standard Normal inverse cumulative distribution function
z=norminv(alpha,0,1);
%Estimated Quantile adjusted for Skewness and Kurtosis
Q=z+(z^2 - 1)*S/6+(z^3 -3*z)*(K-3)/24 - (2*z^3 - 5*z)*(S*diag(S))/36;
%Adjusted Value-at-Risk
adjvar=min(mu+sig*diag(Q),0);
%Adjusted Conditional VaR
adjcvar=mean(rp(rp<=adjvar));
Fmincon is used as follows:
[w]=fmincon(@(w)adjcvar([ret.mscimin,static.vsfret],alpha,w),w0w,[],[],[],[],lbw,ubw,[],options);
with
options = optimset('Display','notify','Algorithm','active-set');
lbw=0; %Upper-bound
ubw=1; %Lower-bound
w0w=0.5; %Starting Value
What happens is that if I set w0w, the starting value, between 0 and 0.61, fmincon returns w=0. If i set w0w at 0.62 or above, fmincon returns w=1.
I know empirically that the right weight is around 0.61-0.62.
Fmincon returns the following message:
Local minimum found that satisfies the constraints.
Optimization completed because the objective function is non-decreasing in
feasible directions, to within the default value of the function tolerance,
and constraints were satisfied to within the default value of the constraint tolerance.
<stopping criteria details>
Active inequalities (to within options.TolCon = 1e-006):
lower upper ineqlin ineqnonlin
1
I'm quite new to fmincon and don't really understand why itjust goes to the upper or lower boundary and stops.
Thanks for reading and any advice you could give.
Have a nice day.
Edouard
Respuesta aceptada
Más respuestas (1)
Moad
el 18 de Feb. de 2014
0 votos
Hello Sir can u provide a code of minimazing Value at Risk with the fmincon
i actualy want to minimize portfolio Parametric VaR for many assest returns
thank you very much
Categorías
Más información sobre Create Portfolio en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!