Bayesian Estimation, What is Equivalent Sample Size or Imaginary Sample Size? I am trying to understand the formula given in the book Bayesian Networks, With Examples in R, by Marco Scutari & Jean-Baptiste Denis.
The formula estimates the parameters of a categorical distribution "in a Bayesian setting" (pages 12-13). I am simplifying the formulas to get to the point, so let's suppose we have a binary variable $X$, and that we want to estimate, "in a Bayesian setting" and with a uniform prior, $\hat{P}(X = 1)$. The book uses this formula (Formula 1.7)
$$\hat{P}(X = 1) =  \frac{iss}{n + iss}\pi + \frac{n}{n + iss }\hat{p} $$
where $\hat{p}$ is the MLE estimator, i.e. $\hat{p} = \frac{k}{n} $, where $k$ is the number of successes (1); and $n$ is the dataset size. $\pi$ is said to be the uniform prior, and therefore $\pi = \frac{1}{2}$, since this is a binary variable we are dealing with.

Now, I am having trouble completely understanding the rationale of what the author calls equivalent sample size or imaginary sample size, $iss$ in the formula above. The formula is, of course, a weighted mean of the expected value of the uniform prior $ \pi$ and $\hat{p}$, and the bigger the $iss$ the bigger the influence of the prior. 
But I want to derive the rationale behind $iss$ in the Bayesian context, if there is one. So let's derive the formula:
For a binary variable we take a flat prior, i.e. $\theta \sim Beta(1,1)$. Then the posterior of $\theta \sim B(1+k, 1+n-k)$, whose expected value is
$$\frac{1 +k}{2+n} = \frac{1}{2+n} + \frac{k}{2+n}= \frac{1}{2+n} + \frac{n}{2+n}\hat{p}$$
This clearly corresponds to the formula above for $iss = 2$. So, how does one 
give more or less "weight" to the prior distribution? Of course I can just weight these two terms as I want, but what does it means in terms of Bayesian estimation?
To me it seems like giving more weight to the prior would be like reducing the sample size $n$, something like, in the above formula, letting $n = \tilde{n}-1$, but the math does not work. Any formal explanation of what is equivalent/imaginary sample size applied to this example?
 A: Bayesian probability and Bayesian statistics are subjective.  Bayesian probability depends on the prior knowledge of the researcher;  Bayesian statistics depend on the subjective loss function of the decision-maker.  So, your statement, $\hat{p}=\frac{k}{n}$, is only true under specific loss functions and priors in the usual case.  It does work for your formula, however.  $\hat{p}$ is usually considered the posterior estimator.
So let us consider the case of a strictly fair coin with observers, Naïve Bob and Slick Eddy.  The fair coin will be tossed by Dr. Clueless Statistician and Mandrake the Magician.  You are an engineer and have formally tested the fairness of the coin.
Up comes Naïve Bob, and Naïve Bob has seen coins tossed before and knows that you checked to see if the coin is fair.  He uses a prior of $\beta(100,100)$ when both Dr. Statistician and Mandrake toss the coin.  Dr. Statistician tosses the coin first.  There are 10 tosses, and five are heads.  That leaves Naïve Bob with a posterior of $\beta(105,105)$ and a posterior mean of $$\hat{p}=\frac{100+5}{100+100+5+5}=\frac{1}{2}.$$
Slick Eddy was also in the audience.  Slick Eddy meets Dr. Statistician before the toss and interviews him to see if he has any particular experience with tossing coins.  For example, he could be a frequent player of role-playing games, and his dice could have come up with critical rolls too often.  That could have caused him to practice “magic.”  He concludes that Clueless has no specific coin-tossing skills and assigns a prior of $\beta(1000,1000)$ and sees the same ten coin tosses.
After this is over, Mandrake the Magician comes to toss the coin.  He asks both viewers to inspect the coin.  He shows that there is nothing up either sleeve and asks Naïve Bob to choose Heads or Tails for a simple one-dollar gamble.  If Mandrake can cause the coin to match Naïve Bob’s call ten times in a row, then Bob will pay \$1; otherwise, Mandrake will pay \$10.  Given Bob’s prior, he eagerly accepts the bet with a prior of $\beta(105,105)$.  Slick Eddy, on the other hand, waits to hear what Bob calls out to form his prior.
Naïve Bob calls out, “Heads.”  At first, Fast Eddy considers setting his prior at $\beta(10,1)$ to reflect the odds, but then realized that Mandrake could have his own prior of $\beta(100,1)$ and is underpaying Bob for the risk.  Fast Eddy decides to be conservative and uses a prior of $\beta(10,1)$ since he has no other personal knowledge of Mandrake’s coin-tossing skills.
To get a point statistic from a Bayesian prior or a Bayesian posterior, you have to apply a loss function to the distribution.  In the case where the posteriors created from conjugate prior distributions, you can decompose a point statistic into prior pseudo-observations and sample observations, which is what you see there.
The posterior mean is $$\frac{\alpha+k}{\alpha+\beta+n}.$$  You could decompose this into $$\hat{p}|k,n=\pi\frac{a+b}{a+b+n}+\hat{p}\frac{n}{a+b+n},$$ slightly modifying your prior notation, where $a$ is pseudo-successes, $b$ is pseudo-failures, so $a+b=iss$, and $k$ is observed successes and $n$ is the sample size.  Note that using a posterior mean implies that your loss function is quadratic.
Surprisingly/Unsurprisingly, the coin comes up Heads ten times in a row.  Naïve Bob has a posterior of $\beta(115,105)$ and remains eager to retake the bet.  Chance effects do happen.  Fast Eddy, who did not bet, now has a prior of $\beta(20,1)$ with a posterior mean of $\frac{20}{21}$.  He secretly goes to Naïve Bob and offers 20-1 odds to make the same bet, but offers even more money.
In each of these cases, the prior could have been acquired by observations with a $\beta(0,0)$ prior distribution.  Because of this, the prior can be viewed, in some cases, as being equivalent to a certain number of pseudo-observations.  The linkage is obvious in the cases where there is a conjugate prior distribution.  It is not clear how many pseudo-observations exist when working outside the exponential family of distributions or when not using a conjugate prior.
