MCA11: Mathematical Foundation For Computer Science 1: Example 2.13

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

Semester: I

MCA11: Mathematical Foundation for Computer Science 1

Example 2.13:
Compute the quadratic regression equation of following data.
Check its best fitness.
x -3 -2 -1 0 1 2 3

y 7.5 3 0.5 1 3 6 14

Solution:
We prepare following table, Here N=7

x y x2 x3 x4 xy x2y
-3 7.5 9 -27 81 -22.5 67.5
-2 3 4 -8 16 -6 12
-1 0.5 1 -1 1 -0.5 0.5
0 1 0 0 0 0 0
1 3 1 1 1 3 3
2 6 4 8 16 12 24
3 14 9 27 81 42 126

Page 1 of 3
The equations are

Substituting values the equations are

7a0 + 0 + 28a2 = 35 -----eq1

0 + 28a1 + 0 = 28 ------eq2

28a0 + 0 + 196a2 = 233 -------eq3


Solving the simultaneous equations eq1 and eq3

7a0 + 28a2 = 35

28a0 + 196a2 = 233

Hence a2 = 1.107142 and a0 = 0.571429

Page 2 of 3
We get a1 = 1 using equation 2 Hence

the quadratic equation is

y= 0.571429 + x + 1.107142 x2

The following plot is just for reference. If asked then only draw it.
Quadratic Regression
16

14
y= 0.571429 + x + 1.107142 x2

12

10

8
Series1
6

0
-4 -3 -2 -1 0 1 2 3 4
x



Page 3 of 3

You might also like