This function generates the integral of B-spline basis matrix for a polynomial spline. The arguments are exactly the same with function bs in package splines.

ibs(x, df = NULL, knots = NULL, degree = 3, intercept = FALSE,
Boundary.knots = range(x, na.rm = TRUE), ...)

## Arguments

x The predictor variable. Missing values are allowed and will be returned as they were. Degrees of freedom of the B-spline basis to be integrated. One can specify df rather than knots, then the function chooses "df - degree" (minus one if there is an intercept) knots at suitable quantiles of x (which will ignore missing values). The default, NULL, corresponds to no inner knots, i.e., "degree - intercept". The internal breakpoints that define the B-spline basis to be integrated. The default is NULL, which results in a basis for ordinary polynomial regression. Typical values are the mean or median for one knot, quantiles for more knots. See also Boundary.knots. Non-negative integer degree of the piecewise polynomial to be integrated. The default value is 3 for the integral of cubic B-splines. If TRUE, an intercept is included in the basis; Default is FALSE. Boundary points at which to anchor the B-spline basis to be integrated. By default, they are the range of the non-NA data. If both knots and Boundary.knots are supplied, the basis parameters do not depend on x. Data can extend beyond Boundary.knots. Optional arguments for future usage.

## Value

A matrix of dimension length(x) by df = degree + length(knots) (plus on if intercept is included). Attributes that correspond to the arguments specified are returned for usage of other functions in this package.

## Details

It is an implementation of the close form integral of B-spline basis based on recursion relation. Internally, it calls bSpline and generates a basis matrix for representing the family of piecewise polynomials and their corresponding integrals with the specified interior knots and degree, evaluated at the values of x.

## References

De Boor, Carl. (1978). A practical guide to splines. Vol. 27. New York: Springer-Verlag.