4. Mixture extensions
A single von Mises distribution has one preferred direction. Some data instead combine directed and undirected headings, or contain competing preferred directions. Mixtures extend the GLM and GLMM framework by combining observation densities with estimated weights.
Here \(\mathcal{M}\) denotes the von Mises density, \(n\) indexes observations, and \(i\) identifies an animal.
Directed and undirected headings: von Mises–uniform
The von Mises–uniform mixture (vMU) combines a directional component and a uniform component:
\(\omega_n\) is the probability that an observation comes from the directed component; \(1-\omega_n\) is the probability of the uniform component. \(\kappa_n\) describes consistency within the directed component. The model can therefore separate a change in the prevalence of directed headings from a change in their precision, rather than making one concentration absorb both.
Use the same circular-modulo and softplus links for \(\mu_n\) and \(\kappa_n\). For the weight, define a linear predictor with coefficients \(\boldsymbol{\gamma}\):
The inverse-logit, also called the sigmoid, maps an unconstrained prediction to a probability between zero and one. Its forward link is \(\operatorname{logit}(\omega)=\log[\omega/(1-\omega)]\). Predictors can change mean direction, directed-component concentration, and the directed fraction separately.
Which component could have generated an observation?
Let \(w_n=1\) denote the directed component and \(w_n=0\) the uniform component. For a particular parameter draw \(\Theta\),
This responsibility is a probability of component membership under the model. Evaluate it for each posterior draw and summarise across draws to include parameter uncertainty. A component's biological interpretation depends on the experiment; membership alone does not establish a behavioural mechanism. If \(\kappa_n\) is near zero, the directed component also becomes nearly uniform, making its weight difficult to distinguish from concentration.
Two competing directions: a two-component von Mises mixture
For two directional components,
Each component has a mean direction and concentration, with its own predictor effects if needed. The weight uses the same inverse-logit mapping as above. Two components need not produce two visibly separate peaks if they overlap; they describe candidate directional processes, and the fitted density should be checked against the observations. The mean of the whole mixture can lie between its preferred directions or be undefined when their effects cancel. Inspect the predictive density and component-specific predictions as well.
Add animal differences to a mixture
Mixture weights can vary among animals alongside component means and concentrations. For example, a hierarchical weight model is
\(c_i\) is an animal-specific offset and \(\tau_\omega\) its population standard deviation, with a suitable hyperprior. Component means and concentrations can have the same partially pooled coefficients described for GLMMs.
Repeated observations help distinguish animals that each mix between two directions from animals that consistently choose different directions. Priors on the weight offsets matter: narrow distributions favour similar weights among animals, while wider distributions allow weights close to zero or one. Check what those priors imply on the probability scale. This mixture specifies component probabilities for observations; temporal persistence or transitions between states require additional structure.
More than two components
For \(K\) directional components, the general model is
The weights \(\pi_{nk}\) are positive probabilities. Each component can use regressions for its mean and concentration, with the same links as before:
The softmax inverse link maps weight predictors to probabilities that sum to one:
Adding the same constant to every weight predictor leaves all weights unchanged. Fix one reference predictor, such as \(\eta_{\pi,nK}=0\), or impose a sum-to-zero constraint to remove this redundancy. This is separate from the component-label issue below. For numerical stability, subtract the largest weight predictor before evaluating the exponentials; the weights are unchanged. The locust mixture example uses two components; additional components require more data and careful evaluation.
Component labels and interpretation
With exchangeable von Mises components, swapping component labels leaves the mixture density unchanged. This label switching can make component-wise posterior averages misleading. Use scientifically justified identifying structure or appropriate posterior relabelling, and check the predictive density. Ordering angles requires an explicit circular reference convention.
Fixing one component to uniform removes the vMU model's label symmetry, but does not prevent weak identification when its components look similar. For either mixture, compare predictions with observed angular distributions at both animal and population levels before assigning biological meaning.
Python implementation
Specify mixture structure explicitly in PyMC. The
VonMisesMixture helper combines
von Mises components; component regressions, weight links, priors, and
identifying structure belong in the model specification. The vMU equation
also requires a uniform component. These mixture equations are not selected
by Bambi's single-component family="vonmises" setting.
See the biological examples for the locust mixture analysis and its data and execution requirements.