17 - 3/15/2010 Regression: Object is to find the curve (of...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
3/15/2010 1 Regression: Object is to find the curve (of some chosen form) that best represents a collection of data points. Points are assumed to involve errors. The curve need not pass through any of the data points. Interpolation: Object is to find a curve that can be used in fill in the gaps between data points. Points are assumed to be absolutely correct. The curve must pass through all of the data points. Linear interpolation: ( x 2 , y 2 ) matching y X ( x 1 , y 1 ) ) ( ) ( ) ( ) ( 1 2 1 1 2 1 x x x x y y y x f x of interest X The basic technique (used in Thermodynamics I, etc.) 2 points uniquely define a straight line (first order polynomial ) The equation for this line is used to estimate y for x values between x 1 and x 2
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
3/15/2010 2 ( x 3 , y 3 ) x Quadratic interpolation: 3 points are used ( x 2 , y 2 ) ( 1 , y 1 ) c bx ax x f 2 ) ( 3 points uniquely define a quadratic (a second order polynomial, y = ax 2 + bx + c ) This quadratic is used to estimate y for x values between x 1 and x 3 . The dotted blue lines represent piecewise linear interpolation. In this case linear interpolation is used between each pair of data points. Demonstration that 3 points define a quadratic: Given: three points ( x 1 , y 1 ), ( x 2 , y 2 ), and ( x 3 , y 3 ) To find : a , b , and c such that y = ax 2 + bx + c passes through the three points Because the curve must pass through all three points: 1 1 2 1 y c bx ax In matrix form: 3 3 2 3 2 2 2 2 y c bx ax y c bx ax 3 2 1 3 2 3 2 2 2 1 2 1 1 1 1 y y y c b a x x x x x x a , b , and c are the solution to this series of three equations in three unknowns In practice it is not a good idea to try and solve this series of equations directly because matrix A is a Vandermonde matrix . Such matrices have high condition numbers and make for ill conditioned systems. The values of a , b , and c can be found in other ways.
Background image of page 2
3/15/2010 3 General polynomial interpolation: The concept generalizes to higher order polynomials: n data points uniquely define a polynomial of order n –1 The polynomial passing through a set of n data points can be found using polyfit : p = polyfit (x, y, n 1); % n = length(x) = length(y) When m is equal to the number of data points–1, polyfit (x, y, m) gives the interpolating polynomial (the polynomial that passes through all of the points).
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

17 - 3/15/2010 Regression: Object is to find the curve (of...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online