splines2: splines2: Regression Spline Functions and Classes

splines2R Documentation

splines2: Regression Spline Functions and Classes

Description

This package provides functions to construct basis matrices of

  • B-splines

  • M-splines

  • I-splines

  • convex splines (C-splines)

  • periodic splines

  • natural cubic splines

  • generalized Bernstein polynomials

  • along with their integrals (except C-splines) and derivatives of given order by closed-form recursive formulas

Details

In addition to the R interface, it also provides a C++ header-only library integrated with Rcpp, which allows the construction of spline basis functions directly in C++ with the help of Rcpp and RcppArmadillo. Thus, it can also be treated as one of the Rcpp* packages. A toy example package that uses the C++ interface is available at <https://github.com/wenjie2wang/example-pkg-Rcpp-splines2>.

The package splines2 is intended to be a user-friendly supplement to the base package splines. The trailing number two in the package name means "too" (and by no means refers to the generation two). See Wang and Yan (2021) for details and illustrations of how the package can be applied to shape-restricted regression.

References

Wang, W., & Yan, J. (2021). Shape-restricted regression splines with R package splines2. Journal of Data Science, 19(3), 498–517.


splines2 documentation built on Aug. 20, 2023, 1:07 a.m.