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.
can't get "efmenu" to work in startup file.
I always get this Warning when starting Matlab 2012b:
Warning: Executing startup failed in matlabrc.
This indicates a potentially serious problem in your MATLAB setup,
which should be resolved as soon as possible. Error detected was:
Not enough input arguments.
> In matlabrc at 205
any ideas where this warning originates? Executing efmenu when matlab is already running works perfectly.
So far, love it... An improvement suggestion, modify extrapolate (or add a user option) to not extrapolate in the Y dimension as well as the X.
and a "bug". If there are several subplots, and showfit is used on several of them, the equation boxes are all drawn in the upper left subplot, not in the relevant subplot.
Otherwise, love it!!!