View source: R/time_basisFun_df.R
time_basisFun_df | R Documentation |
Given a numeric time vector, construct a set of overlapping basis functions.
time_basisFun_df(timeVar, basisDens, basis_calc_fun = "gaussian")
timeVar |
Vector of time (e.g., trial number) |
basisDens |
Space between basis function peaks (equal if gaussian; approximate if bspline) |
basis_calc_fun |
The function with which to calculate the basis functions. Either |
Gaussian bases are equally-spaced with respect to time. Together, entered as linear predictors into a typical regression model, each basis function acts as a "bump" offset from the overall model fit, thereby approximating arbitrary nonlinear changes over time.
The function defining the bases defaults to Gaussian with a half-width half-max equal
to the distance between the basis centers, that is, each basis function
uses approximately dnorm(time_vector,basis_center,basis_width / .5875)
.
The bases are then normalized so that each timepoint's bases sum to 1.
B spline bases are also implemented (and are more conventional), relying on the fda
package.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.