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 existingliesel.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 whenx
is not already aliesel.model.Var
. (default:None
)add_intercept (
bool
) – IfTrue
, 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 thelinear predictor.