## ----setup, include=FALSE-----------------------------------------------------
knitr::opts_chunk$set(echo = TRUE, fig.width = 7, fig.height = 5)
library(BsplineQuantReg)

## -----------------------------------------------------------------------------
## 2.6 Visual illustration of knot multiplicity

# We compare a quartic (degree 4) B-spline basis with simple knots
# and the same basis where the central knot is repeated 4 times.
degree <- 4
knots_simple <- c(0,0,0,0,0, 0.25, 0.5, 0.75,1,1,1,1, 1)
knots_mult   <- c(0,0,0,0,0, 0.25, 0.5, 0.5, 0.5, 0.5, 0.75, 1,1,1,1,1)

# Basis with simple knots
B_simple <- Bspline_base( knots_simple,degree)

# Basis with a multiplicity-4 knot at 0.5
B_mult <- Bspline_base(knots_mult, degree)

view_basis(B_simple)
view_basis(B_mult)



