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)
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 filter_nonzero_bases.
If the keep argument is provided, filter_nonzero_bases is applied exclusively to the functions specified in keep.
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.