SL.mgcv: Wrapper for mgcv's gam implementation

View source: R/sl_mgcv.R

SL.mgcvR Documentation

Wrapper for mgcv's gam implementation

Description

Wrapper for mgcv's gam implementation.

Usage

SL.mgcv(
  Y,
  X,
  newX,
  family,
  obsWeights = NULL,
  id = NULL,
  degree = -1,
  continuous_values = 5,
  smooth_fn = "s",
  exclude_spline = NULL,
  method = "REML",
  select = TRUE,
  gamma = 1,
  formula_rhs = NULL,
  ...
)

Arguments

Y

Outcome variable

X

Covariate dataframe

newX

Optional dataframe to predict the outcome

family

"gaussian" for regression, "binomial" for binary classification

obsWeights

Optional observation-level weights (supported but not tested)

id

Optional id to group observations from the same unit (not used currently).

degree

Dimension of the basis expansion, default 2.

continuous_values

Variables with this or more unique values are considered continuous and will be incorporated as spline terms.

smooth_fn

"s", "te", "ti", or "t2"

exclude_spline

Variable names for which not to spline, even if they meet the continuous variable definition.

method

"REML" (default), "GCV.Cp", "GACV.Cp", "P-REML", "ML", "P-ML"

select

If covariates can be removed entirely due to a penalty.

gamma

Gamma setting, default 1.

formula_rhs

Custom RHS formula, if built-in options are insufficient.

...

Any remaining arguments, not used.

References

Wood S.N. (2006b) Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC Press.

Hastie and Tibshirani (1990) Generalized Additive Models. Chapman and Hall.

Wahba (1990) Spline Models of Observational Data. SIAM

Green and Silverman (1994) Nonparametric Regression and Generalized Linear Models. Chapman and Hall.

See Also

gam


ck37/ckTools documentation built on April 29, 2023, 11:47 p.m.