LinearConstraintEVD

LinearConstraintEVD#

class liesel_gam.LinearConstraintEVD[source]#

Bases: object

Computes reparameterization matrices for linear constraints.

Reparameterization matrices are computed via eigenvalue decomposition.

If you have a linear constraint A @ coef to be applied to a basis-coef product B @ coef, were B is the basis matrix, then this constraint can be enforced by computing B @ Z @ latent_coef instead, where latent_coef is an unconstrained version of coef, with penalty matrix Z.T @ K @ Z, where K is the penalty matrix in the prior for coef.

See Basis.constrain() for more detailed documentation and Kneib et al. (2019) for an in-depth reference.

See also

Basis.constrain

Uses this class to apply constraints.

StrctTerm.constrain

Uses 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

constant_and_linear

Reparameterization matrix for removing a constant and a linear trend from a smooth like B(x) @ coef.

general

Reparameterization matrix for a general linear constraint constraint @ coef.

sumzero_coef

Reparameterization matrix for enforcing a constraint jnp.ones(...).T @ coef.

sumzero_term

Reparameterization matrix for enforcing a constraint jnp.ones(...).T @ B(x) @ coef.