Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

ConcentratedGaussian

A unified probabilistic primitive in GTSAM for representing a (possibly shifted) Gaussian density on a manifold value type. This notebook serves three audiences:

  1. General GTSAM users who just want a probability-like object.

  2. EKF users receiving ConcentratedGaussian outputs.

  3. Advanced users leveraging transport, reset, and fusion of Left Extended Concentrated Gaussians (L-ECGs).

Related notebooks: PriorFactor, ExtendedPriorFactor.

Open In Colab

1. General Usage

ConcentratedGaussian<T> behaves like a continuous probability density over a manifold variable T. For Gaussian noise models it evaluates to properly normalized probabilities (up to floating-point limits):

  • Construct with origin o, covariance Σ (or noise model), and optional tangent mean m.

  • Error term internally: e(x) = -Local(x, o) - m (if mean provided).

  • Probability: P(x) = exp( logProbability(x) ).

  • evaluate(x) is a convenience synonym for P(x).

We’ll start with a simple 2D example using Point2 (Euclidean).

Loading...

Adding a Tangent-Space Mean

A non-zero mean shifts the mode to origin.retract(mean) (Point2: just addition).

Mode probability (approx peak): 0.6015491419254174
Loading...

Pose2 Example with Samples (Banana Shape)

Let us simulate a vehicle taking N steps, but with large uncertainty in angle. To obtain a pronounced “banana” distribution we simulate many short forward motion increments with heading noise. Each sample is a random walk of small steps:

  1. Start at identity pose.

  2. For each of K steps, sample a small forward translation with little lateral drift and a heading perturbation.

  3. Compose these incremental poses.

  4. Record the final (x,y,theta).

Accumulated heading noise bends trajectories, producing a curved (banana-like) marginal over (x,y).

Source
Loading...

Just as in the RSS 2008 paper, “The Banana Distribution is Gaussian”, we can now fit a Gaussian *to the exponential coordinates:

ConcentratedGaussian on 20
  origin:  (0, 0, 0)
  tangent space mean: [2.36917357; -0.0453072606; 0.694605119];
  noise model: Gaussian [
	16.4385844, -0.0183798711, -0.0487508153;
	0, 3.66909727, 0.227405048;
	0, 0, 2.57923483
]

Loading...

The banana shape crucially depends on having a Gaussian with a mean far from the origin: geodesics in Pose2 trace out circles in the x-y plane, and hence an offset Gaussian, as provided by ConcentratedGaussian, is able to approximate the banana distribution well.

We can even analytically predict the Gaussian:

Loading...

2. EKF Perspective

An Extended Kalman Filter (EKF) posterior can be represented as a ConcentratedGaussian:

  • Origin: the linearization/reference state.

  • Tangent mean: offset from origin to the mode.

  • Covariance: uncertainty in that tangent space.

Before using this posterior as a prior for the next prediction, call reset() to move the origin to the mode and zero the mean (keeping covariance transported).

Origin: (1, 2, 0.2)

Mode  : (1.31388691, 1.96159414, 0.35)

Mode probability: 9.769507109185751
After reset -> origin == mode? False
Reset mean (should be empty/None): None
Loading...

3. Advanced Operations: L-ECG Mechanics

ConcentratedGaussian implements a Left Extended Concentrated Gaussian (L-ECG). Advanced capabilities:

  1. reset() – Move origin to mode, zero the tangent mean, transport covariance.

  2. transportTo(x_hat) – Express density in a new chart (new origin) inducing a mean and transported covariance.

  3. operator* – Approximate fusion of two densities (same key) in a common chart followed by reset.

Below: transport and fusion examples (Pose2).

Fused origin: (0.320684765, 0.704438054, -0.130899694)

Fused mean (should be None): None
Source
Loading...

Caveats

  • Fusion and transport are first-order; for large separations, consider iterative refinement.

  • Large tangent means may signal re-centering (reset) to maintain Gaussian fidelity.

  • Current examples track covariance externally for sampling; exposing underlying Gaussian model in Python would make advanced visualization easier.

Summary

ConcentratedGaussian = manifold-aware Gaussian density: basic probability evaluation (Section 1), EKF posterior handling with retractMean()/reset() (Section 2), and geometric operations (transport, fusion) for advanced workflows (Section 3). Choose the simplest interface that solves your task.