Page 1 of 1

Nested Latent Class Model

Posted: 03 Aug 2025, 22:31
by kiki
Hi,

I am currently working with latent class models in Apollo and would like to inquire whether it is possible to implement a hierarchical latent class model. That is, a model structure allows for subclasses nested within higher-level latent classes.

If this is supported, could you kindly provide a code example and guidance on how to structure such a model in Apollo?

Thank you very much for your time and assistance!

Best regards,
kiki

Re: Nested Latent Class Model

Posted: 09 Aug 2025, 17:04
by stephanehess
Hi

could you provide a mathematical example of what you are after? Then I can advise on how to do this in Apollo

Stephane

Re: Nested Latent Class Model

Posted: 13 Aug 2025, 14:53
by kiki
Hi Stephone,

Thank you! The mathematical example can be referred in the paper named "A model for the simultaneous inference of attribute nonattendance and taste heterogeneity", Eq(1)-(9).

The outer latent classes are specified as a conventional latent class model, where each class has its own set of parameters. The inner IANA latent classes have only one set of parameters, which are shared across all inner classes. This parameter structure seems inconsistent with Apollo’s requirements. In the Apollo, all existing specifications of the latent class model have the same parameter structure (same number and naming of parameters) to construct the joint likelihood. When I attempt to include two indices in the utility function to reflect this structure, it triggers errors

Best regards,
kiki

Re: Nested Latent Class Model

Posted: 09 Sep 2025, 14:21
by stephanehess
Hi

you only need the same structure if you write the classes in a loop. Otherwise you can have different structures in different classes. If you share your code, I can have a look

Stephane