liesel.model

liesel.model#

Liesel modeling framework.

Functions

dist_reg_mcmc(model, seed, num_chains[, ...])

Configures an EngineBuilder for a distributional regression model.

tau2_gibbs_kernel(group)

Builds a Gibbs kernel for a smoothing parameter with an inverse gamma prior.

PIT(_input[, distribution, name])

A weak variable evaluating a probability integral transform (PIT).

Addition(*inputs[, distribution, name])

A weak variable calculating an element-wise sum.

Bijector(_input, bijector[, inverse, ...])

A weak variable evaluating the forward() or inverse() method of a TFP bijector.

ColumnStack(*inputs[, distribution, name])

A weak variable stacking its inputs column-wise.

DesignMatrix(value[, distribution, name])

A strong variable representing a design matrix.

Hyperparameter(value[, distribution, name])

A strong variable representing a hyperparameter.

InverseLink(_input, bijector[, inverse, ...])

A weak variable representing an inverse link function.

Parameter(value[, distribution, name])

A strong variable representing a model parameter.

Predictor(*inputs[, distribution, name])

A weak variable representing a regression predictor.

RegressionCoef(value[, distribution, name])

A strong variable representing a vector of regression coefficients.

Response(value[, distribution, name])

A strong variable representing a response vector.

Smooth(x, beta[, distribution, name])

A weak variable calculating the matrix-vector product x @ beta.

SmoothingParam(value[, distribution, name])

A strong variable representing a smoothing parameter.

load_model(file)

Loads a model from a dill file.

save_model(model, file)

plot_nodes(model[, show, save_path, width, ...])

Plots the nodes of a Liesel model.

plot_vars(model[, show, save_path, width, ...])

Plots the variables of a Liesel model.

Classes

DistRegBuilder()

A model builder for distributional regression models.

GraphBuilder([to_float32])

A graph builder, used to set up a Model.

Model(nodes_and_vars[, grow, copy, to_float32])

A model with a static graph.

Calc(function, *inputs[, _name, ...])

A Node subclass that calculates its value based on its inputs nodes.

Data(value[, _name])

A Node subclass that holds constant data.

Dist(distribution, *inputs[, _name, _needs_seed])

A Node subclass that wraps a probability distribution.

Group(name, **nodes_and_vars)

A group holds a collection of related Var and/or Node objects.

InputGroup(*inputs[, _name, _needs_seed])

A node that groups its inputs for another node.

Node(*inputs[, _name, _needs_seed])

A node of a computational graph that can cache its value.

NodeState(value, outdated[, extra])

The state of a node.

TransientCalc(function, *inputs[, _name, ...])

A transient calculator node that does not cache its value.

TransientDist(distribution, *inputs[, ...])

A transient distribution node that does not cache its value.

TransientIdentity(_input[, _name])

A transient identity node that does not cache its value.

TransientNode(*inputs[, _name, _needs_seed])

A node that does not cache its value.

Value(value[, _name])

A Node subclass that holds constant values.

Var(value[, distribution, name, inference])

A variable in a statistical model.