PTMCoef#

class liesel_ptm.PTMCoef(scale, penalty, inference=None, name='', scale_penalty=True, diagonalize_penalty=True, Z=None, role='transformation_coef', noncentered=False)[source]#

Bases: Var

Coefficient for PTM transformation splines.

This class wraps latent spline coefficients with penalty handling and provides several factory constructors for common penalty/prior setups.

Parameters:
  • scale (Var) – A scale variable used for the coefficient prior.

  • penalty (Any) – Penalty matrix applied to the spline coefficients.

Z#

Reparameterization matrix applied to latent coefficients.

penalty#

The (possibly scaled) penalty matrix used for priors.

latent_coef#

Underlying latent coefficient variable.

nparam#

Number of spline parameters (after transformations).

Methods

new_ridge

Create a ridge-penalized coefficient set.

new_rw1_fromzero

Create RW1 coefficients anchored at zero.

new_rw1_fromzero_ig

Create from-zero RW1 coefficients with an inverse-gamma prior on the variance parameter.

new_rw1_fromzero_wb

Create RW1 sum-to-zero coefficients with a Weibull prior on the random walk variance.

new_rw1_sumzero

Create RW1 (first-order random walk) coefficients with sum-to-zero.

new_rw1_sumzero_ig

Create RW1 sum-to-zero coefficients with an inverse-gamma prior on the random walk variance.

new_rw1_sumzero_wb

Create RW1 sum-to-zero coefficients with a Weibull prior on the random walk variance.

Attributes