You are on page 1of 14

TERM PAPER

Curve Fitting Numerical Methods

Walid Kashir F2016019092


Wasif Ahsan F2016019069
Ibtesam Ellahi 13018019067

Submission To:
Dr. Aziz Ur Rehman
Table of Contents
History and Introduction of Curve Fitting Numerical Method: .................................................................. 2
Least square method to-be used: ............................................................................................................ 2
Proof of y = a + bx ................................................................................................................................ 3
Proof of y=a+bx+c𝑥2 ............................................................................................................................ 3
Proof of y=a𝑏𝑥 ..................................................................................................................................... 4
Proof of y=a𝑥𝑏 ..................................................................................................................................... 5
Proof of y=a𝑒𝑏𝑥 ................................................................................................................................... 6
Geometrical Interpolation ....................................................................................................................... 6
Example 1:............................................................................................................................................... 8
Question:............................................................................................................................................. 8
Example 2:............................................................................................................................................... 9
Question:............................................................................................................................................. 9
Applications in engineering ................................................................................................................... 11
Advantages of curve fitting method ....................................................................................................... 13
Simplicity ........................................................................................................................................... 13
Applicability....................................................................................................................................... 13
Theoretical Under-pinning ................................................................................................................. 13
Disadvantages of curve fitting method .................................................................................................. 13
Sensitivity to outliners ....................................................................................................................... 13
Test statistics might be unreliable ...................................................................................................... 13
Tendency to over fit data ................................................................................................................... 13
History and Introduction of Curve Fitting Numerical Method:

The least squares method a very popular technique that is used to compute estimations of
parameters and to fit data. It is one of the oldest techniques of modern statistics, being first
published in 1805 by the French mathematician Legendre in a now-classic memoir. But this
method is even older because it turned out that, after the publication of Legendre's memoir(a
historical account or biography written from personal knowledge) , Gauss, the famous German
mathematician, published another memoir (in 1809) in which he mentioned that he had
previously discovered this method and used it as early as 1795. A bit similar to that of the Leibniz-
Newton controversy about the invention of calculus. A somewhat bitter early dispute followed,
which, however, did not diminish the popularity of this technique. Galton used it (in 1886) in his
work on the heritability of size, which laid down the foundations of CORRELATION and
REGRESSION analysis and also gave it its name. Both Pearson and Fisher, who did so much in the
early development of statistics used this technique and developed it in different contexts. One
of their famous contexts was “FACTOR ANALYSIS for Pearson and EXPERIMENTAL DESIGN for
Fisher”.

Least square method to-be used:


EQUATIONS:

• y = a + bx

• y = a + bx + cx 2

• y = abx

• y = a𝑥 b

• y = a𝑒 bx
Proof of y = a + bx

 y = a + bx

 ∑y = na + b ∑x (Eq:1)

 xy = ax + b𝑥 2

 ∑xy = a∑x + b∑𝑥 2 (Eq:2)

Then we form a table in order to find the values such as: ∑y. The table shown below can be made.
After making the table we can input the values and solve the equations simultaneously from a
and b. Hence, later equating values of a and b in original equation to obtain the equation of the
values from the table.

Proof of y=a+bx+c𝑥 2

 ∑y = na + b∑x + c∑𝑥 2 Eq: (1)

 ∑xy = a∑x + b∑𝑥 2 + c∑𝑥 3 Eq: (2)

 ∑𝑥 2 y = a∑𝑥 2 + b∑𝑥 3 + c∑𝑥 4 Eq: (3)

Then we form a table in order to find the values such as: ∑y. The table shown below can be made.
After making the table we can input the values and solve the equations simultaneously from a
and b. Hence, later equating values of a, b and c in original equation to obtain the equation of
the values from the table.
Proof of y=a𝑏 𝑥

 log y = log a𝑏 𝑥

 log y = log a + x log b

 Y = A +Bx

 Y = A + Bx

 ∑Y = nA + B ∑x (Eq:1)

 xY = Ax + B𝑥 2

 ∑xY = A∑x + B∑𝑥 2 (Eq:2)

