create_bases | R Documentation |

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.

```
create_bases(t, keep = NULL)
```

`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. |

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.

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`

```
t <- seq(0, 10, by = 0.5)
bases <- create_bases(t)
selected_bases <- create_bases(t)
selected_bases[[1]]
selected_bases[[2]]
```

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.