Hi, I have some parameters which look like
real <lower = L, upper = U> foo;
and then later in the model
section,
foo ~ normal (mu, sigma);
I’ve been working with that for a while and it seems to have the expected effect, namely that the distribution of foo is truncated to the range [L, U]. Is it possible it’s not working correctly and I’m just fooling myself?
However, I’ve lately become aware that there’s a syntax for declaring a truncated distribution, such as
foo ~ normal (mu, sigma) T[L, U];
Given that there is already a range specified for the parameter, what is the effect of including T[L, U]
in the distribution? Does it change the sampling distribution? Or perhaps it makes sampling more or less efficient? Or something else entirely?
Thanks for any insights. I’ve found some discussions about this topic in the Stan forums, such as Constraint checking and resulting distribution (truncated normal) - #2 by jsocolar , and also Sec. 7.4 in the reference manual (7.4 Sampling statements | Stan Reference Manual), but I’m not sufficiently enlightened to understand the implications for the case I’ve described here. I appreciate your help.
Robert Dodier