Shape-Restricted Regression Splines with R Package splines2
Volume 19, Issue 3 (2021), pp. 498–517
Pub. online: 12 August 2021
Type: Computing In Data Science
Received
20 July 2021
20 July 2021
Accepted
20 July 2021
20 July 2021
Published
12 August 2021
12 August 2021
Abstract
Splines are important tools for the flexible modeling of curves and surfaces in regression analyses. Functions for constructing spline basis functions are available in R through the base package splines. When the curves to be modeled have known characteristics in monotonicity or curvature, more efficient statistical inferences are possible with shape-restricted splines. Such splines, however, are not available in the R package splines. The package splines2 provides easy-to-use shape-restricted spline basis functions, along with their derivatives and integrals which are important tools in many inference scenarios. It also provides additional splines and features that are not available in the splines package, such as periodic splines and generalized Bernstein polynomials. The usages of the functions are illustrated with shape-restricted regression, recurrent event data analysis, and extreme-value copulas.
Supplementary material
Supplementary MaterialWe review the generalized Bernstein polynomials, B-splines, and Natural cubic splines implemented in the package splines2 but not covered in the main text. We also provide the R code that produced the micro-benchmark results.