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.
Having some problems after upgrading Matlab to 2014b version. Following Olaf's sugegstions, some of the problems are solved (efmenu in figure), however still cannot do fit, returned error:
Error in pickdata (line 84)
Error in ezfit (line 210)
[x,y,h] = pickdata(fp);
Error in showfit (line 164)
(The line numbers might have changed since I tried to investigate a bit the problem)
Anyone has seen the same issue ??
Excellent tool. Needed a quick bug fix in 2014b:
in efmenu.m, replace everything with set(0,.. with set(groot,.. and get(0,.. with get(groot,... Also fixed line 95:
Replace everything with set(0,.. with set(groot,.. and get(0,.. with get(groot,... in other files as well