5 Week 5 Bayesian statistics: Decisions

5.4 Evaluating the cost or utility of an experiment

Cost of experiment

Here we need calculate the expected utility or loss when both the parameters and the future data are unknown.

Recall that the expected loss of a decision d𝒟 with respect to the state of nature sπ(S) is

πL(d,s)=sL(d,s)π(s)𝑑s

Utility of experiment

The utility of an experiment

If we are interested in future data, call it x, but the data is as yet unknown then the Bayes risk, Equation 5.2, becomes

ρ* =infd𝒟ExEθxL(d,{x,θ})
=Exinfd𝒟EθxL(d,{x,θ})
=xm(x)ρ*(x)𝑑x

where ρ*(x)=infd𝒟EθxL(d,{x,θ}). In other words the Bayes risk over all possible samples is the marginal expectation of the posterior Bayes risk.

Utility of sampling procedure

This Bayes risk or loss of the sampling procedure can be obtained by

  1. 1.

    Choose a conjugate prior, π(θ) to the likelihood f(xθ).

  2. 2.

    Calculate Bayes rule, d*, and Bayes risk using this prior, ρ*(θ).

  3. 3.

    Update the prior using the likelihood, f(xθ), and re-calculate Bayes risk as a function of x:

    ρ*(x)=EθxL(d,{x,θ}).
  4. 4.

    The problem is now to calculate the marginal expectation, Exρ(x,θ). This can be done by using the identity

    ρ*=Exρ*(x)=EθExθρ*(x)

    .

Example

The next example illustrates this procedure.

Example

Suppose that we wish to estimate the parameter, θ, of a Poisson distribution. Our prior for θGamma (α,β). The loss function, for estimate d and value θ, is

L(θ,d)=(θ-d)2
  1. 1.

    Find the Bayes rule and Bayes risk of an immediate decision.

  2. 2.

    Find the Bayes rule and Bayes risk if we take a sample, x, of size n.

  3. 3.

    Find the Bayes risk of the sampling procedure.

Solution

  1. (1)

    We have already seen that for a squared loss, Bayes rule is

    d=πθ=αβ

    with corresponding Bayes risk

    ρ(π) =var πθ=αβ2
  2. (2)

    As θGamma (α,β) and XiPoisson (θ) then
    θxGamma (α+i=1nxi,β+n) We observe that the Bayes rule and Bayes risk after sampling can be found from substituting α+i=1nxi for α and β+n for β to obtain the Bayes rule

    d=α+i=1nxiβ+n
    ρ(f(θx))=α+i=1nxi(β+n)2

Solution

Bayes risk is

  1. (3)

    The risk of the sampling procedure is the expected value of the posterior Bayes risk, when viewed as a random quantity,

    Xρ(f(θx)) =X[(α+i=1nXi)(β+n)2]
    =(α+nX)(β+n)2

    We use (X)=θ((X|θ))=θ(θ)=αβ leading to Bayes risk of

    ρ=(α+nαβ)(β+n)2

Example 1

Example 1

A game of chance is being played with a possibly biased coin with an unknown probability θ of landing heads: The rules of the game allow you to win 2 pounds if two successive tosses of the coin land heads, and lose 3 pounds if the first toss lands tails. Consider a loss function, L(θ,a) for a bet, where L(θ,a) is the money you expect to lose conditional on θ for actions of betting, a1, or not betting, a2. The loss function in this case is

L(θ,a) θ
a1 3(1-θ)-2θ2
a2 0

Your prior distribution for θ is Beta(1,1).

Example (cont)

Example 1

  1. (i)

    Calculate the prior expected loss of both actions.

  2. (ii)

    Should you bet and why or why not?

    You now observe n=3 tosses of the coin, and of those tosses it lands heads every time.

  3. (iii)

    Calculate the posterior distribution for θ.

  4. (iv)

    Calculate the posterior expected loss for each action, using the given loss function and state whether a bet should be made.

Answers


  1. (i)

    (θ)=12=1, Var(θ)=112, so (θ2)=13

    (L(θ,a1)) =3-3(θ)-2(θ2)
    =56
    (L(θ,a1)) =0
  2. (ii)

    No, you should not bet. Bayes rule is to minimise expected loss which is zero.

  3. (iii)
    p(θx) p(θ)p(xθ)
    θx(1-θ)n-x
    θx Beta (x+1,n-x+1)
    θx Beta (4,1)

Answers

  1. (iv)
    (θx) =x+1n+2=45
    Var (θx) =(x+1)(n-x+1)(n+2)2(n+3)=275
    (θ2x) =(x+1)(n-x+1)(n+2)2(n+3)+(x+1n+2)2=23
    (L(θ,a1)) =3-3(θx)-2(θ2x)
    =3-3x+1n+2-2{(x+1)(n-x+1)(n+2)2(n+3)-(x+1n+2)2}
    =-1115
    (L(θ,a1)) =0  Nowyoushouldbet.

