Questions about using panel data

227 views
Skip to first unread message

Zahra Sanatgar

unread,
Aug 13, 2021, 11:15:03 AM8/13/21
to Biogeme

Dear Professor Bierlaire,

 

I have a couple of basic question about developing a multinomial logit model using panel data in Python. I have followed the steps in 12panel.py. Here is what I have done:

1-    I define utility functions, associate utility functions with the numbering of alternatives, and associate the availability conditions with the alternatives

2-    Then I use the following few lines to estimate the model:

# The likelihood of one observation is given by the logit model

obsprob = models.logit(V, av, Choice)

# The likelihood of all observations for one individual (the trajectory) is the product of the likelihood of each observation.

logprob = PanelLikelihoodTrajectory(obsprob)

# Create the Biogeme object

biogeme = bio.BIOGEME(database, logprob)

biogeme.modelName = 'Panel'

 

# Estimate the parameters.

results = biogeme.estimate()

pandasResults = results.getEstimatedParameters()

print(pandasResults)

 

My specific questions are:

a-     Given that we are developing simple MNL, logprob is obtained by using PanelLikelihoodTrajectory. Essentially, there is no need for Monte-Carlo as no random parameters is involved. Do I understand it correctly?

b-    I get negative AIC and BIC. In addition, all variables have p-values that are either equal to 0 or 1. Any thoughts for potential reasons?

 

Thank you very much for your help.

 

 

 

Bierlaire Michel

unread,
Aug 13, 2021, 11:27:36 AM8/13/21
to sanat...@gmail.com, Bierlaire Michel, Biogeme
You need to use PanelLikelihoodTrajectory only if you have an agent effect. If not, the fact that the data is panel is irrelevant, and you can treat them as cross-sectional data.

--
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/8dd24ae0-c6f5-4e60-811e-16f6df572e76n%40googlegroups.com.

Zahra Sanatgar

unread,
Aug 13, 2021, 12:05:17 PM8/13/21
to Bierlaire Michel, Biogeme
Dear Professor Bierlaire,

Thank you very much for your reply.

I do use PanelLikelihoodTrajectory. My question is that do I need to use Monte-Carlo while I do NOT have a mixture of logit models?

I also have a second question: I get negative AIC and BIC. In addition, all variables have p-values that are either equal to 0 or 1. Any thoughts for potential reasons?

All the best
ZS

Bierlaire Michel

unread,
Aug 13, 2021, 12:06:32 PM8/13/21
to Zahra Sanatgar, Bierlaire Michel, Biogeme
On 13 Aug 2021, at 17:49, Zahra Sanatgar <sanat...@gmail.com> wrote:

Dear Professor Bierlaire,

Thank you very much for your reply.

I do use PanelLikelihoodTrajectory.

You should not. 


My question is that do I need to use Monte-Carlo while I do NOT have a mixture of logit models?

No. As I said, the fact that the data are panel is irrelevant for your model.


I also have a second question: I get negative AIC and BIC. In addition, all variables have p-values that are either equal to 0 or 1. Any thoughts for potential reasons?

Just estimate a simple logit model, without the trajectory.
Reply all
Reply to author
Forward
0 new messages