Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Curve Fitting

• The technique to fit curves to obtain intermediate


estimates and compute values of the function at a number
of discrete values along the range of interest.
• is the process of constructing a curve, or mathematical
function, that has the best fit to a series of data points,
possibly subject to constraints.
• also known as regression analysis, is used to find the
"best fit" line or curve for a series of data points. Most of
the time, the curve fit will produce an equation that can
be used to find points anywhere along the curve.
Least-Square Regression
• The data exhibit a significant degree of error or “noise”
• To derive a single curve that minimizes the discrepancy
between the data points and the curve
• The curve is designed to follow the pattern of the points
taken as a group.
• Straight Line / Simple Linear Regression
y = a + bx

Σy = na + bΣx
Σxy = aΣx + bΣx²
example
• Fit a straight line curve y = a+bx for the following data
using least square method.

x 1 2 3 4 6 8
y 2.4 3 3.6 4 5 6

n=6
x y xy x²
1 2.4 2.4 1
2 3 6 4
3 3.6 10.8 9
4 4 16 16
6 5 30 36
8 6 48 64
Σx = 24 Σy = 24 Σxy = 113.2 Σx² = 130

24 = 6a + 24b y = a + bx
113.2 = 24a + 130b
a = 1.98, b = 0.506 y = 1.98 + 0.506x
try
• Fit a straight line curve y = a+bx for the following data
using least square method.

x 1 2 3 4 5 6
y 2 4 7 9 12 14

n=6
x y xy x²
1 2 2 1
2 4 8 4
3 7 21 9
4 9 36 16
5 12 60 25
6 14 84 36
Σx = 21 Σy = 48 Σxy = 211 Σx² = 91

48 = 6a + 21b y = a + bx
211 = 21a + 91b
a = -0.6, b = 2.46 y = 2.46x – 0.6
try
• Fit a straight line curve y = a+bx for the following data
using least square method.

x 1 2 3 4 5
y 4 3 6 7 11

n=5
x y xy x²
1 4
2 3
3 6
4 7
5 11
Σx = Σy = Σxy = Σx² =
• Polynomial Linear Regression
y = a+bx+cx²

Σy = na + bΣx + cΣx²
Σxy = aΣx+ bΣx² + cΣx³
Σx²y = aΣx² + bΣx³ + cΣx4
try
• Fit a curve of the form y = a+bx+cx² for the following data
using least square method.

x 0 1 2 3 4
y 1 1.8 1.3 2.5 6.3

n=5
x y xy X²y x² x³ x4
0 1 0 0 0 0 0
1 1.8 1.8 1.8 1 1 1
2 1.3 2.6 5.2 4 8 16
3 2.5 7.5 22.5 9 27 81
4 6.3 25.2 100.8 16 64 256
Σx = 10 Σy = 12.9 Σxy = Σx²y = Σx² = 30 Σx³ = 100 Σx4 = 354
37.1 130.3

12.9 = 5a + 10b + 30c y = a + bx + cx²


37.1 = 10a+ 30b + 100c
130.3 = 30a + 100b + 354c y = 0.55x² - 1.07x + 1.42
a = 1.42, b = -1.07, c = 0.55
try
• Fit a curve of the form y = a+bx+cx² for the following data
using least square method.

x 0 1 2 3 4 5
y 2.1 7.7 13.6 27.2 40.9 61.1

n=6
x y xy x²y x² x³ x4
0 2.1
1 7.7
2 13.6
3 27.2
4 40.9
5 61.1
Σx = Σy = Σxy = Σx²y = Σx² = Σx³ = Σx4 =
• Exponential Curve Regression
𝑦 = 𝑎𝑏 𝑥

log y = log (a𝑏 𝑥 )


log y = log a + log 𝑏 𝑥
log y = log a + x log b log y = Y
Y = A+Bx log a = A
log b = B

ΣY = nA + BΣx
ΣxY = AΣx + BΣx²
example
• Fit a curve of the form 𝑦 = 𝑎𝑏 𝑥 for the following data using
least square method.

x 1 2 3 4 5 6 7
y 87 97 113 129 202 195 193

n=7
x y Y = log y xY x²
1 87 1.94 1.94 1
2 97 1.99 3.98 4
3 113 2.05 6.15 9
4 129 2.11 8.44 16
5 202 2.31 11.55 25
6 195 2.29 13.74 36
7 193 2.29 16.03 49
Σx = 28 ΣY = ΣxY = Σx² = 140
14.98 61.83

14.98 = 7A + 28B a = 74.13


61.83 = 28A + 140B b = 1.17
𝑦 = 74.13 1.17 𝑥
A = 1.87, B = 0.068
try
• Fit a curve of the form 𝑦 = 𝑎𝑏 𝑥 for the following data using
least square method.

x 3 4 5 6 7 8 9
y 11 12 14 18 19 21 23

n=7
x y Y = log y xY x²
3 11 1.04 3.12 9
4 12 1.08 4.32 16
5 14 1.15 5.75 25
6 18 1.26 7.56 36
7 19 1.28 8.96 49
8 21 1.32 10.56 64
9 23 1.36 12.24 81
Σx = 42 ΣY = 8.49 ΣxY = Σx² = 280
52.51

8.49 = 7A + 42B a = 7.52


52.51 = 42A + 280B b = 1.14
𝑦 = 7.52 1.14 𝑥
A = 0.876, B = 0.056
• Power Model Curve Regression
𝑦 = 𝑎𝑥 𝑏

log y = log (a𝑥 𝑏 )


log y = log a + log 𝑥 𝑏
log y = log a + b log x log y = Y
Y = A+bX log a = A
log x = X

ΣY = nA + bΣX Σy = na + bΣx
ΣXY = AΣx + bΣX² Σxy = aΣx + bΣx²
try
• Fit a curve of the form 𝑦 = 𝑎𝑥 𝑏 for the following data using
least square method.

x 3 4 5 6 7 8 9
y 11 12 14 18 19 21 23

n=7
x y X = log x Y = log y XY X²
3 11 0.477 1.04 0.496 0.228
4 12 0.602 1.08 0.65 0.362
5 14 0.699 1.15 0.803 0.489
6 18 0.778 1.26 0.98 0.606
7 19 0.845 1.28 1.08 0.714
8 21 0.903 1.32 1.19 0.816
9 23 0.954 1.36 1.30 0.911
Σx = 42 ΣX = 5.26 ΣY = 8.49 ΣXY = 6.5 Σx² =
4.12

8.49 = 7A + 5.26b a = 4.74


6.5 = 5.26A + 4.12b
A = 0.676, b = 0.714 𝑦 = 4.74𝑥 0.714
Activity
• Fit a straight line curve y = a+bx for the following data using
least square method.
x 1 3 4 6 8 9 11 14
y 1 2 4 4 5 7 8 9

• Fit a curve of the form 𝑦 = 𝑎𝑏 𝑥 for the following data using


least square method.
x 1 2 3 4 5 6
y 151 100 61 50 20 8

• Fit a curve of the form y = a+bx+cx² for the following data using
least square method

You might also like