Then we form a table in order to find the values such as: ∑y. The table shown below can be made.
After making the table we can input the values and solve the equations simultaneously from a
and b. Hence, later equating values of a and b in original equation to obtain the equation of the
values from the table.
Proof of y=a𝑥 𝑏

 log y = log a𝑥 𝑏

 log y = log a + b log x

 Y = A +bX

 Y = A + bX

 ∑Y = nA + b ∑X (Eq:1)

 XY = AX + b𝑋 2

 ∑XY = A∑X + b∑𝑋 2 (Eq:2)


Proof of y=a𝑒 𝑏𝑥
 log y = log a𝑒 𝑏𝑥

 log y = log a + bx

 Y = A +bx

 Y = A + bx

 ∑Y = nA + b ∑x (Eq:1)

 xY = AX + b𝑥 2

 ∑xY = A∑x + b∑𝑥 2 (Eq:2)

Then we form a table in order to find the values such as: ∑y. The table shown below can be
made. After making the table we can input the values and solve the equations simultaneously
from a and b. Hence, later equating values of a and b in original equation to obtain the
equation of the values from the table.

Geometrical Interpolation
As it can be seen in the graph below that data of two sensors are plotted on a grid. The graph
obtained is somewhat scattered. Hence, in order to analyze and understand the graph we have
drawn a best-fit line.
In the graph below it can be seen that a much more scattered graph has been plotted. Analyzing
these kinds of graphs is a tedious job. So, in order to have a better explanation and understanding
of the data we have used best-fit to plot the graph and techniques like geometric interpolation
can be used for obtaining best possible values for data not available.
Example 1:
Question:
Data of an IR sensor from an IR camera used to measure the temperature intensity of a
heating rod is given in the table below. Fit a curve of the form y = a + bx

 ∑y = na + b ∑x (Eq:1)

 ∑xy = a∑x + b∑𝑥 2 (Eq:2)

Let Temp = y & IR sensor resistance = x

Equating values in both equations from the table

 225 = 2a + 15.58b Eq (1)


 649.5 = 15.58a + 59.34b Eq (2)
Solving equations simultaneously give us vales of a & b:

 a = -26.1
 b= 17.8

Final Equation:

y = -26.1 + 17.8x

Example 2:
Question:
A data is collected relating to the average marks obtained in Computer Science of
students from a class. Use the table below fit the curve of the form y = a + bx + c𝑥 2 .

 ∑y = na + b∑x + c∑𝑥 2
 ∑xy = a∑x + b∑𝑥 2 + c∑𝑥 3
 ∑𝑥 2 y = a∑𝑥 2 + b∑𝑥 3 + c∑𝑥 4
Using x = Student & y = Marks Obtained

Equating values in both equations from the table

 230.8 = 2a + 21b + 91c


 894.8 = 21a + 91b + 441c
 4056.8 = 91a + 441b + 2275c

Solving equations simultaneously give us vales of a & b:

 a = -0.67 b = 20.07 c = -2.08

Final Equation:

y = -0.67 + 20.07x – 2.08𝒙𝟐


Applications in engineering
The graph below shows the cost of power generation increasing with the cumulative generation
capacity from different sources. A best fit graph can be obtained in order to predict the most
probable changes in the future of production and hence cost can be estimated and controlled
using various precautions.
In the graph below a load curve is shown. This is quit a neat curve which is obtained after drawing
a best fit. This graph is way too scattered and readability is extremely poor. So after best-fit future
load predictions and power generation schedules can be predicted. Moreover, future load and
rate of load can also be predicted.
Advantages of curve fitting method

Simplicity
It is very easy to explain and to understand

Applicability
There are hardly any applications where least squares doesn’t make sense

Theoretical Under-pinning
It is the maximum-likelihood solution and, if the Gauss-Markov conditions apply, the best linear
unbiased estimator

Disadvantages of curve fitting method


Sensitivity to outliners
The outliners i.e. wrong values can affect the sensitivity of the graph and hence lead to less
probable results

Test statistics might be unreliable


Test statistics might be unreliable when the data is not normally distributed (but with many
datapoints that problem gets mitigated)

Tendency to over fit data


Tendency to overfit data (LASSO or Ridge Regression might be advantageous)

You might also like