From angles to inference
Animal headings are circular data: values repeat after a full rotation, with no meaningful beginning or end. Circular models let us distinguish changes in mean direction from changes in directional variability. Bayesian inference combines prior information with observations to estimate these quantities and quantify uncertainty. These examples illustrate the process with simulated headings.
Infer a mean direction and concentration.
Ready
Observed directions
Posterior on the circle
Data
Mean direction across the predictor
Concentration across the predictor
Posterior geometry
Unconstrained space
ημ ∈ ℝ · ηκ ∈ ℝConstrained space
μ ∈ [−180°, 180°) · κ > 0Chains
Mean predictor ημ
Concentration predictor ηκ
Weight predictor ηw
Model details
Bayesian inference updates prior expectations with the evidence in the observations. The posterior describes plausible parameter values and the uncertainty that remains.
Link functions connect unconstrained values to valid model parameters. They keep directions within a complete circle, concentrations positive and mixture weights between zero and one. The paired posterior panels show how these constraints change the geometry of the same sampled uncertainty.
Markov chain Monte Carlo (MCMC) explores the posterior through a sequence of parameter values. Four chains start separately. An initial warmup period adapts the sampler and is excluded from the density estimates and uncertainty summaries. Restart replays the same data and deterministic chains; New data generates another set of observations.
Retained draws0
Acceptance—
Divergent proposals0
PhaseReady
Dots show observations, and dashed curves show the distribution used to generate them. Both circles plot radius as 1 + density, so density zero begins on the unit circle. They share the same fixed radial limit during sampling. For mixtures, the colored component curves include their mixing weights and add to the full density. The posterior band shows the central 90% of sampled density values at each angle; it is uncertainty about the density, not a range containing 90% of observations.
Posterior contours mark regions containing 50%, 80% and 95% of the displayed density. Single-distribution and two-treatment contours are evaluated numerically; mixture, regression and hierarchical contours are estimated from retained samples. The trace-coordinate selector lets you compare unconstrained sampling values with valid model parameters.
Compare the chains to assess whether they explore the same posterior. Acceptance and divergence counts provide useful checks, but acceptance alone does not establish convergence.
Repeated parameter values after a rejected proposal remain part of the posterior sample. Thin proposal paths show the sampler’s movement and are distinct from retained draws. More about MCMC.