You are on page 1of 72

CIE4801 Transportation and spatial modelling

Trip distribution

Rob van Nes, Transport & Planning


31-08-18

Delft
University of
Technology

Challenge the future


Content

• Question on choice modelling

• Modelling component 2: Trip distribution


• Your comments/questions on Chapter 5
• Additional topics
• Choice models
• Poisson model
• Practical issues

CIE4801: Trip distribution 2


2.
Trip distribution

CIE4801: Trip distribution 3


Introduction to trip distribution
Zonal data Trip generation Trip frequency
choice

Transport Destination
Trip distribution
networks choice

Travel Mode
Modal split choice
resistances

Time
Period of day choice

Route
Assignment choice

Travel times
network loads
etc.
CIE4801: Trip distribution 4
Topics to study sections 5.1-5.6

• What does this modelling component do? What’s its output and
what’s its input? How does it fit in the framework?
• Do you understand the definitions?
• OD-matrix, production, attraction, generalised costs, deterrence
function
• Do you understand the modelling methods?
• Growth factor: singly and doubly constrained
• Gravity model
• Logic for “borrowing” from Newton or Entropy maximisation?
• Do you understand the iterative algorithm?
• Do you understand the calibration of the model?
• Deterrence function (Hymann’s method)
• Do you understand tri-proportional fitting (“bins”)?
• Are these models appropriate?
CIE4801: Trip distribution 5
2.1
Trip distribution: definitions

CIE4801: Trip distribution 6


Introduction to trip distribution
Given: Productions and attractions for each zone
(i.e. departures and arrivals)
Determine: The number of trips from each zone to all other zones
(i.e. fill in the OD-matrix)
To:

production
zone j
zone 1

total



zone 1

zone i
From: …

total attraction

CIE4801: Trip distribution 7


Two key principles in trip distribution

• Big produces/attracts more

• Nearby attracts more

• These principles remain, independent of the analogy or


framework chosen

CIE4801: Trip distribution 8


Far away is less:
Distribution or deterrence functions
Fij = f (cij ) cij = travel costs from zone i to zone j

distribution function
describes the relative willingness to make a trip
f as a function of the travel costs.

bike

car Very simple model!


train

distance
10km 50km
CIE4801: Trip distribution 9
Requirements for distribution functions

• Decreasing with travel costs


• Integral should be finite

F ( a × cij )
• Fraction depends on value of cij
F ( cij )

• Fixed changes should have a diminishing relative impact:


F ( cij + Dc ) F ( cij + A + Dc )
>
F ( cij ) F ( cij + A )

CIE4801: Trip distribution 10


Distribution functions
Power function: f (cij ) = a × cij- b
Exponential function: f (cij ) = a × exp(- b cij )
f Combined function: f (cij ) = acijb × exp( -gcij )
Lognormal function: f (cij ) = a × exp(- b × ln 2 (cij + 1))
æ 2 æ cij öö
Top-lognormal function: f ( cij ) = a × exp ç b × ln ç ÷÷
è è g øø

Note that these functions do not always


meet the theoretical requirements

travel cost
CIE4801: Trip distribution 11
2.2.1
Trip distribution models:
Method 1: Growth models

CIE4801: Trip distribution 12


Growth factor models

• trip observations
base
• outcomes of (older) model
matrix • calibrated using traffic counts

Growth • outcomes base year and future trip


factors generation model
• outcomes base year and future gravity model

predicted
matrix

CIE4801: Trip distribution 13


Growth factor models

Advantages
• Network specific peculiarities can be captured by
observations
• A base matrix is more understandable and verifiable
than a model

Disadvantages
• New residential zones are difficult to capture
• Historical patterns may change over time

CIE4801: Trip distribution 14


Growth factor models
Tij0 g Tij = gTij0
base matrix cell growth factor predicted matrix cell

Tij = gTij0 Network independent,


general factor

Tij = giTij0 or Tij = g jTij0 Network independent,


origin or destination specific factor

Tij = gi g jTij0 Network independent,


factors for origins and destinations

Tij = gijTij0 Network dependent,


OD-specific factors

CIE4801: Trip distribution 15


Common application

• Given expected spatial development (short term)


• Future production (departures)
• Future attraction (arrivals)

• Fill in new areas by copying columns and rows of nearby (and


look alike!) zones from the base year matrix
• Pay attention to interaction of original and copy!

