Skip to contents

This function generates a design matrix using spline parameters and metadata. It accommodates both B-splines and natural cubic splines based on the provided spline type and parameters.

Usage

design2design_matrix(meta, spline_params, level_index, design)

Arguments

meta

A dataframe containing the metadata, including the time column.

spline_params

A list containing the spline parameters. This list can include `dof` (degrees of freedom), `knots`, `bknots` (boundary knots), `spline_type`, and `degree`.

level_index

An integer representing the current level index for which the design matrix is being generated.

design

A character string representing the design formula to be used for generating the model matrix.

Value

A design matrix constructed using the specified spline parameters and design formula.