In the two-environment example of conditional independence, g(T) is 0.1 or 0.9 with equal probabilities. Hence E[g(T)]=0.5 and Var(g(T))=((0.1−0.5)2+(0.9−0.5)2)/2=0.16. The two trials have zero conditional covariance in either environment, yet their unconditional covariance is positive because their success probabilities rise and fall together.
A normal local effect αi∣δ,τ∼N(δ,τ2) can be represented by a standardized latent variablezi∼N(0,1) independent of the hyperparameters, with αi=δ+τzi. This preserves the hierarchical model while changing the coordinates explored by Markov chain Monte Carlo. It often improves mixing when individual effects are weakly informed, reducing strong scale-effect dependence. Centered coordinates can be better with very informative individual data. The stochastic prior on zi implements the transformation correctly; re-expressing an existing density directly instead requires the appropriate Jacobian determinant.
and then chooses θ(m+1) maximizing this function in its first argument. Thus the E-step averages the missing information conditional on the current model and observed data; the M-step treats those expectations as fixed while maximizing.
For a short proof of likelihood function monotonicity, let qm(Z)=pθ(m)(Z∣x). Then
The displayed mean follows by integrating ue−dru against the conditional density; the missing weak-swimmer mean is Tj−mj(r). As dr→0, the conditional density becomes uniform on (0,Tj) and mj(r)→Tj/2.
Write Ur=A+∑jmj(r) and Vr=B+∑j(Tj−mj(r)). The E-step objective is
These are eight divided by the completed expected totals for the corresponding swimmers; imputing only observed pair totals without the conditional split would not perform the E-step.
The stated ordering must also be enforced. The ordered-rate exponential M-step accepts these updates when Ur<Vr, so λ1(r+1)>λ2(r+1). Otherwise its maximum on the closed constraint λ1≥λ2 lies at
Under a strictly open constraint λ1>λ2, a boundary optimum is only asupremum; a finite interior maximizer is not assured for every possible sample. One should report that situation rather than swap the labeled swimmer groups. Starting from positive ordered rates, iterate the E-step and constrained M-step until the parameter changes and observed log-likelihood improvement are small. EM likelihood monotonicity applies to every exact constrained M-step. No numerical swimming times are supplied, so the data-dependent updates, rather than fabricated numerical estimates, are the answer.
and its M step maximizes this function over θ. Exact steps do not decrease the observed-data likelihood function. Their aim is a likelihood stationary point, often alocal maximum, rather than draws from aparameter distribution. Adding a log prior to the maximization gives a posterior-mode version, which still does not sample the posterior.
Set nj=∑irij; because ∑jrij=1, ∑jnj=N. The constrained weight maximization usesa Lagrange multiplierη: differentiating ∑jnjlogαj−η(∑jαj−1) gives αj=nj/η, and summing fixes η=N. Differentiating the residual quadratic in each mean gives ∑irij(xi−μj)=0. Hence the first two M-step updates are
With these new meansdefine R=∑i,jrij(xi−μj(r+1))2. The remaining objective in u=σ2 is −Nlogu/2−R/(2u), whose derivative is −N/(2u)+R/(2u2). For R>0 it increases up to u=R/N and decreases afterwards. Thus the shared-variance update is
for the maximizing M step. This proves likelihood increase, not convergence to the global maximum. Use several initializations to reduce sensitivity to local maxima. Compute responsibilities with a log-sum-exp function normalization to avoid numerical underflow.
If nj=0, that component's updated weight is zero and its mean is unidentified; retain its old mean or remove the empty component. Strictly positive interior initialization avoids this case in exact arithmetic while the variance stays positive. If R=0, there is no positive finite variance maximizing this M step: the objective tends to infinityas σ2↓0. Such boundary degeneracy needs avariance constraint or regularization, as discussed in the next solution. For k=1 the formulas reduce to the ordinary sample mean and the maximum-likelihood variance N−1∑i(xi−x)2.
The Bayesian networkhas a shared parent ψ and, for each hospital, the chain ψ→θi→yi. A plate encloses the hospital-specificpair. Observed counts are shaded; the local rates are latent variables. Conditional on ψ, the pairs are independent.