X is a random variable with Ber(p), 0
Y is the number of trials until a success occurs.
Assume the prior p is unif(0,1).
I have trouble in figuring out the posterior density f(p|Y).
With the knowledge of f(p|Y)=$\frac{f(Y|p)f(p)}{f(Y)}=\frac{p^{n}(1-p)^{\sum x_{i}-n}\cdot 1_{(0<p<1)}}{\int_{0}^{1}p^{n}(1-p)^{\sum x_{i}-n}dp}$.
I have two concerns about the equation above.
First, I'm not sure whether the joint pdf f(Y|p) calculated by $\prod_{i=1}^{n}p(1-p)^{x_{i}-1}$ is correct because the support of Y is not cleared based on the given information; second, the integration in the denominator is kind of weird.
Could anyone share your though with me regarding this question? Thank you!
Using a geometric distribution with a beta prior (conjugate)
$X_i \sim geometric(\theta)$
where
$Pr(X_i=j|\theta)=(1-\theta)^{j-1}\theta$
so the likelihood is
$L(\theta;x)=\prod_{i=1}^n \theta (1-\theta)^{x_i-1}$
$L(\theta;x)= \theta^n (1-\theta)^{S-n}$
where $S=\sum_{i=1}^nx_i$
using the conjugate beta prior which has a pdf proportional to
$\theta^{a-1} (1-\theta)^{b-1}$
the posterior becomes
$\theta^{a-1}(1-\theta)^{b-1} \theta^n (1-\theta)^{S-n}=\theta^{a+n-1} (1-\theta)^{b+S-n-1}$
which is simply a beta distribution
Now is we use a $Beta(1,1)$ as the prior which is the same as $Uniform(0,1)$ you get the posterior you want.
I hope this helps.