Trying to make Bayesian inference with prior proportional to power law

23 Views Asked by At

The problem is as follows:

We have N trucks, and each truck is assigned a number from 1 to N. If we assume that the prior of N is proportional to:

$\frac {1}{x}$, for x = 1, ..., 500

We are tasked with finding the posterior mean for N when we observe a truck with number 50. The first thing that must be done is finding the likelihood, which I think can be defined as $\frac{1}{N}$ when N $\geq$ 50 and 0 otherwise. Now I'm struggling with finding the exact posterior distribution of N, since we don't know the precise form of the prior. Also, if we eventually find the posterior, is there a way to compute the posterior mean analytically?

1

There are 1 best solutions below

0
On BEST ANSWER

Let $T$ be the number of an observed truck. Then it is implied in the question that $$T \mid N \sim \operatorname{DiscreteUniform}(1,N)$$ with probability mass function $$\Pr[T = t \mid N = n] = \frac{1}{n}, \quad t \in \{1, 2, \ldots, n\}.$$ The prior likelihood of $N$ is given as $$\mathcal L(N = n) \propto \frac{1}{n}, \quad n \in \{1, 2, \ldots, 500\}.$$ We want $$\operatorname{E}[N \mid T = 50].$$ The posterior probability is therefore $$\Pr[N = n \mid T = 50] = \frac{\Pr[T = 50 \mid N = n]\Pr[N = n]}{\Pr[T = 50]}.$$ Since the denominator is $$\Pr[T = 50] = \sum_{k=1}^{500} \Pr[T = 50 \mid N = k]\Pr[N = k],$$ and $\Pr[N = n] \propto \mathcal L(N = n) \propto n^{-1}$, we can rewrite this as $$\Pr[N = n \mid T = 50] = \frac{\Pr[T = 50 \mid N = n]/n}{\sum_{k=1}^{500}\Pr[T = 50 \mid N = k]/k} = \frac{\mathbb 1 (50 \le n \le 500)/n^2}{\sum_{k=50}^{500} 1/k^2}.$$ Then the posterior mean is $$\operatorname{E}[N \mid T = 50] = \sum_{n=50}^{500} n\Pr[N = n \mid T = 50] = \frac{\sum_{n=50}^{500} 1/n}{\sum_{k=50}^{500} 1/k^2} \approx 127.09860509132488508.$$ It is not difficult to see that in general, $$\operatorname{E}[N \mid T = t] = \frac{H_{500}^{(1)} - H_{t-1}^{(1)}}{H_{500}^{(2)} - H_{t-1}^{(2)}}$$ where $H_n^{(m)} = \sum_{k=1}^n 1/k^m$ is the $m^{\rm th}$ order harmonic number.