Chapter 7 Exercises
Tea tasting
Solutions

In Example 7.1.1 (tea tasting), instead of assessing whether the taster has any ability at all, assess whether she has a ``practically-significant'' tasting ability. Specifically, what is the posterior probability that she correctly detects the pouring order at least twice as often as she gets it wrong, under

a) a one-parameter uniform prior,

b) a (one-parameter) sceptical prior with a 80% prior probability of p1=0.5, and a uniform distribution on p1>0.5.

model {
for (i in 1:2) {
y[i] ~ dbin(p[i], n[i])
}
p[2] <- 1 - p[1]

# a) Uniform prior
# p[1] ~ dunif(0, 1)

# b) Sceptical prior
p[1] <- theta[pick]
pick ~ dcat(q[])
q[1] <- 0.8; q[2] <- 0.2
theta[1] <- 0.5
theta[2] ~ dunif(0.5, 1)

post <- step(p[1] / p[2] - 2)

}

list(n=c(4,4), y=c(3,1))

a) Under the one-parameter uniform prior, the posterior probability is 62%.
   node   mean   sd   MC error   2.5%   median   97.5%   start   sample
   p[1]   0.6997   0.1382   0.001521   0.4045   0.7133   0.9243   501   9500
   p[2]   0.3003   0.1382   0.001521   0.07567   0.2867   0.5955   501   9500
   post   0.6196   0.4855   0.005326   0.0   1.0   1.0   501   9500

b) Under the sceptical prior, the posterior probability is reduced to 21%.
   node   mean   sd   MC error   2.5%   median   97.5%   start   sample
   p[1]   0.5711   0.1221   0.00118   0.5   0.5   0.8819   501   9500
   p[2]   0.4289   0.1221   0.00118   0.1181   0.5   0.5   501   9500
   pick   1.313   0.4639   0.004615   1.0   1.0   2.0   501   9500
   post   0.2145   0.4105   0.00411   0.0   0.0   1.0   501   9500
   theta[2]   0.7439   0.1356   0.001461   0.5135   0.744   0.9836   501   9500