Skip to content

Package: bayesian

Nodes for Bayesian inference.

These nodes can be used to specify statistical models and perform Bayesian inference on them using a variety of algorithms. Simply put, the main use case is to quantify and propagate uncertainty through statistical analyses, This yields distributions over resulting quantities which may be further reduced to confidence intervals or other kinds of error bars, or which can also be propagated through most downstream computations. See also the distributions package for the predefined probability distributions. List elsewhere in NeuroPype, observations are typically indexed using the instance axis, features using the feature axis, and so forth, but the nodes can handle any other axes that the input data may contain, and these will propagate through the operations as expected. Note that distributions can be constructed from tensors with extra axes, which is a powerful tool to cause batches of random variables to be drawn from the same distribution; likewise, Random Draw and With Stacked Variables each offer several ways in which extra axes can be introduced, including from template data (via the like= input). Inference results can either be summarized with a statistic axis (indexing, e.g., mean, standard deviation, etc) or with a distribution axis (representing a sample of alternative draws from the posterior distribution). The latter is useful for propagating uncertainty through downstream computations, such as plotting or other post-hoc analyses. The main nodes to use are the Inference nodes, which perform the actual inference and are given a statistical (generative) model. The model itself is made up of Random Draw nodes interspersed with other nodes, and optionally With Stacked Variables, At Subscripts, and (rarely) Log Probability Term. The following node groups exist, which are mainly to configure more finely the behavior of the inference process: - nodes ending in Approx represent types of variational approximations - nodes ending in Sampler represent different sampling algorithms such as NUTS, HMC, and so forth.

Nodes in this package: