create_bases {plsmmLasso} | R Documentation |
Generate bases function matrix
Description
The create_bases
function generates a matrix of bases functions for modeling time.
The bases function matrix include Fourier basis functions and polynomial basis functions.
Usage
create_bases(t, keep = NULL)
Arguments
t |
A vector representing the timepoints for which basis functions are generated. |
keep |
(Optional) A vector specifying the indices of the basis functions to retain. If not provided, all generated basis functions are retained. |
Details
The function constructs two types of basis functions: Fourier basis functions and polynomial basis functions.
Fourier basis functions are constructed based on the maximum timepoint (max_t
) and the input timepoints t
.
Polynomial basis functions are constructed with degrees ranging from 0.1 to 2, incrementing by 0.02.
Value
A list with the following components:
bases |
A matrix containing the generated bases function. |
selected_bases |
A vector containing the indices of the selected basis functions after applying |
See Also
Examples
t <- seq(0, 10, by = 0.5)
bases <- create_bases(t)
selected_bases <- create_bases(t)
selected_bases[[1]]
selected_bases[[2]]