gam.fun: Train generalized additive models

Description Usage Arguments Value Examples

View source: R/gam_model.R

Description

Fit a generalized additive model(GAM) for data to capture the relationship between the relationship between the X and each column of Y.

Usage

1
gam.fun(X, Y, LogY = TRUE, k = 10, parallel = FALSE, num.cores = 2)

Arguments

X

a dataframe with n rows and c columns, where n is the number of observations and c is the number of explanatory variables.

Y

a dataframe with n rows and F columns. Each column is considered as a response variable to fit the generalized additive model.

LogY

logical. If TRUE then the logarithmic form of Y becomes the response variable.

k

the dimension of the basis used to represent the smooth term when mgcv package is used to fit GAM. If k is not specified then basis specific defaults are used.

parallel

logical. If TRUE then the model training is conducted in parallel.

num.cores

the specified amount of parallel processes to be used if parallel = TRUE.

Value

gam.fun returns a list with F generalized additive models for each response variable.

Examples

1
2
3
X <- as.data.frame(state.x77[, "Murder"])
Y <- as.data.frame(state.x77[, c("Population", "Illiteracy", "Income", "Frost")])
gam.fit <- gam.fun(X, Y, LogY = FALSE, k = 10)

xqnwang/fuma documentation built on May 29, 2021, 6:38 a.m.