Example 2

Example 2

We wish to estimate the parameter, λ, of a Poisson distribution. Our prior for λ is Gamma (α,β). The loss function, for estimate d and value λ, is

L(θ,d)=(λ-d)2+λd.
  1. (i)

    Find the Bayes rule and show that Bayes risk of an immediate decision is

    4α+3α24β2.
  2. (ii)

    Find the Bayes rule and Bayes risk when we have observed X=x.

  3. (iii)

    Explain how you would calculate the integrated risk of the sampling procedure.

Example 2- Answers

  1. (i)

    Find the Bayes rule and show Bayes risk of an immediate decision is

    4α+3α24β2

    Bayes rule, d* is the decision that minimises the expected loss.

    ρ(d) =λ(L(λ,d)
    =λ(λ2)-λ(λ)d+d2
    ρ(d) =-λ(λ)+2d=0
    d* =Eλ(λ)2
    =α2β

Example 2- Answers

Bayes risk is the expected loss at the optimal decision.

ρ(d*) =λ(L(λ,d*)
=λ(λ2)-λ(λ)d*+d*2
=λ(λ2)-λ(λ)α2β+(α2β)2
=αβ2+(αβ)2-α22β2+(α2β)2
=4α+4α2-2α2+α24β2
=4α+3α24β2

Example 2- Answers

  1. (ii)

    Find the Bayes rule and Bayes risk when we have observed X=x.
    We note that the posterior distribution of λ is Gamma (αp,βp)=Gamma (x+α,1+β).

    d* =αp2βp=α+x2(β+1)
    ρ(d*) =4αp+3αp24βp2=4(α+x)+3(α+x)24(β+1)2
  2. (iiii)

    Explain how you would calculate the integrated risk of the sampling procedure.
    The risk of the sampling procedure an be found by taking the marginal expectation of the posterior risk

Example 3

Example 3

Consider the following loss function

L(θ,d)=dθ-log(dθ)-1.
  • (i)

    Find the Bayes rule of an immediate decision.

  • (ii)

    Let X1,,Xn be exchangeable so that the Xi are conditionally independent given parameter θ. Suppose that Xi|θPoisson (θ) and θGamma (α,β) with α>1.

    Under the loss given above, find the Bayes rule after observing x=(x1,,xn).

Example 3. Answers

Find the Bayes rule of an immediate decision.

  1. (i)
    ρ(d) =d(1θ)-log(d)+log(θ)-1
    ρ(d) =(1θ)-1d
    ρ(d*)=0 d*=[(1θ)]

    Can show for θGamma (α,β)

    (1θ) =βαΓ(α)Γ(α-1)βα-1
    =βα-1
    d* =α-1β

Example 3. Answers

Under the loss given above, find the Bayes rule after observing x.

  1. (ii)
    θxGamma (α+xi,β+n)

    ,

    d* =α*-1β*
    =α+xiβ+n

Example 4

Example 4

A certain coin has probability ω of landing heads. We assess that the prior for ω is a Beta distribution with parameters α,β>1. The loss function for estimate d and value ω is

L(ω,d)=(ω-d)2+d2ω
  1. (a)

    Find the Bayes rule and Bayes risk for an immediate decision.

  2. (b)

    Suppose that we toss the coin n times before making our decision, and observe k heads and n-k tails. Find the new Bayes rule and Bayes risk.

Example 4. Answers

  1. (a)
    ρ(d) =(w)-2d+2d2(w-1)
    ρ(d) =-2+4d(w-1))
    ρ(d*)=0 d*=-1(w-1)2

    with Bayes risk ρ(d*)=(w)-2d*+2d*2(w-1)=(w)--1(w-1)2.

    Can show

    E(w-1) =Γ(α+1)Γ(α+β)Γ(α)Γ(α+β-1)
    BayesRule=d*= =α+β-1α-1

Example 4. Answers

Bayes risk can be found

ρ(d*) =αα+β-α-1(α+β-1)
=α(α+β-1)+β2(α+β)(α+β-1)

Example 4. Answers

  1. (b)

    The posterior of w is wkBeta (α+k,β+n-k).

    BayesRule=d*= α*+β*-1α*-1
    =α+k-12(α+β+n-1)
    BayesRisk =α*(α*+β*-1)+β*2(α*+β*)(α*+β*-1)
    =(α+k)(α+β+n-1)+β+n-k2(α+β+n)(α+β+n-1)