I need to do a bayesian test for a simple random sample with exponential distribution and N(2,3) as a prior distribution conditioned by: Null hypothesis=> $\theta$ less or equal to 1 ; Alternative hypothesis=> $\theta$>3

  • $\begingroup$ I am catching up on the lingo in stats so let me make sure I understand your problem. You have a set of data that you know is sampled from an exponential distribution. You have prior belief on the parameter $\lambda$ being drawn from a normal distribution with mean $\mu=2$ and standard deviation $\sigma=3$. You would like to compare the probability $\theta = \frac{1}{\lambda}<1$ with an alternative hypothesis $\theta = \frac{1}{\lambda} <3$. Is that correct? $\endgroup$ May 21, 2016 at 17:23
  • $\begingroup$ I only have a mistake, the alternative hypothesis is $\theta$ > 3, rest of problem is correct. $\endgroup$
    – GeorgeF
    May 21, 2016 at 17:35
  • $\begingroup$ Is the problem that you can't find the posterior distribution? It should be pretty easy to derive, or you can probably just Google it. $\endgroup$
    – Jon
    May 21, 2016 at 17:49
  • $\begingroup$ I'm trying to find the posterior distribution using the parametric formulation: en.wikipedia.org/wiki/Bayesian_inference#Parametric_formulation ; but I don't know how to solve that integral. I didn't find it in Google. $\endgroup$
    – GeorgeF
    May 21, 2016 at 18:05
  • $\begingroup$ Are you talking about the denominator? If so that should be a constant independent of your $\lambda$ parameter. You might be better off considering the ratio of probabilities. Then you don't need to take that integral. It looks like you get something rather ugly with erf everywhere. $\endgroup$ May 21, 2016 at 18:37

1 Answer 1


So in order to solve this problem you find the posterior distribution $p(\theta | \bf{x})$, where $x_i \sim Exp(\theta)$. The Likelihood is simple, $\theta ^n exp(-\theta \sum_{i=1}^n x_i)$ and the prior is $p(\theta) \propto exp(-\frac{(\theta - \mu)^2}{2 \sigma^2})$.

The posterior: $p(\theta | \bf{x}) \propto \theta ^n exp(-\theta \sum_{i=1}^n x_i) exp(-\frac{(\theta - \mu)^2}{2 \sigma^2})$

Somehow you want to make all of that look like the kernel of an exponential, gamma, or Normal. From my quick attempt, I didn't see an easy way of doing this. I would suggest changing priors if you can, to something like a reference prior or conjugate (i.e. gamma).


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.