For any action , decompose the posterior expected quadratic loss around the posterior mean:
The unique minimizer is therefore the Bayes estimator under squared error loss. Using the mean of the posterior Beta distribution gives
Under repeated sampling at parameter value , has the binomial distribution with expected value . Consequently
so its bias of an estimator is .
The mean condition gives , hence . The beta distribution variance is then
Since , equating variances gives . Therefore
By Bayes' theorem, with respect to Lebesgue measure on ,
The omitted constant includes the binomial coefficient and the normalizing constant of the beta distribution; the uniform prior contributes only the support indicator.
The uniform prior is the Beta distribution . By Beta-binomial conjugacy, after observing heads the posterior is
The Bayes estimator under squared error loss is the posterior mean, hence
The probability of no recovery through month is the product of the conditional survival probabilities, so
Under quadratic loss, the Bayes estimator is the posterior mean. Posterior independence and the mean of a Beta distribution give
Consequently
By continuity of the cumulative distribution function and nonnegativity, ; strict increase and allow inversion for every . The probability integral transform follows from
Thus is uniformly distributed on .
The order statistics arrange the sample increasingly: . Strict monotonicity means is the th order statistic of independent uniform variables. Its density is
obtained by choosing the observations below and the above it. This is the beta distribution with parameters , so
For the given log-logistic distribution, rearrangement gives
Consequently plot vertically against horizontally. Under a good fit, replacing by its plotting position gives an approximate straight line with
This is a diagnostic probability plot, rather than an assertion that the expectation of the nonlinear transformed order statistic equals that transformed plotting position. Positive observations occur almost surely under the model.
Let . The Bernoulli distribution likelihood is proportional to . Multiplication by the beta distribution prior gives
Normalizing with the beta function therefore gives
The parameters remain positive. This is Beta-binomial conjugacy: successes add to the first shape parameter and failures to the second.
Let denote the distribution function of the posterior beta distribution, with and . This distribution is continuous with positive density on . Its equal-tailed credible interval is
Compute the two quantiles by solving and . Each excluded tail has mass , leaving posterior mass between the endpoints.
The difference of the two eigenvalues is , hence . Its expectation is
For , put . The set of angles satisfying consists of , and , of total length . Thus the full cumulative distribution function is
Differentiating on gives the probability density function
This is the arcsine distribution, equivalently the beta distribution with both parameters . It has no atoms at either endpoint.
Assume and a current state with , . The unnormalized posterior density is
Thus the log-posterior, up to an additive constant, is the log-likelihood plus the beta distribution and exponential distribution log prior densities. The exponential distribution rate is , since is its mean. [ref] [ref]
Choose a symmetric joint random-walk Metropolis algorithm proposal: and , for independent standard normal distribution draws. Its scale depends only on fixed hyperparameters, so forward and reverse proposal probability density functions agree. Reject immediately outside ; otherwise accept with Metropolis–Hastings acceptance probability
The following function makes exactly one proposal, with rejection retaining both old parameters:
MHstep <- function(x, p, beta, a, b, mu) {
  p_new <- rnorm(1, mean = p, sd = 0.1)
  beta_new <- rnorm(1, mean = beta, sd = mu / 2)
  if (p_new <= 0 || p_new >= 1 || beta_new <= 0)
    return(list(p = p, theta = beta))
  logpost <- function(pp, bb) {
    ll_f(pp, bb, x) + dbeta(pp, a, b, log = TRUE) +
      dexp(bb, rate = 1 / mu, log = TRUE)
  }
  logA <- logpost(p_new, beta_new) - logpost(p, beta)
  if (log(runif(1)) <= min(0, logA)) {
    p <- p_new
    beta <- beta_new
  }
  list(p = p, theta = beta)
}
The returned field theta contains the updated value of beta. The original PDF really asks for p and theta, although no parameter is defined in this question. This choice preserves its literal interface while making the intended second parameter explicit. A caller therefore advances with state <- MHstep(x, p, beta, a, b, mu), p <- state$p, and beta <- state$theta.
The proposal is an unrestricted symmetric normal distribution followed by rejection outside the support. Repeatedly drawing until a valid proposal appears would instead truncate and renormalize the proposal, requiring a proposal-density correction. The code uses immediate rejection and needs no such correction. The displayed scales are valid fixed choices; practical efficiency can be improved using a separate tuning phase.
For odd sample size, the sample median is the central order statistic, . Since , its index is and . Substitute these into the expectation and variance formulas from part (i):
In fact has the symmetric beta distribution , explaining why its expectation is exactly the centre of the interval.
The given probability density function is that of a beta distribution with parameters and . We can derive the required moments directly rather than assuming the beta moment formulas. For an integer , the Euler beta function gives
Here for positive integers ; this identity also follows by repeated integration by parts. Taking yields
Subtract the square of the first moment from the second to obtain the variance:
These are exact finite-sample identities for each uniform order statistic.
Let . The Bernoulli distribution likelihood function is . Multiplication by the beta distribution prior density and Bayes' theorem give
Recognizing the normalized beta distribution,
This is Beta-binomial conjugacy; the same update applies whether the data are recorded as the individual Bernoulli trials or their success count.
Put and as in part (a), and let be the cumulative distribution function of the beta distribution . The two endpoint equations are
The first equation fixes the posterior probability, and the second makes the two endpoint posterior densities equal. Their admissible ordering is
To justify sufficiency and uniqueness, the derivative of the logarithm of the posterior density is
which is positive below and negative above it. Thus the posterior density increases strictly to its unique mode and decreases strictly thereafter, vanishing at both ends. Each density threshold between zero and the maximum determines exactly one endpoint on each side of . The probability between these endpoints decreases continuously and strictly from one to zero as increases, so exactly one threshold gives 0.95. This is the beta highest posterior density endpoint characterization.
For the beta distribution with parameters , the Euler beta function gives . Its probability density function is therefore on . Direct integration gives the raw moments
In particular, its mean is . Equating this to the sample mean and rearranging gives
The observations lie strictly between zero and one with probability one, so and this method of moments estimator is well defined and positive. This is an instance of estimation of a beta shape parameter.
A likelihood-ratio test rejects for small . The derivative of the natural logarithm of its variable factor is
Thus increases up to and decreases thereafter, tending to zero at both endpoints. Every nontrivial lower level set of therefore consists of two tails. For a prescribed test size , the exact critical region is
Writing for the cumulative distribution function of the beta distribution with parameters , the required two equations are
The first makes both cutoffs have the same likelihood ratio; the second calibrates the null hypothesis rejection probability. Equivalently, the second left-hand side is
As the common likelihood ratio threshold increases from zero to one, this probability increases continuously and strictly from zero to one; hence the equations determine unique cutoffs. The two tail probabilities need not each equal when . Exact calibration holds for every common rate because the given null distribution of is independent of that rate. Boundary equalities have zero probability.
Set and . Conditional independence of the binomial distribution observations gives the likelihood function
The prior distribution is the beta distribution with parameters . By Bayes' theorem, multiplying the prior density by the likelihood function gives a posterior density proportional to
Recognizing and normalizing this beta distribution gives
for . This is Beta-binomial conjugacy; the original binomial coefficients cancel in the normalization because they are independent of .
For , decreasing the second parameter by one gives another valid beta distribution density and
Normalization therefore gives
The restriction is essential for this finite expected value; when , the singularity near instead makes the expectation infinite.
Multiplying the beta distribution density by gives a constant multiple of the normalized density with parameters :
Integrating and using the fact that the latter probability density function integrates to one gives
This is a normalization-ratio argument, requiring no explicit integration of the polynomial density.