0
$\begingroup$

I have a prior distribution $f(x)=\pi cos(\pi x) $ where $x$ is the probability of getting tails in a coin toss. Should a coin toss result in tails, how would this be reflected in the posterior distribution?

Would the posterior distribution simply be $f(x)=\pi cos(\pi/2) $, as $P(x)=1/2$?

Thank you!

$\endgroup$
  • 1
    $\begingroup$ Is $x$ in $[0,0.5]$? $\endgroup$ – gunes May 11 at 19:29
  • $\begingroup$ Hi gunes, $x$ is in [0,1] $\endgroup$ – Sarina May 11 at 19:30
  • 2
    $\begingroup$ Then, $f(x)$ is not a valid PDF, since it is negative after $0.5$. $\endgroup$ – gunes May 11 at 19:31
1
$\begingroup$

If your prior is made valid, e.g. as in your comment, $f(x)=\pi/2\sin(\pi x)$, you can find the posterior via Bayes Rule ($D$ denotes your experiment): $$f(x|D)=\frac{p(D|x)f(x)}{p(D)}\propto p(D|x)f(x)=x\pi/2\sin(\pi x)$$ $p(D|x)=x$ because we have only one toss and it is tails. Finally, we need to normalize this expression by calculating the following integral and dividing the expression by it: $$Z=\pi/2\int_0^1 x\sin(\pi x)dx\rightarrow f(x|D)=\frac{1}{Z}x\pi/2\sin(\pi x)$$

$\endgroup$
  • $\begingroup$ Hi gunes, thank you so much! If this were two tails, how would the $p(D|x)$ function change? $\endgroup$ – Sarina May 11 at 20:11
  • $\begingroup$ Thank you! Can I ask you one more question regarding this.. in order to calculate posterior probability, would the function need to be integrated at a certain value? $\endgroup$ – Sarina May 11 at 20:24
  • 1
    $\begingroup$ You should just calculate $Z$ above. I didn't get what you mean by integrating at a certain value. $\endgroup$ – gunes May 11 at 20:26
  • $\begingroup$ thank you for your help! $\endgroup$ – Sarina May 11 at 20:43
  • $\begingroup$ @Sarina if it were two tails: $p(D|x)=x^2$ $\endgroup$ – gunes May 12 at 4:13
1
$\begingroup$

If $f(x)\propto x\,\sin \pi x\Bbb 1_{(0,1)}(x)$, then $$\int_0^1 x\,\sin \pi x\,\text{d}x=\pi^{-2}\int_0^\pi x\,\sin x\,\text{d}x=\pi^{-2}\underbrace{\left[-x\cos x\right]_0^\pi}_{=\pi-0}+\pi^{-2}\underbrace{\int_0^\pi \cos x\,\text{d}x}_{=0}=\pi^{-1}$$ therefore $$f(x)=\pi x \sin \pi x$$

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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