CmdStan, Stan 2.23.0, Math 3.2.0 released!

Stan 2.23.0 and Math 3.2.0 Released!

The latest Stan release is now up on GitHub:

New features of the 2.23 release:

In addition, this release contains numerous improvements to the Stanc3 parser and Stan math library.

Many thanks to everyone who contributed - great work, and great fun!

18 Likes

Love the chapter on Decision Analysis with a worked example. Thanks for putting that in! (in addition to all the other goodies, of course)

1 Like

Cool!

Regarding reduce_sum, where can I find its type signature? I have been using the stan-functions.txt file in rstan (https://github.com/stan-dev/rstan/blob/develop/rstan/rstan/tools/stan-functions.txt) for the emacs stan-mode (https://github.com/stan-dev/stan-mode). But it hasn’t been updated for a while.

Hi @kaz-yos,

that list has not been updated as the list refers to the old stan-to-c++ compiler, which is currently still ins use in rstan and pystan.

Cmdstan has switched to stanc3 (as of 2.22), whose signatures can be found here https://github.com/stan-dev/stanc3/blob/master/test/integration/signatures/stan_math_sigs.expected

rstan is expected to switch soon, not sure on the pystan timeline.

But you wont find reduce_sum even in the list I linked as its a variadic function (the first after print()) and those are not listed right now.

These are the supported signatures:

(T[], int, int, …) => real, T[], int, …
(T[,], int, int, …) => real, T[,], int, …
(T[,], int, int, …) => real, T[,], int, …
(T[,], int, int, …) => real, T[,], int, …
(T[,], int, int, …) => real, T[,], int, …
(T[,], int, int, …) => real, T[,], int, …
(T[,], int, int, …) => real, T[,], int, …

Where T is any one of int, real, vector, row_vector or matrix and … can be 0+ arguments of any type (but the “…” arguments must match in types).

If we were to add them in this way would that be useful for you?

(int[], int, int, …) => real, int[], int, …
(int[,], int, int, …) => real, int[,], int, …
(int[,], int, int, …) => real, int[,], int, …
(int[,], int, int, …) => real, int[,], int, …
(int[,], int, int, …) => real, int[,], int, …
(int[,], int, int, …) => real, int[,], int, …
(int[,], int, int, …) => real, int[,], int, …
(real[], int, int, …) => real, real[], int, …
(real[,], int, int, …) => real, real[,], int, …
(real[,], int, int, …) => real, real[,], int, …
(real[,], int, int, …) => real, real[,], int, …
(real[,], int, int, …) => real, real[,], int, …
(real[,], int, int, …) => real, real[,], int, …
(real[,], int, int, …) => real, real[,], int, …

1 Like

Thank you for your information! I’ll examine this file and think about what’s the best way to accommodate this change in the emacs stan-mode. I’ll let you know if I need help.

2 Likes

Way to go guys! Great work!

3 Likes

Hi @rok_cesnovar, I have some questions.

https://github.com/stan-dev/rstan/blob/develop/rstan/rstan/tools/stan-functions.txt has argument names. Is there a way to look up the argument names for these functions in https://github.com/stan-dev/stanc3/blob/master/test/integration/signatures/stan_math_sigs.expected?

There are similar entries like the following. Are they refering to arrays of any dimensions except the first one?

real Phi(int)
real[] Phi(int[])
real[,] Phi(int[,])
real[,,] Phi(int[,,])
real[,,,] Phi(int[,,,])
real[,,,,] Phi(int[,,,,])
real[,,,,,] Phi(int[,,,,,])
real[,,,,,,] Phi(int[,,,,,,])

I would use these for on-the-fly help like seen at the bottom of the picture. But showing them all seems redundant, so I’m considering how to reduce them.

Ah yes, the list you are referring too, is actually made from docs (stan-dev/docs). So ignore my link to stanc3.

We need to merge this script (https://github.com/stan-dev/docs/pull/128 )
so this gets generated automatically. Do you need this file to be hosted on the web?

1 Like

hi @kaz-yos , just filed a docs issue for you:

I think this is what you’re really looking for - please comment as to what would be most useful to you w/r/t formatting

2 Likes

hi @rok_cesnovar, would prefer not to merge that PR - would prefer a more modular solution.

2 Likes

following up on the stan-functions.txt stuff - PR has been merged - you can now generate the listing from the Stan Functions Reference. https://github.com/stan-dev/docs/pull/180

Awesome work. When will an updated version of rstan be released? Thanks.

2 Likes

Hi,
that is hard one to say exactly. I am not directly involved with the process, but there is one or two features missing and then the process of submitting to CRAN. So not very soon but we are not too far either :)

I know my answer is not heplful but its really hard to predict unfortunately.

2 Likes