Latent class model with class membership for panel data

5 views
Skip to first unread message

Marie Duper

unread,
May 23, 2024, 5:11:58 AMMay 23
to Biogeme

Hi 


I am making a latent class model for panel data. I have estimated the mixed logit model. I am trying to follow the description here:
https://biogeme.epfl.ch/sphinx/auto_examples/swissmetro/plot_b16panel_discrete_socio_eco.html#

I have several things that I do not understand. 


  1. What are ASC_CAR_S_class0 and ASC_CAR_S_class1? And what are CLASS_CTE and CLASS_INC? Do you need one of these for every SE factor that we include?
  2. Does something like this count as two or three latent classes: 
  3. W = CLASS_CTE + CLASS_INC * INCOME + CLASS_Gender*GENDER
  4. I want to calculate the class memberships. I have thried to follow this: 

https://biogeme.epfl.ch/sphinx/auto_examples/swissmetro/plot_b13panel_simul.html



simulated_loglike = logprob.getValue_c(

    database=flat_database,

    betas=results.getBetaValues(),

    numberOfDraws=250,

    aggregation=True,

    prepareIds=True,

)


numerator = MonteCarlo(ACS2_param[0] * probIndiv)

denominator = MonteCarlo(probIndiv)


simulate = {

    'Numerator': numerator,

    'Denominator': denominator,

}



biosim = bio.BIOGEME(flat_database, simulate)

biosim.modelName = 'panel_flat_latent_class_individual_sim'

class_simulation = biosim.simulate(theBetaValues=results.getBetaValues())

class_simulation.describe()


But this gives me 100% class membership.  It is also only for one parameter. How do I fix it? 


Reply all
Reply to author
Forward
0 new messages