Open alashworth opened 5 years ago
Comment by bob-carpenter
Sunday Nov 19, 2017 at 01:35 GMT
For now, we're just requiring devs to support also the old _log
form for ease of code generation until we remove that functionality in Stan 3. It's an ugly and roundabout workaround since the _log
functions will just call the _lpdf
functions under the hood.
It might be possible to fix the generator, but I keep expecting us to be able to get rid of all the _log
stuff eventually.
Comment by bob-carpenter
Tuesday Nov 21, 2017 at 00:02 GMT
Please leave it open. Let's close it when we fix the problem you raised. The laborious workaround is only intended as a stopgap until the issue gets fixed.
Summary:
Stan replaces lpdf suffix for probability functions that aren't user defined.
Description:
In
src/stan/lang/grammars/semantic_actions_def.cpp
, Stan does the following:https://github.com/stan-dev/stan/blob/b1493865a8df7d82b94984538aa2cea73d21e991/src/stan/lang/grammars/semantic_actions_def.cpp#L1938-L1943
Reproducible Steps:
std_normal_lpdf
is a valid function instan/math
, but notstd_normal_log
. So, when I exposestd_normal_lpdf
in Stan and write the appropriatefunction-signature
test forstd_normal_lpdf
, making the test header file will error out. If I look at the corresponding header file,std_normal_lpdf
has been replaced withstd_normal_log
.Current Output:
Any non-user defined
lpdf
function will be replaced withlog
.Expected Output:
I expect that I can add probability functions with only the
lpdf
orlpmf
version implemented.Additional Information:
Current Version:
v2.17.0