4PL and 5PL Curve Fitting with Interpolation
Operator: Abdulla Al Fahad. How tools are built and checked
An ELISA standard curve of 16 readings (eight two-fold dilutions from 100 down to 0.78 ng/mL, each in duplicate) fits a four-parameter logistic with R-squared 0.998, an EC50 of 12.9 ng/mL (95% interval 11.5 to 14.5), a Hill slope of 1.22 and a top plateau of 2.35. Three unknown samples read off that curve come out at 3.14, 11.0 and 36.7 ng/mL, each with an interval, and a fourth reading above the top plateau is reported as outside what the curve can reach. This page fits 4PL, 5PL, exponential, Michaelis-Menten and polynomial models by Levenberg-Marquardt so the estimates come with standard errors. For straight lines and multiple predictors, use Linear Regression for CSV.
Key features
- Six model families: 4PL, 5PL, exponential, exponential with plateau, Michaelis-Menten and polynomial
- Standard errors and 95% t intervals for every parameter, plus half-life or doubling time and the halfway point of a 5PL
- R-squared, adjusted R-squared, residual standard deviation and AICc (which counts the residual variance as a fitted parameter)
- Log-x chart of data and fit, and a residual plot
- Interpolation of unknown y values to x with an interval, and a flag when the answer is outside the fitted range
- Parameters, residuals, fitted curve and interpolations as CSV, and an XLSX whose fitted values and inverse are formulas on the parameter cells
How the models are fitted, and how unknown samples are read off the curve
Two columns, x and y, one point per row; put replicates on separate rows. Up to 5,000 points are fitted. Rows where either value is empty or not a number are left out and counted, and the fit needs more points than parameters (and at least as many different x values as parameters for the logistic models).
The 4PL, 5PL and Michaelis-Menten models need x of zero or more, and rows with a negative x are left out with a note. A zero x is allowed: the logistic curve takes its value at zero concentration there, but a point at zero cannot be drawn on the logarithmic axis, so the chart tells you how many are hidden.
Weighting is either none or relative (1 / y squared), which suits signals whose scatter grows in proportion to the signal. Under relative weighting rows with y = 0 are left out because the weight is undefined. Polynomials can be of degree 1 to 6.
How it works
Starting values come from the data. For a 4PL, Bottom and Top start at the lowest and highest y, the EC50 at the x where the data first cross mid-height, and the Hill slope at 0.5, 1, 2 or 4 with its sign set by whether y rises or falls with x. Levenberg-Marquardt then moves all parameters together using a central-difference Jacobian and Marquardt damping, accepting only steps that lower the weighted sum of squares, and the best of several starts is kept. It stops when the error no longer falls.
The 4PL is written y = Bottom + (Top - Bottom) / (1 + (EC50 / x)^Hill). A positive Hill slope means y rises with x, and a negative one means it falls, in which case EC50 is the concentration at the halfway response (the IC50 of an inhibitor). EC50 and the 5PL asymmetry are fitted as logarithms so they cannot go negative; their reported intervals are exponentiated and so are not symmetric around the estimate. In the 5PL the denominator is raised to the asymmetry power, and C is no longer the halfway point, so the page also reports the x at the halfway response.
Uncertainty uses the residual variance s squared = weighted SSE / (n - p) and the covariance matrix s squared times the inverse of J'J, where J is the Jacobian at the solution. Intervals use the t distribution with n - p degrees of freedom. Polynomials are solved as a linear least-squares problem with x centred and scaled for numerical stability, then converted back to coefficients of x with the covariance transformed to match.
For interpolation, the 4PL, 5PL, exponential, plateau and Michaelis-Menten models have closed-form inverses, and polynomials are inverted by scanning the fitted x range for crossings and bisecting, listing every crossing. The interval comes from the delta method: the derivative of x with respect to each parameter is minus the parameter derivative of the curve divided by its x derivative, combined with the parameter covariance. It reflects uncertainty in the curve only, not scatter in the unknown's own reading.
Common use cases
- Computing sample concentrations from a plate reader's optical densities using a duplicate eight-point standard curve.
- Fitting a Michaelis-Menten curve to 12 reaction rates and reading Vmax and Km with their standard errors.
- Estimating the half-life of a decaying signal from an exponential-with-plateau fit, with an interval from the rate constant's interval.
How to use this tool
- Open a table of x and y values, or press Load example for the ELISA standards, and check the x and y columns.
- Pick the model, the polynomial degree if relevant, and the weighting.
- Read the parameters and intervals, the warnings, the chart and the residual plot.
- Paste the y values of your unknowns to read their x off the curve.
- Download the parameters, residuals, curve or interpolations as CSV, or the XLSX.
Example
Excerpt of the example (ELISA standards, duplicates)
concentration_ng_ml,od450
100,2.134
100,2.170
50,2.018
50,2.049
25,1.565
...4PL fit and three unknowns
Bottom 0.0765 (se 0.0371) Top 2.3482 (se 0.0582)
EC50 12.946 (se 0.684; 95% 11.54 to 14.53) Hill slope 1.2176 (se 0.0856)
R-squared 0.9980, Sy.x 0.0391, 12 degrees of freedom
OD 0.42 -> 3.14 ng/mL (2.81 to 3.47)
OD 1.10 -> 11.0 ng/mL (10.37 to 11.62)
OD 1.85 -> 36.7 ng/mL (33.63 to 39.82)
OD 2.60 -> outside the range the curve can reachTips for best results
- Enter replicates as separate rows rather than averaging them. The fit then sees the real scatter and has n - p degrees of freedom to work with.
- A 4PL needs points on both sides of the bend. If the highest concentration is below the EC50, Top is an extrapolation and the page warns; extend the dilution series instead of trusting Top.
- Try relative weighting when the residual plot fans out with the signal, as it often does for absorbance and fluorescence, and check that the fan narrows afterwards.
- Compare models by AICc only when they are fitted to the same points with the same weighting. Prefer the 5PL over the 4PL when its AICc is lower by more than about 2 and its asymmetry interval excludes 1.
Common pitfalls
Interpolating near the plateaus is unreliable: the curve is almost flat there, so a tiny change in y moves x enormously, and the interval widens accordingly. Keep unknowns inside the middle of the standards.
The interval on an interpolated value excludes the scatter of the unknown's own measurement. Run unknowns in replicate and average before reading the curve.
Common errors and how to fix them
- A 4-parameter logistic needs at least 4 different x values (there are 3)
- Replicates at the same x do not count as different positions. Add dilutions so the curve has points to bend through.
- The fit failed: no starting guess led to a finite error
- The values are extreme or the model is far from the data. Check the units, look for a typo such as a missing decimal point and try a simpler model.
- 2 rows with a negative x left out; this model needs x of zero or more
- 4PL, 5PL and Michaelis-Menten are defined for concentrations of zero or more. Negative x usually means a blank-subtracted value; use the raw concentration, or fit an exponential or polynomial.
Best practices
- Cover the whole response: standards from below the bottom plateau to above the top one, in at least 8 dilutions, so that all four parameters are determined by data rather than by extrapolation.
- Report each parameter with its interval, not only R-squared. Two models can both reach 0.998 and disagree by a factor of two on EC50.
Which model to choose
A 4PL describes a symmetric S-shaped response between two plateaus and is the usual choice for immunoassays and dose-response data. The 5PL adds an asymmetry parameter for curves that approach one plateau faster than the other, and needs more points to support it. Michaelis-Menten has one saturating plateau and no lower one, so it suits enzyme rates with a zero baseline.
Exponential models describe growth or decay. Without a plateau they assume the signal heads to zero or infinity; with one they model approach to a floor, and the half-life they report is for the part above the plateau. A polynomial is a smoothing device, not a mechanism: it can fit well inside the data and misbehave outside.
Reading EC50 and the Hill slope
EC50 is the x at which the response is halfway between Bottom and Top. It is the quantity assays are usually compared on, and its interval here is computed on the log scale, so it is wider above the estimate than below. The Hill slope sets how steep the transition is: near 1 the curve spans about two orders of magnitude of concentration from 10% to 90% of the response, and larger values make it sharper.
The example's Hill slope of 1.22 with an interval of 1.03 to 1.40 describes a slightly steeper-than-hyperbolic response. A negative slope in your fit just means the response falls as x rises.
Weighting and the residual plot
Ordinary least squares assumes every point is equally noisy. In many assays the noise grows with the signal, so the high points dominate the fit and the low end, where unknowns often sit, is fitted loosely. Relative weighting divides each squared residual by y squared, which treats a 5% miss the same at every level.
The residual plot is the check: a random scatter around zero says the model shape suits the data, a curved pattern says the model is wrong, and a fan that widens to the right says weighting is needed.
Frequently asked questions
Why is the EC50 interval not symmetric around the estimate?
EC50 is fitted as a logarithm so that it stays positive, and the t interval is built on that scale and then exponentiated. A 95% interval of 11.54 to 14.53 around 12.95 is therefore longer on the upper side.
Can I fix Top or Bottom at a known value?
No. All parameters of a model are fitted from the data. If one plateau is known, the Michaelis-Menten model (a zero baseline) or a polynomial may be a closer description than a free 4PL.