Skip to content

Minimum Smoothening Parameter bounds with H matrix#469

Open
vsl366 wants to merge 4 commits intodswah:mainfrom
vsl366:feature/lam-min-h-matrix
Open

Minimum Smoothening Parameter bounds with H matrix#469
vsl366 wants to merge 4 commits intodswah:mainfrom
vsl366:feature/lam-min-h-matrix

Conversation

@vsl366
Copy link
Copy Markdown

@vsl366 vsl366 commented Feb 28, 2026

The _P() Method already builds a lam * P matrix for each term. For the H matrix ( lower bounds on smoothening, we code a function build_minimum_penalties similar to build_penalties, which uses a new parameter lam_min (default 0) instead of lam. This term lam_min is added to every Term and init function, and is used to build the H matrix, using the _H() function. Previously, a snippet in line 750 already asks us to add the H matrix. Now, it is implemented as a function H, which returns the matrix, therefore it is changed to S += self._H(). This simple change enables us to add a minimum smoothening bound and now enforces it in the form:

GAM(s(0, lam_min=0.1) + s(1, lam_min=10)).fit(X, y)
enforces λ₁ ≥ 0.1, λ₂ ≥ 10

Closes #26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add minimum smoothing parameter bounds

1 participant