This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: Lecture 20 Least Squares Fitting: Noisy Data Very often data has a significant amount of noise. The least squares approximation is intentionally wellsuited to represent noisy data. The next illustration shows the effects noise can have and how least squares is used. Traffic flow model Suppose you are interested in the time it takes to travel on a certain section of highway for the sake of planning. According to theory, assuming up to a moderate amount of traffic, the time should be approximately: T ( x ) = ax + b where b is the travel time when there is no other traffic, and x is the current number of cars on the road (in hundreds). To determine the coefficients a and b you could run several experiments which consist of driving the highway at different times of day and also estimating the number of cars on the road using a counter. Of course both of these measurements will contain noise , i.e. random fluctuations. We could simulate such data in Matlab as follows: &gt; x = 1:.1:6; &gt; T = .1*x + 1; &gt; Tn = T + .1*randn(size(x)); &gt; plot(x,Tn,.) The data should look like it lies on a line, but with noise. Click on the Tools button and choose Basic fitting . Then choose a linear fit. The resulting line should go through the data in what looks like a very reasonable way. Click on show equations . Compare the equation with T ( x ) = . 1 x + 1. The coefficients should be pretty close considering the amount of noise in the plot. Next, try to fit the data with a spline. The result should be ugly. We can see from this example that splines are not suited to noisy data . How does Matlab obtain a very nice line to approximate noisy data? The answer is a very standard numerical/statistical method known as least squares ....
View
Full
Document
This note was uploaded on 02/09/2012 for the course MATH 344 taught by Professor Young,t during the Fall '08 term at Ohio University Athens.
 Fall '08
 Young,T
 Approximation, Least Squares

Click to edit the document details