3. The method of least squares is a standard
approach to the approximate solution of over
determined systems, i.e., sets of equations in which
there are more equations than unknowns.
"Least squares" means that the overall solution
minimizes the sum of the squares of the errors
made in the results of every single equation.
The least-squares method is usually credited to Carl
Friedrich Gauss (1795), but it was first published
by Adrien-Marie Legendre.
4. A linear regression is a statistical analysis assessing
the association between two variables. It is used to
find the relationship between two variables.
Regression Equation(y) = a + bx Slope(b) =
(NΣXY - (ΣX)(ΣY)) / (NΣX2 - (ΣX)2)
Intercept(a) = (ΣY - b(ΣX)) / N
5. To fit the straight line y=a+bx:
Substitute the observed set of n values in this
equation.
Form the normal equations for each constant i.e.
Σy=na+bΣx, Σxy=aΣx+bΣx2 .
Solve these normal equations as simultaneous
equations of a and b.
Substitute the values of a and b in y=a+bx, which is
the required line of best fit.
6. Fit a straight line to the x and y values in the following
Table:
xi yi xiyi xi
2
1 0.5 0.5 1
2 2.5 5 4
3 2 6 9
4 4 16 16
5 3.5 17.5 25
6 6 36 36
7 5.5 38.5 49
28 24 119.5 140
28 i x 24.0 i y
140 2 i x i i 119.5 x y
3.428571
24
x y
7
4
28
7
3.428571
24
x y
7
4
28
7
7. 0.8392857
n x y
x y
i i i i
2 2
n x x
( )
7 119.5 28
24
2
7 140 28
a y
a x
0 1
3.428571 0.8392857 4 0.07142857
1
a
i i
*
* Y a a X
0 1
Y = 0.07142857 + 0.8392857x
8. Suppose if we want to know the approximate y value
for the variable x = 4. Then we can substitute the
value in the above equation.
Y * a a X
*
0 1
Y = 0.07142857 + 0.8392857x
Y = 0.07142857 + 0.8392857(4)
Y = 0.07142857 + 3.3571428
Y = 3.42857137 Ans
9.
10. Fit the following Equation:
0 . 24 i y
to the data in the following table:
xi yi X*=log xi Y*=logyi
1 0.5 0 -0.301
2 1.7 0.301 0.266
3 3.4 0.477 0.534
4 5.7 0.602 0.753
5 8.4 0.699 0.922
15 19.7 2.079 2.141
b y a x
log log( 2 )
2
log y log a b log x 2 2
* *
Y y, X x,
let log
log
a log
a , a b
0 2 1 2
*
* Y a a X
0 1