Package: BsplineQuantReg 0.2.6

Alexandre Abbes

BsplineQuantReg: 'Constrained Quantile Regression with B-Splines'

Quantile regression with B-splines under shape constraints. The initial version with cubic splines is now augmented with splines of degree 1 to 4. Constraints for degrees 3 (monotone) and 4 (monotone and convex) use the Karlin-Studden SOCP characterization for the sign of the polynomial, while other constraints applied at the knots are added as linear problems. The method for cubic splines is described in 'Abbes (2025)' <doi:10.5281/zenodo.17427913>. Other formulations are simple consequences of the other given references. All B-spline and polynomial functions have been rewritten for consistency. This package provides an original B-spline library for conversion between PP-form and B-spline representation, evaluation, differentiation, callable and non-callable objects, print human readable pp forms, view basis, all based on "De Boor\'s" theory. It also extends to multiple knots to catch up singularities. This feature is robust in the package including for constrained regression. This R implementation is intended for demonstration and prototyping. An equivalent Python package is available at <https://pypi.org/project/BsplineQuantRegpy/>.

Authors:Alexandre Abbes [aut, cre]

BsplineQuantReg_0.2.6.tar.gz
BsplineQuantReg_0.2.6.zip(r-4.7-any)BsplineQuantReg_0.2.6.zip(r-4.6-any)BsplineQuantReg_0.2.6.zip(r-4.5-any)
BsplineQuantReg_0.2.6.tgz(r-4.6-any)BsplineQuantReg_0.2.6.tgz(r-4.5-any)
BsplineQuantReg_0.2.6.tar.gz(r-4.7-any)BsplineQuantReg_0.2.6.tar.gz(r-4.6-any)
BsplineQuantReg_0.2.6.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
DESCRIPTION |NEWS
card.svg |card.png
BsplineQuantReg/json (API)

