LinearConstraintEVD#
- class liesel_gam.LinearConstraintEVD[source]#
Bases:
objectComputes reparameterization matrices for linear constraints.
Reparameterization matrices are computed via eigenvalue decomposition.
If you have a linear constraint
A @ coefto be applied to a basis-coef productB @ coef, wereBis the basis matrix, then this constraint can be enforced by computingB @ Z @ latent_coefinstead, wherelatent_coefis an unconstrained version ofcoef, with penalty matrixZ.T @ K @ Z, whereKis the penalty matrix in the prior forcoef.See
Basis.constrain()for more detailed documentation and Kneib et al. (2019) for an in-depth reference.See also
Basis.constrainUses this class to apply constraints.
StrctTerm.constrainUses this class to apply constraints.
References
Kneib, T., Klein, N., Lang, S., & Umlauf, N. (2019). Modular regression—A Lego system for building structured additive distributional regression models with tensor product interactions. TEST, 28(1), 1–39. https://doi.org/10.1007/s11749-019-00631-z
Methods
Reparameterization matrix for removing a constant and a linear trend from a smooth like
B(x) @ coef.Reparameterization matrix for a general linear constraint
constraint @ coef.Reparameterization matrix for enforcing a constraint
jnp.ones(...).T @ coef.Reparameterization matrix for enforcing a constraint
jnp.ones(...).T @ B(x) @ coef.