Trip Generation II Meeghat Habibian Transportation Demand Analysis Lecture note Trip Generation II Meeghat Habibian
Content: Linear regression Statistical tests Aggregate vs. Disaggregate approach The dummy variable Transferability and temporal stability of model Accessibility Transportation Demand Analysis- Lecture note
Introduction Calibrating models to forecast trips produced from (attracted to) each zone in the future Methods: Graphs Land use based factors (ITE) Growth factor Cross classification Linear regression Transportation Demand Analysis- Lecture note
Transportation Demand Analysis Lecture note Linear Regression
Linear Regression An approach for modeling a relationship between Dependent variable (y) and One (or more) independent variable(s) (xk) y=β0+β1x1+β2x2 +β3x3 +β4x4 +…+βkxk +ε Goal: To calculate coefficients (βi), such to minimize sum of the squares of errors (differences between observations and estimation) Transportation Demand Analysis- Lecture note
Matrix notation Y=X β+ ε n: number of observation β0 Transportation Demand Analysis- Lecture note n: number of observation k: number of independent variables
Assumptions for error term 1- εi has normal distribution: εi ~ Normal 2- Mean of εi is 0: E(εi)=0 3- Expectation of εi2 is finite: E(εi2)=σ2 Var(εi)=E[εi-E(εi)]2=E[εi-0]2=E(εi2)= σ2 Therefore: εi~ N(0 , σ2 ) Transportation Demand Analysis- Lecture note
Assumptions for error term 4- Errors are independent: ∀i≠j: E(εi εj)=0 E(εi εj)= E(εi) E(εj)=0 (Non auto regression) 5- Xi s are deterministic such to 6-Number of observations is grater than number of coefficients: n > k+1 7- Xi s are independent from each other Transportation Demand Analysis- Lecture note
Society and Sample Calculations are based on the sample but results should reflect the society E(yi)=β0+β1xi β 0~N(β0, σ2) β 1~N(β1, σ2) Transportation Demand Analysis- Lecture note
Dependent variable distribution (y) y=β0+β1x1+β2x2 +β3x3 +β4x4 +…+βKxK + ε E(y) =E(β0+ Σβkxk+ ε)=E(β0)+E(Σβkxk)+ E(ε) =β0+Σ(E(βkxk)+0= β0+ ΣxkE(βk) = β0+ Σxkβk Var(y)=E[y-E(y)]2=E[β0+ Σβkxk+ ε-E(β0+ Σβkxk)]2= E(ε2)= σ2 Therefore: y~N(β0+β1x1+β2x2 +β3x3 +β4x4 +…+βKxK , σ2) Transportation Demand Analysis- Lecture note
Question? What are the mean and standard error of the estimated coefficients based on the sample (i.e., )? Given (society): y~N(β0+β1xi, σ2) β 0~N(β0, σ2) β 1~N(β1, σ2) Transportation Demand Analysis- Lecture note
Remember from TP We were looking for estimation of β0 and β1: Error sum of squares definition: We calculated in order to minimize ESS: Transportation Demand Analysis- Lecture note
Remember from TP Transportation Demand Analysis- Lecture note
Remember from TP By solving the recent equations: Transportation Demand Analysis- Lecture note
Definitions Therefore: Transportation Demand Analysis- Lecture note
Expectation of 𝛽 1 (Mean) 𝛽 1 = 𝑆 𝑥𝑦 𝑆 𝑥𝑥 = 𝑖 𝑥 𝑖 − 𝑥 ∗ 𝑥 𝑖 − 𝑦 𝑖 𝑥 𝑖 − 𝑥 2 Transportation Demand Analysis- Lecture note
Expectation of 𝛽 1 (Mean) Demonstration: 𝛽 1 = 𝑆 𝑥𝑦 𝑆 𝑥𝑥 = 𝑖 𝑥 𝑖 − 𝑥 ∗ 𝑥 𝑖 − 𝑦 𝑖 𝑥 𝑖 − 𝑥 2 𝐸 𝛽 1 =𝐸 𝑖 𝑥 𝑖 − 𝑥 𝑦 𝑖 − 𝑦 𝑆 𝑥𝑥 = 1 𝑆 𝑥𝑥 𝐸( 𝑖 𝑥 𝑖 − 𝑥 𝑦 𝑖 − 𝑦 ) = 1 𝑆 𝑥𝑥 ( 𝑖 𝑥 𝑖 − 𝑥 𝐸 𝑦 𝑖 − 𝑦 ) Transportation Demand Analysis- Lecture note
Expectation of 𝛽 1 (Mean) = 1 𝑆 𝑥𝑥 ( 𝑖 𝑥 𝑖 − 𝑥 𝐸 𝑦 𝑖 −𝐸 𝑦 = 1 𝑆 𝑥𝑥 ( 𝑖 𝑥 𝑖 − 𝑥 ( 𝛽 0 + 𝛽 1 𝑥 𝑖 − 𝛽 0 + 𝛽 1 𝑥 ) ) = 1 𝑆 𝑥𝑥 𝑖 𝑥 𝑖 − 𝑥 𝛽 1 𝑥 𝑖 − 𝑥 = 𝛽 1 𝑆 𝑥𝑥 𝑖 𝑥 𝑖 − 𝑥 2 = 𝛽 1 𝑆 𝑥𝑥 𝑆 𝑥𝑥 = 𝛽 1 Transportation Demand Analysis- Lecture note Therefore: E( 𝛽 1 )= β1
Variation of 𝛽 1 (Variance) We can rewrite 𝛽 1 in form of linear combination of 𝑦 𝑖 as follows: 𝛽 1 = 𝑖 𝑐 𝑖 𝑦 𝑖 𝛽 1 = 𝑖 𝑥 𝑖 − 𝑥 𝑦 𝑖 − 𝑦 𝑆 𝑥𝑥 = 𝑖 𝑥 𝑖 − 𝑥 𝑦 𝑖 − 𝑖 𝑥 𝑖 − 𝑥 𝑦 𝑆 𝑥𝑥 = 𝑖 𝑥 𝑖 − 𝑥 𝑦 𝑖 − 𝑦 𝑖 𝑥 𝑖 − 𝑥 𝑆 𝑥𝑥 Transportation Demand Analysis- Lecture note
Variation of 𝛽 1 (Variance) 𝑖 𝑥 𝑖 − 𝑥 𝑦 𝑖 𝑆 𝑥𝑥 = 𝑖 𝑥 𝑖 − 𝑥 𝑆 𝑥𝑥 𝑦 𝑖 = 𝑖 𝑐 𝑖 𝑦 𝑖 ; 𝐶 𝑖 = 𝑥 𝑖 − 𝑥 𝑆 𝑥𝑥 Transportation Demand Analysis- Lecture note
Variation of 𝛽 1 (Variance) =E [Σciεi]2 =E [Σci2εi2+2ΣiΣjcicjεiεj] Transportation Demand Analysis- Lecture note
Variation of 𝛽 1 (Variance) 𝜎 2 𝑆 𝑥𝑥 2 𝑖 𝑥 𝑖 − 𝑥 2 = 𝜎 2 𝑆 𝑥𝑥 2 𝑆 𝑥𝑥 = 𝜎 2 𝑆 𝑥𝑥 → 𝛽 1 ~𝑁( 𝛽 1 , 𝜎 2 𝑖 𝑥 𝑖 − 𝑥 2 ) Transportation Demand Analysis- Lecture note
Expectation of 𝛽 0 (Mean) 𝛽 0 = 𝑦 − 𝛽 1 𝑥 →𝐸 𝛽 0 =𝐸 𝑦 − 𝛽 1 𝑥 =𝐸 𝑦 − 𝑥 𝐸 𝛽 1 = 𝛽 0 + 𝛽 1 𝑥 − 𝛽 1 𝑥 = 𝛽 0 Transportation Demand Analysis- Lecture note
Variation of 𝛽 0 (Variance) Demonstrate that 𝛽 0 is linear combination of 𝑦 𝑖 : 𝛽 0 = 𝑖 𝑑 𝑖 𝑦 𝑖 𝛽 0 = 𝑦 − 𝛽 1 𝑥 = 1 𝑛 𝑖 𝑦 𝑖 −( 𝑖 𝑐 𝑖 𝑦 𝑖 ) 𝑥 = 1 𝑛 𝑖 𝑦 𝑖 − 𝑥 𝑖 𝑥 𝑖 − 𝑥 𝑆 𝑥𝑥 𝑦 𝑖 = 1 𝑛 𝑖 𝑦 𝑖 − 𝑥 𝑆 𝑥𝑥 𝑖 𝑥 𝑖 − 𝑥 𝑦 𝑖 Transportation Demand Analysis- Lecture note
Variation of 𝛽 0 (Variance) = 𝑖 1 𝑛 − 𝑥 𝑆 𝑥𝑥 ( 𝑥 𝑖 − 𝑥 ) 𝑦 𝑖 = 𝑖 𝑑 𝑖 𝑦 𝑖 𝑑 𝑖 = 1 𝑛 − 𝑥 𝑆 𝑥𝑥 𝑥 𝑖 − 𝑥 𝑉𝑎𝑟 𝛽 0 =𝑉𝑎𝑟 𝑖 𝑑 𝑖 𝑦 𝑖 =𝐸 𝑖 𝑑 𝑖 𝑦 𝑖 −𝐸( 𝑖 𝑑 𝑖 𝑦 𝑖 ) 2 =𝐸 𝑖 𝑑 𝑖 𝑦 𝑖 − 𝑖 𝑑 𝑖 𝐸( 𝑦 𝑖 ) 2 Transportation Demand Analysis- Lecture note
Variation of 𝛽 0 (Variance) 2 2 = Transportation Demand Analysis- Lecture note
Variation of 𝛽 0 (Variance) = 𝑖 𝑑 𝑖 2 𝐸 𝜀 𝑖 2 + 𝑖≠𝑗 𝑑 𝑖 𝑑 𝑗 𝐸 𝜀 𝑖 𝜀 𝑗 = 𝑖 𝑑 𝑖 2 𝜎 2 = 𝜎 2 𝑖 𝑑 𝑖 2 = 𝜎 2 𝑖 1 𝑛 − 𝑥 𝑆 𝑥𝑥 𝑥 𝑖 − 𝑥 2 = 𝜎 2 1 𝑛 − 𝑥 2 𝑆 𝑥𝑥 → 𝛽 0 ~ 𝑁 𝛽 0 , 𝜎 2 1 𝑛 + 𝑥 2 𝑖 𝑥 𝑖 − 𝑥 2 + Transportation Demand Analysis- Lecture note
Conclusion ( 𝛽 ) Least square estimators have normal Distribution as follows: Transportation Demand Analysis- Lecture note Best Linear Unbiased Estimator = BLUE
Sample standard error σ is measure of variability of y lower values for σ2 show that observations are closer to regression line For 1 independent variable: For k independent variables: Transportation Demand Analysis- Lecture note
Transportation Demand Analysis Lecture note Statistical Tests
Correlation Coefficient Square of correlation coefficient is called Coefficient of Determination, R2 -1≤R≤1 Transportation Demand Analysis- Lecture note
Goodness of fit measure Define: TSS=RSS+ESS Transportation Demand Analysis- Lecture note
Coefficient significance T-student test (T-Test) T-Table Tcritical (α,n-k-1) T0<Tcritical H0 can not be rejected at α level T0>Tcritical H0 is rejected at α level Transportation Demand Analysis- Lecture note
Statistical Hypothesis: F test: For checking whole model: H0:R2=0 (RSS=0) K: Number of independent variables Transportation Demand Analysis- Lecture note F0<Fcritical H0 can not be rejected at α level F0>Fcritical H0 is rejected at α level
Choosing Best Model 1- Low correlation of independent variables (IVs) 2- Intuitive sign of coefficients 3- T-Student test 4- Smaller values for β0 5- Goodness of fit value 6- F test 7- Lower number of variables Transportation Demand Analysis- Lecture note
Aggregate vs. Disaggregate Approach Transportation Demand Analysis Lecture note Aggregate vs. Disaggregate Approach
Modeling Approaches Disaggregate models Lower sample size Aggregate total (zonal average level) Aggregate rate (household-based average level) Higher variation Lower goodness of fit Makes more sense Transportation Demand Analysis- Lecture note
Aggregate & disaggregate: Values of R2 for aggregate models are much higher than disaggregate models Coefficient of aggregate models have grater variance than disaggregate models A class lecture on variance of above models Transportation Demand Analysis- Lecture note
Transportation Demand Analysis Lecture note The Dummy Variable
Why we need dummy variables? Non quantifiable variables e.g., Gender, Marital status, … 2. Non uniform effect (in different intervals) variables e.g., Age, distance, … Transportation Demand Analysis- Lecture note Uniform effect Non-uniform effect
Structure Dummy variable = Example: D1= D2= 1, if a condition is satisfied 0, otherwise Dummy variable = Example: D1= D2= 1, if a household has 1 car 0, otherwise Transportation Demand Analysis- Lecture note 1, if a household has 2 or more car 0, otherwise
Example (Trip generation) An ordinary regression model: Trip number = 𝛽 0+ 𝛽 1 (Car ownership)+ 𝛽 2 (HHSZ) Trips Cars HHSZ=2 HHSZ=1 HHSZ=0 β1 Transportation Demand Analysis- Lecture note 𝛽 0+2 𝛽 2 𝛽 0+ 𝛽 2 𝛽 0
Example (Trip generation) An ordinary regression model: Trip number = 𝛽 0+ 𝛽 1 (Car ownership)+ 𝛽 2 (HHSZ) A dummy enhanced model: Trip number = 𝛽 0+ 𝛽 1X2i+…+ 𝛽 5X6i+ 𝛽 6Z2i+ 𝛽 7Z3i+εi X1i= Z1i= X2i= Z2i= … X6i= Z3i= Therefore: Household i: 1, household i has 1 member 0, otherwise 1, household i has not car 0, otherwise Transportation Demand Analysis- Lecture note 1, household i has 2 members 0, otherwise 1, household i has 1 car 0, otherwise 1, household i has 6 members 0, otherwise 1, household i has 2+ cars 0, otherwise X1i+X2i+X3i+X4i+X5i+X6i=1 Z1i+Z2i+Z3i=1
Example (Trip generation) Dummy enhanced model: Trip number = 𝛽 0+ 𝛽 1X2i+…+ 𝛽 5X6i+ 𝛽 6Z2i+ 𝛽 7Z3i+εi X1i= Z1i= X2i= Z2i= … X6i= Z3i= Examples: Household containing 1 member and no car: 𝑌 = 𝛽 0 Household containing 1 member and 1 car: 𝑌 = 𝛽 0+ 𝛽 6 Household containing 3 members and 3 cars: 𝑌 = 𝛽 0+ 𝛽 3+ 𝛽 7 1, household i has 1 member 0, otherwise 1, household i has not car 0, otherwise 1, household i has 2 members 0, otherwise 1, household i has 1 car 0, otherwise Transportation Demand Analysis- Lecture note 1, household i has 6 members 0, otherwise 1, household i has 2+ cars 0, otherwise
Notes Each pair of dummy variables must not overlapped Union of all levels must be the Universal set At least, one level (known as base level) should excluded from the modeling A multiplicative dummy may also use (e.g., XZ) which would be a more complicated case Transportation Demand Analysis- Lecture note
Transferability and Temporal Stability of Model Transportation Demand Analysis Lecture note
Model Transferability Aggregate model Aggregate Total Different zone size, topography, … Aggregate rate Households behavior can be similar Disaggregate model Individuals may behave more similar E.g., New mass transit choice for new towns Transportation Demand Analysis- Lecture note
Temporal Stability Use a model after a long period in the future Shall a new dataset for new time (t2) be collected? Two issues should be checked (small dataset) Macro Observation – estimation graph Micro Statistical assessment of coefficients Transportation Demand Analysis- Lecture note
Macro (Observation – estimation graph) Use an observation-estimation graph Yt2=α+βY^t1 α Statistically, α should be 0 and β should be 1 Yt2 β Transportation Demand Analysis- Lecture note Y^t1
Micro (Statistical assessment of coefficients) Differences of respective βs should be statistically 0 As βs have normal distributions, their respective difference has also normal distribution: βt1-βt2 ~ N( 0, SE(βt1-βt2) ) Transportation Demand Analysis- Lecture note
Micro (Example) Trip generation data for 357 household is available for times t1 and t2 Trip number = β0+β1 (Car ownership)+ β2 (HHSZ) Two models have been calibrated as follows: Transportation Demand Analysis- Lecture note t1 t2 β0 -0.45 -0.19 β1 1.40 (0.13) 1.46 (0.15) β2 1.92 (0.31) 1.52 (0.27) R2 0.34 0.36
Micro (Example) Assessing β1 Trip number = β0+β1 (Car ownership)+ β2 (HHSZ) H0: βt1-βt2 =0 T=(βt1-βt2 )/SE(βt1-βt2 ) Remember: Var(X-Y)=Var(X)+Var(Y)-2Cov(X,Y) Independent samples: Cov(βt1,βt2 )=0 SE2=(0.13)2+(0.15)2-2*0=0.0394 SE=0.198 T=(1.40-1.46)/0.198=-0.303 H0 can not be rejected t1 t2 β0 -0.45 -0.19 Β1 (SE) 1.40 (0.13) 1.46 (0.15) Β2 (SE) 1.92 (0.31) 1.52 (0.27) R2 0.34 0.36 Transportation Demand Analysis- Lecture note
Micro (Example) Assessing β2 Trip number = β0+β1 (Car ownership)+ β2 (HHSZ) H0: βt1-βt2 =0 T=(βt1-βt2 )/SE(βt1-βt2 ) Remember: Var(X-Y)=Var(X)+Var(Y)-2Cov(X,Y) Independent samples: Cov(βt1,βt2 )=0 SE2=(0.31)2+(0.27)2-2*0=0.169 SE=0.411 T=(1.92-1.52)/0.411=0.97 H0 can not be rejected t1 t2 β0 -0.45 -0.19 Β1 (SE) 1.40 (0.13) 1.46 (0.15) Β2 (SE) 1.92 (0.31) 1.52 (0.27) R2 0.34 0.36 Transportation Demand Analysis- Lecture note
Notes No change in the role of variables during the studied period E.g., Car as a proxy of income vs. Car as an essential instrument in individual’s lifestyle Pooling the data together and use a respective dummy is also recommended to calibrate a model for a long period with two datasets Transportation Demand Analysis- Lecture note
Transportation Demand Analysis Lecture note Accessibility
Necessity Trip generation models are not sensitive to policy making Because they are not sensitive to attributes of the transportation system (e.g., time and cost) Note: Time and cost depend on both origin and destination which is not known in trip generation stage Transportation Demand Analysis- Lecture note
Definition Acci=ΣjcijAj Acci: Accessibility index for zone i Cij: Cost of travel between I and j Aj: Opportunities at zone j (e.g., Population, Student number, School number) Transportation Demand Analysis- Lecture note
Transportation Demand Analysis- Lecture note Finish