You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stan reference section 31.13 lists several composed functions, which accept only real argument and return value is real. It would be useful if they would accept also vector argument and return vector. And same for array, row_vector and matrix...
Example
For example, in addition to
real log1p(real x);
it would be useful to have also the following defined pointwise
We could also extend this so that it handled arbitrary containers, so arrays of vectors or matrices, 2D arrays, etc. The main issue is going to be checking that the shapes are the same for functions of more than one argument.
Thanks, Aki. I'm assigning myself to this at least temporarily and targeting v3.
We need to scope out which functions to vectorize. We should really do them all.
I think this should be done via class static template functions which we can easily pass in via generic template functions to do this for 1, 2, and 3 arguments. I'll code up examples.
Version
2.8.0
Category
improved functions
Description
Stan reference section 31.13 lists several composed functions, which accept only real argument and return value is real. It would be useful if they would accept also vector argument and return vector. And same for array, row_vector and matrix...
Example
For example, in addition to
it would be useful to have also the following defined pointwise
We could also extend this so that it handled arbitrary containers, so arrays of vectors or matrices, 2D arrays, etc. The main issue is going to be checking that the shapes are the same for functions of more than one argument.
Example Stan model can be found in
https://groups.google.com/forum/#!topic/stan-users/C6IxqRU1Cuw
This Stan model includes user defined function
which is used in user defined functions
gpareto_log
andgpareto_ccdf
.Multi-argument functions, shape matching, and broadcasting
Thus if we have a function of signature
and
v
is a vector of sizeN
andc
is a scalar, thenThe text was updated successfully, but these errors were encountered: