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.
The standard normal distribution function gives
The observations are independent Bernoulli random variables, because the original errors are independent. Thus the probit regression has intercept and coefficient vector . With the specified known and , recovery is
The scale would not be recoverable from threshold data alone if were unknown.
The most plausible cause is strong dependence between the latent variables and covariance hyperparameters in their joint posterior distribution. In the usual conditionally independent Gaussian process classification model, put , , and . The probit regression likelihood is , while has a multivariate normal distribution with covariance matrix .
For distinct inputs and positive length scales, is positive definite. Its Gaussian probability density function contributes
The unit-rate exponential prior distribution on therefore gives
Its scale is tightly tied to the current magnitude and shape of . Changing changes the eigenvectors and eigenvalues of its covariance matrix; a latent vector typical under the old covariance may be very atypical under a substantially different one. Holding fixed can thus restrict the range of a hyperparameter update, and holding the hyperparameters fixed restricts the next latent-function update. Even exact sampling of each full conditional distribution can move slowly along a narrow ridge of the joint posterior distribution.
Binary observations provide limited information about the absolute size of large correctly signed latent values. This can leave substantial scale uncertainty and strengthen the dependence. Long correlation lengths can also make the covariance matrix nearly singular and the latent coordinates highly dependent. These are plausible explanations for a large mixing time, not proofs that every data set causes slow convergence. A blocked Gibbs sampler removes dependence within its chosen blocks, but not dependence between them. Repeated identical inputs should be represented by one shared latent value; otherwise the nominal Gaussian matrix is singular and the displayed inverse formula must be replaced by a representation on its support.
Put and . The probit regression likelihood is , so with the stated normal prior,
Differentiating gives the probit posterior score
Equivalently, the th likelihood term is . The prior's gradient is essential.
This posterior density is smooth, positive everywhere, and bounded above by a constant times the Gaussian prior, since the likelihood is at most one and has positive normalizing constant. Its derivatives are integrable: differentiating a likelihood factor gives a bounded normal density, and differentiating the prior gives a linear factor times a Gaussian. Integration by parts therefore yields
Thus each component has a known zero expected value and can be used as a posterior score control variate. This identity differentiates the posterior density in the random parameter; it is distinct from the usual mean-zero score identity for a likelihood under repeated sampling.
The requisite second moments are finite. For , is bounded. For ,
Hence the score grows at most exponentially in , and the Gaussian upper bound on the posterior gives finite second moments. For a fixed vector , averaging is therefore an unbiased Monte Carlo estimator of the same mean; suitable coefficients can reduce its variance.
A generalized linear model assumes that the independent responses have distributions in an exponential family, with means , and that
The invertible function is the link function; it connects the mean to the linear predictor.
For binomial regression, write independently, so . The logistic regression link is
while probit regression uses
where is the standard-normal distribution function. The logit is the canonical link function for the binomial family.
The commands choose observations and predictors; generate a matrix of independent standard-normal values; generate independent binary random variables with success probability ; and report the observed number of successes, . The first glm call then fits the Bernoulli logistic-regression model
The prediction command returns the fitted response probabilities and sums them.
The likelihood is
At the maximum-likelihood estimator, the intercept component of the score function is
Therefore
exactly, by the fitted-mean balance for logistic regression with an intercept.
The second fit uses probit regression,
where is the standard normal distribution function. Its intercept score is
a weighted residual equation. It does not imply , so exact equality is not expected. The output should nevertheless be close to : the data were generated with constant success probability independently of , so the fitted slopes should be small, the linear predictors should cluster near a common intercept, and the score weights should be nearly constant.
Probit posterior score Created 2026-10-05 Updated 2026-10-06
For probit regression with and prior , the posterior score control variate is
For , its covariance with the score is . It is nonzero whenever , ensuring strict improvement by the optimal control variate.