5.0

5.0 | 1 rating Rate this file 34 Downloads (last 30 days) File Size: 11.7 KB File ID: #31399
image thumbnail

Fit Logistic Curve to a Data Set

by

 

10 May 2011 (Updated )

This is a Matlab GUI, that will try to fit a logistic function to a given set of data.

| Watch this File

File Information
Description

The method used in this work is based on a tutorial by David Arnold.

http://online.redwoods.cc.ca.us/instruct/darnold/diffeq/logistic/logistic.pdf

RUN The Logistic.m this will bring up the GUI.

1. Give the x values on a text file in column format
2. Give the y values on a text file in col format
3. 'Plot Initial' Button will plot the distribution
4. 'Find Fit' button will find the best fit
5. 'Reset' will remove the plot (Although I wanted to clean all the fields - did not have time)
5. K, G, Dm are the values in the following equation

y = K./(1+exp(-G*(x-Dm)));

6. SSE gives the sum of squred error between the fitted function and the actual data
7. CC give the correlation co-efficient between the fitted function and actual data

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (9)
04 Jul 2014 Aishwarya Gunaputi

Sir, I got these errors after running this code. Can u please tell how to solve this problem.

??? Error using ==> feval
Undefined function or method 'Logistic_OpeningFcn' for input arguments of type 'struct'.

Error in ==> gui_mainfcn at 221
feval(gui_State.gui_OpeningFcn, gui_hFigure, [], guidata(gui_hFigure), varargin{:});

Error in ==> Logistic at 31
gui_mainfcn(gui_State, varargin{:});

16 May 2013 James Conder

I suspect the problem Rita and Michael were having is that their data describes a decreasing logistic and the program is set up to do an increasing logistic. I just uploaded a non-GUI fit_logistic function and at first it failed with Rita's data, too. Fortunately, it is an easy fix by making the time series negative.

14 Jun 2012 Ryan  
23 Feb 2012 Lu

hi Varuna De Silva,

This is the errors I received while following your instructions on the readme.txt

??? Attempt to reference field of non-structure array.

Error in ==> Logistic>plotBut_Callback at 159
axes(handles.axes1)

Error in ==> gui_mainfcn at 96
feval(varargin{:});

Error in ==> Logistic at 30
gui_mainfcn(gui_State, varargin{:});

??? Error while evaluating uicontrol Callback

15 Feb 2012 Varuna De Silva

Dear Rita and Michael,

Please check to see if your problem is solved in this new version.

Hopefully it is right this time.

BR, Varuna

16 Nov 2011 D Bhuiyan

Hello Varuna De Silva,
Thanks for nice program. Can you please help about the following question?
How can I get the curve fitting by using linear polynomial method (y=p1*x+p2)?
thanks....

16 Oct 2011 Michael

Hi Varuna De Silva,
this is really a great program (and it's almost what I need), but I have the same problem as Rita described. It would be great if it could be fixed somehow.
Thanks

15 Jul 2011 Varuna De Silva

Hello Rita,

Yes, I tried your data, and it seems in the CC estimation it divides by zero. I couldnt find a quick way out. I will do so and return later

30 Jun 2011 Rita

This program looks great and I was very excited with using it but it doesn't seem to like my data. I have for instance X=[.2;.4;.6;.7;.8;.9;1] and Y=[95;90;90;70;65;55;50]. When I press 'plot inital' it looks ok, but when I press 'find it' I get the message 'Exiting: Maximum number of function evaluations has been exceeded - increase MaxFunEvals option. Current function value: -Inf' with K=-Inf and s_sq_e=NaN.
Would be great if you could explain who to get this right. Thanks!

Updates
15 Feb 2012

Bug fixes in parameter estimation process. Thanks to Prof. Sean Crosson for directing me to those errors.

Contact us