Astroinformatics / Astrostatistics

Shift Fitting under Heteroskedasticity

A wrong width can move a peak. Unequal uncertainties decide which data pull hardest.

Read the lecture →
The principle The observation model matters. A fixed wrong width or slope can turn unequal errors into a systematic centroid or intercept shift.
Generated experiment
Truth / shift parameter
Fit assumptions

Data & Model

Fixed width / slopeSelected shift ± conditional SDSelected amplitude ± SDMean shift ± MC SEEmpirical shift SDNoiseless shift ± local SD95% cover truth / reference

What is fitted? What does uncertainty mean?

The experiment

Truth is y = x or the unit-normal density N(x; 0, 1). Observations are truth plus independent Normal(0, σᵢ²) noise, on an evenly spaced x grid. The noise SD is constant, linear, or log-linear across x. This is additive Gaussian noise even when fitting a Gaussian-shaped curve; these observations are not Gaussian-distributed x samples.

Each fixed slope m fits y = m x + b; the shift is b (true b = 0). Each fixed width s fits y = A N(x; μ, s); the shift is μ (true μ = 0), with unrestricted amplitude A (true A = 1). Widths and slopes are deliberately fixed, not estimated.

Weighting is part of the inference

The R reference minimizes Σ residual²/σ, not the known-noise Gaussian likelihood Σ residual²/σ². Both are available, alongside equal weights. “Correction” preserves its extra step: regress absolute residuals on the fitted response, then multiply the base weights by inverse squared predicted residual size. This is a data-dependent heuristic, not recovery of known σ(x). Negative or zero predicted scales are rejected explicitly.

Bias, spread and reference

The mean shift estimates bias relative to the true zero shift. MC SE describes uncertainty of that simulation mean; it is not the uncertainty of one fit. Empirical SD describes scatter between noise realisations. The noiseless reference is the optimum for the true curve under the chosen fixed width/slope and base weights; it can differ from zero under misspecification. Its SD is hypothetical noise propagation around that reference, not uncertainty in the known truth.

Conditional SD uses the actual generating σᵢ, not an estimated residual variance. It is exact for a linear intercept with fixed weights. For Gaussian centroids and amplitudes it is a local sensitivity approximation using the full residual-curvature Hessian, conditional on the fixed width. It need not give 95% coverage at high noise or with wrong widths. Boundary/singular fits have no symmetric interval; coverage lists only fits with an interval and reports the denominator. The heuristic has no analytic intervals, and its noiseless reference remains the base-weight reference.

Precisely, Var(b) = Σwᵢ²σᵢ² / (Σwᵢ)². For Gaussian parameters, the local covariance is H⁻¹BH⁻¹, where J is the fitted-response Jacobian, W = diag(wᵢ), B = JᵀW diag(σᵢ²) WJ, and H = JᵀWJ − Σwᵢrᵢ∇²fᵢ includes residual curvature. Displayed SDs are square roots of covariance diagonals. Coverage is the fraction of available intervals shift ± 1.959964 SD containing zero or the noiseless reference, respectively. MC SE = empirical SD / √(number of realisations).

Deliberate translation decisions

Data are shared across fitted models and held fixed when fit/display controls change: paired comparisons remove the R plot's accidental resimulation. Gaussian centroids are searched across the displayed x interval, with exact amplitude profiling and explicit boundary warnings, rather than trusting one unconstrained local start. A peak outside the sampled interval cannot be reliably identified here.

The Bias–Width view shows a descriptive line through group means. Bands propagate paired whole-realisation trends: ±1.96 MC SE for the mean and ±1.96 SD for realisation-to-realisation spread. They are normal approximations, not the independent-observation regression confidence/prediction intervals of the R reference, and the relationship need not be linear. Poissonian and Gamma were selectable labels in R, but selecting either stopped with “not yet implemented”; no corresponding truth, fit or noise likelihood existed. They remain explicitly disabled here. The R linear correction's incorrect “width” argument is fixed to slope.

Other display/control differences from R: common-bin histograms replace rectangular-kernel density curves; axes auto-range instead of clipping to fixed y limits; up to 100 ensemble curves are selected deterministically, avoiding the R sampling failure below 100 realisations. Logarithmic counts are rounded explicitly, underidentified fits and excessive workloads are rejected rather than silently altered, and annotation scaling affects headings and legends. Data settings apply with Generate data; fit settings refit existing observations, and figure, realisation and annotation settings only redraw.