# Cmdstanr compilation error when using std\_normal\_lpdf

**URL:** <https://discourse.mc-stan.org/t/cmdstanr-compilation-error-when-using-std-normal-lpdf/16295>\
**Category:** Other\
**Tags:** bug, cmdstanr\
**Created:** [June 30, 2020, 12:36am UTC](https://discourse.mc-stan.org/t/cmdstanr-compilation-error-when-using-std-normal-lpdf/16295 "2020-06-30T00:36:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh\_fiechter](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/josh_fiechter/32/6031_2.png) [@josh\_fiechter](https://discourse.mc-stan.org/u/josh_fiechter)\
**Post date:** [June 30, 2020, 12:36am UTC](https://discourse.mc-stan.org/t/cmdstanr-compilation-error-when-using-std-normal-lpdf/16295/1 "2020-06-30T00:36:50Z")

</div>

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!

---

<div class="post-metadata">

**Author:** ![jonah](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jonah/32/200_2.png) [@jonah](https://discourse.mc-stan.org/u/jonah)\
**Post date:** [June 30, 2020, 2:04am UTC](https://discourse.mc-stan.org/t/cmdstanr-compilation-error-when-using-std-normal-lpdf/16295/2 "2020-06-30T02:04:17Z")

</div>

> [@josh\_fiechter](#):
>
> But `std_normal_lpdf` of course only takes a single input.

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

> <https://github.com/stan-dev/stanc3/issues/393>
>
> From https://github.com/stan-dev/stanc3/pull/390#discussion\_r349343260, 
> Stan3 …says this code is incorrect
> 
> \`target += std\_normal\_lpdf(x);\`
> and expects instead
> 
> \`target += std\_normal\_lpdf(x|);\`
> but Stan2 can't parse that.

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

---

<div class="post-metadata">

**Author:** ![jonah](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.mc-stan.org/jonah/32/200_2.png) [@jonah](https://discourse.mc-stan.org/u/jonah)\
**Post date:** [June 30, 2020, 2:06am UTC](https://discourse.mc-stan.org/t/cmdstanr-compilation-error-when-using-std-normal-lpdf/16295/3 "2020-06-30T02:06:27Z")

</div>

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