Let eventual outcome have probability , with . An observed outcome at time contributes to the likelihood, while right censoring at contributes . The expectation-maximization algorithm imputes both the censored outcome and its latent log event time. Its E-step uses the displayed conditional weights and the first two moments of a truncated normal distribution above . With and Inverse Mills ratio , these moments are and . Observed outcomes use deterministic class weights and moments . The M-step updates each class probability to its average weight, its mean to the weighted first moment, and its variance to the weighted second moment minus the squared new mean. Outcome-specific cumulative probabilities are cumulative incidence functions, not the conditional distributions themselves.
Gaussian–exponential hierarchical colour model Created 2026-10-05 Updated 2026-10-06
An observed astronomical colour is the sum of a normal intrinsic colour, a nonnegative dust contribution with an exponential distribution, and normal measurement noise. With latent , and , the Gibbs sampler conditionals for are normal and those for are truncated normal distributions. A flat prior on and inverse-gamma priors on give inverse-gamma conditional updates for the two scales. Log-flat priors on both scales instead make the joint posterior improper when all , despite formally proper full conditionals at generic latent states: the marginal observed likelihood has a positive limit at either zero-scale boundary. Proper positive-scale priors restore a genuine joint posterior.
Latent-normal Gibbs sampler for probit regression Created 2026-10-07 Updated 2026-10-14
For binary observations with success probability , introduce latent and let the sign determine the observation. Given and the observed sign, each latent variable has a truncated normal distribution. With a standard normal prior, the full conditional distribution of is normal with precision and mean . Alternating these blocks is Gibbs sampling with the required marginal posterior.
This is an EM algorithm for a censored lognormal competing-risks mixture. Write and suppose , with mixing weights , . The missing data are and for censored patients; neither is missing for recorded deaths or recoveries. The complete-data log-likelihood, apart from terms independent of the parameters, is
The lognormal Jacobian is also parameter-independent and therefore does not affect the maximization.
At iteration , set for each censored patient and let . Bayes' rule gives the E-step class weights
Given that class, has a truncated normal distribution above . With the Inverse Mills ratio , compute both moments needed for the E-step:
Thus , , and the corresponding second moment is . For an observed outcome at time , use , , and . These specify the full conditional expectation of .
Put and let be the total number of patients. Maximizing that expected complete-data log-likelihood gives the M-step
All moments on the right are evaluated at the old parameters. Repeat the E-step and M-step until the observed log-likelihood stabilizes, using positive initial variances and mixing weights. The expectation-maximization algorithm increases that likelihood at each exact iteration, but need not find its global maximum; multiple starts help distinguish local optima. The resulting estimates give the case fatality probability and
These are conditional event-time distributions, distinct from the cumulative incidence functions and .
For the Box-Muller transform, draw independent from the uniform distribution on and set
The radial density is for , with an independent uniform angle. The polar-to-Cartesian Jacobian determinant is , so the joint density of is
This factorization proves that both outputs have the standard normal distribution and are independent. Repeating the Box-Muller transform with fresh independent uniform pairs gives independent normal outputs; discard one extra output if the desired sample size is odd.
For the prescribed binary probabilities, generate independent standard normal values in this way and use
The standard normal distribution function gives , and independence is preserved because each threshold uses a different independent normal value.
For the probit regression posterior, introduce latent variables
Given , these are independent variables, and normal symmetry gives . Thus this data augmentation has exactly the observed binary likelihood. With the specified normal prior distribution, the augmented joint posterior is proportional to
The latent-normal Gibbs sampler for probit regression alternates two blocks. First, given the current , draw each independently from its truncated normal distribution, namely restricted to the sign fixed by . One exact method is to use the Box-Muller transform for , form , and reject until the sign is correct. The probability of success is positive at every finite parameter value, so the method is valid, although it can be slow for a rare sign.
For direct sign-truncated normal sampling, let , and draw . An inverse transform sampling implementation is
Use suitable tail or survival-function evaluations when floating-point probabilities approach zero or one; the rejection construction remains a valid alternative.
Second, completing the square in yields its full conditional distribution:
Generate a fresh standard normal value by the Box-Muller transform, multiply by the conditional standard deviation, and add the conditional mean. Start from any finite , alternate these steps, discard an initial transient and use the retained values to approximate its posterior distribution. These are dependent Markov chain Monte Carlo samples, rather than independent posterior draws. Each block is an exact Gibbs sampling update for the augmented posterior, whose marginal in is the requested posterior.
Let and denote the first- and second-stage sample means, let , and write . Continuation is the selection event . The second-stage sample mean stays independent of , so . The first-stage sample mean has a truncated normal distribution. With and the upper-tail Inverse Mills ratio ,
The positive conditional selection bias after futility continuation comes from selecting unusually large first-stage outcomes. The unconditional sample mean of a fixed observations would be unbiased; that is a different sampling distribution from the one restricted to continued trials.
As , , and , so the estimator bias tends to zero. It decreases with : differentiating gives , because for a standard normal random variable. Thus
Let , and write for the standard normal distribution density. For importance sampling, choose the proposal density , namely the uniform distribution on the target interval. Its importance sampling weight is
For iid uniform draws ,
is an unbiased estimator of the target mean, since its expectation integrates . If one chooses not to evaluate , the self-normalized importance sampling alternative has statistical consistency, but generally is not an unbiased estimator.
Alternatively, draw independent random variables with the standard normal distribution, let and , and use
Conditionally on , the retained draws are iid from the truncated normal distribution, so their average is an unbiased estimator with variance , where is its variance. If the ratio is undefined; one can continue drawing until a prescribed number of retained observations is obtained.
Here importance sampling uses every draw inside the interval, whereas only of the normal proposals are retained. The advantage can also be quantified. Integration using gives
For uniform importance sampling,
For the retained-draw ratio with a fixed total proposal budget, its asymptotic variance coefficient is . Thus this importance choice has substantially smaller error for the same proposal count; it also avoids wasting about two thirds of the standard normal distribution draws. This comparison is specific to this well-matched importance sampling proposal; arbitrary proposal choices do not share this guarantee.
The terms involving give
Completing the square produces the truncated normal distribution
For , its normalized density is on . The exponential prior shifts the untruncated conditional mean downwards before truncation; changing the variance here to the intrinsic variance would be incorrect. These are the other latent-variable updates of the formal Gibbs sampler.
For a fixed observed colour , Bayes' theorem gives
Completing the square shows that this is a truncated normal distribution with variance , lower endpoint zero, and untruncated location
Hence
Conditioning first on and using the law of total expectation yields the dusty colour-magnitude relation
As , the Inverse Mills ratio implies with vanishing derivative, so the asymptotic slope is . As , , so the asymptotic slope is .
Select units with first reading , keep that membership fixed, and measure the same units again. The first reading now has a truncated normal distribution. For a general finite threshold , write for the standard normal density and for the standard normal distribution function. Since ,
The tower property of conditional expectation lets us average the line over the selected group.[ref] At this gives
The average second reading is below the selection threshold even though every selected first reading exceeded it. This is a group expectation; any finite generated group's sample mean fluctuates around it. Selecting again on would define a different group and answer a different question.
The latent variable decomposition makes the apparent drop especially clear. Gaussian conditioning gives and . Thus
The first measurement error has zero unconditional mean, but positive selected mean. The second measurement error stays centered because it is independent of selection on . The persistent signal never changed.
Figure 1.
Selection captures an extreme first error while the persistent signal stays fixed
. Original synthetic repeated measurements, not actual measurements. Left: 40 generated units selected by ; orange trajectories move farther from zero. Right: analytic selected-group expectations decompose the first and second readings into persistent latent variable and measurement error. Black dots give generated group sample means after selecting from 60,000 synthetic units; their small departures from the bar totals reflect sampling variation. All selections use the first reading only. Details.