Logit with multiple alternatives Michel Bierlaire Transport and - - PowerPoint PPT Presentation

logit with multiple alternatives
SMART_READER_LITE
LIVE PREVIEW

Logit with multiple alternatives Michel Bierlaire Transport and - - PowerPoint PPT Presentation

Logit with multiple alternatives Michel Bierlaire Transport and Mobility Laboratory School of Architecture, Civil and Environmental Engineering Ecole Polytechnique F ed erale de Lausanne M. Bierlaire (TRANSP-OR ENAC EPFL) Logit with


slide-1
SLIDE 1

Logit with multiple alternatives

Michel Bierlaire

Transport and Mobility Laboratory School of Architecture, Civil and Environmental Engineering Ecole Polytechnique F´ ed´ erale de Lausanne

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 1 / 78

slide-2
SLIDE 2

Outline

Outline

1

Random utility

2

Choice set

3

Error term

4

Systematic part Linear utility Continuous variables Discrete variables Nonlinearities Interactions Heteroscedasticity

5

A case study

6

Maximum likelihood estimation

7

Simple models

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 2 / 78

slide-3
SLIDE 3

Random utility

Random utility

For all i ∈ Cn Uin = Vin + εin What is Cn? What is εin? What is Vin?

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 3 / 78

slide-4
SLIDE 4

Choice set

Outline

1

Random utility

2

Choice set

3

Error term

4

Systematic part Linear utility Continuous variables Discrete variables Nonlinearities Interactions Heteroscedasticity

5

A case study

6

Maximum likelihood estimation

7

Simple models

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 4 / 78

slide-5
SLIDE 5

Choice set

Choice set

Universal choice set All potential alternatives for the population Restricted to relevant alternatives Mode choice driving alone sharing a ride taxi motorcycle bicycle walking transit bus rail rapid transit

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 5 / 78

slide-6
SLIDE 6

Choice set

Choice set

Individual’s choice set No driver license No auto available Awareness of transit services Transit services unreachable Walking not an option for long distance Mode choice driving alone sharing a ride taxi motorcycle bicycle walking transit bus rail rapid transit

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 6 / 78

slide-7
SLIDE 7

Choice set

Choice set

Choice set generation is tricky How to model “awareness”? What does “long distance” exactly mean? What does “unreachable” exactly mean? We assume here deterministic rules Car is available if n has a driver license and a car is available in the household Walking is available if trip length is shorter than 4km.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 7 / 78

slide-8
SLIDE 8

Error term

Outline

1

Random utility

2

Choice set

3

Error term

4

Systematic part Linear utility Continuous variables Discrete variables Nonlinearities Interactions Heteroscedasticity

5

A case study

6

Maximum likelihood estimation

7

Simple models

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 8 / 78

slide-9
SLIDE 9

Error term

Error terms

Main assumption εin are extreme value EV(0,µ), independent and identically distributed. Comments Independence: across i and n. Identical distribution: same scale parameter µ across i and n. Scale must be normalized: µ = 1.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 9 / 78

slide-10
SLIDE 10

Error term

Derivation of the logit model

Assumptions Cn = {1, . . . , Jn} Uin = Vin + εin εin ∼ EV(0, µ) εin i.i.d. Choice model P(i|Cn) = Pr(Vin + εin ≥ max

j=1,...,Jn Vjn + εjn)

Assume without loss of generality (wlog) that i = 1 P(1|Cn) = P(V1n + ε1n ≥ max

j=2,...,Jn Vjn + εjn)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 10 / 78

slide-11
SLIDE 11

Error term

Derivation of the logit model

Composite alternative Define a composite alternative: “anything but alternative one” Associated utility: U∗ = max

j=2,...,Jn(Vjn + εjn)

From a property of the EV distribution U∗ ∼ EV   1 µ ln

Jn

  • j=2

eµVjn, µ  

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 11 / 78

slide-12
SLIDE 12

Error term

Derivation of the logit model

Composite alternative From another property of the EV distribution U∗ = V ∗ + ε∗ where V ∗ = 1 µ ln

Jn

  • j=2

