How to proper evaluate the PDF of a Beta Distribution? On page 40 of "Think Bayes - Bayesian Statistics Made Simple", Allen evaluates the PDF of the Beta distribution as
def EvalPdf(self, x):
    return x**(self.alpha-1) * (1-x)**(self.beta-1)

I understand the formula used but I'm trying to better understand the 1 subtracted from the alpha and beta parameters.
Allen defined the prior as B(1,1) so I'm assuming the -1 refers to the definition of the prior, but why is it necessary to exclude that? Since we're evaluating the PDF, shouldn't we use the posterior as it is (with the 1's from the prior included)?
 A: The -1 is a result of the usual parameterization of the beta distribution, which in turn is because of the presence of of -1 in the powers of the beta function:
$$B(x,y) = \int_0^1t^{x-1}(1-t)^{y-1}\,\mathrm{d}t\;,\: x,y>0$$
Note that there's also a power -1 in the definition of the (related) gamma function:
$$ \Gamma(t) = \int_0^\infty  x^{t-1} e^{-x}\,dx\;$$
The -1 there is a matter of convention but I presume it was chosen for convenience in some problem for which this would be a natural way to do it. The section on integration problems on the Wikipedia page for the gamma function suggests that this might indeed be why; note that at that link we have:
$\int_0^\infty t^b e^{-at} \,dt = \frac{\Gamma(b+1)}{a^{b+1}}$
and the presence of $b+1$ in the denominator may have been the reason to define the power in the integral in the gamma function one smaller, leaving both terms on the right without +1s. 
It may well be that the use of -1 in these definitions dates right back to Euler (whose work on the functions predates the names we give them now); certainly the -1s were clearly in place not long after.
If I locate which of Euler's works they were in I'll try to pin down whether he did use the -1.
Edit: Well documents like the one linked here - suggest that he was using powers -1 routinely and looking across which cases the -1s tended to crop up in (such as including it in numerator terms but not in denominator terms), it may well have been for the kind of convenience suggested above. There's some discussion of the history of Euler's work with the Gamma function by Ed Sandifer here but it doesn't seem to enlighten the discussion further.
