✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.
Suppose the university now believes enrolment is likely to be high, and expresses this as a Normal(0.8, 0.1) prior on p, truncated to the interval (0, 1). This prior is not conjugate to the binomial likelihood, so the posterior cannot be found with a Beta update and is approximated by simulation using MCMCpack::MCMCmetrop1R(). This function requires the log of the unnormalised posterior. Of the 45 students surveyed, 31 said "yes".
Which of the following should replace the blank line?
log_post <- function(theta) {
if (theta <= 0 || theta >= 1) return(-Inf)
____________________
}