I haven’t had a chance to use the unnormalized _lupmf and _lupdf’s yet, but I noticed them in the documentation and was curious of the exact definitions of them. The documentation is a little vague on them currently and I couldn’t find the location of the code on github.
I bring this up because the documentation [1] has an example for the normal_lupdf that I found interesting. I noticed it dropped both the pi terms as well as the log of the standard deviation. I had not expected that and wanted to check out what else was different from what I would have expected.
Note that in the example, sigma is declared as data. If sigma is a parameter, this won’t be dropped. This flexibility makes a concise definition of these functions a bit cumbersome, because what gets dropped depends on which inputs are parameters. I don’t know if this is helpful, but here the C++ where it all happens
The difference is that an _lupdf call sets the template argument propto to true while the _lpdf call sets it it false. Those include_summand<>s check if the inputs are data or parameters (i.e. autodiff types).