• Scale this adapted base year matrix to the future production and
attraction using appropriate factors ai and bj
(see also slides 2.2.2, replace Fij by Tij (i.e prior OD-matrix),
and example on slides 2.3)

CIE4801: Trip distribution 16


2.2.2
Trip distribution models
Method 2: Gravity model

CIE4801: Trip distribution 17


The gravity model
mi Newton: Gij = g × mi × m j × 1
dij2

mi
dij

mj
Gij = gravitational force between i and j
g = gravitational constant
mi , m j = mass of planet i (j respectively)
dij = distance between i and j
CIE4801: Trip distribution 18
The gravity model
Assumptions:
Number of trips between an origin and a destination zone
is proportional to:
• a production ability factor for the origin zone
• an attraction ability factor for the destination zone
• a factor depending on the travel costs between the zones
Mathematical formulation:
Tij = r Qi X j Fij Tij = # trips from zone i to zone j
r = measure of average trip intensity
Qi = production potential of zone i
X j = attraction potential of zone j
Fij = willingness to travel from i to j
Possible interpretations of Qi and Xj: populations, production & attraction, …
CIE4801: Trip distribution 19
Singly constrained model

Basic gravity model:


Tij = r Qi X j Fij Tij = # trips from zone i to zone j
r = measure of average trip intensity
Qi = production potential of zone j
X j = attraction potential of zone i
F = willingness to travel from i to j
ij

If the trip productions Pi are known: åT


j
ij = Pi

If the trip attractions Aj are known: åT


i
ij = Aj

CIE4801: Trip distribution 20


Singly constrained: origin
Tij = r Qi X j Fij

åT
j
ij = Pi

åT = å ( rQ X
j
ij
j
i j Fij ) = r Qi å ( X j Fij ) = Pi
j

Pi
Þ Qi =
r å X j Fij
j

Pi
Þ Tij = r X j Fij = ai Pi X j Fij
r å X j Fij
j ( ai = balancing factor)

Singly constrained origin based model: Tij = ai Pi X j Fij

CIE4801: Trip distribution 21


Singly constrained: destination
Tij = r Qi X j Fij

åT
i
ij = Aj

åT = å ( rQ X
i
ij
i
i j Fij ) = r X j å ( Qi Fij ) = Aj
i

Aj
Þ Xj =
r å Qi Fij
i
Aj
Þ Tij = r Qi Fij = b j Qi Aj Fij
r å Qi Fij
i ( b j = balancing factor)

Singly constrained destination based model: Tij = b j Qi Aj Fij

CIE4801: Trip distribution 22


Doubly constrained model

Basic gravity model:


Tij = r Qi X j Fij Tij = # trips from zone i to zone j
r = measure of average trip intensity
Qi = production potential of zone j
Xj = attraction potential of zone i
Fij = willingness to travel from i to j

Trip productions Pi and trip attractions Aj are known:

åT ij = Pi and åT
i
ij = Aj
j

CIE4801: Trip distribution 23


Doubly constrained model

Tij = r Qi X j Fij

åT
i
ij = Aj

åT
j
ij = Pi

åT = å ( rQ X
j
ij
j
i j Fij ) = r Qi å ( X j Fij ) = Pi
j

åT = å ( rQ X
i
ij
i
i j Fij ) = r X j å ( Qi Fij ) = Aj
i

Pi Aj
Þ Qi = and Xj =
r å ( X j Fij ) r å ( Qi Fij )
j i

CIE4801: Trip distribution 24


Doubly constrained model

Pi Aj 1
Þ Tij = r × Fij = ai b j Pi Aj Fij
r å X j Fij r å Qi Fij ρ
j i

ai = balancing factor
b j = balancing factor

Doubly constrained model: Tij = ai b j Pi Aj Fij

Note that Xj is a function of Qi and vice versa


Solving this model thus requires an iterative approach

CIE4801: Trip distribution 25


2.2.3
Trip distribution models
Method 3: Entropy maximisation

CIE4801: Trip distribution 26


Maximising entropy given
constraints
Analogue to the thermodynamic concept of entropy as maximum
disorder, the entropy- maximizing procedure seeks the most
likely configuration of elements within a constrained situation.

The objective can be formulated as:


