Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculation of the number of parameters in continuous LCA #40

Closed
justinsavoie opened this issue Jul 5, 2023 · 3 comments
Closed

Calculation of the number of parameters in continuous LCA #40

justinsavoie opened this issue Jul 5, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@justinsavoie
Copy link

Hello, and thanks for this great package!

In the first example of the first tutorial (LCA with Continuous Features) the number of estimated parameters is 28. Is there a reason for this? Normally for a diagonal GMM like this one it would be 12 (means) + 12 (variances) + 2 (number of weights - 1) = 26? That seems to be what is calculated in e.g. mclust or sklearn.mixture.GaussianMixture. It's also possible I misunderstand and there is no issue.

@sachaMorin
Copy link
Collaborator

You are correct. I can reproduce. Thanks for reporting

@sachaMorin sachaMorin added the bug Something isn't working label Jul 5, 2023
@sachaMorin sachaMorin self-assigned this Jul 5, 2023
@sachaMorin
Copy link
Collaborator

sachaMorin commented Jul 5, 2023

I think I found the problem. For counting parameters, StepMix simply adds the number of parameters in the measurement and structural models to n_components - 1 in the main class (i.e., the class weights).

For Gaussian measurement models however, StepMix actually relies on the sklearn Gaussian mixture class, which already includes the class weights when calling n_parameters. Class weights are therefore included twice.

sachaMorin added a commit that referenced this issue Jul 5, 2023
Test for issue #40. Also test other models.
sachaMorin added a commit that referenced this issue Jul 5, 2023
@sachaMorin
Copy link
Collaborator

This should be fixed with the changes in 1.2.3 and 1.2.4. Thanks again,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants