LinearTerm

Contents

LinearTerm#

class liesel_ptm.LinearTerm(x, name, prior=None)[source]#

Bases: Term

Linear function of one or more covariates.

Parameters:
  • x (Any) – Covariate array.

  • name (str) – Unique name of the covariate term.

  • prior (Optional[Dist]) – Joint prior distribution for the regression coefficients. If None, uses a constant prior. (default: None)

Methods

predict

Computes predicted values given an array of posterior samples.

predict_elementwise

Computes predicted values given an array of posterior samples.

summarise_by_quantiles

Computes a posterior summary for this term based on quantiles.

summarise_by_samples

Computes a posterior summary for this term based on a subsample from the posterior.

Attributes

hyper_parameters

List of hyperparameter names associated with this term.

nuts_params

observed_value

Array of observed x values.

parameters

List of parameter names associated with this term.

value

Evaluation of this term.

x

Covariate node.

coef

Regression coefficient node.

smooth

Node for the evaluated linear term x @ coef.

mcmc_kernels

List of liesel.goose.kernel.Kernel MCMC kernel classes.