To examine the effects of storage conditions on shelf life of a product several experiments were conducted. One involved measuring the moisture content of samples of the product at different levels of relative humidity. The results were as follows:
Relative Humidity (%) x: 30 35 40 45 50 55 Moisture Content (%) y: 7 10 11 12 15 16
Points on the scatter plot lie almost on a straight line so we can represent the relationship between moisture content and relative humidity by an equation
Fit a line to points "by eye". From the graph
at x = 35, y = a + 35b = 9
at x = 50, y = a + 50b = 14
Solve for a and b:
35b + a = 9
50b + a = 14
Subtract the first equation
so the equation of the straight line is approximately
y = - 2.67 + 0.33x
In general we need a systematic way of finding a straight line
y = a + bx
It is not satisfactory to fit a line "by eye" or arbitrarily take two points on the line the calculate a and b because different people would obtain different equations.
The most commonly used systematic method for estimating a and b is called the method of least squares.
The vertical distance from point (xi, yi) to the line y = a + bx is yi - (a + b.xi)
The sum of the squared distance is
The method of least squares consists of finding values of a and b which
minimise S. To find the minimum, you differentiate S with respect to a
and b, set the derivatives
and
to zero, and solve for a and
b. (The following derivation does not need to be remembered)
Hence the required values for a and b are given by the solution of the equations
The solution is obtained by solving for a in equation (1)
For moisture data, calculation of the least squares line is as follows:
So the line, estimated by the method of least squares, is
y = -2.98 + 0.35x
(compared with the approximation
y = -2.67 + 0.33x
obtained "by eye")
y = -2.98 + 0.35(37) = 9.97, i.e. approx 10%
Also, the points do not lie exactly in a line - there is some random
variation. Therefore the estimates
and
and predictions of y values
are also subject to some variation.
Progress check |
| ... Previous page | Next page ... |