I have three questions regarding the understanding behind and implementation of a noninformative prior for variance. I'm attempting to build a Metropolis sampler and I'm trying to sample from a noninformative prior for variance. From most texts I've consulted, the noninformative prior for variance $\sigma^2$ is given as $p(\sigma^2) \propto 1/\sigma^2$. One book states that you first assign a uniform prior to $log(\sigma^2)$, so (1st question) is this saying that $p(log(\sigma^2)) \propto 1$? Second, the book says to transform the uniform prior on $log(\sigma^2)$ into a density for $\sigma^2$, since doing so will give $p(\sigma^2) \propto 1/\sigma^2$. (2nd Question) I'm lost as to how they went from the uniform prior on $log(\sigma^2)$ to $p(\sigma^2) \propto 1/\sigma^2$ and was hoping someone could explain this. Finally (3rd question), if I were to sample from the density $p(\sigma^2)$, how exactly do I do this? That is, if I were going to code this in MATLAB would I sample from a uniform distribution and take its reciprocal as a sample for $\sigma^2$ (something like sigma_sq = 1/rand;)? Thanks!