Panel data with mixed logit model

25 views
Skip to first unread message

Rachel Murray-Watson

unread,
May 14, 2024, 11:23:31 AMMay 14
to Biogeme
Dear Professor Bierlaire,

I see on this website  https://biogeme.epfl.ch that there are two versions of a mixed logit model with panel data: 

Flat data organization: https://biogeme.epfl.ch/sphinx/auto_examples/swissmetro/plot_b12panel_flat.html

"Not" flat: https://biogeme.epfl.ch/sphinx/auto_examples/swissmetro/plot_b12panel.html


I have two questions: 

1) What accounts for the serial correlation in the not-flat example? Is it the 
condprobIndiv = PanelLikelihoodTrajectory(obsprob) ?
2) Is the time parameter acting as the only parameter to account for taste heterogeneity? Elsewhere I have seen examples such as:
ZERO_SIGMA_PANEL_CAR = SIGMA_PANEL_CAR * bioDraws(
'ZERO_SIGMA_PANEL_CAR', 'NORMAL'
)
ZERO_SIGMA_PANEL_TRAIN = SIGMA_PANEL_TRAIN * bioDraws(
'ZERO_SIGMA_PANEL_TRAIN', 'NORMAL'
)
ZERO_SIGMA_PANEL_SM = SIGMA_PANEL_SM * bioDraws(
'ZERO_SIGMA_PANEL_SM', 'NORMAL'
)
For the "not flat" database. If these were included, would the time variable need the biodraws? And are such things required for use in the flat database? 3) When should one use something like:
database.panel('Participant_ID')?

Best wishes, Rachel

Michel Bierlaire

unread,
May 14, 2024, 11:44:10 AMMay 14
to r.mu...@gmail.com, Michel Bierlaire, Biogeme


> On 14 May 2024, at 16:43, Rachel Murray-Watson <r.mu...@gmail.com> wrote:
>
> Dear Professor Bierlaire,
>
> I see on this website https://biogeme.epfl.ch that there are two versions of a mixed logit model with panel data:
>
> Flat data organization: https://biogeme.epfl.ch/sphinx/auto_examples/swissmetro/plot_b12panel_flat.html
>
> "Not" flat: https://biogeme.epfl.ch/sphinx/auto_examples/swissmetro/plot_b12panel.html

Yes. And they are both equivalent.
>
>
> I have two questions:
>
> 1) What accounts for the serial correlation in the not-flat example? Is it the condprobIndiv = PanelLikelihoodTrajectory(obsprob) ?

No, You do not need the expression "PanelLikelihoodTrajectory" for the flat version, as all choices of the same individual are on the same row.

V1 = [
ASC_TRAIN_RND
+ B_TIME_RND * Variable(f'{t}_TRAIN_TT_SCALED')
+ B_COST * Variable(f'{t}_TRAIN_COST_SCALED')
for t in range(1, 10)
]

The distributed terms ASC_TRAIN_RND and B_TIME_RND are the same for each interval, capturing serial correlation.


> 2) Is the time parameter acting as the only parameter to account for taste heterogeneity? Elsewhere I have seen examples such as: ZERO_SIGMA_PANEL_CAR = SIGMA_PANEL_CAR * bioDraws(
> 'ZERO_SIGMA_PANEL_CAR', 'NORMAL'
> )
> ZERO_SIGMA_PANEL_TRAIN = SIGMA_PANEL_TRAIN * bioDraws(
> 'ZERO_SIGMA_PANEL_TRAIN', 'NORMAL'
> )
> ZERO_SIGMA_PANEL_SM = SIGMA_PANEL_SM * bioDraws(
> 'ZERO_SIGMA_PANEL_SM', 'NORMAL'
> )
> For the "not flat" database. If these were included, would the time variable need the biodraws? And are such things required for use in the flat database?

Again, this is exactly the same model. The syntax changes just because the data is organized differently.


> 3) When should one use something like: database.panel('Participant_ID')?

When the data is not flat.
"flat" means: one observation = all choices of one individual on the same row
"non flat" or "panel" means: one observation = one choice of one individual. Several consecutive rows capture the trajectory of choices for a given individual.


>
> Best wishes, Rachel
>
>
> --
> You received this message because you are subscribed to the Google Groups "Biogeme" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to biogeme+u...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/biogeme/22d5a7d8-94ef-4e49-9954-05cef76a1630n%40googlegroups.com.

Michel Bierlaire
Transport and Mobility Laboratory
School of Architecture, Civil and Environmental Engineering
EPFL - Ecole Polytechnique Fédérale de Lausanne
http://transp-or.epfl.ch
http://people.epfl.ch/michel.bierlaire

Marie Duper

unread,
May 22, 2024, 11:24:27 AMMay 22
to Biogeme
I also do not understand this what are ZERO_SIGMA_PANEL_SM
Reply all
Reply to author
Forward
0 new messages