Minimum Smoothening Parameter bounds with H matrix#469
Open
vsl366 wants to merge 4 commits intodswah:mainfrom
Open
Minimum Smoothening Parameter bounds with H matrix#469vsl366 wants to merge 4 commits intodswah:mainfrom
vsl366 wants to merge 4 commits intodswah:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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