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

fitted functionality #42

Open
zacksteel opened this issue Apr 7, 2024 · 2 comments
Open

fitted functionality #42

zacksteel opened this issue Apr 7, 2024 · 2 comments

Comments

@zacksteel
Copy link

Hi Jeff,

Thanks again for a great package. I have a suggestion/request for additional functionality. The various model types can be passed through the predict function to get posterior predictions, which is very handy. However, it would also be nice to be able to easily get fitted/expected values in a similar fashion (e.g., to plot marginal effects like this). I see that you use the generic fitted function as part of the goodness of fit assessments, but this produces y and p matrices but not z or psi. Would it be doable to add a convenience function that also produces expected values of the latent state?

Cheers,
Zack

@doserjef
Copy link
Collaborator

Hi Zack,

Thanks for the note and sorry for the delay in response. The posterior distributions for the latent states z and psi (for the sites used to fit the model) are provided directly in the model fit object. So if you saved the model results in an object called out, you can access those values directly via out$psi.samples and out$z.samples. It is on my todo list to make easier functions for generating marginal effects plots to make those a bit easier to generate (it's a bit clunky now, but here is a repository that contains some code with examples of doing that). Thanks again for the suggestions, I'll keep this issue open for now until I can get some nicer functions together for making marginal effects plots.

Thanks!

Jeff

@zacksteel
Copy link
Author

zacksteel commented Apr 12, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants