0

I try to understand how R obtain the values of the basis matrix with bs function. For example I create a vector :

A=c(1, 2,3)

And use the follow command

bs(A, knots = c(1,2 3), degree=1)

And I obtain this values

1 0 0 0
0 1 0 0
0 0 1 0

Can anyone explain how this values are obtained?

Shree
  • 10,835
  • 1
  • 14
  • 36
  • Include the package name for `bs()` function. – Shree Aug 28 '19 at 18:28
  • 1
    @Shree I guess it's ``splines``. – Gainz Aug 28 '19 at 18:28
  • @tony napora Have you take a look at the function description? ``?bs`` and ``?splineDesign`` explains pretty well what they are doing. – Gainz Aug 28 '19 at 18:32
  • Sry Shree is in the splines package – tony napora Aug 28 '19 at 18:38
  • Yes Gainz I understand that the value is obtained via linear interpolation, thx to this https://stackoverflow.com/questions/39446842/interpretation-of-the-output-of-r-function-bs-b-spline-basis-matrix. But I cannot reached the same value.. – tony napora Aug 28 '19 at 18:40

0 Answers0