# Thread: Bayesian Statistics

1. ## Bayesian Statistics

Hello,

I have a small question which I find hard to handle:

X~U(0,a)
a is unknown and his prior distribution is:

p c
g(a)=
1-p 2c

find the posterior distribution of a. for which range of x, the posterior distribution of a=c is bigger ? show your calculations.

I found the posterior:

p/c a=c
f(a|x)=
(1-p)/2c a=2c

how can I found the second part ?
cheers !

2. Originally Posted by WeeG
Hello,

I have a small question which I find hard to handle:

X~U(0,a)
a is unknown and his prior distribution is:

p c
g(a)=
1-p 2c

find the posterior distribution of a. for which range of x, the posterior distribution of a=c is bigger ? show your calculations.

I found the posterior:

p/c a=c
f(a|x)=
(1-p)/2c a=2c

how can I found the second part ?
cheers !
Because spaces are not preserved in posts I find your expressions for g(a) and f(a|x) dificult to understand.

Could you either post them in [code]..[/code] block or as an image file of some kind.

example of use of [code]..[/code] block:

Code:
        a+b
f(x) =  ----
c
(you may have to addjust the number of spaces to get correct allighment due to vatriable width charaters)

RonL

3. another try:
( if it doesn't work I'll try the image idea )

Code:
I have a small question which I find hard to handle:

X~U(0,a)
a is unknown and his prior distribution is:

p    c
g(a)=
1-p  2c

find the posterior distribution of a. for which range of x, the posterior distribution of a=c is bigger ? show your calculations.

I found the posterior:

p/c        a=c
f(a|x)=
(1-p)/2c  a=2c

the functions are defined in two different regions.

how can I found the second part ?
cheers !

4. Originally Posted by WeeG
another try:
( if it doesn't work I'll try the image idea )

Code:
I have a small question which I find hard to handle:

X~U(0,a)
a is unknown and his prior distribution is:

p    c
g(a)=
1-p  2c

find the posterior distribution of a. for which range of x, the posterior distribution of a=c is bigger ? show your calculations.

I found the posterior:

p/c        a=c
f(a|x)=
(1-p)/2c  a=2c

the functions are defined in two different regions.

how can I found the second part ?
cheers !
Is this what you mean?

$\displaystyle g(a) = \begin{cases} p & \text{if } a = c \\ 1-p & \text{if } a = 2c. \end{cases}$

$\displaystyle f(a|x) = \begin{cases} p/c & \text{if } a = c \\ (1-p)/2c & \text{if } a = 2c. \end{cases}$

If so, there is a problem: the definition of $\displaystyle f(a|x)$ does not include $\displaystyle x$! If it is a posterior distribution, it has to.

Actually, the joint density is

$\displaystyle f(a,x) = \begin{cases} p/c & \text{if } a = c \text{ and } x \in [0,c] \\ (1-p)/2c & \text{if } a = 2c \text{ and } x \in [0,2c]. \end{cases}$

The marginal density of $\displaystyle x$ is

$\displaystyle f_x (x) = \begin{cases} p/c + (1-p)/2c & \text{if } x \in [0,c] \\ (1-p)/2c & \text{if } x \in [c,2c]. \end{cases}$

And the posterior density is

$\displaystyle f(a|x) = \frac{f(a,x)}{f_x (x)} = \begin{cases} \frac{p}{p + (1-p)/2} & \text{if } a = c \text{ and } x \in [0,c] \\ \frac{(1-p)/2}{p + (1-p)/2} & \text{if } a = 2c \text{ and } x \in [0,c] \\ 1 & \text{if } a = 2c \text{ and } x \in [c,2c]. \end{cases}$

5. you are right, the quesion is taken from an old exam I was trying to solve.
there is something wrong with it...I don't know