Code covered by the BSD License  

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Highlights from
Four parameters logistic regression - There and back again

4.8
4.8 | 5 ratings Rate this file 19 Downloads (last 30 days) File Size: 4.46 KB File ID: #38122 Version: 1.1
image thumbnail

Four parameters logistic regression - There and back again

by

 

11 Sep 2012 (Updated )

Fit data points with a four points logistic regression or interpolate data.

| Watch this File

File Information
Description

One big holes into MatLab cftool function is the absence of Logistic Functions. In particular, The Four Parameters Logistic Regression or 4PL nonlinear regression model is commonly used for curve-fitting analysis in bioassays or immunoassays such as ELISA, RIA, IRMA or dose-response curves. It is characterized by it’s classic “S” or sigmoidal shape that fits the bottom and top plateaus of the curve, the EC50, and the slope factor (Hill's slope). This curve is symmetrical around its inflection point.
The 4PL equation is:
F(x) = D+(A-D)/(1+(x/C)^B)
where:
A = Minimum asymptote. In a bioassay where you have a standard curve, this can be thought of as the response value at 0 standard concentration.
 
B = Hill's slope. The Hill's slope refers to the steepness of the curve. It could either be positive or negative.
 
C = Inflection point. The inflection point is defined as the point on the
curve where the curvature changes direction or signs. C is the concentration of analyte where y=(D-A)/2.
 
D = Maximum asymptote. In an bioassay where you have a standard curve, this can be thought of as the response value for infinite standard concentration.
  
In this submission there are 2 functions:
L4P - to find the 4 parameters and to fit your data (as calibrators...);
L4Pinv - to interpolate data of unknown samples onto calibrators curve.

Enjoy!

Required Products Curve Fitting Toolbox
MATLAB release MATLAB 7.11 (R2010b)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (12)
30 Jun 2016 Anders

Anders (view profile)

 
29 Feb 2016 D C

D C (view profile)

Yes it is fiddly in MatLab, I recommend taking a look at www.mycurvefit.com or if you're running ELISAs then www.myassays.com

28 Jan 2016 Giuseppe Cardillo

gosh!!! varargin is not a "function". It is Variable length input argument list. In particular, for L4P, the mandatory input data are, of course, X and Y data points. Varargin is a 1x4 vector of guessing parameters for logistic regression: if you pass it to L4P, it will use it for non linear regression; if you don't pass it, L4P will estimate the vector from your X,Y data. Is it clear now?

Comment only
28 Jan 2016 Mark Ferris

Hi Giuseppe, thanks for the curve fitting code, it should be exactly what I need. I'm not great with MATLAB though and I keep getting this error with your code:

Attempt to execute SCRIPT varargin as a function:
C:\Program
Files\MATLAB\R2015a\toolbox\matlab\lang\varargin.m

Error in SensorResponseCode6 (line 56)
args=cell(varargin);

Any idea how to fix this? Line 56 is referring to line 131 of your original code. SensorResponseCode6 is a combination of a code I wrote and your code.

Comment only
30 Sep 2014 Giuseppe Cardillo

I don't know. I should see your data points

Comment only
29 Sep 2014 Ufop

Ufop (view profile)

why i get this error? I have two data measured, X and Y. I just put:

load x.txt
load y.txt

[cf G]=L4P(x,y) , and appears this error:

Error using fit>iFit (line 415)
NaN computed by model function, fitting cannot continue.
Try using or tightening upper and lower bounds on coefficients.

Error in fit (line 109)
[fitobj, goodness, output, convmsg] = iFit( xdatain, ydatain, fittypeobj, ...

Error in L4P (line 194)
[cf G] = fit(x(ok_),y(ok_),ft_,fo_);

thanks

Comment only
05 Mar 2014 Andrew Horchler  
23 Apr 2013 Hugo Gasca-Aragon

C is the mean response point where y=(D+A)/2. The inflection point is where F''(x)=0, this is C*((B-1)/(B+1))^(1/B).

02 Apr 2013 Giuseppe Cardillo

sorry, I did an error when I created the zip file. I'm uploading the correct version

Comment only
02 Apr 2013 Daniel

Daniel (view profile)

Dear Giuseppe,
I cannot find your m file L4Pinv, is it uploaded somewhere else?
Thank you!

Comment only
02 Apr 2013 Daniel

Daniel (view profile)

 
29 Jan 2013 Jessica Inskip

My apologies. I had not read through the notes thoroughly; I have found the fitted curve plot.
Thanks!

Comment only
Updates
03 Apr 2013 1.1

I uploaded L5Pinv instead of L4Pinv

Contact us