> On 22 May 2024, at 14:40,
marie...@gmail.com wrote:
>
> Hi there, I have tried to post to the google group but it didn't work
>
> 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.
> • What are ASC_CAR_S_class0 and ASC_CAR_S_class1?
The alternative specific constants of the models in each class.
> And what are CLASS_CTE and CLASS_INC? Do you need one of these for every SE factor that we include?
The parameter of the class membership model. CLASS_CTE is the intercept, and CLASS_INC the coefficient of income.
> • Does something like this count as two or three latent classes:
> • W = CLASS_CTE + CLASS_INC * INCOME + CLASS_Gender*GENDER
> • I want to calculate the class memberships.
But you simulate the logprob...
I suggest that you try first a simple latent class model, not mixed, to figure out how it works. Once it givea sensible results, you can start distributing some parameters.
> 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?
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