You're a champion for creating this!
Thanks very much...
I do have a couple of questions I would like to ask:
When you say "There is no way for the moment to change this number of iterations in EzyFit", I am a bit confused by this. In fminsearch the default for 'MaxInter' and 'MaxFunEvals' are both '200*numberOfVariables'.
I have set these to 2000000*numberOfVariables but I still run into the exact same error when using:
The error is:
Exiting: Maximum number of function evaluations has been exceeded
- increase MaxFunEvals option.
Current function value: 30502.906917
Also, since MaxInter and MaxfunEvals both must be integer values, I do not understand how the iteration above can have decimal values. Or maybe I am misinterpreting it?
The other thing I wanted to say is that if run fminsearch and call fitfun as per the code below, fminsearch is able to generate a perfect 3 exponent decay function in 175 iterations (i.e., much lower than 30502.906917). I should think ezfit should be able to achieve the exact same result if allowed to iterate within definable constraints (see TollX and TollFun below), because it also uses fminsearch.
Finally, probably a dumb question, how come 'showfit' will work when I supply a 3 (or 2) exponent function but ezfit fails with the above iteration error?
Looking forward to reading your answers......this is otherwise a brilliant toolbox.
% Define initial paramters
t = x;
y = y;
% Grab x and y values generated in ginput
TolFun = .000000001;
TolX = 0.1;
% TolFun = Termination tolerance on the function value
% TolX = Termination tolerance on x
% Plot x and y
h = plot(t,y,'b');
start = [0;0;0];
% Define starting lambdas (initial guesses)
outputFcn = @(x,optimvalues,state) fitoutputfun(x,optimvalues,state,t,y,h);
% User defined output function for each iteration of fminsearch
options = optimset('OutputFcn',outputFcn,'TolX',TolX,'TolFun',TolFun, 'Display', 'iter');
% Options for fminsearch
After reading the help file and trying to following the examples (only #2 seemed to work btw), my understanding how this script works is still a little vague. I have three questions:
1) What is the purpose of the variable 'tt' and how is it derived?
2) Why does the script only work when lsq_val is set to 'no'
3) What exactly are the parameters 's' returns - e.g., if I'm running a double exponent, does it return, in the following order:
A1 = first amplitude
t1 = first lifetime
A2 = second amplitude
t2 = second lifetime
yo = offset
04 Feb 2010
Toolbox for automated sorting of cellular calcium signals from optical imaging data.
Author: Eran Mukamel
The associated publication in Neuron 63, 747–760 makes this look promising. However, getting this to run based on the instructions provided in the supplementary publication is very trying for those with less than a mastery of Matlab.
James, Sara, Thierry and all others:
R2013b doesn't have the start button anymore. To install, get your path to ezyfit (setpath) and save it in the Environment tab. Then there is a hard coded problem in efmenu.m at line 212. The semi-colon should be a colon:
212 sufolder = strrep(userpath,':','');
I have a question: is there a way to force variables being smaller than a certain value or within an interval?
F.i. something like f=ezfit(x,y,'a/(1+exp(-b*(x-c)))+d;a=8&a>0;b<1&b>0;c=70;d=0'); (this of course does not work)