Closed gowerc closed 3 months ago
Wow, I was not aware that this is a recommendation for how to work in Stan. While sometimes truncated distributions are useful, I don't think we should encourage that on the jmpost level.
Really interesting discussion about this here.
If I'm reading that right then the use of truncated distributions is valid as the sample only cares about likelihood up to proportionality of which the truncation doesn't impact that. However it does have a meaningful impact if used for the likelihood. Considering we don't use truncated distributions for the Likelihood I don't think that last point impacts us.
@danielinteractive - I'm guessing from your comment then we would just be pushing users to set their own initial values if they want to use truncated distributions then ?
Yes exactly. Generally I would not encourage / give examples for this and instead recommend / have examples where the support of the distribution is identical with the constraints.
Re-opening this as the point came up again that this is not overly intuitive behaviour especially given that the Stan team actively recommend users to use half-cauchy distributions for variance parameters. At the very least we should probably support >0 constraints
A common pattern in Stan is to use unconstrained distributions but then simply specify a constraint band within the stan code.
For example
Our current method for initial value generation is to sample one from the prior distribution, however this doesn't currently respect the constraints placed on the value within the stan code which can lead to the model failing on the first pass e.g.
Couple of questions arise from this:
abs()
the sampled value? but what about arbitrary constraints ?