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

Extend predicted_draws() to handle sim() calls using vars argument #17

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jonathan-g
Copy link

As issue #15 reports, rethinking::sim(model, new_data, vars = c("foo", "bar")) returns a named list of matrices: one for "foo" and one for "bar" as dependent variables. predicted_draws() expects sim() to return a single matrix, so predicted_draws(model, new_data, vars = c("foo", "bar")) throws an error.

This patch has predicted_draws() test for whether sim() returns a list, and if so, it returns a named list of data.frames, one for each matrix in the list returned by sim().

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

Successfully merging this pull request may close these issues.

1 participant