T!
Max w (Tij ) =
Õ ij Tij !
åT
j
ij = Pi

åT ij = Aj
Replace by logarithm
æ ö
( ( ))
i
Max ln w (Tij ) = Max ç ln (T !) - å ln (Tij !) ÷
åå T
i j
ij × cij = C
è ij ø

CIE4801: Trip distribution 27


Illustration entropy principle

• How many ways can you distribute 4 people?

H T
C

• Let’s assume we use a coin to decide where a person will go to:


thus flip a coin 4 times

• In total there are 16 sequences leading to 5 options:


• 4H,0T (1) 3H,1T (4), 2H,2T (6), 1H,3T (4), 0H,4T (1)
T!
• Weight of each option is determined by
Õ ij Tij !
CIE4801: Trip distribution 28
Derivation (1/2)

Lagrangian of maximisation objective:

æ ö æ ö æ ö
ln (T !) - å ln (Tij !) + å li × ç Pi - å Tij ÷ + å l j × ç Aj - å Tij ÷ + b × ç C - åå Tij × cij ÷
ij i è j ø j è i ø è i j ø

Use as approximation
¶ ln ( N !)
ln ( N !) » N × ln ( N ) - N Þ » ln ( N )
¶N
Set derivatives equal to zero and solve the equation
¶L
= - ln (Tij ) - li - l j - b × cij = 0
¶Tij Note that the other derivatives
- li - l j - b ×cij -l j - b ×cij
lead to the orginal constraints
Þ Tij = e = e - li × e ×e

CIE4801: Trip distribution 29


Derivation (2/2)

Substitute result in constraints:

å Tij = å e = e - li å e
- li - l j - b ×cij - l j - b ×cij
= Pi
j j j

1
Þ e - li = × Pi = ai × Pi
åe
- l j - b ×cij

Similar for destinations, and substitute in Tij


-l j - b ×cij - b ×cij
Tij = e - li × e ×e = ai × Pi × b j × A j × e

Which is equivalent to the doubly constrained model


Thus different analogies lead to similar formulation

CIE4801: Trip distribution 30


2.3
Matrix balancing algorithm

CIE4801: Trip distribution 31


Key algorithm

• Distributing departures or arrivals over rows or columns based on:


• Older OD-matrix
• Willingness to travel
• Choice probabilities

• Two modelling methods


• Singly constrained: simply distributing departures over destinations or
arrivals over origins
• Doubly constrained: iteratively distributing departures and arrivals
• Triply constrained: iteratively distributing departures, arrivals and e.g.
distance classes

CIE4801: Trip distribution 32


Example doubly constrained model
3
1 2
3
2 1
3 2 Trip balancing
3
Pi

100

200

250

Aj 220
200 165
150 165
150

CIE4801: Trip distribution 33


Example doubly constrained model
3
1 2
3
2 1
3 2 Trip balancing
3
Pi Travel costs cij

1 3 3 100

3 1 1 200

2 2 1
250

Aj 220
200 165
150 165
150

CIE4801: Trip distribution 34


Example doubly constrained model
3
1 2
3
2 1
3 2 Trip balancing
3
Pi Travel costs cij
Willingness Fij
13.0 1.1
3 1.1
3 100

31.1 3.0
1 3.0
1 200

21.8 1.8
2 3.0
1 250
Fij = f (cij )
Aj 220
200 165
150 165
150 = 5 × exp(-0.5 × cij )

CIE4801: Trip distribution 35


Example doubly constrained model
3
1 2
3
2 1
3 2 Trip balancing
3
Pi Travel costs cij
100 Willingness Fij
´ 3.0 1.1 1.1 100
5.2 Balancing factors ai , b j
200
´ 1.1 3.0 3.0 200
7.1
250
´ 1.8 1.8 3.0 250
6.6

Aj 220
200 165
150 165
150

CIE4801: Trip distribution 36


Example doubly constrained model
3
1 2
3
2 1
3 2 Trip balancing
3
Pi Travel costs cij
Willingness Fij
57.6 21.2 21.2 100
Balancing factors ai , b j

31.0 84.5 84.5 200

68.2 68.2 113.6 250

Aj 220
200 165
150 165
150
220 165 165
´ ´ ´
156.8 173.9 219.3 CIE4801: Trip distribution 37
Trip distribution using the gravity
model
3
1 2
3
2 1
3 2 Trip balancing
3
Pi Travel costs cij
Willingness Fij
80.8 20.1 15.9 100
Balancing factors ai , b j

43.5 80.2 63.6 200

95.7 64.7 85.5 250

Aj 220
200 165
150 165
150

CIE4801: Trip distribution 38


Example doubly constrained model
3
1 2
3
2 1
3 2 Trip balancing
3
Pi Travel costs cij
Willingness Fij
70.5 16.5 13.0 100
Balancing factors ai , b j

48.7 84.3 67.0 Repeat until there


200
are no changes:
=>OD matrix
100.8 64.2 85.0 250

Aj 220
200 165
150 165
150

CIE4801: Trip distribution 39


2.4.1
Calibration of deterrence functions
Hyman’s method

CIE4801: Trip distribution 40


Hyman’s method

No OD-information available

Given:
- Observed trip production
- Observed trip attraction
- Cost matrix
- Observed mean trip length (MTL)

Assumption: F (cij ) = exp(-a cij ), a is unknown

OD matrix can then be determined by:


using the doubly constrained gravity model
while updating a to match the MTL.

CIE4801: Trip distribution 41


Example Hyman’s method

Given: Pi =

3 11 18 22 400
12 3 13 19 460
cij = 400
15 13 5 7
24 18 8 5 702

Aj = 260 400 500 802

Observed: MTL = 10

F (cij ) = exp(-a cij ), a is unknown

Compute the OD-matrix and distribution function


that fits the MTL.

CIE4801: Trip distribution 42


Example Hyman’s method: iteration 1
Pi

156 99 68 77 400
58 204 103 95 460 3 11 18 22
26 45 138 191 400 12 3 13 19
cij =
20 52 191 439 702 15 13 5 7
24 18 8 5
Aj 260 400 500 802

First step: Choose a = 1/ MTL = 0.1


Compute trip distribution using a gravity model
Compute modelled MTL
156×3 + 99×11 + 68×18 + 77×22 + 58×12 + …
MTL1 = 156 + 99 + 68 + 77 + 58 + …
= 8.7
CIE4801: Trip distribution 43
Example Hyman’s method:
iterations and result
Set next α MTL1
n = 1: a 2 = a1 ,
MTL
Compute OD-matrix
n ³ 1: a n +1 =
( MTL - MTLn-1 )a n - ( MTL - MTLn )a n-1
Set next α , etc. MTLn - MTLn -1
After a number of iterations: a = 0.0586
Pi
112 98 81 109 400
66 156 109 129 460 3 11 18 22
39 60 120 181 400 cij =
12 3 13 19
43 86 190 383 702 15 13 5 7
24 18 8 5
Aj 260 400 500 802

112×3 + 98×11 + 81×18 + 109×22 + 66×12 + …


MTL = 112 + 98 + 81 + 109 + 66 + …
= 10.0
CIE4801: Trip distribution 44
2.4.2
Calibration of deterrence functions
Poisson model or Tri-proportional
fitting

CIE4801: Trip distribution 45


Poisson model (Tri-proportional problem)

• Observed OD-matrix from a survey


• Not necessarily complete
• Usually at an aggregate level (e.g. municipality)

• Cost functions
• Your definition in time, cost, length plus…..
• When an aggregate level is used, costs should be aggregated as well

• Discretisation of the cost function F ( cij ) Þ Fk ( cij )


• Preferably each “bin” having a similar rate of observations

CIE4801: Trip distribution 46


Mathematical background (1/2)

• Key assumption: number of trips per OD-pair is Poisson


distributed

• Model formulation: Tˆij = Qi × X j × Fk ( cij )


e-l l x
• Poisson model: P ( x ) =
x!
( ( ))
(Q × X × Fk ( cij ) )
- Qi × X j × Fk cij Tij
e
• For Tij Þ p (Tij ) =
i j

Tij !
• For a set of N observations nij the likelihood becomes

e
( ( ))
- c×Qi × X j × Fk cij
(c × Q × X j × Fk ( cij ) )
nij
ån ij

( ) Õ
p {nij } | Qi , X j , Fk ( cij ) =
i , jÎN
i

nij !
,c = ijÎN

CIE4801: Trip distribution 47


Mathematical background (2/2)

• Setting derivatives equal to 0 yields 3 linear equations in which


each parameter is function of the other two

• Similar solution procedure as for trip distribution:

• Determine the constraints


• For each origin i the number of observed trips (departures)
• For each destination j the number of observed trips (arrivals)
• For each “bin” k the number of observed trips

• Set all parameters Qi, Xj and Fk equal to 1

• Determine successively the values for Qi, Xj and Fk until


convergence
CIE4801: Trip distribution 48
Example Poisson estimator
962
# observed OTLD

365
160 150 230
95
0 4 8 12 16 20 24
distance Pi =

3 11 18 22 400
10 3 13 19 460
cij = 400
F (cij ) 15 13 5 7
24 18 6 5 702
? distribution function
? Aj = 260 400 500 802
?
?
?
?
distance
0 4 8 12 16 20 24

CIE4801: Trip distribution 49


Example Poisson estimator: step 1
Pi

1 1 1 1 400 ´100
1 1 1 1 460 ´115
1 1 1 1 400 ´100
1 1 1 1 702 ´175.5

Aj 260 400 500 802


F (cij )

Start with F (cij ) = 1


Scale to the productions 1.0 1.0 1.0 1.0 1.0 1.0

distance
0 4 8 12 16 20 24

CIE4801: Trip distribution 50


Example Poisson estimator: step 2
Pi

100 100 100 100 400


115 115 115 115 460
100 100 100 100 400
175.5 175.5 175.5 175.5 702

Aj 260 400 500 802


´0.53 ´0.82 ´1.01 ´1.63

Scale to the attractions

CIE4801: Trip distribution 51


Example Poisson estimator: step 3
Pi

53 82 102 164 400


61 94 117 188 460
53 81 102 163 400
93 143 179 287 702
Aj 260 400 500 802
F (cij )
Scale the distribution # observed
values such that they
represent the OTLD

distance
0 4 8 12 16 20 24

CIE4801: Trip distribution 52


Example Poisson estimator: step 3
Pi

53 82 102 164 400


61 94 117 188 460
53 81 102 163 400
93 143 179 287 702
Aj 260 400 500 802
F (cij )

# predicted
3 11 18 22
731
cij =
10 3 13 19
15 13 5 7 433
24 18 6 5 251 257
147 143
distance
0 4 8 12 16 20 24

CIE4801: Trip distribution 53


Example Poisson estimator: step 3
Pi

53 82 102 164 400


61 94 117 188 460
53 81 102 163 400
93 143 179 287 702
Aj 260 400 500 802

# predicted
# observed
Scale the distribution
values such that they
represent the OTLD

distance
0 4 8 12 16 20 24

CIE4801: Trip distribution 54


Example Poisson estimator: step 3
Pi

53 ×2.5 82 ×1.1 102 ×0.5 164 ×0.4 400


61 ×1.1 94 ×2.5 117 ×0.6 188 ×0.5 460
53 ×0.6 81 ×0.6 102 ×1.3 163 ×1.3 400
93 ×0.4 143 ×0.5 179 ×1.3 287 ×1.3 702

Aj 260 400 500 802


F (cij )

3 11 18 22 2.5
cij =
10 3 13 19
15 13 5 7 1.3
1.1
24 18 6 5 0.6 0.5 0.4
distance
0 4 8 12 16 20 24

CIE4801: Trip distribution 55


Example Poisson estimator: result
iteration 1 Pi

132 92 54 61 400
68 233 70 100 460
32 49 134 215 400
34 76 235 377 702
Aj 260 400 500 802

Perform next iteration


- scale to productions
- scale to attractions
- scale distribution values
etc.

CIE4801: Trip distribution 56


Example Poisson estimator: result
Pi

156 101 69 74 400


58 208 85 109 460 OD-matrix
after 10
26 39 121 214 400
iterations
20 52 225 405 702

Aj 260 400 500 802


F (cij )
Distribution
2.9 = 1 × 2.5 × …
function:
1.2 1.2
0.7
0.5 0.3
distance
0 4 8 12 16 20 24

CIE4801: Trip distribution 57


From discrete distribution function
to continuous function

• Just test which function yields the best fit with the function values
• Function type and parameters

• In practice it’s likely that you have to choose for which range of
costs the fit is best
• “One size doesn’t fit all”

