What is the difference between "a priori", "a posteriori" and "likelihood"? I am trying to understand definitions. Let $x$ denote a random variable (outcome of experiment) and $\theta$ a parameter. This is what I think:

*

*"a priori" is a density function of $x$ given certain value of $\theta$. For example $p(x) = \frac{1}{\theta} I_{([0,\theta])}$

*"a posteriori" is a probability that parameter has some value, given observed $x$, i.e. conditional probability $p(\theta | x) = \frac{p(x|\theta)}{p(x)} \cdot p(\theta)$, where $p(x) = \int p(x|\theta)\cdotp(\theta) d\theta$

*"likelihood" is a probability of obtaining certain $x$ given the parameter $\theta$, i.e. conditional probability $p(x|\theta) = \frac{p(\theta|x)}{p(\theta)} \cdot p(x)$.

"a priori" and "likelihood" seem very similar, sometimes $p(x)$ is denoted as $p_\theta(x)$, which kind of gives probability of $x$ given $\theta$. I suppose the difference is that by "a priori" we mean a density function and "likelihood" is a single value calculated for specific $x$. But I am not sure and it sounds weird. In general I have no idea if I understand these three terms and the difference between them or not.
Also, it's not exactly the topic of this question, but I can't learn when should I use $X$ ("random variable") and when $x$ ("observed value of X"?). Maybe it affects my understanding of definitions.
Can anyone help?
 A: The prior is $p(\theta)$, i.e. it treats the parameter $\theta$ as a random variable. Your definitions of posterior and likelihood look correct. "$p(\cdot )$" in this context would refer to a mass function or density.
Notation varies, but I would say a frequent convention is $X$ is the random variable and $x$ is a realization of the random variable, so we may write
$$P(X=x):=P(\{\omega\in \Omega:X(\omega)=x\}).$$

It may be more instructive to use an example. Suppose $X_1,..X_n$ are iid Poiss($\lambda$), for $\lambda>0$. Note that in a Bayesian context, this means $X_i|\lambda\overset{\text{iid}}{\sim} $Poiss($\lambda$).
Then the likelihood is
$$p(x_1,...,x_n|\lambda)=\Pi_i p(x_i|\lambda)=\Pi_i\frac{\lambda^{x_i}e^{-\lambda}}{x_i!}=\frac{\lambda^{\sum_i x_i}e^{-n\lambda}}{\Pi_i x_i!}.$$
Supposing $\lambda\sim$ Gamma($\alpha,\beta$), which is a conjugate prior for the above likelihood, then the prior density is
$$p(\lambda)\propto \lambda^{\alpha-1}e^{-\beta\lambda},$$
and you can work out the posterior is
$$p(\lambda|x_1,...,x_n)\propto \lambda^{\sum_i x_i +\alpha-1}e^{-(\beta+n)\lambda},$$
implying $\lambda|X_1,...,X_n\sim$Gamma($\sum_i X_i +\alpha,\beta+n$).

