Penalized Transformation Models in Liesel#
Installation#
The library can be installed from GitHub:
$ pip install git+https://github.com/liesel-devs/liesel-ptm.git#egg=liesel_ptm
Acknowledgements#
Liesel-PTM is developed by Johannes Brachem with support from Paul Wiemann and Thomas Kneib at the University of Göttingen. As a specialized extension, Liesel-PTM belongs to the Liesel project. We are grateful to the German Research Foundation (DFG) for funding the development through grant 443179956.
API Reference#
Model
Penalized transformation model for location and scale. |
|
Posterior predictions for a penalized transformation model. |
|
Used to define the prior for the shape parameters of the transformation function. |
|
Organizes the terms of a structured additive predictor. |
Covariate terms
Linear function of one or more covariates. |
|
Term in a structured additive predictor. |
|
A P-spline with second-order random walk prior. |
|
A random intercept with iid normal prior in noncentered parameterization. |
Variable classes
A variable with a Weibull prior. |
|
A variable with an inverse gamma prior. |
|
A variance parameter with a half Cauchy prior on its square root. |
|
A variable with a Weibull prior on its square. |
|
A variable with an inverse gamma prior on its square. |
|
A scale parameter with a half Cauchy prior. |
|
Class for defining a scalar \(\omega\) with symmetrically bounded support around 1. |
|
Class for defining a possibly transformed variable. |
Data generation
Draws random samples from a location-scale transformation model. |
|
Draws a random sample of the shape parameters \(\boldsymbol{\delta}\) from a first order random walk prior. |
Helpers
Constructs a reparameterization matrix fo removing the nullspace from a penalty matrix of a structured additive predictor term. |
|
A P-spline penalty matrix based on |
|
Matrix |
|
Matrix |
|
Vectorized B-spline basis function evaluation. |
|
Create equidistant knots for B-Spline of the specified order. |