eµVjn and ε∗ ∼ EV(0, µ)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 12 / 78

slide-13
SLIDE 13

Error term

Derivation of the logit model

Binary choice P(1|Cn) = P(V1n + ε1n ≥ maxj=2,...,Jn Vjn + εjn) = P(V1n + ε1n ≥ V ∗ + ε∗) ε1n and ε∗ are both EV(0,µ). Binary logit P(1|Cn) = eµV1n eµV1n + eµV ∗ where V ∗ = 1 µ ln

Jn

  • j=2

eµVjn

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 13 / 78

slide-14
SLIDE 14

Error term

Derivation of the logit model

We have eµV ∗ = eln Jn

j=2 eµVjn =

Jn

  • j=2

eµVjn and P(1|Cn) = eµV1n eµV1n + eµV ∗ = eµV1n eµV1n + Jn

j=2 eµVjn

= eµV1n Jn

j=1 eµVjn

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 14 / 78

slide-15
SLIDE 15

Error term

Scale parameter

The scale parameter µ is not identifiable: µ = 1. Warning: not identifiable = not existing µ → 0, that is variance goes to infinity lim

µ→0 P(i|Cn) = 1

Jn ∀i ∈ Cn

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 15 / 78

slide-16
SLIDE 16

Error term

Scale parameter

µ → +∞, that is variance goes to zero limµ→∞ P(i|Cn) = limµ→∞

1 1+

j=i eµ(Vjn−Vin)

= 1 if Vin > maxj=i Vjn if Vin < maxj=i Vjn What if there are ties? Vin = maxj∈Cn Vjn, i = 1, . . . , J∗

n

P(i|Cn) = 1 J∗

n

i = 1, . . . , J∗

n and P(i|Cn) = 0

i = J∗

n + 1, . . . , Jn

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 16 / 78

slide-17
SLIDE 17

Systematic part

Outline

1

Random utility

2

Choice set

3

Error term

4

Systematic part Linear utility Continuous variables Discrete variables Nonlinearities Interactions Heteroscedasticity

5

A case study

6

Maximum likelihood estimation

7

Simple models

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 17 / 78

slide-18
SLIDE 18

Systematic part

Systematic part of the utility function

Vin = V (zin, Sn) zin is a vector of attributes of alternative i for individual n Sn is a vector of socio-economic characteristics of n

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 18 / 78

slide-19
SLIDE 19

Systematic part Linear utility

Functional form: linear utility

Notation xin = (zin, Sn) Linear-in-parameters utility functions Vin = V (zin, Sn) = V (xin) =

  • k

βk(xin)k Not as restrictive as it may seem

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 19 / 78

slide-20
SLIDE 20

Systematic part Continuous variables

Outline

1

Random utility

2

Choice set

3

Error term

4

Systematic part Linear utility Continuous variables Discrete variables Nonlinearities Interactions Heteroscedasticity

5

A case study

6

Maximum likelihood estimation

7

Simple models

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 20 / 78

slide-21
SLIDE 21

Systematic part Continuous variables

Explanatory variables: alternatives attributes

Numerical and continuous (zin)k ∈ R, ∀i, n, k Associated with a specific unit Examples Auto in-vehicle time (in min.) Transit in-vehicle time (in min.) Auto out-of-pocket cost (in cents) Transit fare (in cents) Walking time to the bus stop (in min.) Straightforward modeling

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 21 / 78

slide-22
SLIDE 22

Systematic part Continuous variables

Explanatory variables: alternatives attributes

Vin is unitless Therefore, β depends on the unit of the associated attribute Example: consider two specifications Vin = β1TTin + · · · Vin = β′

1TT′ in + · · ·

If TTin is a number of minutes, the unit of β1 is 1/min If TT′

in is a number of hours, the unit of β′ 1 is 1/hour

Both models are equivalent, but the estimated value of the coefficient will be different β1TTin = β′

1TT′ in =

⇒ TTin TT′

in

= β′

1

β1 = 60

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 22 / 78

slide-23
SLIDE 23

Systematic part Continuous variables

Explanatory variables: alternatives attributes

