My understanding is that for 2.19, there will be no traditional PDF for the functions available to be called from a Stan program due to the move to HTML. When that happened, we postponed what to do about rstan::lookup
, whose underlying lookup table was based on parsing the LaTeX index for the user manual.
I think @seantalts had a C++ program to output all of the functions that could be called, but I can’t find it anywhere. Does anyone know where it is?
it exists here (not a great archival copy, but): https://github.com/stan-dev/stan/compare/introspection
Not super complicated to add. One place it’s not ideal is that it can’t tell all of those RNG etc functions that the manual says return R
, where R
is somewhere defined as something like an int if you wanted just one int, or a double if it was supposed to be a double, or an array of them if you asked for more than 1, etc.
OK, we need to merge something like that, but it would be better if it looked like the index looked for <= 2.18 with things like
> rstan::lookup("sqrt")
StanFunction Arguments ReturnType Page
620 sqrt (T x) R 26
We generate both HTML and pdfs.
Isn’t there also a whole standalone representation being generated for RStudio?
But will the PDF have a machine parseable index? The RStudio thing is generated from the lookup table in the RStan package, which has historically been generated by parsing the index of the user manual and then adding some things by hand.
I think it’s generated the same way as before, but you’ll have to tell me. Here’s the latest thing that was generated for 2.19 and it has the same kind of index as before:
That would probably work, except the code to parse it got deleted. So, I made a new PR that parses off the Rmd files a few days ago
Upon further review, the index in the PDF is kind of messed up currently. If, for example, you look at the entry for “normal” in the index, it looks like
So, it does not really indicate which normal_
functions those two signatures pertain to. Apparently, they are normal_rng
and normal_lpdf
but normal_cdf
, normal_lcdf
and normal_lccdf
are not there. If you go to pages 102 – 103 to see what is up, then you see stuff about the Poisson distribution. The normal distribution is actually on page 107. But really all the probability distributions are not indexed as well as they used to be when we had things like
this was fixed in the docs by https://github.com/stan-dev/docs/pull/43
here’s the index for the 2.19 functions ref pdf: