makef {relgam}R Documentation

Make non-linear features

Description

Internal function for making non-linear features.

Usage

makef(x, r, df, tol = 0.01, removeLin = T)

Arguments

x

Input matrix, of dimension nobs x nvars; each row is an observation vector.

r

Vector of residuals.

df

Degrees of freedom for the fit.

tol

A tolerance for same-ness or uniqueness of the x values. To be passed to the smooth.spline() function. Default is 0.01.

removeLin

If TRUE (default), removes the linear component from the newly created non-linear features.

Value

A list:

f

Non-linear features associated with the features in x.

spline_fit

A list of the spline fits of the residual against each feature. Useful for creating the non-linear features for new data.

lin_comp_fit

If removeLin = TRUE, a list of coefficients for simple linear regression of non-linear feature on original feature. Useful for creating the non-linear features for new data.


[Package relgam version 1.0 Index]