how to use transformation with fminunc
3 次查看(过去 30 天)
显示 更早的评论
Dear all,
I am replicating a paper who recommends using fminunc to do a "constrained" optimization through a transformation. I have tried to use directly fmincon (with different algorithms) but the function doesnt optimize, thats the reason I would like to follow the paper advice and use a transformation as follows:
C_bar = lamda*(exp(C)/1+ exp(C))
where lamda is a constant, C is the unconstrained variable and C_bar is the constrained variable. I would really appreciate if you could show me how I could use the transformation in matlab. Do I have to create a seperate function? How can I link it to the optimizer please?
Here is my code
C=[1; 1; 1 ; 1; 1; 1; 1; 1; 1];
options=optimset('Diagnostics','on','Display','iter','TolX',0.001,'TolFun',0.001,'LargeScale','off','HessUpdate','bfgs');
[beta,fval,exitflag,output,grad,hessian] =fminunc(@mll,C,options)
Thanks a lot for your help
Best Regards
SB
2 个评论
采纳的回答
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Quadratic Programming and Cone Programming 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!