example-models
example-models copied to clipboard
update case study of hierarchical models for binary trials
Updated models and notebook for Stan case study "Hierarchical Partial Pooling for Repeated Binary Trials"
- use affine transform for non-centered hierarchical logit model
- use include directives for data, transformed data, and generated quantities code shared across all models
- rework Rmd notebook so that it runs with CmdStanR
This PR updates the Rmd notebook and the HTML A subsequent PR will break this case study into multiple parts and create Jupyter notebooks.
To actually update the one people see I think there needs to be a separate PR to https://github.com/stan-dev/stan-dev.github.io, right?
I’ll take a look at this tomorrow
If you OK this PR, that should be sufficient review for the stan-dev.github.io pages as well.
can we turn off compilation for the include fragments? if so, how?
I think @rok-cesnovar put it together. My guess is provably naming them something other than .stan would work, but then you lose syntax highlighting etc
@rok-cesnovar - the include files are in a directory named "include" - can we do something with this information? for this case study, using includes makes a lot of sense. also, it's good to have more examples of how this works somewhere.
Feel free to ignore the testing errors, will fix the GHA script later this week to ignore the files you mentioned.
It doesn't let me comment directly on the rendered HTML, but here are some thoughts on the way the output looks:
- Can we hide the 'A newer version of CmdStan is available. See ?install_cmdstan() to install it.' message? If possible it would also be great to hide some (if not all) of these setup messages such as the cmdstan path
- There's some strange formatting around the code blocks at the end. Some of the titles seem to stretch onto the next line while still in
typewritertext - I'm not sure how the html is built from the Rmd in this case - would it be possible to get syntax highlighting of the Stan code?
Can we hide the 'A newer version of CmdStan is available. See ?install_cmdstan() to install it.' message? If possible it would also be great to hide some (if not all) of these setup messages such as the cmdstan path
I think this is an CmdStanR bug. I actually have CmdStan 2.28.2 installed. I also have a version of develop in my .cmdstan directory and I named that dir cmdstan-develop - CmdStanPy ignores it, but CmdStanR wanted to use that and not 2.28.2. @rok-cesnovar - what are the rules for CmdStanR?
It mentions an environment variable to disable it for now
I just converted it to a draft because there's more work to be done here.
will investigate formatting issues.
it would definitely be nice to get Stan syntax highlighting into the HTML and I'm pretty sure we can hack the .Rmd to make that happen.
What program is used to ultimately create the HTML? Pandoc?
@rok-cesnovar - what are the rules for CmdStanR?
We sort the folder in .cmdstan, not sure why -develop would be ahead though. Will check.