Dear Prof. Bierlaire,
I am estimating a seat choice model with panel data (5 observations per individual) and I am dealing with introducing the agent effect in the utility functions. My model has a large set of alternatives (>20) and all their attributes are included in the utility function. I want to introduce the agent effect by means of an error component distributed only across individuals (and not alternatives).
I looked into the panel data examples on the
biogeme website (e.g. 13panelNormalized.py) and I realized the utility functions always have one different error component for
each alternative. But I would like only to include a individual error term, not an alternative-based one.
Should it be correct to introduce a single error component N(0,sigma) for all the alternatives but one to address the agent effect? My code (Betas, V’s and AV’s defined as usual, not copied below) is as follows:
database = db.Database('Panel', Panel)
Best regards,
Carlos
On 9 Nov 2021, at 20:05, Carlos Romero <carlos9...@gmail.com> wrote:
Dear Prof. Bierlaire,
I am estimating a seat choice model with panel data (5 observations per individual) and I am dealing with introducing the agent effect in the utility functions. My model has a large set of alternatives (>20) and all their attributes are included in the utility function. I want to introduce the agent effect by means of an error component distributed only across individuals (and not alternatives).
I looked into the panel data examples on the biogeme website (e.g. 13panelNormalized.py)
and I realized the utility functions always have one different error component for each alternative.
But I would like only to include a individual error term, not an alternative-based one.
Should it be correct to introduce a single error component N(0,sigma) for all the alternatives but one to address the agent effect? My code (Betas, V’s and AV’s defined as usual, not copied below) is as follows:
database = db.Database('Panel', Panel)
database.panel("respondentId")
globals().update(database.variables)
# Error component
SIGMA = Beta('SIGMA',1.0,None, None, 0)
ERRORCOMP = SIGMA * bioDraws('ERRORCOMP', ‘NORMAL_ANTI’)
# Utility functions (just written the first 4)
V1 = B1 * X1_1 + B2 * X2_1 + B3 * X3_1
V2 = B1 * X1_2 + B2 * X2_2 + B3 * X3_2 + ERRORCOMP
V3 = B1 * X1_3 + B2 * X2_3 + B3 * X3_3 + ERRORCOMP
V4 = B1 * X1_4 + B2 * X2_4 + B3 * X3_4 + ERRORCOMP
#Likelihood and model estimation (as usual)
obsprob = models.logit(V, av, seatChoice)
condprobIndiv = PanelLikelihoodTrajectory(obsprob)
logprob = log(MonteCarlo(condprobIndiv))
biogeme = bio.BIOGEME(database, logprob, numberOfDraws=num_draws)
Best regards,
Carlos
--
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/f6529f8c-242a-4a27-894e-2eabde467697n%40googlegroups.com.
Dear Prof. Bierlaire
Thank you for your quick reply. I am now looking
for a more efficient (i.e. less computer time consuming) approach to account
for panel effect in my model, since otherwise I would have to include more than 20 error
components N(0,sigma). My question now is: Would I correctly address the panel
effects on individuals if I only use random parameters (random betas) for an appropriate
number of variables (as for example eq. (1) in Cherchi, Cirillo & Ortuzar, 2017)?
Or should I anyway include an error component for each alternative even if I am
adding random parameters?
Therefore, if I am right, this would be my code (based on the accurate 12panel.py but without including the alternative specific constant because I am not expecting any meaningful hidden preference for alternative j over alternative j+1):
Best regards,
CarlosTo view this discussion on the web visit https://groups.google.com/d/msgid/biogeme/6cad8d9c-ea87-4ad5-b99a-a1a96fdfb89cn%40googlegroups.com.