{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Regression_trafficapplications

# Regression_trafficapplications - CEE 3604 Introduction to...

This preview shows pages 1–8. Sign up to view the full content.

CEE 3604: Introduction to Transportation Engineering Applications of Linear Regression Drs. H. Baik and A. Trani Spring 2004

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

View Full Document
CEE 3604 Slide 2 The Basic Question Suppose we have 10 data points, (i.e., n=10) What is the equation of a line, y = ax + b , that represents these data points? Procedure: Find parameters a and b . Estimate the goodness of this fit >>(R 2 ) x (=time, min.) y_obs (=temp, K) 0 298 1 299 2 301 3 304 4 306 5 309 6 312 7 316 8 319 9 322
CEE 3604 Slide 3 Find Parameters a and b in y = a x+ b . Minimize Prediction Error (or S um of the S quare of the D eviation, SSD ) ! ! ! = = = " " = + = = " = = n 1 i 2 i obs i i i pred i n 1 i 2 pred i obs i n 1 i 2 ) ) b ax (y SSD i.e., b. ax y eq. line the from obtained for x y of value predicted y where, ) y (y Error) n (Predictio SSD y = ax + b y i obs y i pred (=ax i +b) x i We like to minimize SSD by selecting appropriate values of coefficients a & b.

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

View Full Document
CEE 3604 Slide 4 Normal Equations to Find a and b To minimize SSD ! ! ! ! ! ! ! = = = = = = = + = = " = # # + = = " = # # = # # = # # n 1 i n 1 i i obs i n 1 i i obs i n 1 i n 1 i n 1 i i 2 i obs i i i n 1 i i obs i (2) bn x a y 0, 1) ( b) - ax - (y 2 b SSD (1) x b x a y x 0, ) x ( b) - ax - (y 2 a SSD 0 b SSD a SSD ) ) ) b ax (y ( n 1 i 2 i obs i ! = " " = ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! = = = = = = = = = = = = = = = = " " # \$ % % & ( = " " # \$ % % & ( = ) ) * + , , - . " " # \$ % % & ( = / ( / n 1 i 2 n 1 i i 2 i n 1 i n 1 i n 1 i i obs i obs i i n 1 i 2 n 1 i i 2 i n 1 i n 1 i n 1 i i obs i obs i i n 1 i n 1 i 2 n 1 i i 2 i n 1 i n 1 i i obs i obs i i n 1 i i x n 1 x x y n 1 - y x x x n x y - y x n a so, x x n a x y - y x : x (2) n (1) n x a y b : (2) From n 1 i n 1 i i obs i ! ! = = " =
CEE 3604 Slide 5 What if b = 0, i.e., y = ax? To minimize SSD x a y x 0, ) x ( ) ax - (y 2 da dSSD 0 da dSSD n 1 i n 1 i 2 i obs i i i n 1 i i obs i ! ! ! = = = = = " = = ) ) ax (y ( n 1 i 2 i obs i ! = " = x y x a so, n 1 i 2 i n 1 i obs i n 1 i i ! ! ! = = = =

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

View Full Document
CEE 3604 Slide 6 An Example for Finding a & b Many ways to find a & b:  Using a spreadsheet like Excel to compute a and b the long way using equations shown in slide 4 of this handout  Using the ‘ Trend Line’ in chart option  Using tools\data analysis\Regression  Use Matlab curve fit analysis procedure An example
CEE 3604 Slide 7 Autobahn Data (text file) % Traffic Flow Data % % Autobahn data % % Column 1 = Density (veh/km- % Column 2 = Speed (km/kr) % Column 3 = Flow (veh/hr per % Column 4 ignore for this probl 0.08 160 12 2000 0.08 152 12 2000 0 0 0 2000 0 0 0 2000 The data is available at the CEE3604 web site (look at the syllabus web page)

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 39

Regression_trafficapplications - CEE 3604 Introduction to...

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

View Full Document
Ask a homework question - tutors are online