-Rpost <- res1$posterior
-loc <- which(Rpost$pmf == max(Rpost$pmf))
-Rpost$supp[loc] # Posterior mode.
-res1$Rhat # Compare with the posterior mean.
-
-par(mfrow = c(2, 1), mar = c(2, 2, 1, 1))
-
-plot(Rpost$supp, Rpost$pmf, col = "black", type = "l", xlab = "", ylab = "")
-abline(h = 1 / (20 / 0.01 + 1), col = "red")
-abline(v = res1$Rhat, col = "blue")
-abline(v = Rpost$supp[loc], col = "purple")
-legend("topright",
- legend = c("Prior", "Posterior", "Posterior mean", "Posterior mode"),
- col = c("red", "black", "blue", "purple"), lty = 1)
+# Same as above, but return the posterior distribution instead of the
+# estimate.
+posterior <- seq_bayes(cases, mu = 1, kappa = 4, post = TRUE)