When I try to start building a package with rstantools (using rstan_create_package) that uses the function ordered_logistic_glm_lpmf I get the error:
No matches for:
ordered_logistic_glm_lpmf(int[ ], vector, matrix, vector)
Function ordered_logistic_glm_lpmf not found.
even though I can compile the same model that includes ordered_logistic_glm_lpmf when I try to compile it directly with stan_models. (I used install_StanHeaders to install the Stan/math version that includes the function)
Does anybody have an idea what the problem could be?
(tagging @bgoodri, @jonah)
Thanks in advance, Guido
PS: RStudio also dose not recognize the function in the .stan file
That function might not be in the Stan language, which hasn’t been updated on the C++ side as we are switching to OCaml. If so, then you would need to declare ordered_logistic_glm_lpmf as a “user-defined” C++ function in the functions block and then the definition should already be #included through Stan Math.
It seems that ordered_logistic_glm_lpmf is also missing from the Stan documentation.
Can you say of the speed improvement of ordered_logistic_glm_lpmf over ordered_logistic_lpmf is meaningfull (lets say > 10% for a design matrix with 150 columns and 5000 rows)
Yeah, its only documented in the math library, sorry for that. For the speed question I am tagging @tadej as he added this GLM in Stan Math and would probably know best.
When I run bin/stanc --dump-stan-math-signatures | grep ordered_logistic_lpmf, I get the following, indicating that indeed the matrix version is not available:
real ordered_logistic_lpmf(int, real, vector)
real ordered_logistic_lpmf(int[], vector, vector)
real ordered_logistic_lpmf(int[], vector, vector[]).
After unzipping the latest release, I built using make build
EDIT: Sorry, I realized my mistake! I was using ordered_logistic_lpmf instead of ordered_logistic_glm_lpmf.
It seems that the initial post was never addressed. How do I get real ordered_logistic_glm_lpmf(int[] Y, matrix X, vector b, vector cuts) to work to leverage the gpu-based speed-up? This seems to be a bug… Thank you!