Aleator.Library 0.5.1

dotnet add package Aleator.Library --version 0.5.1
                    
NuGet\Install-Package Aleator.Library -Version 0.5.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Aleator.Library" Version="0.5.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Aleator.Library" Version="0.5.1" />
                    
Directory.Packages.props
<PackageReference Include="Aleator.Library" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Aleator.Library --version 0.5.1
                    
#r "nuget: Aleator.Library, 0.5.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Aleator.Library@0.5.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Aleator.Library&version=0.5.1
                    
Install as a Cake Addin
#tool nuget:?package=Aleator.Library&version=0.5.1
                    
Install as a Cake Tool

Aleator.Library

Standard element library of Aleator, the C# port of the Figaro probabilistic programming library:

  • Atomic continuous distributions — Normal, Uniform, Exponential, Gamma, Beta, Dirichlet, InverseGamma, LogNormal, StudentT, Cauchy, Laplace, Weibull, Pareto, ChiSquared, Gumbel, LogisticDistribution, Rayleigh, SkewNormal, VonMises, MultivariateNormal (Cholesky), OrderedNormal (an increasing vector: ordinal cutpoints), KernelDensity.
  • Atomic discrete distributions — Binomial, BetaBinomial, Poisson, ZeroInflatedPoisson, HurdlePoisson, Geometric, NegativeBinomial, ZeroInflatedNegativeBinomial2, Hypergeometric, Multinomial, OrderedLogistic, OrderedProbit, CategoricalLogits, UniformInt, FromRange, SwitchingFlip, IntSelector (with OneShifter MH proposals).
  • Element-parameter (Compound*) forms of every family — CompoundNormal, CompoundStudentT, CompoundLogNormal, CompoundCauchy, CompoundLaplace, CompoundExponential, CompoundGamma, CompoundInverseGamma, CompoundWeibull, CompoundPareto, CompoundChiSquared, CompoundBeta, CompoundUniform, CompoundGumbel, CompoundLogisticDistribution, CompoundRayleigh, CompoundSkewNormal, CompoundVonMises, CompoundDirichlet, CompoundMultivariateNormal (element mean), CompoundBinomial, CompoundBetaBinomial, CompoundPoisson, CompoundZeroInflatedPoisson, CompoundHurdlePoisson, CompoundNegativeBinomial2 (mean and dispersion), CompoundZeroInflatedNegativeBinomial2, CompoundGeometric, CompoundOrdinal (ordered logistic or probit), CompoundCategoricalLogits, CompoundSelect, CompoundDist. These take their parameters from other elements, which is what makes a hierarchy a graph edge rather than a hand-rolled Chain: inference, learning discovery and the gradient bridge all read the dependency off Arguments.
  • Truncated — any distribution that answers ICumulativeDistribution (Normal, Exponential, Uniform, LogNormal, Gamma, Beta, InverseGamma, StudentT, ChiSquared, Cauchy, Laplace, Weibull, Pareto, Gumbel, LogisticDistribution, Rayleigh, and Truncated itself) restricted to an interval and renormalised over it. Drawn by inverting the CDF, so no sample is rejected and a window in the far tail is sampled as readily as one at the mode.
  • Censored — a distribution clipped to an interval, the mass beyond a bound moved onto it (the Tobit model of a saturating measurement): the inner density inside, the censored mass at a bound, so an observation recorded at a detection limit is scored as "at or beyond it". Mixture — a finite mixture with fixed weights as one atomic distribution, with a density, a CDF when the components have one, and draws.
  • CompoundTruncated, CompoundCensored, CompoundMixture — the same wrappers over families whose parameters are elements (y ~ normal(mu, sigma) T[0,], a Tobit record with a latent mean, a mixture with latent means or Dirichlet weights), renormalising, censoring or mixing at the parameters sampled in each world. The Alea factories pick them from the family the factory lambda returns.
  • Deterministic combinators — CPD / RichCpd pattern matching, Inject, tuples, boolean/arithmetic operators.
  • Open-universe collections — Container, Process, FixedSizeArray, MakeArray, VariableSizeArray, MakeList.
  • Decisions (Decision, policies), references, nonparametrics (Dirichlet-process mixture, CRP, IBP), and the Aleator.Language.Alea static factory facade.
using static Aleator.Language.Alea;

var bias = Beta(2, 5);
var coin = Flip(bias);

// A hierarchy: each level takes the one above it as a parameter.
var mu = Normal(0, 10);
var theta = Normal(mu, 1.0);
var y = Normal(theta, 1.0);

// A scale that cannot be negative, sampled exactly rather than by rejection.
var sigma = TruncatedNormal(0, 3, lower: 0);

// A robust likelihood and a truncated one, both with latent parameters.
var slope = Normal(0, 5);
var obs = StudentT(4.0, slope, sigma);
var positive = TruncatedNormal(slope, sigma, lower: 0);

// Over-dispersed counts on the log link, and an ordinal response with ordered latent cutpoints.
var counts = NegativeBinomial2(Exp(slope), 3.0);
var rating = OrderedLogistic(slope, OrderedNormal(3, 0, 2));

Zero third-party dependencies. Pair with Aleator.Algorithms for inference.

Documentation: atalib.com/docs. Runnable examples: atalib.com/examples.html.

Questions, bug reports and feedback: contact the maintainers through nuget.org. The source repository is private, so there is no public issue tracker yet. Report a suspected vulnerability the same way, with SECURITY: at the start of the subject, and do not disclose it publicly before it is fixed.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Aleator.Library:

Package Downloads
Aleator.AutoDiff

Reverse-mode automatic differentiation, unconstraining transforms, and a differentiable joint-density builder for gradient-based inference (HMC/NUTS/ADVI/SVGD, Gaussian processes) in Aleator.

Aleator.Algorithms

Inference algorithms (VE, BP, Importance, Metropolis-Hastings, Gibbs, EM, particle filtering, lazy, structured, causal) for Aleator.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.5.1 61 11/21/2026
0.4.1 165 11/12/2026
0.3.0-preview.1 166 9/6/2026