Stutzer index (stutzer performance ratio)
Show older comments
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 Comment
Oleg Komarov
on 1 Aug 2012
Comment out the
returns=xlsread('stutzer.xls','Sheet1','A1:A5');
in objfun() function.
Answers (0)
Categories
Find more on Creating and Concatenating Matrices in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!