Curve Fitting
Curve Fitting
Curve Fitting
Department of Statistics
P.R. Government College(A)
Kakinada
Curve Fitting
Curve fitting means finding a functional
relationship between the two variables X and
Y in the form Y = f(X) (X-Independent, Y-
Dependent) using a given set of n points
(x1,y1), (x2,y2),....(xn,yn).
The functional form is to be fitted at
best level using a principle, which is called
principle of least squares.
Principle of Least Squares:
The principle of least squares was
introduced by Legendre.
The Principle is “ the sum of squares of
deviations between actual values and estimated
values by the curve is to be minimum”.
i.e., ∑[yi-f(xi)]2 is to be minimum.
-> the term yi-f(xi)=E(say) is called error or residue
of ith ordinate.
Now the objective of the curve fitting is to
estimate the parameters in the functional relation
that chosen by minimizing the total error
some important curves applied in
practical life are,
-> Straight Line (Y = a + bX) [1st degree polynomial]
-> Parabola (Y=a + bX + CX2) [2 degree polynomial]
nd
=> 2 {∑[yi-(a+bxi+cxi2)](-1)} = 0
=> ∑yi – a ∑(1) - b∑xi - c∑xi2 = 0
=> ∑yi = na + b∑xi + c∑xi2 ....(2)
Again consider, ∂E/∂b= 0
=> ∂(∑[yi-(a+bxi+cxi2)]2 )/∂b = 0
=> 2 {∑[yi-(a+bxi+cxi2)](-xi)} = 0
=> ∑xiyi – a ∑xi - b∑xi2 - c∑xi3 = 0
2 3
Now, ∂E/∂c = 0
=> ∂(∑[yi-(a+bxi+cxi2)]2 )/∂a = 0
=> 2 {∑[yi-(a+bxi+cxi2)](-xi2)} = 0
=> ∑xi2yi – a ∑xi2 - b∑xi3 - c∑xi4 = 0
=> ∑xi2yi = a ∑xi2 + b∑xi3 + c∑xi4 ....(4)
The equations (2), (3) and (4) are called Normal
equations. Solving these equations we can get best
estimates for a and b.
With these estimates (1) becomes the parabola of best
fit.
c). Fitting of an Exponential curve of the form
Y = aebX:
Y = aebX ...(1) is the exponential curve to be fitted
for a given data of n points (x1,y1), (x2,y2),...(xn,yn) using
the principle of least squares.
If we approach directly, we can not get normal equations
( because of exponential terms).
So, we can simplify the work using logarithms.
Taking Ln (loge)on both sides of (1)
Ln(Y) = Ln(aebX)
=> Ln(Y) = Ln(a) + bX ....(2)
Clear that (2) is a straight line in Ln(Y) and X with
parameters Ln(a) and b.
By applying the principle of least squares, the Normal
equations to estimate the parameters Ln(a) and b are,