n-kall / priorsense

priorsense: an R package for prior diagnostics and sensitivity
https://n-kall.github.io/priorsense/
GNU General Public License v3.0
53 stars 5 forks source link

Bounds in log-prior statements #13

Closed cmgoold closed 1 year ago

cmgoold commented 1 year ago

Do we care about the exact parameter bounds/additive constants when computing the log joint priors for powerscaling? In the examples, this doesn't seem to be the case, as the computation of the log priors don't account for the parameter bounds. For instance, for a scale parameter, the examples state something to the effect of:

real lprior = std_normal_lpdf(sigma);

but this really should be:

real lprior = std_normal_lpdf(sigma) - std_normal_lcdf(0);

if we care about the precise likelihood contribution.

@n-kall @avehtari I couldn't find this in the original paper, but would be interested in your thoughts. Thanks!

avehtari commented 1 year ago

std_normal_lcdf(0) is constant, so it doesn't affect the importance ratios nor the sensitivity measures. If you like to include that in your code, it doesn't harm anything.

cmgoold commented 1 year ago

Thanks @avehtari. Testing a few examples indicated that was the case but wanted to make sure it was in general.