makef: Make non-linear features

Description Usage Arguments Value

View source: R/makef.R

Description

Internal function for making non-linear features.

Usage

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

Arguments

x

Input vector of length nobs.

r

Vector of residuals.

df

Degrees of freedom for the fit. Default is 4.

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 feature associated with x.

nl_predictor

A function which, when given new data newx, returns the value of the non-linear predictor at those x values. Needed for creating the non-linear features for new data.


kjytay/relgam documentation built on March 4, 2020, 4:13 a.m.