Skip to main content

bayesian

Function bayesian 

Source
pub fn bayesian(
    observed: Option<&Observations>,
    stated: &Stated,
    noise: Noise,
    forward: &mut dyn Forward,
    sampling: Sampling,
) -> Bayesian
Expand description

The Bayesian option (ADR-317, ADR-320): fit, then the posterior of its unknowns drawn around its answer by posterior::sample_in_two, each draw a flight flown.

The posterior is the least-squares fit’s own on the heights: the same residuals at the same noise, the noise widened for a residual that runs on from bin to bin as the fit’s errors widen it, the same bins read and the same priors. On a track whose noise the fit takes from the log, it reads the drift through a receiver’s navigation filter and integrates out the track’s noise, its run and the pad’s position (ADR-321, Problem::track_noise_integrated); its draws are then centered near that posterior’s peak, by three Gauss-Newton steps. The sensor’s four linear unknowns (height offset, gain, drift, port) are integrated out in closed form, −2 ln p(θ) = χ²_min(θ) + ln det H(θ), so seven unknowns are drawn: the six flown and the clock. On a log of height alone the wind’s shear exponent is an eighth, uniform on [0, SHEAR_EXPONENT]. The wind is drawn first, from its block of the fit’s covariance at the answer; the rest about where one Gauss-Newton step puts them in that wind, from their covariance given the wind; a pilot widens either block’s scale where the posterior reaches further. Its 90% credible intervals are the posterior’s 5% and 95% points as they come: no shares widen them.