sam: Unified Entry Point for Sparse Additive Modelling

View source: R/sam.R

samR Documentation

Unified Entry Point for Sparse Additive Modelling

Description

Fit a sparse additive model by dispatching to the appropriate family-specific function (samQL, samLL, samEL, or samHL).

Usage

sam(X, y, p = 3, family = c("gaussian", "binomial", "poisson", "hinge"), ...)

Arguments

X

Numeric training matrix with n rows (samples) and d columns (features).

y

Response vector of length n.

p

The number of basis spline functions. The default value is 3.

family

A string specifying the loss family. One of "gaussian" (default), "binomial", "poisson", or "hinge".

...

Additional arguments passed to the family-specific function.

Value

An S3 object of class samQL, samLL, samEL, or samHL, depending on the chosen family.

See Also

samQL, samLL, samEL, samHL

Examples

n <- 100; d <- 50
X <- matrix(runif(n * d), n, d)
y <- rnorm(n)
fit <- sam(X, y, family = "gaussian")
fit

SAM documentation built on March 13, 2026, 9:08 a.m.