Prior effective sample size (ESS) doesn't have a single definition. It's a heuristic to understand the influence of the prior on the posterior parameters. Prior ESS tells you that your choice of prior is comparable to having an additional $n_{E}$ data points.
It is straightforward to demonstrate prior ESS with conjugate priors. It is more complicated when you have non-conjugate priors.
Conjugate Priors
Beta-Binomial Example
Say you having a binomial random variable, $Y$ and you want to estimate the probability of success, $\theta$. You observe $y$ successes and $n-y$ failures. Assume a $Beta(\alpha, \beta)$ for $\theta$.
$$ Y \sim Binom(n, \theta),$$
$$\theta \sim Beta(\alpha, \beta), \text{ and }$$
$$ \theta | Y \sim Beta(\alpha + y, \beta + n - y)$$
If the prior contributed no information to the posterior, we would use only the data to inform the posterior: $\theta | y \sim Beta(y, n - y)$. We can compare the parameters of this noninformative posterior to the general form of the posterior to see how the prior adds information to the likelihood. The $Beta(\alpha, \beta)$ prior is equivalent to observing an additional $\alpha$ heads and an additional $\beta$ tails. So the prior effective sample size is $\alpha + \beta$.
Non-conjugate case
When the prior and the likelihood aren't conjugate, we can't see exactly how the prior parameters interact with the likelihood to make the posterior parameters. Morita et all (2008) generalize the concept from conjugate distributions to distributions in general. I'll give the concept, but you can reference that paper for all the details.
You find the prior ESS with the algoritm:
- Choose your prior distribution. Calculate the information matrix of the prior parameter.
- Identify a non-informative alternative to (1). Ex: $\theta \sim Normal(\mu = 0, \sigma^2 = 10e5)$
- Take a sequence from $m = 0, \dots, M$ and get the posterior for each prior (2) with a dataset of size $m$. Calculate the information matrix.
- The prior ESS is the same size, $m_o$, which minimizes the distance of between the prior information from (1) and posterior information from (3).