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

Format of comparison plot data in likelihood function #404

Open
amageh opened this issue Apr 20, 2021 · 0 comments
Open

Format of comparison plot data in likelihood function #404

amageh opened this issue Apr 20, 2021 · 0 comments
Labels

Comments

@amageh
Copy link
Member

amageh commented Apr 20, 2021

  • respy version used, if any: any
  • Python version, if any: any
  • Operating System: any

Describe the bug

We allow the msm and likelihood functions to return comparison_plot_data which is a DataFrame containing moments/likelihood contributions that are useful for visualizations, etc. The format of the data for the likelihood function seems unintended to me:

If the model includes types, the comparison plot data returns two additional columns: type and log_type_probability. I am not sure if this is implemented correctly, as the resulting DataFrame looks like this (example: kw_97_basic):

identifier period choice value kind type log_type_probability
0 0 0 school -0.020207 choice NaN NaN
1 0 0 school -1.577148 choice NaN NaN
2 0 0 school -1.143622 choice NaN NaN
3 0 0 school -0.018780 choice NaN NaN
4 0 1 school -0.088496 choice NaN NaN
... 0 1 school -0.088496 choice NaN NaN
... ... ... ... ... ... ... ...
21963 1371 0 NaN NaN NaN 3 -3.413402
21964 1372 0 NaN NaN NaN 3 -3.413402
21965 1372 0 NaN NaN NaN 3 -3.413402
21966 1372 0 NaN NaN NaN 3 -3.413402
21967 1372 0 NaN NaN NaN 3 -3.413402

I think this stems from the way the log_type_probabilities look like before they are added to the data, it seems to me like they contain duplicates? I am not entirely sure how the final DataFrame is supposed to look like though, so I am not sure if this is even an issue.

To reproduce

Construct likelihood function with comparison plot data for a model with types (e.g. kw_97_basic)

@amageh amageh added the bug label Apr 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant