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
The Stan language should have the ability to create user-defined member functions of the model class
Description:
At the last meeting, we proposed adding a new block to the Stan language that perhaps could be called local functions that would go after transformed data. The Stan syntax would be the same as in the functions block but unlike the user-defined functions in the functions block the user-defined functions in the local functions block could refer to objects in the data and transformed data blocks without explicitly passing them as arguments. This would make such functions much easier to use than integrate_ode, which requires fixed arguments to be passed in a very clunky way. It might look like
data {
int<lower=1> N;
}
transformed data {
int<lower=2> two_N;
two_N =2* N;
}
local functions {
void what_is_2N() {
print("2N = ", two_N);
}
}
Reproducible Steps:
Does not currently exist.
Current Output:
Does not currently exist.
Expected Output:
Whatever the user-defined function returns
Additional Information:
None
Current Version:
v2.11.0
The text was updated successfully, but these errors were encountered:
I take it this requires all four flavors of function:
_lp : has access to density so target += and ~ statements may be used (only callable in model block)
_rng: has access to PRNG, so _rng functions may be used (only callable in generated quantities block)
_lpdf, _lpmf, _lcdf, _lccdf : pdf and pmf may be used on right-hand side of sampling statements, called with vertical bar notation (can be used anywhere, but sampling sttements restricted to model block)
none-of-the-above: can't do any of the above, but may be used anywhere
Summary:
The Stan language should have the ability to create user-defined member functions of the model class
Description:
At the last meeting, we proposed adding a new block to the Stan language that perhaps could be called
local functions
that would go aftertransformed data
. The Stan syntax would be the same as in thefunctions
block but unlike the user-defined functions in thefunctions
block the user-defined functions in thelocal functions
block could refer to objects in thedata
andtransformed data
blocks without explicitly passing them as arguments. This would make such functions much easier to use thanintegrate_ode
, which requires fixed arguments to be passed in a very clunky way. It might look likeReproducible Steps:
Does not currently exist.
Current Output:
Does not currently exist.
Expected Output:
Whatever the user-defined function returns
Additional Information:
None
Current Version:
v2.11.0
The text was updated successfully, but these errors were encountered: