Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Uniform Prior on logσ\log \sigma or σ\sigma

Consider the problem of estimating a scale parameter σ\sigma from observations X1,,Xni.i.dN(0,σ2)X_1, \dots, X_n \overset{\text{i.i.d}}{\sim} N(0, \sigma^2). We want to use an uniformative prior for σ\sigma. There are two options. Option A is σuniform(0,+)\sigma \sim \text{uniform}(0, +\infty) (or uniform(0,C)\text{uniform}(0, C) for a large CC). Option B is logσuniform(,+)\log \sigma \sim \text{uniform}(-\infty, +\infty) (or uniform(C,C)\text{uniform}(-C, C) for a large CC). The second prior (option B) is universally preferred to the first prior (option A). Here are some reasons for why this is the case.

  1. Relative Scale vs Absolute Scale: Consider the two probabilities P{1<σ<2}\P\{1 < \sigma < 2\} and P{101<σ<102}\P\{101 < \sigma < 102\}. Under the first prior (uniform(0,C)(0, C)), both these probabilities are the same.

    Under the second prior (logσ\log \sigma is uniform on (C,C)(-C, C)), we have:

    P{1<σ<2}=P{0<logσ<log2}=log22C=0.6932C\begin{align*} \P\{1 < \sigma < 2\} = \P\{0 < \log \sigma < \log 2\} = \frac{\log 2}{2C} = \frac{0.693}{2C} \end{align*}

    and

    P{101<σ<102}=P{log101<logσ<log102}=log(102/101)2C=0.009852C\begin{align*} \P\{101 < \sigma < 102\} = \P\{\log 101 < \log \sigma < \log 102\} = \frac{\log(102/101)}{2C} = \frac{0.00985}{2C} \end{align*}

    The second probability is therefore much smaller than the first. This reflects the fact that Prior B regards the values 101 and 102 as much closer to one another than the values 1 and 2. This behavior aligns well with intuition on a relative scale: moving from σ=1\sigma = 1 to σ=2\sigma = 2 corresponds to a doubling, whereas moving from σ=101\sigma = 101 to σ=102\sigma = 102 represents only a very small relative change.

  2. Prior Odds: Under the first prior, consider the prior odds that σ<2\sigma < 2 versus σ2\sigma \geq 2:

    P{σ<2}P{σ2}=2/C(C2)/C=2C2\begin{align*} \frac{\P\{\sigma < 2\}}{\P\{\sigma \geq 2\}} = \frac{2/C}{(C-2)/C} = \frac{2}{C - 2} \end{align*}

    which is very small (as CC is large). This is clearly an informative statement about σ\sigma (that it is much more likely to be more than 2 than smaller than 2). On the other hand, the same odds for the second prior becomes:

    P{σ<2}P{σ2}=P{logσ<log2}P{logσlog2}=C+log2Clog2\begin{align*} \frac{\P\{\sigma < 2\}}{\P\{\sigma \geq 2\}} = \frac{\P\{\log \sigma < \log 2\}}{\P\{\log \sigma \geq \log 2\}} = \frac{C + \log 2}{C - \log 2} \end{align*}

    which is approximately equal to 1, reflecting prior ignorance between the events σ<2\sigma < 2 and σ2\sigma \geq 2.

  3. Posterior Propriety for n=1n = 1: The posterior for σ\sigma corresponding to the first prior is:

    2(S2)(n1)/2Γ(n12)σnexp(S2σ2)I{σ>0}\begin{align} \frac{2 \left(\frac{S}{2} \right)^{(n-1)/2}}{\Gamma\left(\frac{n-1}{2} \right)} \sigma^{-n} \exp \left(-\frac{S}{2 \sigma^2} \right) I\{\sigma > 0\} \end{align}

    while the posterior corresponding to the second prior is:

    2(S2)n/2Γ(n2)σ(n+1)exp(S2σ2)I{σ>0}.\begin{align} \frac{2 \left(\frac{S}{2} \right)^{n/2}}{\Gamma\left(\frac{n}{2} \right)} \sigma^{-(n+1)} \exp \left(-\frac{S}{2 \sigma^2} \right) I\{\sigma > 0\}. \end{align}

    In both these formulae, S:=i=1nXi2S := \sum_{i=1}^n X_i^2.

    These two posteriors will behave similarly when nn is large. However, when n=1n = 1, the first posterior is actually ill-defined because the Gamma function term is Γ(0)\Gamma(0) which is \infty. In other words, the posterior is improper when n=1n = 1. On the other hand, the second posterior is proper even when n=1n = 1.

    This is another reason for preferring the second prior in this problem. We would intuitively expect to obtain some concrete information on σ\sigma when n=1n = 1 so we want the posterior to be proper in that case. This is only true for the second prior but not for the first prior.

Now consider the problem of estimating both θ\theta and σ\sigma from X1,,Xni.i.dN(θ,σ2)X_1, \dots, X_n \overset{\text{i.i.d}}{\sim} N(\theta, \sigma^2). Here there are two options for the prior. Prior A is:

θ,σ are independent with θunif(,) and σunif(0,).\begin{align*} \theta, \sigma \text{ are independent with } \theta \sim \text{unif}(-\infty, \infty) \text{ and } \sigma \sim \text{unif}(0, \infty). \end{align*}

Prior B is

θ,logσi.i.dunif(,).\begin{align*} \theta, \log \sigma \overset{\text{i.i.d}}{\sim} \text{unif}(-\infty, \infty). \end{align*}

Again the universally preferred prior is the second one. All of the reasons previously mentioned apply here as well. For the third point, the marginal posterior of σ\sigma corresponding to the first prior is:

2(S2)(n2)/2Γ(n22)σ(n1)exp(S2σ2)I{σ>0}\begin{align} \frac{2 \left(\frac{S}{2} \right)^{(n-2)/2}}{\Gamma\left(\frac{n-2}{2} \right)} \sigma^{-(n-1)} \exp \left(-\frac{S}{2 \sigma^2} \right) I\{\sigma > 0\} \end{align}

and the marginal posterior for σ\sigma corresponding to the second prior is:

2(S2)(n1)/2Γ(n12)σnexp(S2σ2)I{σ>0}.\begin{align} \frac{2 \left(\frac{S}{2} \right)^{(n-1)/2}}{\Gamma\left(\frac{n-1}{2} \right)} \sigma^{-n} \exp \left(-\frac{S}{2 \sigma^2} \right) I\{\sigma > 0\}. \end{align}

In both the above formulae, S=i=1n(XiXˉ)2S = \sum_{i=1}^n (X_i - \bar{X})^2. The first posterior above is ill-defined when n=1,2n = 1, 2 while the second posterior is ill-defined only for n=1n = 1. It is well-known that in this problem we would need at least two observations to estimate σ\sigma, so we would like the posterior to be well-defined for n=2n = 2 which is only true if we use the second prior.

For more, see Zellner (1971, pages 41-47). See also Jaynes (2003, Section 12.4) for another justification for the logσuniform(,+)\log \sigma \sim \text{uniform}(-\infty, +\infty) prior based on invariance to certain parameter transformations.

References
  1. Zellner, A. (1971). An Introduction to Bayesian Inference in Econometrics. Wiley.
  2. Jaynes, E. T. (2003). Probability Theory: The Logic of Science. Cambridge University Press.