5

In the Bayesian analysis, $\mathtt{rjags}$ in particular, it is very frequent to see the code:

sigma ~ dunif(0, 100)
sigma.1 <- pow(sigma, -2)

But, what does this mean? Is this meaning that $\sigma\sim Unif(0.01, 100)$ and $\sigma_1=\sigma^{-2}$ and we are doing a transformation of the uniform distribution? As I do the transformation, I got the pdf of $\sigma_1$ to be $\frac{y}{50}$ over $(100^{-2}, +\infty)$, which indeed is not a valid density if I did not make any mistake in my calculations.

Any explanations? Thanks!

user132565
  • 73
  • 2

1 Answers1

3

I think you misunderstood the code because of the parametrisation used in Bugs and Jags syntax. In Jags and Bugs, the normal density as well as other location/scale distributions are parametrized such as e.g.

dnorm(location,precision)

where precision is the precision i.e. by definition $1/\sigma^2$ and generally denoted as $\tau$. So the prior on $\sigma$ is uniform (which has its limits but it is another question see e.g. Weakly informative prior distributions for scale parameters)

peuhp
  • 4,622
  • 20
  • 38