Open AngusMcLure opened 3 years ago
Hi Angus, that documentation is for Stan 2.26 whereas RStan is (currently) only at 2.21, which does not have the elementwise pow
operator yet.
You have two options if you want to use the elementwise pow
. You can install the experimental version of RStan 2.26 via:
remove.packages(c("StanHeaders", "rstan"))
install.packages("StanHeaders", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
With the caveat that stability is *not* guaranteed.
Alternatively, you can use cmdstanR
: https://mc-stan.org/cmdstanr/articles/cmdstanr.html, which uses the latest version of Stan
Thanks Andrew! Explains a lot. Are the version numbers consistent across RStan, PyStan and Stan? i.e. does RStan 2.26 implement Stan 2.26 etc? If this is the convention perhaps this could be make clear out somewhere with high visibility
A suggestion for the Stan team: Whatever the version number convention, something like the following might help make sure people are looking at the right documentation:
When you load the RStan package in R, the initial print to screen could include a link to the relevant versions of the documentation for Stan?
Online documentation for Stan could include a banner or something explaining which version of RStan/PyStan etc. the documentation is relevant for?
Summary:
Element-wise (vectorised) power operations do not work
Description:
According to the stan functions reference, it should be possible to use
.^
to do various element-wise power operations. However,rstudio_stanc()
,rstanc()
, and the alike come up with parsing errors in many cases.Reproducible Steps:
The following stan program illustrates the problem. Any one of the commented out assignments for z in the transformed parameters block should be valid according to the stan functions reference, but the first four are coming up with different parser errors for me.
Current Output:
For
z = x .^ y;
I get the following errorRStan Version:
2.21.2
R Version:
4.0.3 (2020-10-10)
Operating System:
OS X 10.13.6