extrapolation/interpolation techniques & applications. 1)curve fitting. – non-linear to linear...

20
Extrapolation/ Interpolation Techniques & Applications. 1) Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2) Piece-wise Linear Interpolation. From – SHREYAS JOSHI

Upload: amanda-boyd

Post on 05-Jan-2016

220 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Extrapolation/Interpolation Techniques & Applications.

1) Curve Fitting. – Non-linear to linear modeling. – Extrapolation.

2) Piece-wise Linear Interpolation.

From – SHREYAS JOSHI

Page 2: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Curve Fitting. – Non-linear to linear modeling.

• Let’s take an example – the values are hypothetical.

X – Values. (Signal voltage - output)

Y- Values. ( Signal Strength).

0 2

1 3

2 5

3 4

4 6

Page 3: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Curve Fitting. – Non-linear to linear modeling.

• Let’s plot the points.

0 0.5 1 1.5 2 2.5 3 3.5 4 4.50

1

2

3

4

5

6

7

2

3

5

4

6

Plot-Points - Y vs. X

Plot-Points

Page 4: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Curve Fitting. – Non-linear to linear modeling.

• Let’s Join the Point and see the nature of graph.

0 2 4 6 8 10 12 140

1

2

3

4

5

6

7

Series1Series2Series3Series4Series5Non-linear-Representa-tion.

Page 5: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

How to realize the Non-linear to linear

• The Principle is that the line should pass through the average points of x and y. This way we can realize that at least it touches the average points.

• In our example, the average of x is 2 and y is 4.• Remember, we don’t know the slope of the

line yet. What should be the slope of line? In such a way that the deviation of point from the arbitrary line ( linear model ) is minimum.

Page 6: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Is this a good model?.

• Is it good to have a line whose slope is zero and passes through the average points of x and y.

0 2 4 6 8 10 12 140

1

2

3

4

5

6

7

Series1

Series2

Series3

Series4

Series5

Non-linear-Representation.

Average Plot.

Page 7: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

How about this model ?

0 2 4 6 8 10 12 140

1

2

3

4

5

6

7

Series1

Series2

Series3

Series4

Series5

Non-linear-Representation.

Average Plot.

Page 8: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

What is changed in the two graphs.

• 1) Slope of the line is changed.• Does Slope makes the deviation minimal.• -- Answer is yes, slope has a good effect on

minimizing the deviation.

Let’s go to the basics of straight line equation. y = mx + c ; where m is slope and c is intercept.Another way to represent line is ( Y- Y1) = m ( X-X1)

Page 9: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Let’s start realizing now.

• The two good points are sure the average points of x and y which are 2 and 4 respectively.

• Y-4 = m(x-2) or Y = m(x-2) + 4.

• Let’s make a new table. Now.

Page 10: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Computing Linear model.

Remember here, Linear model data is calculated using , Y = m(x-2) + 4

x Real – Y values.

Based on Linear model – Y-value.

Difference in Y-Values.

0 2 4-2m 2-2m

1 3 4-m 1-m

2 5 4 -1

3 4 4+m m

4 6 4+2m 2m-2

Page 11: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

The goal is to predict.

• The real value and predicted value should be very close. So that it realizes the practical values.

• Therefore the deviation should be minimal.• Remember the deviation here is signed based-

vector but direction doesn’t matter, it should be close to real value. Therefore we need the absolute value. One way to get absolute value is square it as squaring will turn negative to positive value.

Page 12: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

What is the total deviation.

• (Total deviation)-square = dev1-square + dev2-square….

(Total deviation)-square = (2-2m)square + (1-m)square + (-1) square + m-square + (2m-2) square.This turns out to be.Total deviation – square = 10 m –square -18m +10.

Page 13: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Total deviation vs. m (slope).

• let’s get back to differential calculus.• usage is to get a slope of a tangent to a curve.• After squaring we get the total deviation in

terms of m (slope). • See – you always get m-square in positive

terms. This tells the parabola will be upward facing.

Page 14: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Deviation vs. Slope-graph.

-2 -1 0 1 2 3 4 5 6 7 80

50

100

150

200

250

300

350

400

Deviation vs. Slope

Deviation vs. Slope

Page 15: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Calculate where deviation is minimal.

• Have we got the minimal point.• Yes, we got it. – If we draw a tangent to that

minimal point – a point of inflexion, the slope of that tangent will be zero.

• Basis to find out the slope, differentiate the deviation with respect to m, to find out the slope and then equate to zero.

Page 16: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Differentiate to find the slope .

• d ( Total deviation)/ dm = 20m -18 • At the point of the inflexion, the deviation will

be minimum.• Therefore, equate to zero.• We get, 20m-18 = 0;• Hence m = 18/20 = 0.9.Yes, we realized the linear model now. y = 0.9(x-2) + 4.

Page 17: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Applications

• Capture the data and predict the model.• This way you can extend this interpolation to

extrapolation, predicting future values too.• Sensor – for example, volume

increase/decrease ( linear based) vs. Audio db. level.

• Stock-rate prediction.

Page 18: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Piece-wise linear interpolation.

• This can be easily interpolated via dividing the irregular graph into linear representation.

For example.

0 2 4 6 8 10 12 140

1

2

3

4

5

6

7

Series1

Series2

Series3

Series4

Series5

Non-linear-Representation.

Average Plot.

Page 19: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Piece-wise linear

• All the 4 lines can be realized using straight line equation.

• Y- y. = m( X –x.).• So, when the x –value falls into particular

range, then an appropriate equation will be applied.

• This is called interpolation, future values cannot be predicted.

Page 20: Extrapolation/Interpolation Techniques & Applications. 1)Curve Fitting. – Non-linear to linear modeling. – Extrapolation. 2)Piece-wise Linear Interpolation

Example of Piece-wise linear.

• LM20 sensor- voltage vs. Temperature. . Used only for interpolating the value. The data should be complete , it should cover the maximum and minimum value. . Generally for sensor, whereas Extrapolation can be used in Business models.