When will we have Stan 2.20.0 features in Rstan?
Stan 2.20 has been out since July 2019
(Stan 2.20.0 released!)
BR
Anders MM
When will we have Stan 2.20.0 features in Rstan?
Stan 2.20 has been out since July 2019
(Stan 2.20.0 released!)
BR
Anders MM
You can get 2.21 from GitHub. CRAN is another matter.
Why is CRAN difficult?
I have been trying to install it from source, however that is not very easy.
Error: package or namespace load failed for âStanHeadersâ:
.onAttach failed in attachNamespace() for âStanHeadersâ, details:
call: system.file(âincludeâ, âstanâ, âmathâ, âprimâ, âmatâ, âfunâ,
error: no file found
Can someone help point me in the right direction, please?
You need to install the StanHeaders 2.21.0-1 (that was subsequently reverted on CRAN) via
install.packages(
"https://cran.r-project.org/src/contrib/Archive/StanHeaders/StanHeaders_2.21.0-1.tar.gz",
repos = NULL)
and then install the rstan that was intended to go with it (but not accepted by CRAN) from GitHub via
remotes::install_github("stan-dev/rstan", ref = "develop", subdir = "rstan/rstan")
And you have to use the v8 package because the stanc3 parser is written in OCaml rather than C++ and it is easier (particularly on Windows) to convert the parser to Javascript than to get CRAN (or anyone who wants to install from source) to put all the OCaml libraries and optional modules onto all of its servers for Linux, Mac, Windows, and Solaris.
Wait, so the stanc3 parser (written in OCaml) also has a javascript version?
Edit:
Oh wow, didnât see this before: A javascript stanc3
Interesting. So for future rstan releases, the ocaml parser is compiled from OCaml to javascript, and then the js parser is used by rstan to create the C++? Thatâs crazy, in the best way. I understand the reason (OCaml dependencies are certainly harder to manage than a single js engine), Iâm just surprised it works at all.
It works, thanks to @seantalts. I think Google also prefers the javascript version. It is still missing the functionality for expose_stan_functions
and quotation marks on included Stan files, so we will have to use both the old stanc and the new stanc if we can ever get a rstan 2.21 onto CRAN without segfaulting many of the other packages due to the TBB / CRTP thing.
is it possible to get this on the wiki on github for rstan? Iâm having to update some models from what Iâve written to work with cmdstanr and rstan so decided to get the develop version (some stan functions didnât exist prior). Anyway, I had to search here to get the answer, maybe nicer to have on the readme for users who wish to install the âbleedingâ edge.
At least on linux, I just needed to install v8 via my package manager (in arch linux: v8-r from the AUR); then I followed what @bgoodri said above about installing the 2.21 headers and the develop branch of rstan. Worked fine, no tweaking needed. Hardest part was getting v8 installed, and only because their git repo wasnât responding for some reason.
I meant more that there could be a line on github that rstan users can use the 2.2* versions by installing the dev branch. I understand itâs not too hard to do this, just that it wasnât easily found for me what version the dev branch is on and if it can be used (ie no big bugs, issues with R, etc.).