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

Possiblility of generating the stan code from R #202

Open
WardBrian opened this issue Aug 5, 2024 · 2 comments
Open

Possiblility of generating the stan code from R #202

WardBrian opened this issue Aug 5, 2024 · 2 comments
Labels
Milestone

Comments

@WardBrian
Copy link
Collaborator

The primary use case of this would be to support brms. This supports a make_stancode and make_standata functions which are paired together.

Related to #139, with the same questions about whether or not it belongs in the same scripts.

There is not really an equivalent need/desire for this in Python

@WardBrian WardBrian added this to the post-1.0 milestone Aug 5, 2024
@WardBrian
Copy link
Collaborator Author

This was requested at StanCon by @wds15

@paul-buerkner mentioned that some additional changes in BRMS would be necessary if we wanted to be able to take advantage of all the cool downstream stuff BRMS enables for its models, so this issue can also serve as a place to discuss if anything would be needed on our end

@WardBrian
Copy link
Collaborator Author

For basic uses, it looks like this is already possible, e.g.:

install.packages('brms')
library(brms)
make_stancode(rating ~ treat + period + carry + (1|subject),
         data = inhaler, family = "cumulative")

data <- make_standata(rating ~ treat + period + carry + (1|subject),
         data = inhaler, family = "cumulative")

in the data generation window will set the data and print the Stan code, which you can copy over yourself. A bit clunky, and missing all of brms' niceties around PPC, etc

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