Lecture 6 - Approximation Flashcards
Regression
Another name of approximation
Using of approximation
We use it when the data have some error and we want to represent for example the general trend of data. There is no sens to make an effort to intersect every point because they may be incorrect.
Measurements
Lagrange interpolation is ok, but when we take into consideration that some points was measured with some accuracy then the STRAIGHT LINE would be more proper.
Trends
They can be shown by polynomials with different degrees (very often low-degree ones) instead large tables
Linear Regression start
We create a straight line “y=a0+a1x”, which pass directly through a single point and we can shift this line up or down using error “e”
Linear Regression with N points
When we consider N points and one straight line, each point has its own error ei
Linear Regression strategy
The most popular strategy for fitting the best line is to minimize the SUM OF THE SQUARES of errors
Least squares criterion
The approach with minimizing sum if the squares of errors
Error in the linear regression
Residual between the measured y and the y calculated with the linear model; Value that was given and value of our line function in the same point
Linear regression error equation
ei=(yi-a0-a1xi)^2
Determining coefficients on line/polynomial step 1
Calculate the DERIVATIVE of “sum of the squares” with respect to each coefficient and compare them to zero
Determining coefficients on line/polynomial step 2
Divide the sum of whole bracket to sums of particular elements. Change the equation in such way that elements with Y are on the right side and rest on the left.
Note for sums
When you calculate SUM form i=1 to n of free coefficients a0 it just n*a0
Polynomial Regression
Works exactly the same as linear, just more coefficients
Drawback of polynomial regression
RUNGE’s effect - big oscillations at the edges