Page 1 of 1

LC with continuous random parameters with LV

Posted: 26 Apr 2020, 21:38
by rafael_lionello
Hello all,

May anyone provide an example of a LC with continuous random parameters (Apollo_example_21) with a Latent Variable (i.e., Apollo_example_25, ICLV)?

Thank you very much.

Best, Rafael.

Re: LC with continuous random parameters with LV

Posted: 15 May 2020, 12:43
by dpalma
Hi Rafael,

Attached to this post is a compressed folder containing four files:
  • ILVLC.pdf The formulation of a latent class model with two latent variables: one influencing the class allocation, and another influencing the utility functions.
    ILVLC.R The implementation of the same model in Apollo.
    ILVLC_dataGen.R A script generating the data used in the model. No need to run it yourself, ILVLC.R calls this script automatically.
    ILVLC_output.txt The output of the model.
The implementation of the model is slightly tricky, as you need to make sure the dimensionality of all components match. As we write the likelihood at the level of the individual (see last equation in the pdf file), we only keep the first row of each individual for the indicators, and the product of all observations from each individual within each class.

Even though this model does not include random coefficients, you can easily extend it by making, for example, beta_1 random, in the same way that random parameters are defined in Apollo_example_14 or any other example with random parameters.

I hope this helps.

Best wishes
David

Re: LC with continuous random parameters with LV

Posted: 23 Jun 2020, 17:32
by rafael_lionello
Thank you very much, David!