Stutzer index (stutzer performance ratio)
이전 댓글 표시
I'm trying to obtain a result from this formula: http://www.activetradermag.com/assets/news/Web%20extra%20images/stutzer1-1209.gif
However, i'm going somewhere detrimentally wrong
I run this matlab file, with stutzer.xls just having 5 random returns
% x0 = [0]; % Starting guess
x0=1;
returns=xlsread('stutzer.xls','Sheet1','A1:A5');
% optimopt = optimset('LargeScale','off');
% optimopt = optimset('fminsearch');
% optimopt = optimset('algorithm','interior-point');
% optimopt.MaxIter=9000000;
% optimopt.MaxFunEvals=9000000;
% optimopt.TolFun=1e-6;
% optimopt.TolX=1e-6;
% optimopt.Display='final';
% optimopt.HessUpdate='bfgs';
% optimopt.Tolcon=1e-6;
% optimopt.Diagnostics='off';
[result] = fminunc(@objfun,x0,options);
% x = fminunc(@(x) objfun(x,returns),options)
% x = fminsearch(@(x) objfun(x,returns),options)
and the OBJfun is written here;
function f = objfun(x,returns)
for i=1:5
returns=xlsread('stutzer.xls','Sheet1','A1:A5');
Omega = (-log((1/100)*(exp((x*returns(i,1))))));
Omega(:,i)=Omega;
f = sum(Omega);
end
I however do not get any results :( What am i doing wrong?
댓글 수: 1
Oleg Komarov
2012년 8월 1일
Comment out the
returns=xlsread('stutzer.xls','Sheet1','A1:A5');
in objfun() function.
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!