Quick sanity check; I want to replace the uniform prior on a variance parameter with a half cauchy, as suggested in the manual. I'm using:
real<lower=0> sigma;
...
sigma ~ cauchy(0, scale) //scale is an input to the program
The manual also suggests I should reparametrize the cauchy to avoid sampling problems:
real <lower=-pi()/2, upper=pi()/2> sigma_unif;
...
real sigma;
sigma <- 0 + scale * tan(sigma_unif);
....
sigma_unif ~ uniform(-pi()/2, pi()/2)) //not necessary
Of course this is the parametrization for a full, not half, cauchy, which is inappropriate for a scale parameter. Is the solution to set the lower limit of sigma_unif to 0 instead of pi/2? That produces the desire half cauchy right?