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.

TableDistribution (deprecated)

TableDistribution was a DiscreteConditional that stored its probabilities in a sparse table. A DiscreteConditional can now store its probabilities in any DiscreteFactor, so constructing one from a TableFactor gives the same sparse representation without a separate class.

TableDistribution is deprecated in GTSAM 4.3. In C++ it is available only when GTSAM_ALLOW_DEPRECATED_SINCE_V43 is enabled, and it is no longer wrapped in Python. This page shows the replacement for each use.

Open In Colab

Creating a distribution

Normalize a TableFactor into a DiscreteConditional, taking all of its keys as frontals. The conditional keeps the sparse table, which factor() returns.

Evaluating and choosing values

The conditional supports evaluate(), logProbability(), argmax(), and sample(). evaluate() expects DiscreteValues; argmax() returns the most likely frontal value for the supplied parent assignment.

Multiple keys and table access

For a joint distribution over several keys, take all of them as frontals. toTableFactor() replaces table(), and toTableFactor().argmax() replaces argmax() for the most likely assignment to all keys. As before, choose(given) fixes parent values and marginal(key) removes other frontals by summation.

Source

DiscreteConditional.h, TableFactor.h, and the deprecated TableDistribution.h.

AI assistance caveat

AI was used to help draft this documentation, and inaccuracies could be present.