Fit a straight line for the given pairs of x y which are 0 3 1 6 2 8 3 11 4 13 5 14

A line of best fit is a straight line that is the best approximation of the given set of data.

It is used to study the nature of the relation between two variables. (We're only considering the two-dimensional case, here.)

A line of best fit can be roughly determined using an eyeball method by drawing a straight line on a scatter plot so that the number of points above the line and below the line is about equal (and the line passes through as many points as possible).

A more accurate way of finding the line of best fit is the least square method .

Use the following steps to find the equation of line of best fit for a set of ordered pairs ( x 1 , y 1 ) , ( x 2 , y 2 ) , ... ( x n , y n ) .

Step 1: Calculate the mean of the x -values and the mean of the y -values.

X ¯ = ∑ i = 1 n x i n Y ¯ = ∑ i = 1 n y i n

Step 2: The following formula gives the slope of the line of best fit:

   m = ∑ i = 1 n ( x i − X ¯ ) ( y i − Y ¯ ) ∑ i = 1 n ( x i − X ¯ ) 2

Step 3: Compute the y -intercept of the line by using the formula:

b = Y ¯ − m X ¯

Step 4: Use the slope m and the y -intercept b to form the equation of the line.

Example:

Use the least square method to determine the equation of line of best fit for the data. Then plot the line.

x 8 2 11 6 5 4 12 9 6 1
y 3 10 3 6 8 12 1 4 9 14

Solution:

Plot the points on a coordinate plane .

Fit a straight line for the given pairs of x y which are 0 3 1 6 2 8 3 11 4 13 5 14

Calculate the means of the x -values and the y -values.

X ¯ = 8 + 2 + 11 + 6 + 5 + 4 + 12 + 9 + 6 + 1 10 = 6.4 Y ¯ = 3 + 10 + 3 + 6 + 8 + 12 + 1 + 4 + 9 + 14 10 = 7

Now calculate x i − X ¯ , y i − Y ¯ , ( x i − X ¯ ) ( y i − Y ¯ ) , and ( x i − X ¯ ) 2 for each i .

i x i y i x i − X ¯ y i − Y ¯ ( x i − X ¯ ) ( y i − Y ¯ ) ( x i − X ¯ ) 2
1 8 3 1.6 − 4 − 6.4 2.56
2 2 10 − 4.4 3 − 13.2 19.36
3 11 3 4.6 − 4 − 18.4 21.16
4 6 6 − 0.4 − 1 0.4 0.16
5 5 8 − 1.4 1 − 1.4 1.96
6 4 12 − 2.4 5 − 12 5.76
7 12 1 5.6 − 6 − 33.6 31.36
8 9 4 2.6 − 3 − 7.8 6.76
9 6 9 − 0.4 2 − 0.8 0.16
10 1 14 − 5.4 7 − 37.8 29.16
∑ i = 1 n ( x i − X ¯ ) ( y i − Y ¯ ) = − 131 ∑ i = 1 n ( x i − X ¯ ) 2 = 118.4

Calculate the slope.

m = ∑ i = 1 n ( x i − X ¯ ) ( y i − Y ¯ ) ∑ i = 1 n ( x i − X ¯ ) 2 = − 131 118.4 ≈ − 1.1

Calculate the y -intercept.

Use the formula to compute the y -intercept.

b = Y ¯ − m X ¯ = 7 − ( − 1.1 × 6.4 ) = 7 + 7.04 ≈ 14.0

Use the slope and y -intercept to form the equation of the line of best fit.

The slope of the line is − 1.1 and the y -intercept is 14.0 .

Therefore, the equation is y = − 1.1 x + 14.0 .

Draw the line on the scatter plot.

Fit a straight line for the given pairs of x y which are 0 3 1 6 2 8 3 11 4 13 5 14

MCQs of Curve fitting by the numerical method

Showing 1 to 10 out of 18 Questions

1.

Fit a straight line for the given pairs of (x,y) which are (0,3), (1,6), (2,8), ( 3,11), (4,13), (5,14) .

(a)

y=2.26x

(b)

y=3.52+2.26x

(c)

y=3.52x

(d)

y=4+3x

2.

The table shows the average braking distance of a car at various speeds. Use a second degree polynomial to predict the braking distance at 70 mph.

Speed (x) (miles/hr) 20 30 40 50 60
Braking distance (y) (ft) 20 45 80 125 180

(a)

245 ft

(b)

225 ft

(c)

285 ft

(d)

265 ft

3.

Which equation represents the parabola that passes through the following points:

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

(a)

y=1.42x+1.07x2+0.55x3

(b)

y=1.42x3-1.07x2+0.55x

(c)

y=1.42x-1.07x2+0.55x3

(d)

y=1.55x-1.07x2+1.45x3

4.

To find the constants a and b of the regression model y=aebx to fit x1,y1, x 2,y2, ..., xn,yn the sum of the residuals that is minimized is _____________ .

(a)

∑i=1nyi-aebxi2

(b)

∑i=1nlnyi-lna-bxi2

(c)

∑i=1nyi-lna-bxi2

(d)

∑i=1nlnyi-lna-blnxi 2

5.

For data given below find ∑xi2yi .

X 0 1 2 3 4
Y 1 0 3 10 21

(a)

435

(b)

436

(c)

437

(d)

438

6.

If the normal equations for a straight line y=ax+b are 26=4a+6b and 34=6a+ 4b then fit the above straight line.

(a)

y=5x-b

(b)

y=5x+b

(c)

y=x+5b

(d)

y=x-5b

7.

Fit the curve y=aebx if their normal equations are 13.1991=4a+10b and 30.7134=10a+30b .

(a)

y=-0.4569e4.4419x

(b)

y=-404419e0.4569

(c)

y=4.4419e-0.4569x

(d)

y=1

8.

In the least square method we use ____________ to find the value of unknowns.

(a)

Regression equations

(b)

Normal equations

(c)

General equations

(d)

Auxiliary equations

9.

The normal equation for fitting of a parabola y=a+bx+cx2 is __________ .

(a)

a∑xi+b∑xi2+a∑x i3

(b)

a∑xi+b∑xi2+c∑x i3

(c)

a∑xi+b∑xi3+c∑x i4

(d)

a∑xi+b∑xi3+c∑x i2

10.

Fit the parabola y=a+bx+cx2 , if their normal equations are 9a+60c=11 , 60b=51 and 60a+708c=-9 .

(a)

y=0.5599+0.85x-0.2673x2

(b)

y=-0.5599+0.85x2-0.2673x3

(c)

y=-0.5599+0.85x-0.2673x2

(d)

y=-0.5599x2+0.85x-0.2673

Showing 1 to 10 out of 18 Questions

How do you fit a straight line?

Let (x;,yj), t = 0,1,2,....,n be the n sets of observations and let the related relation by y = ax + b. Now we have to select a and b so that the straight line is the best fit to the data. By the principle of least squares, E is minimum.

Which of the following is a normal equation for to fit straight line y a bx *?

Fit a straight line y=a+bx into the given data: (x,y):(5,12)(10,13)(15,14)(20,15)(25,16). Thus, the equation of the line is y=11+0.2x.

How do you fit a straight line trend by the method of least squares?

Use the least square method to determine the equation of line of best fit for the data. Then plot the line. Straight line equation is y = a + bx. This is the required trend line equation.

What is the formula for curve fitting?

The highest-order polynomial that Trendline can use as a fitting function is a regular polynomial of order six, i.e., y = ax6 + bx5 +cx4 + ak3 + ex2 +fx + g. polynomials such as y = ax2 + bx3'2 + cx + + e.