method of least squre

14

Upload: danial-mirza

Post on 13-Jun-2015

387 views

Category:

Education


2 download

DESCRIPTION

METHOD OF LEAST SQURE

TRANSCRIPT

Page 1: METHOD OF LEAST SQURE
Page 2: METHOD OF LEAST SQURE

METHOD OF LEAST SQURE

Mirza Danial Masood

BSIT(B), UOS M.B.Din

Page 3: METHOD OF LEAST SQURE

OVERVIEW

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.

Page 4: METHOD OF LEAST SQURE

Linear Regression 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

Page 5: METHOD OF LEAST SQURE

WORKING PROCEDURE

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.

Page 6: METHOD OF LEAST SQURE

EXAMPLE OF STRAIGHT LINEFit a straight line to the x and y values in the following Table:

xiyi 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 ix 0.24 iy

1402 ix 5.119 ii yx

428571.37

24 4

7

28 yx

428571.37

24 4

7

28 yx

Page 7: METHOD OF LEAST SQURE

EXAMPLE OF STRAIGHT LINE

07142857.048392857.0428571.3

8392857.0281407

24285.1197

)(

10

2

221

xaya

xxn

yxyxna

ii

iiii

Y = 0.07142857 + 0.8392857x

*10

* XaaY

Page 8: METHOD OF LEAST SQURE

EXAMPLE OF STRAIGHT LINE

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.

*10

* XaaY Y = 0.07142857 + 0.8392857x

Y = 0.07142857 + 0.8392857(4)

Y = 0.07142857 + 3.3571428

Y = 3.42857137 Ans

Page 9: METHOD OF LEAST SQURE

EXAMPLE OF STRAIGHT LINE

Page 10: METHOD OF LEAST SQURE

EXAMPLE OF OTHER CURVE Fit the following Equation:

to the data in the following table:0.24 iy

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

)log(log 22

bxay

2120

**

log

logloglet

b, aaa

x, y, X Y

xbay logloglog 22

*10

* XaaY

Page 11: METHOD OF LEAST SQURE

EXAMPLE OF OTHER CURVE

Page 12: METHOD OF LEAST SQURE

EXAMPLE OF OTHER CURVE

Page 14: METHOD OF LEAST SQURE