Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

CE327: 

Transportation Systems Engineering – Lecture 6 Example Problem 

Linear Regression 
 
Given observed data: 
 
Speed  Density 
(us)  (k) 
53.2  20 
48.1  27 
44.8  35 
40.1  44 
37.3  52 
35.2  58 
34.1  60 
27.2  64 
20.4  70 
17.5  75 
14.6  82 
13.1  90 
11.2  100 
8  115 
 
For both the Greenshields model and the Greenberg Model, determine: 
a.  The free flow speed, uf (Greenshields only) 
b. The jam density, kj 
c. The maximum flow (or capacity), qmax 
d. R2 
 
Which model is a better model to describe the observed traffic conditions? 
 
Greenshields Model 
 
           y a b  

y  ,  a ,   , k  


 
First, find b: 
 
1
∑ xy ∑ x ∑ y
n  
1
∑ x ∑ x
n
 
CE327: Transportation Systems Engineering – Lecture 6 Example Problem 

2
y x xy x
Speed (us) Density (k)
53.2 20 1064 400
48.1 27 1298.7 729
44.8 35 1568 1225
40.1 44 1764.4 1936
37.3 52 1939.6 2704
35.2 58 2041.6 3364
34.1 60 2046 3600
27.2 64 1740.8 4096
20.4 70 1428 4900
17.5 75 1312.5 5625
14.6 82 1197.2 6724
13.1 90 1179 8100
11.2 100 1120 10000
8 115 920 13225
Sum 404.8 892 20619.8 66628  
 
1
20619.8 892 404.8
14 .528 
1
66628 892
14
 
Then find a: 
 
404.8
y 28.9 
14
 
892
x 63.7 
14
 
y bx 28.9 .528 63.7 62.6  
 
 
Solve for uf, kj, qmax: 
 
a 62.6  /  
 
62.6
                118.5 veh/mi 
b .528
 
62.6 118.5
1852.8 veh/hr 
4 4
 
 
CE327: Transportation Systems Engineering – Lecture 6 Example Problem 

Find R2: 

1  

 
2 2
y x yhat y‐yhat (y‐yhat) y‐yavg (y‐yavg)
53.2 20 52.0 1.20 1.45 24.28571 589.7959
48.1 27 48.3 ‐0.20 0.04 19.18571 368.0916
44.8 35 44.1 0.72 0.52 15.88571 252.3559
40.1 44 39.3 0.78 0.60 11.18571 125.1202
37.3 52 35.1 2.20 4.84 8.385714 70.3202
35.2 58 31.9 3.27 10.68 6.285714 39.5102
34.1 60 30.9 3.22 10.40 5.185714 26.89163
27.2 64 28.8 ‐1.56 2.44 ‐1.71429 2.938776
20.4 70 25.6 ‐5.20 26.99 ‐8.51429 72.49306
17.5 75 23.0 ‐5.46 29.76 ‐11.4143 130.2859
14.6 82 19.3 ‐4.66 21.71 ‐14.3143 204.8988
13.1 90 15.0 ‐1.94 3.75 ‐15.8143 250.0916
11.2 100 9.8 1.44 2.09 ‐17.7143 313.7959
8 115 1.8 6.16 38.01 ‐20.9143 437.4073
Sum 153.29 2883.997
 
153.23
1 .947 
2883.0
 
Greenberg  Model 
 
k
c ln      ln   ln        y a b  
k
y  ,  ln a ,  c  , ln  
 
First, find b: 
 
1
∑ xy ∑ x ∑ y
n  
1
∑ x ∑ x
n
 
CE327: Transportation Systems Engineering – Lecture 6 Example Problem 

2
y k x xy x
Speed (us) Density (k) ln (k)
53.2 20 2.9957323 159.373 8.974412
48.1 27 3.2958369 158.5298 10.86254
44.8 35 3.5553481 159.2796 12.6405
40.1 44 3.7841896 151.746 14.32009
37.3 52 3.9512437 147.3814 15.61233
35.2 58 4.060443 142.9276 16.4872
34.1 60 4.0943446 139.6171 16.76366
27.2 64 4.1588831 113.1216 17.29631
20.4 70 4.2484952 86.6693 18.04971
17.5 75 4.3174881 75.55604 18.6407
14.6 82 4.4067192 64.3381 19.41917
13.1 90 4.4998097 58.94751 20.24829
11.2 100 4.6051702 51.57791 21.20759
8 115 4.7449321 37.95946 22.51438
Sum 404.8 892 56.718636 1547.024 233.0369  
 
1
1547.02 56.72 404.8
14 28.6 
1
233.04 56.72
14
 
Then find a: 
 
404.8
y 28.9 
14
 
56.72
x 4.05 
14
 
y bx 28.9 28.6 4.05 144.76  
 
 
Solve for kj, qmax: 
 
c             28.6 
.
ln a           ln 5.06       
.
.
158.0  /        
 
At max flow, c 28.6 mi/hr 
58.1  /        
q  k 28.6  58.1 1661.9  /  
 
CE327: Transportation Systems Engineering – Lecture 6 Example Problem 

 
Find R2: 

1  

 
2 2
y x yhat y‐yhat (y‐yhat) y‐yavg (y‐yavg)
53.2 2.9957323 59.1 ‐5.90 34.78 24.285714 589.7959
48.1 3.2958369 50.5 ‐2.42 5.84 19.185714 368.0916
44.8 3.5553481 43.1 1.70 2.90 15.885714 252.3559
40.1 3.7841896 36.6 3.55 12.58 11.185714 125.1202
37.3 3.9512437 31.8 5.52 30.51 8.3857143 70.3202
35.2 4.060443 28.7 6.55 42.85 6.2857143 39.5102
34.1 4.0943446 27.7 6.42 41.16 5.1857143 26.89163
27.2 4.1588831 25.8 1.36 1.85 ‐1.7142857 2.938776
20.4 4.2484952 23.3 ‐2.88 8.28 ‐8.5142857 72.49306
17.5 4.3174881 21.3 ‐3.80 14.47 ‐11.414286 130.2859
14.6 4.4067192 18.8 ‐4.15 17.24 ‐14.314286 204.8988
13.1 4.4998097 16.1 ‐2.99 8.94 ‐15.814286 250.0916
11.2 4.6051702 13.1 ‐1.88 3.53 ‐17.714286 313.7959
8 4.7449321 9.1 ‐1.08 1.17 ‐20.914286 437.4073
Sum 226.12 2883.997
 
226.12
1 .922 
2883.00
 
 
R2 for the Greenshields Model ( .947) is closer to 1 than R2 for the Greenberg Model (.922), so 
Greenshields is a better model to describe this traffic stream. 

You might also like