Free engineering calculators and unit convertersceo@instrumentationblog.in
Calibration · Free Calculator

Calibration Curve (Linear Regression) Calculator

Paste reference values and instrument readings. The calculator fits a least squares straight line, shows the slope and offset (gain and zero error), R², residuals and the formula to correct readings.

Least squaresSlope and offsetR²Residuals
Fit: reading =0.062 + 1.0014 × reference
Slope (gain)1.0014 (0.14 % gain error)
Offset (zero)0.062
R²0.999999
Standard error of fit0.03665
Largest residual (nonlinearity)0.043
Correction reference ≈ (reading − 0.062) ÷ 1.0014
How this result was calculated
  1. b = (nΣxy − ΣxΣy) ÷ (nΣx² − (Σx)²) = 1.0014
  2. a = (Σy − bΣx) ÷ n = 0.062
  3. Residual = reading − fitted value

Residuals

ReferenceReadingFittedResidualError
00.050.062−0.0120.05
2525.1225.0970.0230.12
5050.150.132−0.0320.1
7575.2175.1670.0430.21
100100.18100.202−0.0220.18
Advertisement

Least Squares Line

y = a + b × x
b = (nΣxy − ΣxΣy) ÷ [nΣx² − (Σx)²], a = (Σy − bΣx) ÷ n
R² = 1 − Σ(y − ŷ)² ÷ Σ(y − ȳ)²

x is the reference (standard) value and y the instrument reading. The slope b shows the gain error, the offset a the zero error, and the residuals the nonlinearity left after correcting gain and zero. The correction inverts the fitted line.

Worked example

For the five points shown, the fit is reading = 0.062 + 1.0014 × reference: a gain error of +0.14 % and a zero error of +0.062, with residuals within ±0.043.

Key insight: a high R² does not mean an accurate instrument; it only means the points are close to a straight line. Look at the slope, offset and residuals.
Advertisement

Frequently Asked Questions

What does the slope tell me?

The gain (span) error. A slope of 1.002 means the instrument reads 0.2 % too much per unit of input.

What do residuals show?

How far each point is from the fitted line, which is the nonlinearity after zero and span are corrected.

Can I use this for sensor coefficients?

For linear sensors, yes. For RTDs and thermocouples use the Callendar–Van Dusen or polynomial fits instead.

You May Also Like

Learn more on the blog

Instrumentation calibration and troubleshooting guide

A practical, field focused guide on instrumentationblog.in that explains the theory behind this calculator and how engineers apply it on real plants.

Read Full Article

More Calibration Calculators

More Calculator Categories