CIE4801: Trip distribution 58


2.4.3
Calibration of deterrence functions
Overview of the 2 methods

CIE4801: Trip distribution 59


Estimation of the distribution function

Hyman’s method Poisson model

Given: Given:
• Cost matrix • Cost matrix
• Production and atraction • (partial) observed OD-matrix
• Mean trip length
Thus also known:
Assumed: • (partial) production and
• Type of distribution function attraction
• Totals per “bin” for the travel
Estimated: costs
• Qi, Xj and parameter
distribution function Estimated:
Qi, Xj and Fk

CIE4801: Trip distribution 60


Solution methods: overview
Hyman’s method Poisson model

1. Set parameter α of the 1. Set values for Fk equal to 1


distribution function equal to 2. Balance the (partial) matrix
1/MTL for the (partial) production
2. Determine values for f(cij) 3. Balance the (partial) matrix
3. Balance the matrix for the for the (partial) attraction
productions and attractions 4. Balance the (partial) matrix
(i.e. apply gravity model) for the totals per cost class
4. Determine new estimate for α (i.e. correction in iteration i
based on observed MTL and for estimate of Fk)
computed MTL and go to step 5. Go to step 2 until
2 until convergence is convergence is achieved
achieved observed totalk
Fki = Õ j
j computed total k
CIE4801: Trip distribution 61
2.5
Trip distribution models
Method 4: Choice modelling

CIE4801: Trip distribution 62


Discrete choice model

exp( bV j )
Tij = Pi , V j = q1 X j - q 2cij
å exp(bV )
k
k

Tij = number of trips from i to j


q1 ,q 2 = parameters
b= scaling parameter
Pi = trip production at zone i
Xj = trip attraction potential at zone j
cij = travel cost from zone i to zone j

CIE4801: Trip distribution 63


Explanatory variables?

• Inhabitants
• Households
• Jobs
• Retail jobs
• Students
• Densities
• Location types
• Etc.

• Minus travel costs

More suited for trips or for tours?

CIE4801: Trip distribution 64


Derivation of the gravity model (reprise)
Ni Nj
zone cij
zone
i P j
Observed utility for activities in zone i and zone j:
Vij = N j - N i - q 2 × cij
Subjective utility:
U ij = Vij + e ij
Number of people traveling from i to j:
bVij
e Tij = r Qi X j Fij
pij × T = ×T
åe rs
bVrs

T
= × exp(- b N i ) × exp( b N j ) × exp(- bq 2 cij )
å exp(bVrs )
rs
CIE4801: Trip distribution 65
2.7
Trip distribution
Practical issues

CIE4801: Trip distribution 66


Practical issues

• Distribution function and trip length distribution

• Intra-zonal trips

• External zones: through traffic

• All trips or single mode?

CIE4801: Trip distribution 67


Distribution function and trip length
distribution

• Similar or different?

• Simply put:
distribution function is input and trip length distribution is output!

• See also differences in OTLD en distribution function in slides on


Poisson estimation

CIE4801: Trip distribution 68


Intrazonal trips

• What’s the problem?

• Intrazonal travel costs?


1
• Rule of thumb: 3 (or 1 2 ?) of lowest cost to neighbouring zone
• True for public transport?

• Alternative: Trip generation for intrazonal only


• How?

CIE4801: Trip distribution 69


External zones

• Two possible issues

• Size issue
• Very large zones => high values for production and attraction
=> intrazonal trips? => small errors lead to large differences

• Cordon models
• Through traffic follows from other source, e.g. license plate survey or
other model => through traffic is thus fixed input and should not be
modelled using trip distribution models

CIE4801: Trip distribution 70


Approach for cordon model

• Determine production and attraction for internal zones using e.g.


regression analysis
• Determine production and attraction for external zones using e.g. counts
• Derive matrix for through traffic (i.e. from cordon zone to cordon zone)
from e.g. a regional model
• Subtract through traffic from production and attraction of the external
zones
• Apply gravity model with the resulting production and attraction, while
making sure that there is no through traffic, e.g. by setting the travel
costs between cordon zones equal to ¥
• Add matrix for through traffic to the resulting matrix of the gravity model

CIE4801: Trip distribution 71


All trips or a single mode?

• Check the slides

• Which parts consider a single mode?

CIE4801: Trip distribution 72

You might also like