Learn R Programming

MECfda (version 0.2.1)

bspline_basis-class: b-spline basis

Description

A s4 class that represents a b-spline basis \(\{B_{i,p}(x)\}_{i=-p}^{k}\) on the interval \([t_0,t_{k+1}]\), where \(B_{i,p}(x)\) is defined as $$B_{i,0}(x) = \left\{ \begin{aligned} &I_{(t_i,t_{i+1}]}(x), & i = 0,1,\dots,k\\ &0, &i<0\ or\ i>k \end{aligned} \right.$$ $$B_{i,r}(x) = \frac{x - t_{i}}{t_{i+r}-t_{i}} B_{i,r-1}(x) + \frac{t_{i+r+1} - x} {t_{i+r+1} - t_{i+1}}B_{i+1,r-1}(x)$$ For all the discontinuity points of \(B_{i,r}\) (\(r>0\)) in the interval \((t_0,t_k)\), let the value equals its limit, which means $$B_{i,r}(x) = \lim_{t\to x} B_{i,r}(t)$$

Arguments

Slots

Boundary.knots

boundary of the domain of the splines (start and end), which is \(t_0\) and \(t_{k+1}\). Default is \([0,1]\). See Boundary.knots in bs.

knots

knots of the splines, which is \((t_1,\dots,t_k)\), equally spaced sequence is chosen by the function automatically with equal space (\(t_j = t_0 + j\cdot\frac{t_{k+1}-t_0}{k+1}\)) when not assigned. See knots in bs.

intercept

Whether an intercept is included in the basis, default value is TRUE, and must be TRUE. See intercept bs.

df

degree of freedom of the basis, which is the number of the splines, equal to \(p+k+1\). By default \(k = 0\), and df \(= p+1\). See df bs.

degree

degree of the splines, which is the degree of piecewise polynomials \(p\), default value is 3. See degree in bs.

Author

Heyang Ji

Examples

Run this code
bsb = bspline_basis(
            Boundary.knots = c(0,24),
            intercept      = TRUE,
            df             = NULL,
            degree         = 3
)

Run the code above in your browser using DataLab