get_basis_expansion: Construct basis expansion matrices.

Description Usage Arguments Value

Description

This function was created to avoid repeating it over and over in my research. The penalty for each marginal term is \int \|f''(x)\|^2 dx.

Usage

1
get_basis_expansion(df, num.knots, bases, interactions, knots.list = NULL)

Arguments

df

data frame for which to expand. Must already contain an intercept in column 1, and all covariates should be scaled between 0 and 1.

num.knots

a vector containing the number of knots to use for each predictor.

bases

a vector containing the bases to use for each expansion. Cubic (cr) and cyclic (cc) radial splines are supported.

interactions

logical: should two-way interactions (tensor products) be computed?

knots.list

optional list containing knots to use. Useful for predictions. If present, num.knots is ignored.

Value

A list with components:


hrmerrill/hunterr documentation built on May 17, 2019, 5:54 p.m.