13.08.2022 Views

advanced-algorithmic-trading

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

30

Using a beta distribution for the prior in this manner means that we can carry out more

experimental coin flips and straightforwardly refine our beliefs. The posterior will become the

new prior and we can use Bayes’ rule successively as new coin flips are generated.

If our prior belief is specified by a beta distribution and we have a Bernoulli likelihood

function, then our posterior will also be a beta distribution.

Note however that a prior is only conjugate with respect to a particular likelihood function.

3.5.2 Why Is A Beta Prior Conjugate to the Bernoulli Likelihood?

We can actually use a simple calculation to prove why the choice of the beta distribution for the

prior, with a Bernoulli likelihood, gives a beta distribution for the posterior.

As mentioned above, the probability density function of a beta distribution, for our particular

parameter θ, is given by:

P (θ|α, β) = θ α−1 (1 − θ) β−1 /B(α, β) (3.12)

You can see that the form of the beta distribution is similar to the form of a Bernoulli

likelihood. In fact, if you multiply the two together (as in Bayes’ rule), you get:

θ α−1 (1 − θ) β−1 /B(α, β) × θ k (1 − θ) 1−k ∝ θ α+k−1 (1 − θ) β+k (3.13)

Notice that the term on the right hand side of the proportionality sign has the same form as

our prior (up to a normalising constant).

3.5.3 Multiple Ways to Specify a Beta Prior

At this stage we’ve discussed the fact that we want to use a beta distribution in order to specify

our prior beliefs about the fairness of the coin. However, we only have two parameters to play

with, namely α and β.

How do these two parameters correspond to our more intuitive sense of "likely fairness" and

"uncertainty in fairness"?

Well, these two concepts neatly correspond to the mean and the variance of the beta distribution.

Hence, if we can find a relationship between these two values and the α and β parameters,

we can more easily specify our beliefs.

It turns out that the mean µ is given by:

µ = α

α + β

(3.14)

While the standard deviation σ is given by:

αβ

σ =

(α + β) 2 (α + β + 1)

(3.15)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!