0

Im using the bSpline function on R (under the splines2 package) and I'm a little confused on the output. My understanding was that if I made sure the knot sequence was nested, then the columns produced in bSpline should also be nested. However, this is not what the output is giving me.

For example, consider the following code

n=20
library(splines2)
x <- runif(n)
Knots <- c(0.25,0.5,0.75)
Knots2 <- c(0.125,0.25,0.375,0.5,0.625,0.75,0.875)
P <- bSpline(x,knots=Knots,Boundary.knots=c(0,1))   
P2 <- bSpline(x,knots=Knots2,Boundary.knots=c(0,1))     

The knots that make up the spline in P are contained in P2 but the output shows that none of the columns of P coincide with that of P2.

Exc
  • 173
  • 2
  • 2
  • 8
  • 1
    you might want to add the output, and code and data to get it ;) – jay.sf Jan 01 '20 at 00:03
  • I don't think your assumption about common columns is valid, but you should say where you found this claim. If the assumption is valid but R doesn't do it, your question is appropriate here; if the assumption is not supported, then you should be asking somewhere else about the math of b-splines. – user2554330 Jan 01 '20 at 01:12
  • A true claim is that the span of the columns from the smaller basis lies entirely in the span of the columns from the larger basis, i.e. every column in the smaller one is a linear combination of columns in the bigger one. That's a much weaker claim. – user2554330 Jan 01 '20 at 01:20
  • @user2554330 Thanks. That was pretty much what I was interested in. I confused that with the columns having to be the same. Do you have a reference for this fact by any chance? – Exc Jan 01 '20 at 01:24
  • I'd guess it's in de Boor's book "A Practical Guide to Splines", but I don't have a copy any more. – user2554330 Jan 01 '20 at 13:14

1 Answers1

0

The comments provided in the question answered the question. As it turns out, the span is nested and not the actual columns.

Exc
  • 173
  • 2
  • 2
  • 8