Skip to main content

Infer.NET user guide : : The Infer.NET Modelling API

Variable types and their distributions

The following table shows what types of variables are supported by Infer.NET, along with the distributions which are available for representing uncertainty in each type. You can create variables for each of these types using the static methods on Variable for each distribution. Some distributions with experimental quality band are not shown in this table.

Variable type Restrictions Distribution Distribution Class Example of use
bool - Bernoulli Bernoulli Two coins tutorial
double - Gaussian Gaussian Learning a Gaussian tutorial
double between 0 and infinity Gamma Gamma Learning a Gaussian tutorial
double between 0 and 1 Beta Beta Clinical trial tutorial
double between settable lower and upper bounds Truncated Gaussian TruncatedGaussian -
double between 0 and settable period length Wrapped Gaussian WrappedGaussian -
double between a lower bound and infinity Pareto Pareto -
int between 0 and D-1 inclusive Discrete (categorical) Discrete Latent Dirichlet Allocation
int between 0 and infinity Poisson Poisson -
int between 0 and N inclusive Binomial Binomial -
enum - Discrete over enum values DiscreteEnum -
Vector - Vector Gaussian VectorGaussian Mixture of Gaussians tutorial
Vector each element between 0 and 1, elements sum to 1 Dirichlet Dirichlet Latent Dirichlet Allocation
PositiveDefiniteMatrix matrix is positive definite Wishart Wishart Mixture of Gaussians tutorial
string - Probabilistic automaton StringDistribution Hello, Strings!
char - Discrete over char values DiscreteChar -
TDomain[] T is a value-type distribution over a domain TDomain Array of distributions considered as a distribution over an array DistributionStructArray<T, TDomain> -
TDomain[,] T is a value-type distribution over a domain TDomain 2-D Array of distributions considered as a distribution over a 2-D array DistributionStructArray2D<T, TDomain> -
TDomain[] T is a reference-type distribution over a domain TDomain Array of distributions considered as a distribution over an array DistributionRefArray<T, TDomain> -
TDomain[,] T is a reference-type distribution over a domain TDomain 2-D Array of distributions considered as a distribution over a 2-D array DistributionRefArray2D<T, TDomain> -
ISparseList<bool> - Sparse list of Bernoulli distributions considered as a distribution over a sparse list of bools SparseBernoulliList -
ISparseList<double> elements between 0 and 1 Sparse list of Beta distributions considered as a distribution over a sparse list of doubles SparseBetaList -
ISparseList<double> - Sparse list of Gaussian distributions considered as a distribution over a sparse list of doubles SparseGaussianList -
ISparseList<double> elements between 0 and infinity Sparse list of Gamma distributions considered as a distribution over a sparse list of doubles SparseGammaList -
IList<int> elements between 0 and N-1 inclusive SparseBernoulliList where domain is list of indices with value true BernoulliIntegerSubset -
IFunction - Sparse Gaussian Process SparseGP Gaussian process classifier

Notes: