example-models icon indicating copy to clipboard operation
example-models copied to clipboard

update case study of hierarchical models for binary trials

Open mitzimorris opened this issue 3 years ago • 13 comments

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

mitzimorris avatar Jan 24 '22 22:01 mitzimorris

This PR updates the Rmd notebook and the HTML A subsequent PR will break this case study into multiple parts and create Jupyter notebooks.

mitzimorris avatar Jan 24 '22 22:01 mitzimorris

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

WardBrian avatar Jan 24 '22 22:01 WardBrian

If you OK this PR, that should be sufficient review for the stan-dev.github.io pages as well.

mitzimorris avatar Jan 24 '22 22:01 mitzimorris

can we turn off compilation for the include fragments? if so, how?

mitzimorris avatar Jan 24 '22 22:01 mitzimorris

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

WardBrian avatar Jan 24 '22 22:01 WardBrian

@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.

mitzimorris avatar Jan 24 '22 22:01 mitzimorris

Feel free to ignore the testing errors, will fix the GHA script later this week to ignore the files you mentioned.

rok-cesnovar avatar Jan 25 '22 15:01 rok-cesnovar

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?

WardBrian avatar Jan 26 '22 21:01 WardBrian

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?

mitzimorris avatar Jan 26 '22 21:01 mitzimorris

It mentions an environment variable to disable it for now

WardBrian avatar Jan 26 '22 21:01 WardBrian

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.

mitzimorris avatar Jan 26 '22 21:01 mitzimorris

What program is used to ultimately create the HTML? Pandoc?

WardBrian avatar Jan 26 '22 21:01 WardBrian

@rok-cesnovar - what are the rules for CmdStanR?

We sort the folder in .cmdstan, not sure why -develop would be ahead though. Will check.

rok-cesnovar avatar Jan 27 '22 08:01 rok-cesnovar