Reparametizations and prior distributions of positive parameters

Hi everyone!

I have a more general question:

Are there any specific customs or guidelines on how to reparameterize the distributions we use for positive parameters? I have a model with a number of (weakly) positive parameters and so far fared well with the approach discussed here, i.e., just drawing from a Normal distribution and restricting the parameter to be positive.

However, I got some divergences in my models and may want to re-parameterize, but I’m unsure how to proceed. Of course, the normal distribution can be easily re-parameterized (see below), but how would you go about ensuring it remains positive? Restricting the “raw” z-score doesn’t make any sense to me and simply restricting the final parameter lead to STAN complaining that parameters are outside their legal range (which makes sense to me).

parameters {
real p_mu;
real p_sigma;
real <lower=0>param;

real p_raw;

model {
param ~ normal(p_mu,p_sigma);
//reparameterized version: 
param_raw ~ std_normal()
param = p_mu + param_raw*p_sigma

This got me thinking that it’s probably better to use a different distribution anyways. The exponential distribution seems like it can be easily reparameterized (as discussed here) , but is this really my only option?

//reparameterized exponential

real p_rate;
real param_raw;

real param;

param_raw ~exponential(1)
param = 1/p_rate * param_raw

To sum up, I have two questions:

  1. Am I right in abandoning the reparameterized half-normal for positive parameters?
  2. What other distributions are appropriate, and how can I reparameterize these distributions?

Thank you for your guidance!


The challenge is that “centering” and “non-centering” are not the universal solutions that they are often presented as. Only some very exceptional families of density functions admit various notions of centering and non-centering.

For example the common convention for a half-normal density family is \text{normal}(x; 0, \sigma) with inputs x fixed to positive values. In this case the family admits a multiplicative non-centering,

real<lower=0> z; ... z_tilde ~ normal(0, 1): ... z = sigma * z_tilde;

just like the exponential family of density functions does (as in \text{exponential}(x; \phi) not to be confused with the exponential family of families of density functions…). There is no notion of an additive non-centering. This pattern also holds for most densities over the positive real line that peak at zero.

When the location parameter isn’t zero this multiplicative non-centering is no longer valid. In general a truncated normal density function does not admit addictive or multiplicative non-centering.

Whether to use a density that peaks at zero or a log-normal density that can peak at non-zero values is a modeling question that can be answered only in the context of a particular application.