Cmdstanr compilation error when using std_normal_lpdf

When I include the std_normal_lpdf function in my Stan code, cmdstan_model() won’t compile the script and gives me a warning saying that I need a “|” between the first two arguments of any “_lpdf” function. But std_normal_lpdf of course only takes a single input.

Let me know if any more information would be helpful. Thanks!

Yeah unfortunately that’s a bug in the Stan parser but it should be fixed for the next release:

Until then you can replace it with normal_lpdf(...| 0, 1).

1 Like

Alternatively you could add the vertical bar: std_normal_lpdf(x|) should compile I think.