You are on page 1of 16

Curve Fitting (Straight

Line)
Subhajit Golder
20151177010
Numerical Analysis
Course code:CSE-2303
Semester:2nd year 3rd semester
Department: CSE (4year)
North Western University
Contents

• Curve Fitting
• Why Curve Fitting?
• Approaches for Curve Fitting
• Fitting a straight line - Curve fitting
• Fitting a straight line - Curve fitting example
Curve Fitting

• Curve fitting is the process of constructing a curve, or


mathematical functions, which possess closest proximity
to the series of data.
• By the curve fitting we can mathematically construct the
functional relationship between the observed fact and
parameter values, etc.
• It is highly effective in mathematical modelling some
natural processes.
Curve Fitting

• It is a statistical technique use to drive coefficient values for


equations that express the value of one(dependent) variable as a
function of another (independent variable).
Why Curve Fitting?

• The main purpose of curve fitting is to theoretically describe


experimental data with a model (function or equation) and to find
the parameters associated with this model.
• Mechanistic models are specifically formulated to provide insight
into a chemical, biological or physical process that is thought to
govern the phenomenon under study.
• Parameters derived from mechanistic models are quantitative
estimation of real system properties (rate constants, dissociation
constants, catalytic velocities etc.)
Why Curve Fitting?

• It is important to distinguish mechanistic models from empirical


models that are mathematical functions formulated to fit a
particular curve but those parameters do not necessarily
corresponds to a biological, chemical or physical property.
Approaches for Curve Fitting

• There are two general approaches for curve fitting:

• Least squares regression:


Data exhibit a significant degree of scatter. The strategy is
to derive a single curve that represents the general trend
of the data
Approaches for Curve Fitting

• Interpolation:
Given a set of data that results from an experiment
(simulation based or otherwise), or perhaps taken from a
real-life physical scenario, we assume there is some function
that passes through the data points and perfectly represents
the quantity of interest at all non data points. With
interpolation we seek a function that allows us to
approximate such that functional values between the original
data set values may be determined (estimated). The
interpolating function typically passes through the original
data set.
Fitting a straight line - Curve fitting

Formula
• Straight line equation is y=a+bx

• The normal equations are


Fitting a straight line - Curve fitting example

Examples
Calculate straight line (y=a+bx) using
Least square method
Fitting a straight line - Curve fitting example

Solution:
• Straight line equation is y=a+bx.

• The normal equations are


∑y=an+b∑x
∑xy=a∑x+b∑x2
Fitting a straight line - Curve fitting example
Fitting a straight line - Curve fitting example

Substituting these values in the normal equations


270=5a+0b, 48=0a+10b

Solving these two equations using Elimination method,


5a=270
a=54
10b=48
5b=24
5a=270→(1)
10b=48→(2
Fitting a straight line - Curve fitting example

Taking equation (1), we have


⇒5a=270
⇒a=270/5
⇒a=54→(3)

Taking equation (2), we have


⇒10b=48
⇒b=48/10
⇒b=24/5→(4)
Fitting a straight line - Curve fitting example

Now substituting this values in the equation is y=a+bx, we get

• y=54+24/5(x)

• y=54+24/5

• (X-1998)
Thank You

You might also like