# Definite integrals for Bayesian statistics

• Feb 19th 2010, 08:49 AM
bsk
Definite integrals for Bayesian statistics
Hi,

As far as I know this has an analytical solution but I'm not sure how to go about doing it. Just to clarify, I'm not looking for a numerical method.

Sorry, don't know how to use maths symbols here:

I need to find x and y, such that the integral of exp(-ax^2 - b), evaluated from -infinity to x, equals 0.025, and the same integral evaluated from y to infinity equals 0.0975.

a and b are known constants.

(The question is just to find the 95% confidence interval from a posterior distribution).

Can anyone help?

Thanks!
• Feb 19th 2010, 08:56 AM
vince
Quote:

Originally Posted by bsk
Hi,

As far as I know this has an analytical solution but I'm not sure how to go about doing it. Just to clarify, I'm not looking for a numerical method.

Sorry, don't know how to use maths symbols here:

I need to find x and y, such that the integral of exp(-ax^2 - b), evaluated from -infinity to x, equals 0.025, and the same integral evaluated from y to infinity equals 0.0975.

a and b are known constants.

(The question is just to find the 95% confidence interval from a posterior distribution).

Can anyone help?
Thanks!

up to some factors which you can pick out for instance take the $e^{-b}$ out of the integrand and note that $e^{-ax^2}$ can be handled with the proper choice of $\sigma$, where $\sigma$ is the square root of the variance of a normally distributed r.v., use the table for the normal distribution for answer.
• Feb 19th 2010, 09:06 AM
bsk
Thanks, I think I've got it.
• Feb 19th 2010, 09:19 AM
vince
just be sure u scale things properly in the end, for there is the $\frac1{|\sigma|\sqrt{2\pi}}$ to consider, i.e., if X= $\mu+\sigma{Z}$ is a normal r.v., then p(x), the probability density function of X is given by,
$p(x) = \frac1{|\sigma|\sqrt{2\pi}}exp(-\frac{(x-\mu)^2}{2\sigma^2})$

And thus $P(a\leq{X}\leq{b}) = \int_a^bp(x)dx$