# Install 'BsplineQuantReg' in R:
install.packages('BsplineQuantReg', repos = c('https://alexandreabbes.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/alexandreabbes/bsplinequantreg/issues

On CRAN:

Conda:

6.20 score 1 packages 15 scripts 309 downloads 37 exports 16 dependencies

Last updated from:3e6d51b50f. Checks:7 OK, 2 NOTE. Indexed: yes.

TargetResultTimeFilesSyslog
linux-develOK143
source / vignettesOK247
linux-releaseOK180
macos-releaseOK172
macos-oldrelNOTE233
windows-develOK102
windows-releaseOK78
windows-oldrelNOTE92
wasm-releaseOK134

Exports:bs_directBspline_baseBspline_base_derivBspline_derivbspline_to_deriv_coeffs_cubicbspline_to_deriv_coeffs_linbspline_to_deriv_coeffs_quadbspline_to_deriv_coeffs_quartBsplinetoppchange_polynomial_base_taylorevalppget_parametersmake_splinemakpppoly_evalpolyaddpolyderivpolymulquantile_splinereduce_polsetup_solvershow_polyshow_ppSpline_der_knotspline_evalSplineConstantQuantSplineConstQuantRegBs1SplineConstQuantRegBs2SplineConstQuantRegBs3SplineConstQuantRegBs4SplineCubicQuantSplineLinearQuantSplinePolynQuantSplineQuadraticQuantSplineQuarticQuanttest_karlin_simpleview_basis

Dependencies:backportscheckmateclarabelcliCVXRECOSolveRgmphighslatticeMatrixosqpRcppRcppEigenS7scsslam

Introduction
Simple example | Core content | B-spline library | Graphical user interface | An interactive Shiny GUI is available: | Python port

Last update: 2026-10-10
Started: 2026-08-07

Polynomial Library in BsplineQuantReg
Introduction | Basic Polynomial Operations | Polynomial Multiplication | Polynomial Addition | Polynomial Evaluation | Polynomial Differentiation | Polynomial Reduction | Taylor Basis Change | Piecewise Polynomial (PP) Form | Creating a PP Object | Non-Callable PP Objects | Callable PP Objects | Create a callable PP | Evaluate directly | Print shows information | Can be used in plots | Extrapolating values | PP with two intervals: x^2 on [0,1], 2x-1 on [1,2] | Evaluate inside and outside the knot range | The values at -0.5 and 2.5 are extrapolated | Advanced: PP Form Manipulation | Extracting a Single Interval Polynomial | Combining PP Objects | Visualizing PP with Basis Functions | Comparison: PP vs B-spline | Summary | Displaying polynomial in a human readable form | Basic Usage | Canonical Basis (Default) | Working with Local Bases | Display in Local Basis | Converting Between Bases | Examples with Different Bases | Positive and Negative Centers | Controlling Output Format | Number of Digits | Working with B-splines | Integration with show_pp() | Summary show_pp()

Last update: 2026-10-10
Started: 2026-08-08

Shape Constraints with BsplineQuantReg
Introduction | Available Demos | Uniform Constraints | Monotonicity Constraints | Convexity Constraints | Third Derivative Constraints | Constraints by Degree | Partial Constraints | Partial Monotonicity | Partial Convexity | Mixed Constraints | Constraints with Multiple Knots | Recap: Visualizing Constraint Effects | Karlin-Studden SOCP Formulation | Practical Considerations | When to Use Shape Constraints | Constraint Strength | Choosing the Degree | Summary

Last update: 2026-10-10
Started: 2026-08-07

Theoretical Background
Introduction | 1. Quantile Constrained Regression | 1.1 Quantile Regression | 1.2 Shape Constraints | 1.3 Karlin-Studden Characterization | 1.4 SOCP formulation and CVXR implementation | 2. B-spline Construction with De Boor's Formula | 2.1 B-spline Definition | 2.3 De Boor's Algorithm for Coefficient Computation | 2.4 Implementation Details | 2.5 (Advanced) Knot Multiplicity and Regularity | References | Further Reading

Last update: 2026-10-10
Started: 2026-08-09

B-spline Basis Manipulation
Introduction | Building a B-spline Basis | Basic Construction | Visualizing the Basis | Understanding the Extended Knot Sequence | Visualizing B-spline Bases | Visualizing a B-spline Basis | Visualizing Different Degrees | Customizing Visualization | Differentiating a B-spline Basis | Visualizing Derivative Bases | Differentiating a B-spline Function | Method 1: Using spline_eval() with der Parameter | Method 2: Using Bspline_deriv() to Get Derivative Coefficients | Method 3: Step-by-step evaluation using basis derivatives | 1. Compute the derivative basis | 2. Evaluate the basis at points using bs_direct | 3. Use matrix multiplication with coefficients | PP-form Conversion | Callable PP Objects | Callable Splines | Creating Callable Splines | Non-Callable Splines | Getting Parameters | Advanced: Knot Multiplicity and Regularity | Creating B-splines with Multiple Knots | Effect of Multiplicity on Regularity | Derivatives at Knots | Simple Example: Coherence of Derivative Evaluation Methods (Degree 5) | Summary

Last update: 2026-10-07
Started: 2026-08-08

Readme and manuals

Help Manual

Help pageTopics
Apply Karlin-Studden constraints for a quadratic polynomialapply_karlin_quadratic
Direct evaluation of a B-spline basisbs_direct
Build B-spline basis in piecewise polynomial form Computes local polynomial coefficients for each B-spline basis function on each interval. Polynomials are expressed in the canonical basis Uses De Boor's recursion formula.Bspline_base
Differentiate a B-spline basisBspline_base_deriv
Compute derivative coefficients of a B-splineBspline_deriv
normalized first and second derivative coefficients on each interval. for a cubic B-spline basisbspline_to_deriv_coeffs_cubic
Derivative coefficients for linear B-spline Computes normalized first derivative coefficients for linear B-splines. For linear splines, the derivative is constant on each interval.bspline_to_deriv_coeffs_lin
quadratic B-spline derivative coefficientsbspline_to_deriv_coeffs_quad
Computes normalized first, second, and third derivative coefficients for quartic B-splines on each interval.bspline_to_deriv_coeffs_quart
Convert a B-spline to Piecewise Polynomial (PP) formBsplinetopp
Change polynomial basis (Taylor expansion)change_polynomial_base_taylor
Evaluates a piecewise polynomial (PP form) function at given points.evalpp
Get parameters from a callable spline or a callable pp objectget_parameters
Create a callable spline objectmake_spline
Build a piecewise polynomial (PP) formmakpp
Evaluate polynomialpoly_eval
Polynomial additionpolyadd
Polynomial derivative Computes the derivative of order 'der' of a polynomial.polyderiv
Polynomial multiplicationpolymul
Print method for callable_pp objectsprint.callable_pp
Print method for callable splineprint.callable_spline
Print method for non_callable_pp objectsprint.non_callable_pp
Print method for non_callable_spline resultsprint.non_callable_spline
Unified Quantile Regression with B-Splines of Any Degree (1 to 4)quantile_spline
Reduce polynomialreduce_pol
Vérifier et configurer le solveur CVXRsetup_solver
Displays the equation of a polynomial in a given basisshow_poly
Display Piecewise Polynomial (PP) in a human readble formshow_pp
Derivatives at knot of a B-splineSpline_der_knot
Evaluate a B-splinespline_eval
' Performs quantile/mean regression using constant B-splines with monotonicity constraints. No solver is needed, since for the degree 0, the B-splines in the basis are independent piece-wise constants.SplineConstantQuant
Wrapper function for linear spline quantile regressionSplineConstQuantRegBs1
Wrapper function for quadratic spline quantile regression Previous version notation style This is a convenience wrapper for SplineQuadraticQuant.SplineConstQuantRegBs2
Wrapper function for Cubic spline quantile regressionSplineConstQuantRegBs3
Wrapper function for quartic spline quantile regressionSplineConstQuantRegBs4
Constrained quantile regression with cubic splines Performs quantile regression using cubic B-splines, with optional monotonicity constraints (via Karlin-Studden) and convexity constraints.SplineCubicQuant
Quantile regression with linear splines and monotonicity constraintsSplineLinearQuant
Quantile regression with general polynomial splines and shape constraintsSplinePolynQuant
Quantile regression with quadratic splines and shape constraintsSplineQuadraticQuant
Quantile regression with quartic splines and shape constraintsSplineQuarticQuant
Comprehensive test functiontest_karlin_simple
Visualize a B-spline functions basis Visualize a B-spline basis Plots all basis functions of a B-spline basis with improved styling.view_basis