Generic and alternative specific parameters Vauto = β1TTauto + · · · Vbus = β1TTbus + · · ·

  • r

Vauto = β1TTauto + · · · Vbus = β2TTbus + · · · Modeling assumption: a minute has/has not the same marginal utility whether it is incurred on the auto or bus mode

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 23 / 78

slide-24
SLIDE 24

Systematic part Continuous variables

Explanatory variables: socio-eco. characteristics

Numerical and continuous (Sn)k ∈ R, ∀n, k Associated with a specific unit Examples Annual income (in KCHF) Age (in years) Warning: Sn do not depend on i

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 24 / 78

slide-25
SLIDE 25

Systematic part Continuous variables

Explanatory variables: socio-eco. characteristics

They cannot appear in all utility functions V1 = β1x11 + β2income V2 = β1x21 + β2income V3 = β1x31 + β2income    ⇐ ⇒    V ′

1

= β1x11 V ′

2

= β1x21 V ′

3

= β1x31 In general: alternative specific characteristics V1 = β1x11 + β2income +β4age V2 = β1x21 + β3income +β5age V3 = β1x31

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 25 / 78

slide-26
SLIDE 26

Systematic part Discrete variables

Outline

1

Random utility

2

Choice set

3

Error term

4

Systematic part Linear utility Continuous variables Discrete variables Nonlinearities Interactions Heteroscedasticity

5

A case study

6

Maximum likelihood estimation

7

Simple models

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 26 / 78

slide-27
SLIDE 27

Systematic part Discrete variables

Discrete variables

Mainly used to capture qualitative attributes Level of comfort for the train Reliability of the bus Color Shape etc...

  • r characteristics

Sex Education Professional status etc.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 27 / 78

slide-28
SLIDE 28

Systematic part Discrete variables

Discrete variables

Procedure for model specification Identify all possible levels of the attribute:

Very comfortable, Comfortable, Rather comfortable, Not comfortable.

Select a base case: very comfortable Define numerical attributes Adopt a coding convention

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 28 / 78

slide-29
SLIDE 29

Systematic part Discrete variables

Discrete variables

Introduce a 0/1 attribute for all levels except the base case zc for comfortable zrc for rather comfortable znc for not comfortable zc zrc znc very comfortable comfortable 1 rather comfortable 1 not comfortable 1 If a qualitative attribute has n levels, we introduce n − 1 variables (0/1) in the model

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 29 / 78

slide-30
SLIDE 30

Systematic part Discrete variables

Comparing two ways of coding

Base: very comfortable Vin = · · · +0zivc + βczic + βrczirc + βnczinc βc: difference of utility between comfortable and very comfortable (supposedly negative) βrc: difference of utility between rather comfortable and very comfortable (supposedly more negative) βnc: difference of utility between not comfortable and very comfortable (supposedly even more negative)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 30 / 78

slide-31
SLIDE 31

Systematic part Discrete variables

Comparing two ways of coding

Base: comfortable V ′

in = · · · + β′ vczivc+0zic + β′ rczirc + β′ nczinc

β′

vc: difference of utility between very comfortable and comfortable

(supposedly positive) β′

rc: difference of utility between rather comfortable and comfortable

(supposedly negative) β′

nc: difference of utility between not comfortable and comfortable

(supposedly more negative)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 31 / 78

slide-32
SLIDE 32

Systematic part Discrete variables

Discrete variables

Example of estimation with Biogeme Model 1 Model 2 ASC 0.574 0.574 BETA VC 0.000 0.918 BETA C

  • 0.919

0.000 BETA RC

  • 1.015
  • 0.096

BETA NC

  • 2.128
  • 1.210
  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 32 / 78

slide-33
SLIDE 33

Systematic part Nonlinearities

Outline

1

Random utility

2

Choice set

3

Error term

4

Systematic part Linear utility Continuous variables Discrete variables Nonlinearities Interactions Heteroscedasticity

5

A case study

6

Maximum likelihood estimation

7

Simple models

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 33 / 78

slide-34
SLIDE 34

Systematic part Nonlinearities

Nonlinear transformations of the variables

Example with travel time Compare a trip of 5 min with a trip of 10 min Compare a trip of 120 min with a trip of 125 min Utility difference: βT× 5 min, in both cases. Behavioral assumption One more minute of travel is not perceived the same way for short trips as for long trips

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 34 / 78

slide-35
SLIDE 35

Systematic part Nonlinearities

Nonlinear transformations of the variables

  • 2.5
  • 2
  • 1.5
  • 1
  • 0.5

0.5 1 1.5 2 2.5 2 4 6 8 10 Utility Travel time

  • log(x)
  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 35 / 78

slide-36
SLIDE 36

Systematic part Nonlinearities

Nonlinear transformations of the variables

Assumption 1: the marginal impact of travel time is constant Vi = βTtimei + · · · Assumption 2: the marginal impact of travel time decreases with travel time Vi = βT ln(timei) + · · · Remarks It is still a linear-in-parameters form The unit, the value, and the interpretation of βT is different

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 36 / 78

slide-37
SLIDE 37

Systematic part Nonlinearities

Nonlinear transformations of the variables

Data can be preprocessed to account for nonlinearities Vin = V (h(zin, Sn)) =

  • k

βk(h(zin, Sn))k It is linear-in-parameter, even with h nonlinear.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 37 / 78

slide-38
SLIDE 38

Systematic part Nonlinearities

Categories

Same assumption: sensitivity to travel time varies with travel time Log transform is not the only specification Another possibility: categories of trips

Short trips: 0–90 min. Medium strips: 90–180 min. Long trips: 180–270 min. Very long trips: 270 min. and more

Specifications Categories with constants (inferior solution) Piecewise linear specification (spline)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 38 / 78

slide-39
SLIDE 39

Systematic part Nonlinearities

Categories with constants

Same specification as for discrete variables Vi = βT1xT1 + βT2xT2 + βT3xT3 + βT4xT4 + . . . with xT1 = 1 if TTi ∈ [0–90[, 0 otherwise xT2 = 1 if TTi ∈ [90–180[, 0 otherwise xT3 = 1 if TTi ∈ [180–270[, 0 otherwise xT4 = 1 if TTi ∈ [270–[, 0 otherwise One β must be normalized to 0.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 39 / 78

slide-40
SLIDE 40

Systematic part Nonlinearities

Categories with constants

  • 2.5
  • 2
  • 1.5
  • 1
  • 0.5

50 100 150 200 250 300 Utility Time

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 40 / 78

slide-41
SLIDE 41

Systematic part Nonlinearities

Categories with constants

Drawbacks No sensitivity to travel time within the intervals Discontinuous utility function (jumps) Need for many small intervals Results may vary significantly with the definition of the intervals Appropriate when Categories have been used in the survey (income, age) Definition of categories is natural (weekday)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 41 / 78

slide-42
SLIDE 42

Systematic part Nonlinearities

Piecewise linear specification

  • 3.5
  • 3
  • 2.5
  • 2
  • 1.5
  • 1
  • 0.5

50 100 150 200 250 300 Utility Time Piecewise linear

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 42 / 78

slide-43
SLIDE 43

Systematic part Nonlinearities

Piecewise linear specification

Features Capture the sensitivity within the intervals Enforce continuity of the utility function Vi = βT1xT1 + βT2xT2 + βT3xT3 + βT4xT4 + . . . where

xT1 =

  • t

if t < 90 90

  • therwise

xT2 =    if t < 90 t − 90 if 90 ≤ t < 180 90

  • therwise

xT3 =    if t < 180 t − 180 if 180 ≤ t < 270 90

  • therwise

xT4 =

  • if t < 270

t − 270

  • therwise
  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 43 / 78

slide-44
SLIDE 44

Systematic part Nonlinearities

Piecewise linear specification

Note: coding in Biogeme for interval [a:a+b[ xTi =    if t < a t − a if a ≤ t < a + b b

  • therwise

xTi = max(0, min(t − a, b)) xT1 = min(t, 90) xT2 = max(0, min(t − 90, 90)) xT3 = max(0, min(t − 180, 90)) xT4 = max(0, t − 270) TRAIN_TT1 = min( TRAIN_TT , 90) TRAIN_TT2 = max(0,min( TRAIN_TT - 90, 90)) TRAIN_TT3 = max(0,min( TRAIN_TT - 180 , 90)) TRAIN_TT4 = max(0,TRAIN_TT - 270)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 44 / 78

slide-45
SLIDE 45

Systematic part Nonlinearities

Piecewise linear specification

Examples: t TT1 TT2 TT3 TT4 40 40 100 90 10 200 90 90 20 300 90 90 90 30

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 45 / 78

slide-46
SLIDE 46

Systematic part Nonlinearities

Box-Cox transforms

Box and Cox, J. of the Royal Statistical Society (1964) Vi = βxi(λ) + · · · where xi(λ) =        xλ

i − 1

λ if λ = 0 ln xi if λ = 0. and xi > 0.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 46 / 78

slide-47
SLIDE 47

Systematic part Nonlinearities

Box-Cox transforms

  • 3
  • 2
  • 1

1 2 3 4 5 6 7 8 9 10 Utility Elapsed time (hours)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 47 / 78

slide-48
SLIDE 48

Systematic part Nonlinearities

Box-Cox transforms

Box-Tukey If xi ≤ 0, let α such that xi + α > 0 and xi(λ, α) =        (xi + α)λ − 1 λ if λ = 0 ln(xi + α) if λ = 0.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 48 / 78

slide-49
SLIDE 49

Systematic part Nonlinearities

Box-Cox transforms

Other power transforms are possible: Manly, Biometrics (1971) xi(λ) = exi λ−1

λ

if λ = 0 xi if λ = 0. John and Draper, Applied Statistics (1980) xi(λ) =

  • sign(xi) (|xi|+1)λ−1

λ

if λ = 0 sign(xi) ln(|xi| + 1) if λ = 0.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 49 / 78

slide-50
SLIDE 50

Systematic part Nonlinearities

Box-Cox transforms

Other power transforms are possible: Yeo and Johnson, Biometrika (2000) xi(λ) =                            (xi + 1)λ − 1 λ if λ = 0, xi ≥ 0; ln(xi + 1) if λ = 0, xi ≥ 0; (1 − xi)2−λ − 1 λ − 2 if λ = 2, xi < 0; − ln(1 − xi) if λ = 2, xi < 0.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 50 / 78

slide-51
SLIDE 51

Systematic part Nonlinearities

Power series

Taylor expansion Vi = β1T + β2T 2 + β3T 3 + . . . In practice, these terms can be very correlated Difficult to interpret Risk of over fitting

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 51 / 78

slide-52
SLIDE 52

Systematic part Interactions

Outline

1

Random utility

2

Choice set

3

Error term

4

Systematic part Linear utility Continuous variables Discrete variables Nonlinearities Interactions Heteroscedasticity

5

A case study

6

Maximum likelihood estimation

7

Simple models

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 52 / 78

slide-53
SLIDE 53

Systematic part Interactions

Interactions

Motivation All individuals in a population are not alike Socio-economic characteristics define segments in the population How to capture heterogeneity?

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 53 / 78

slide-54
SLIDE 54

Systematic part Interactions

Interactions of attributes and characteristics

Remember... Vin = V (h(zin, Sn)) =

  • k

βk(h(zin, Sn))k Examples of h for interactions cost / income distance / out-of-vehicle time (= speed)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 54 / 78

slide-55
SLIDE 55

Systematic part Interactions

Segmentation

The population is divided into a finite number of segments Each individual belongs to exactly one segment Example: gender (M,F) and house location (metro, suburb, perimeter areas) 6 segments: (M, m), (M, s), (M, p), (F, m), (F, s), (F, p).

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 55 / 78

slide-56
SLIDE 56

Systematic part Interactions

Segmentation

Specification βM,mTTM,m + βM,sTTM,s + βM,pTTM,p+ βF,mTTF,m + βF,sTTF,s + βF,pTTF,p+ TTi = TT if indiv. belongs to segment i, and 0 otherwise Remarks For a given individual, exactly one of these terms is non zero. The number of segments grows exponentially with the number of variables.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 56 / 78

slide-57
SLIDE 57

Systematic part Interactions

Variable parameters

Taste parameter varies with a continuous socio-economic characteristics Example: the cost parameter varies with income βcost = ˆ βcost inc incref λ with λ = ∂βcost ∂inc inc βcost Remarks λ must be estimated Utility is not linear-in-parameters anymore Reference value is arbitrary Several characteristics can be combined: βcost = ˆ βcost inc incref λ1 age ageref λ2

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 57 / 78

slide-58
SLIDE 58

Systematic part Heteroscedasticity

Outline

1

Random utility

2

Choice set

3

Error term

4

Systematic part Linear utility Continuous variables Discrete variables Nonlinearities Interactions Heteroscedasticity

5

A case study

6

Maximum likelihood estimation

7

Simple models

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 58 / 78

slide-59
SLIDE 59

Systematic part Heteroscedasticity

Heteroscedasticity

Assumption: variance of error terms is different across individuals Assume there are two different groups such that Uin1 = Vin1 + εin1 Uin2 = Vin2 + εin2 and Var(εin2) = α2 Var(εin1) Logit is homoscedastic εin i.i.d. across both i and n. How can we specify the model in order to use logit? Motivation People have different level of knowledge (e.g. taxi drivers) Different sources of data

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 59 / 78

slide-60
SLIDE 60

Systematic part Heteroscedasticity

Heteroscedasticity

Solution: include scale parameters αUin1 = αVin1 + αεin1 = αVin1 + ε′

in1

Uin2 = Vin2 + εin2 = Vin2 + ε′

in2

where ε′

in1 and ε′ in2 are i.i.d.

Remarks Even if Vin1 =

j βjxjin1 is linear-in-parameters, αVin1 = j αβjxjin1

is not. Normalization: a different scale parameter can be estimated for each segment of the population, except one that must be normalized.

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 60 / 78

slide-61
SLIDE 61

A case study

Outline

1

Random utility

2

Choice set

3

Error term

4

Systematic part Linear utility Continuous variables Discrete variables Nonlinearities Interactions Heteroscedasticity

5

A case study

6

Maximum likelihood estimation

7

Simple models

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 61 / 78

slide-62
SLIDE 62

A case study

A case study

Choice of residential telephone services Household survey conducted in Pennsylvania, USA, 1984 Revealed preferences 434 observations

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 62 / 78

slide-63
SLIDE 63

A case study

A case study

Telephone services and availability

metro, suburban

& some

  • ther

perimeter perimeter non-metro areas areas areas Budget Measured yes yes yes Standard Measured yes yes yes Local Flat yes yes yes Extended Area Flat no yes no Metro Area Flat yes yes no

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 63 / 78

slide-64
SLIDE 64

A case study

A case study

Universal choice set C = {BM, SM, LF, EF, MF} Specific choice sets Metro, suburban & some perimeter areas: {BM,SM,LF,MF} Other perimeter areas: C Non-metro areas: {BM,SM,LF}

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 64 / 78

slide-65
SLIDE 65

A case study

A case study

Specification table β1 β2 β3 β4 β5 BM ln(cost(BM)) SM 1 ln(cost(SM)) LF 1 ln(cost(LF)) EF 1 ln(cost(EF)) MF 1 ln(cost(MF))

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 65 / 78

slide-66
SLIDE 66

A case study

A case study

Utility functions VBM = β5 ln(costBM) VSM = β1 + β5 ln(costSM) VLF = β2 + β5 ln(costLF) VEF = β3 + β5 ln(costEF) VMF = β4 + β5 ln(costMF)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 66 / 78

slide-67
SLIDE 67

A case study

A case study

Specification table II β1 β2 β3 β4 β5 β6 β7 BM ln(cost(BM)) users SM 1 ln(cost(SM)) users LF 1 ln(cost(LF)) 1 if metro/suburb EF 1 ln(cost(EF)) MF 1 ln(cost(MF))

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 67 / 78

slide-68
SLIDE 68

A case study

A case study

Utility functions VBM = β5 ln(costBM) + β6users VSM = β1 + β5 ln(costSM) + β6users VLF = β2 + β5 ln(costLF) + β7MS VEF = β3 + β5 ln(costEF) VMF = β4 + β5 ln(costMF)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 68 / 78

slide-69
SLIDE 69

Maximum likelihood estimation

Maximum likelihood estimation

Logit Model Pn(i|Cn) = eVin

  • j∈Cn eVjn

Log-likelihood of a sample L(β1, . . . , βK) =

N

  • n=1

 

J

  • j=1

yjn ln Pn(j|Cn)   where yjn = 1 if ind. n has chosen alt. j, 0 otherwise

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 69 / 78

slide-70
SLIDE 70

Maximum likelihood estimation

Maximum likelihood estimation

Logit model ln Pn(i|Cn) = ln

eVin

  • j∈Cn eVjn

= Vin − ln(

j∈Cn eVjn)

Log-likelihood of a sample for logit L(β1, . . . , βK) =

N

  • n=1

J

  • i=1

yin  Vin − ln

  • j∈Cn

eVjn  

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 70 / 78

slide-71
SLIDE 71

Maximum likelihood estimation

Maximum likelihood estimation

The maximum likelihood estimation problem max

β∈RK L(β)

Nonlinear optimization If the V ’s are linear-in-parameters, the function is concave

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 71 / 78

slide-72
SLIDE 72

Maximum likelihood estimation

Maximum likelihood estimation

Numerical issue Pn(i|Cn) = eVin

  • j∈Cn eVjn

Largest value that can be stored in a computer ≈ 10308, that is e709.783 It is equivalent to compute Pn(i|Cn) = eVin−Vin

  • j∈Cn eVjn−Vin =

1

  • j∈Cn eVjn−Vin
  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 72 / 78

slide-73
SLIDE 73

Simple models

Outline

1

Random utility

2

Choice set

3

Error term

4

Systematic part Linear utility Continuous variables Discrete variables Nonlinearities Interactions Heteroscedasticity

5

A case study

6

Maximum likelihood estimation

7

Simple models

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 73 / 78

slide-74
SLIDE 74

Simple models

Simple models

Null model Ui = εi ∀i Pn(i|Cn) = eVin

  • j∈Cn eVjn =

e0

  • j∈Cn e0 =

1 #Cn L =

  • n

ln 1 #Cn = −

  • n

ln(#Cn)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 74 / 78

slide-75
SLIDE 75

Simple models

Simple models

Constants only [Assume Cn = C, ∀n] Ui = ci + εi ∀i In the sample of size n, there are ni persons choosing alt. i. ln P(i) = ci − ln(

  • j

ecj) If Cn is the same for all people choosing i, the log-likelihood for this part

  • f the sample is

Li = nici − ni ln(

  • j

ecj)

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 75 / 78

slide-76
SLIDE 76

Simple models

Simple models

Constants only (ctd) The total log-likelihood is L =

  • j

njcj − n ln(

  • j

ecj) At the maximum, the derivatives must be zero ∂L ∂c1 = n1 − n ec1

  • j ecj = n1 − nP(1) = 0.
  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 76 / 78

slide-77
SLIDE 77

Simple models

Simple models

Constants only (ctd.) Therefore, P(1) = n1 n Conclusion If all alternatives are always available, a model with only Alternative Specific Constants reproduces exactly the market shares in the sample

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 77 / 78

slide-78
SLIDE 78

Simple models

Back to the case study

Alt. ni ni/n ci eci P(i) BM 73 0.168 0.247 1.281 0.168 SM 123 0.283 0.769 2.158 0.283 LF 178 0.410 1.139 3.123 0.410 EF 3 0.007

  • 2.944

0.053 0.007 MF 57 0.131 0.000 1.000 0.131 434 1.000 Null-model: L = -434 ln(5) = -698.496

Warning: these results have been obtained assuming that all alternatives are always available

  • M. Bierlaire (TRANSP-OR ENAC EPFL)

Logit with multiple alternatives 78 / 78