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.
|
Variable type |
Restrictions |
Distribution |
Distribution Class | Example of use |
|
bool |
- | Bernoulli | Two coins tutorial | |
| double | - | Gaussian | Learning a Gaussian tutorial | |
|
between 0 and infinity |
Gamma | Learning a Gaussian tutorial | ||
| between 0 and 1 | Beta | Beta | Clinical trial tutorial | |
| between settable lower and upper bounds |
TruncatedGaussian | - | ||
| between 0 and settable period length | Wrapped Gaussian | WrappedGaussian | - | |
| int |
between 0 and D-1 inclusive |
Discrete (categorical) |
Discrete | Latent Dirichlet Allocation |
| between 0 and infinity | Poisson | - | ||
| enum | - | Discrete over enum values | DiscreteEnum | - |
| Vector | - | VectorGaussian | Mixture of Gaussians tutorial | |
| each element between 0 and 1,
elements sum to 1 |
Dirichlet | Latent Dirichlet Allocation | ||
|
PositiveDefiniteMatrix |
- | Wishart | Mixture of Gaussians tutorial | |
|
IFunction |
- | SparseGP | Gaussian process classifier |
Notes:
- For descriptions of the Vector and PositiveDefiniteMatrix see the page on Vector and Matrix types.
-
IFunction is an interface type which is used as the domain type for a SparseGP distribution. This interface has a single Evaluate method for a Vector domain:
double Evaluate(Vector v);

