# Talk:Credible interval

WikiProject Statistics (Rated Start-class, High-importance)

This article is within the scope of the WikiProject Statistics, a collaborative effort to improve the coverage of statistics on Wikipedia. If you would like to participate, please visit the project page or join the discussion.

Start  This article has been rated as Start-Class on the quality scale.
High  This article has been rated as High-importance on the importance scale.

## Is a credible interval random?

is credible interval random? — Preceding unsigned comment added by 128.100.74.204 (talkcontribs) 01:56, 20 September 2007

No.
A frequentist confidence interval is a RANDOM interval that contains a FIXED POINT a specified percentage of the time in repeated sampling.
A credible interval is a FIXED INTERVAL such that the values of a certain RANDOM VARIABLE fall within it with a specified probability.
Blaise (talk) 17:51, 8 December 2007 (UTC)
or Yes ... it is possible to consider the frequency properties (coverage probabilities) of credibility intervals, in which case the ends of a credibility interval are treated as being random when considering the coverage probabilities (ie. via stochastic simulation studies). Of course the ends of the credibility region are treated as fixed when credibility intervals are interpreted as credibility intervals, whereas the ends of a confidence interval are treated as random when confidence intervals are interpreted as confidence intervals. Melcombe (talk) 16:42, 25 February 2008 (UTC)

## Example

I wasn't sure if the article would benefit from an example, to show the different thought-patterns behind credible intervals and confidence intervals. In the end, per NOTATEXTBOOK, I thought not, but perhaps it's useful to place here instead.

For an example that has quite simple arithmetic, consider for instance the following question. Suppose a real-valued random variable is drawn from a uniform distribution, x ~ U(0,n); and we seek an interval estimate for the unknown parameter n, which is real-valued.

The confidence-interval analysis for a 95% interval with two equal tails runs as follows:

We place the left hand end of the interval at xobs/0.975; and the right hand end at xobs/0.025, because:
• 2.5% of the time an unknown parameter n will give an observation x that is less than 0.025 * n; this will lead to an interval with end-points that are less than n/39 ... n, so will not include n, being made up of values entirely smaller than n.
i.e. ${\displaystyle \int _{0}^{x_{\rm {obs}}}{\rm {P}}(x|n_{2})\,{\rm {d}}x=0.025}$ when ${\displaystyle n_{2}=x_{\rm {obs}}/0.025}$
• 2.5% of the time an unknown parameter n will give an observation x that is greater than 0.975 * n; this will lead to an interval with end-points that are greater than n... 39n, so will not include n, being made up of values entirely greater than n.
i.e. ${\displaystyle \int _{0}^{x_{\rm {obs}}}{\rm {P}}(x|n_{1})\,{\rm {d}}x=0.975}$ when ${\displaystyle n_{1}=x_{\rm {obs}}/0.975}$
This leaves 95% of the time that the interval will cover n, fulfilling the claim advertised.

That argument is quite different to the credible-interval calculation, which proceeds by finding the posterior probability, which is equal to the prior times the likelihood,

${\displaystyle \mathrm {P} (n|x_{\rm {obs}})\,{\rm {d}}n\propto \mathrm {P} (n|\mathrm {I} )\mathrm {P} (x_{\rm {obs}}|n)\,{\rm {d}}n}$
• Taking for the prior ${\displaystyle \mathrm {Pr} (n|I)}$ the Jeffreys' distribution ${\displaystyle \scriptstyle \mathrm {Pr} (n|I)\,\propto \,1/n}$ gives
${\displaystyle \mathrm {P} (n|x_{\rm {obs}})=0,\,\mathrm {if} \,n
${\displaystyle \mathrm {P} (n|x_{\rm {obs}})\,{\rm {d}}n\propto {\frac {1}{n^{2}}}\,{\rm {d}}n,\qquad \mathrm {if} \,n\geq x_{\rm {obs}}}$
• Integrating this to establish the normalisation, we have that
${\displaystyle \int _{x_{\rm {obs}}}^{\infty }{\frac {1}{n^{2}}}\;{\rm {d}}n=\left[-{\frac {1}{n}}\right]_{x_{\rm {obs}}}^{\infty }={\frac {1}{x_{\rm {obs}}}}}$
• so
${\displaystyle \mathrm {P} (n|x_{\rm {obs}})\,{\rm {d}}n={\frac {x_{\rm {obs}}}{n^{2}}}\;{\rm {d}}n,\;n\geq x_{\rm {obs}}}$
• and so we find n1 and n2 such that
${\displaystyle \int _{0}^{n_{1}}\mathrm {P} (n|x_{\rm {obs}})\,{\rm {d}}n=0.025,}$ given by ${\displaystyle n_{1}=x_{\rm {obs}}/0.975}$
${\displaystyle \int _{0}^{n_{2}}\mathrm {P} (n|x_{\rm {obs}})\,{\rm {d}}n=0.975,}$ given by ${\displaystyle n_{2}=x_{\rm {obs}}/0.025}$

In this case thereofore the confidence interval and the credible interval coincide; but this is only because n was a scale parameter, and ${\displaystyle \mathrm {Pr} (n|I)}$ was the Jeffreys' distribution ${\displaystyle \scriptstyle \mathrm {Pr} (n|\mathrm {I} )\,\propto \,1/n}$; and it is apparent that the logic in each case is very different.

For an example where the confidence interval does not correspond to the credible interval (even using the appropriate Jeffreys' prior), see eg interval estimation for a binomial proportion, [1]. Jheald (talk) 00:27, 8 December 2010 (UTC)

## "within decision theory..."

The article mentions "It is possible to frame the choice of a credible interval within decision theory and, in that context, an optimal interval will always be a highest probability density set". I didn't think this was right, so I asked the guys over at cross validated (http://stats.stackexchange.com/questions/83153/is-this-statement-about-credible-intervals-from-wikipedia-correct), and most seem to agree with me. Maybe it's just unclearly worded? Either way it need attention... 66.29.243.106 (talk) 17:51, 24 January 2014 (UTC)