Burn-in 2026-10-20
The initial segment of a Markov chain Monte Carlo run discarded to reduce dependence on its starting state. A fixed discarded count is a choice to assess using Markov chain Monte Carlo convergence diagnostics, not a proof that the retained sample has reached its stationary distribution.
Nonlinear regression 2026-10-14
Nonlinear regression fits a conditional mean whose dependence on its parameters is nonlinear. In a normal distribution observation model, the likelihood is based on residuals . Nonlinearity can create parameter trade-offs, asymmetric uncertainty and several posterior regions, so prior predictive checks and Markov chain Monte Carlo convergence diagnostics can be especially useful.
The hierarchical Bayesian model separates variability between individuals from variability between repeated measurements on an individual. In WinBUGS, dnorm takes a precision parameter, so inverse variance is the appropriate second argument.
Line (1) gives , hence a positive log-normal distribution for each within-individual variance. Estimating the shared parameters supplies partial pooling of these variances without forcing them equal. Line (2) assigns a proper bounded flat prior to the between-individual standard deviation , and line (3) does the same for the standard deviation on the log-variance scale. The broad bounded priors on and are also proper.
This is a reasonable structure for heterogeneous repeated measurements, but flat does not mean uninformative on all transformed scales. The bounds must be wide enough for plausible values, while such enormous ranges can put substantial mass on implausible predictions. Use prior predictive checks and sensitivity analysis, and check the Markov chain Monte Carlo convergence diagnostics. Serial dependence or systematic trends would require an extension of the independent-measurement likelihood.
Fit both hierarchies to the historical data and compare their posterior predictive checks. Use discrepancies sensitive to between-individual tails, such as the maximum standardized personal mean, tail counts and the spread of individual sample means. Simulate new individual means as well as repeated observations; conditioning only on fitted personal means would conceal a poor population model.
Leave whole individuals out for cross-validation, rather than just measurements, when the aim is prediction for a new individual. Compare held-out predictive log densities or interval calibration, with uncertainty in the comparison. Check both fits' Markov chain Monte Carlo convergence diagnostics and sensitivity to scale priors. Better tail prediction and adequate calibration would support the heavier-tailed model; the data are required to decide, so no empirical winner can be asserted here.
Centre and scale both predictors, particularly the raw dose whose scale is much larger than that of . For example use , and the linear predictor . This reduces the intercept-slope correlations and numerical scale disparities; further orthogonalizing correlated columns or updating coefficients jointly can improve Markov chain Monte Carlo mixing. The exact old prior can be retained through the corresponding coefficient transformation; assigning new independent priors to transformed coefficients would instead change the prior.
For weakly informed plate effects or small , use the non-centred Gaussian random-effect parameterisation with . This often reduces dependence between the scale and local effects; it is not guaranteed to outperform the centred version when plate effects are strongly informed. Sensibly calibrated proper priors also avoid the enormous initial log intensities permitted by the stated coefficient ranges. Use dispersed chains and Markov chain Monte Carlo convergence diagnostics to assess stationarity, agreement between chains and effective sample size of a Markov chain. Reparameterization can improve mixing; simply retaining more iterations does not remove poor mixing.
Introduce independent component indicators , and auxiliary slab effects , independent of the indicators. Set . Then inactive genes have exactly zero effect, while active genes have the stipulated normal distribution. With supplied as known data and elicited positive beta shapes, one suitable WinBUGS model is
model {
q ~ dbeta(aq, bq)
for (i in 1:N) {
z[i] ~ dbern(q)
u[i] ~ dnorm(0, 1/V)
theta[i] <- z[i]*u[i]
y[i] ~ dnorm(theta[i], 1)
}
}
The normal arguments are precisions, not variances. Supply all observed y values, monitor q, theta and optionally z, and assess Markov chain Monte Carlo convergence diagnostics. The proper auxiliary prior remains defined for inactive genes, where is not informed by the likelihood. This represents the exact point-null mixture prior, rather than replacing its point mass by a narrow continuous spike. Conditional on the indicators, has beta distribution , providing a useful check on the update.
Center the log-time predictor and the baseline log measurement near their sample means, so the intercept describes a typical predictor configuration. This reduces intercept-slope posterior correlation and can improve Markov chain Monte Carlo mixing. If exactly the original model is required, transform the intercept prior consistently when changing coordinates rather than silently assigning a different independent prior.
For weakly informed child effects, a non-centered Gaussian random-effect parameterization can also help:
This retains the same conditional prior distribution for but removes its prior-scale dependence from the sampled . It can reduce strong dependence between the effects and . A centered parameterization can be better when each child's effect is very accurately observed, so improvement is not automatic. Blocking strongly correlated coefficients is another option. Check the resulting chains with Markov chain Monte Carlo convergence diagnostics and effective sample size of a Markov chain, rather than judging convergence from the number of iterations alone.
In Markov chain Monte Carlo, retain the derived quantity at every iteration. Rough BUGS code using the actual observations is
model {
  pM ~ dbeta(0.5,0.5)
  pT ~ dbeta(0.5,0.5)
  milkAnswers ~ dbin(pM,4)
  teaAnswers ~ dbin(pT,4)
  delta <- pM-pT
  positive <- step(delta)
}
Supply milkAnswers=3 and teaAnswers=1. Summarize delta by its posterior mean, empirical quantiles and credible interval; the average of positive estimates . Here . Check Markov chain Monte Carlo convergence diagnostics before interpreting the simulation. Since both Bayesian posteriors are independent known beta distributions, direct independent sampling is an equally valid, simpler way to obtain the same summaries.
Represent the independent locally flat intercept prior distributions by broad finite uniform priors, for example on ; this is proper and approximately constant over plausible mortality logits. With calibrated above, rough BUGS code is
model {
  mu ~ dnorm(0,0.25)
  tau ~ dunif(0,A)
  invtau2 <- pow(tau,-2)
  for (j in 1:J) {
    alpha[j] ~ dunif(-10,10)
    beta[j] ~ dnorm(mu,invtau2)
    logit(thetaC[j]) <- alpha[j]-beta[j]/2
    logit(thetaT[j]) <- alpha[j]+beta[j]/2
    rC[j] ~ dbin(thetaC[j],nC[j])
    rT[j] ~ dbin(thetaT[j],nT[j])
    oddsRatio[j] <- exp(beta[j])
  }
}
Use and supply treated death counts with totals , and control death counts with totals . In BUGS, the second dnorm argument is a precision parameter, so 0.25 corresponds to variance four. Initialize the positive scale away from zero. Monitor and study odds ratios, checking Markov chain Monte Carlo convergence diagnostics and sensitivity to the finite intercept bounds and scale prior distribution. The fitted hierarchy combines binomial sampling uncertainty with between-study heterogeneity.
A log-flat improper prior is not appropriate when all known are positive: the integrated likelihood in (iii) has a positive finite limit as , so its integral against diverges. One defensible noninformative choice is the scalar Jeffreys prior for an additive variance component, calculated holding the mean parameters fixed:
Indeed the normal variance score has information . This is a scalar conditional-information prior, not a claim that its product with the flat mean prior is the joint Jeffreys prior. It is bounded near zero and is at infinity. The integrated likelihood is uniformly bounded near zero and is bounded by a constant times at infinity, independently of the mean-shape parameters, since . Thus and a proper external prior on the physically admissible ensure posterior propriety. Proper weak scale priors are another option. If known errors vanish, the boundary argument and appropriate prior need separate reconsideration.
For an efficient parameterization, use with and . A chain on this joint reduced parameter space targets
The factor is the Jacobian determinant. At each iteration propose , with for a fixed nonsingular proposal covariance, and accept with probability . Proposals outside the physical prior domain have target zero. Tune during warmup and freeze it for the retained random-walk Metropolis algorithm. To obtain samples of the full original parameter vector, independently draw from its retained positive prior and reconstruct ; the resulting vector is . Analytically marginalizing using (iii) would also be valid.
Use several dispersed chains, trace plots, rank-normalized split , and the effective sample size of a Markov chain for each parameter and for . These Markov chain Monte Carlo convergence diagnostics reveal poor mixing and disagreement but do not prove convergence. Estimate the integrated autocorrelation time ; with retained draws, . Default to no thinning of a Markov chain, so the thinning factor is . If storage requires thinning, choose a spacing after inspecting the autocorrelation and verify the retained-chain effective sample size; no finite spacing guarantees independent draws.
Using the retained samples, compute
These are posterior summaries, provided the corresponding moments exist, not uncertainties of the numerical estimates. A proper prior alone does not ensure finite second moments; choose or check the external prior accordingly. The Monte Carlo standard error of the posterior mean is approximately .
Use several complementary Markov chain Monte Carlo convergence diagnostics, monitoring both and rather than judging the chain solely by its length:
A million iterations and stable-looking plots do not prove convergence. Agreement across dispersed chains, exploration of all visible modes and adequate effective sample size of a Markov chain provide stronger evidence. Estimate the Monte Carlo standard error using the chain's autocorrelation; the independent random variables formula from 3(b)(ii) does not apply directly to these dependent draws.