-
-
Notifications
You must be signed in to change notification settings - Fork 478
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
update case study of hierarchical models for binary trials #214
base: master
Are you sure you want to change the base?
Conversation
This PR updates the Rmd notebook and the HTML |
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? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments on the Rmd file. The reorganization of the stan files using #include
looks good
@@ -160,33 +216,27 @@ due to numerical arithmetic issues. | |||
|
|||
Assuming each player's at-bats are independent Bernoulli trials, the | |||
sampling distribution for each player's number of hits $y_n$ is modeled as | |||
|
|||
\[ | |||
$$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a minor detail, but generally using \[ \]
is preferred over $$ $$
. The later is a pure-TeX shorthand which can cause some issues with LaTeX macros. Not sure it matters for us, but just thought I'd note. More on Wikibooks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, but only $$
works in Jupyter notebooks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this being run in a jupyter notebook now? Or is the idea that it will be recreated in one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it would be good to be able to run these in jupyter, either in Python or R.
I used jupyter to update this notebook, so I hit this right off the bat.
awhile back I installed juptext on my machine and I prefer jupyter to RStudio - https://mc-stan.org/users/documentation/case-studies/jupyter_colab_notebooks_2020.html#challenge-putting-the-r-in-jupyter
With juptext and IRkernal, I can run the notebook while keeping it in .Rmd format which means that it's easy to edit via the browser of in emacs. but that's just me.
We must first instantiate a CmdStanModel object then call its <code>sample</code> method. | ||
To do this we first call the `cmdstan_model()` function | ||
which instantiates a CmdStanModel object from a file containing a Stan program. | ||
Because these models contain a number of [include directives](https://mc-stan.org/docs/reference-manual/includes-section.html), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because these models contain a number of [include directives](https://mc-stan.org/docs/reference-manual/includes-section.html), | |
Because these models contain a number of [include directives](https://mc-stan.org/docs/reference-manual/includes.html), |
With -section
it will link to the 2_27 version (at least until we fix that redirect)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This still needs to be changed (I think you changed a different copy of the link which I hadn't caught)
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:
|
I think this is an CmdStanR bug. I actually have CmdStan 2.28.2 installed. I also have a version of develop in my |
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 |
What program is used to ultimately create the HTML? Pandoc? |
We sort the folder in .cmdstan, not sure why -develop would be ahead though. Will check. |
Updated models and notebook for Stan case study "Hierarchical Partial Pooling for Repeated Binary Trials"