Dear Jay Kang,

sorry for taking a while to respond. This is exactly correct. You might wanna take a look at the functions `spline1`

and `spline1_grid`

in the toolbox. If you modify these functions such that the return the derivative of the basis function, then you will immediately get to the derivative of the spline function.

In the one-dimensional case this is super easy. It gets a little more tricky in the multi-dimensional case, because you will have to compute the full Jacobian. I guess this is why I didn’t code it up in the toolbox. But I will put it on my todo-list.

Thanks for asking this great question and great that you found the solution on your own.

Best,

Fabian