I've tested out the new code and it works a lot better for my case. One problem I've now identified is that you are not re-reversing t at the end of the function, so the calculated Qpre can be in error.

Other than this, I would suggest for you to include a brief usage example within the Help comments, e.g. constructing data from known parameters, adding some random error and obtaining parameter estimates. Just a few lines to help someone getting started.

Also, you should turn the various plotting calls off by default then have an extra (optional) input parameter for people to use to turn them on.

I notice that there are a couple of other FEX files called "isodd".
http://www.mathworks.com/matlabcentral/fileexchange/24278
http://www.mathworks.com/matlabcentral/fileexchange/2006

Do you know of any differences between these files and yours?
Darren

18 Nov 2010

diffxy
Second-order accurate numerical differentiation (N-dimensional)
Author: Darren Rowland

@ Carlos,
Yes this will handle equally spaced data too. The formula I have used reduces to the central difference formula when the data are equally spaced, so the result is mostly the same as GRADIENT in that case.
The first example in the file demo_diffxy demonstrates the case of equally spaced points (follow the link next to 'Published MATLAB Files' above to view).
Darren

This submission can't be used in its current form as it appears to be missing some functions.
There are also 44 M-lint messages, mostly relating to variables which are set but never used.

Ah, based on recursive permutation as here: http://www.mathworks.com/matlabcentral/fileexchange/13060-perms1

So not in the same order as Matlab PERMS or C++ STL NEXT_PERMUTATION. I guess this means I can't use this as starting points for a multithreaded version based on STL.

Andrew, I spent some time looking at it, and think I have fixed the problem. I just uploaded a newer version. Once it is up, please try your dataset on it and let me know how it goes.

Comment only

10 Feb 2014

Logistic curve fit
Fit a time series to a best-fitting logistic function.

James,
Great function, thank you. I too have the issue with outputting a constant value for Qpre, and, as with Darren, changing the scaling of the value for t fixes this. My t values scale between 0 and 1 in steps of 0.001.
Many thanks

Comment only

28 May 2013

Logistic curve fit
Fit a time series to a best-fitting logistic function.

Hi Darren,
Sorry about the plotting calls. I realized that I forgot to remove them just after resubmitting. I guess the follow up submission with those removed is still moving though the system.
Good catch on reversing t. It is one of those bugs introduced when addressing a different problem. I'll fix that bug and put a test example in the help comments in new submission later today.

Comment only

27 May 2013

Logistic curve fit
Fit a time series to a best-fitting logistic function.

Hey James,
I've tested out the new code and it works a lot better for my case. One problem I've now identified is that you are not re-reversing t at the end of the function, so the calculated Qpre can be in error.
Other than this, I would suggest for you to include a brief usage example within the Help comments, e.g. constructing data from known parameters, adding some random error and obtaining parameter estimates. Just a few lines to help someone getting started.
Also, you should turn the various plotting calls off by default then have an extra (optional) input parameter for people to use to turn them on.
Hope that helps,
Darren

Comment only

23 May 2013

Logistic curve fit
Fit a time series to a best-fitting logistic function.

Thanks for the feedback, Darren. I've made a fix based on your idea of rescaling the vector internally, and submitted an update. It isn't completely obvious to me why Qpre goes to the mean of Q for some scalings of t. In any case, I hope my fix is general and not limited to your special case. Keep me posted.

Comment only