lin()

Contents

lin()#

liesel_ptm.lin(x, xname=None, add_intercept=False)[source]#

Create a linear basis (design matrix) for a predictor.

This function wraps Basis.new_linear() and accepts either a raw array/Series or an existing liesel.model.Var. When a raw array is supplied, xname is used to create a named observation variable.

Parameters:
  • x (Union[Array, ndarray, bool, number, bool, int, float, complex, Series, Var]) – Predictor values or an observed variable.

  • xname (str | None) – Name for the created observation variable when x is not already a liesel.model.Var. (default: None)

  • add_intercept (bool) – If True, include an intercept column of ones in the design matrix. (default: False)

Return type:

Basis

Returns:

  • A Basis instance that produces the design matrix for the

  • linear predictor.