How can I parameterize mgcv to return results like splines::ns()

Viewed 19

I am trying to convert some function in R. I would like to convert my splines::ns() functions to mgcv.

This is my example

min = 0
max = 10
tau = seq(min, max)
pDegree = 5
Q1 <- splines::ns(tau, pDegree)
Q2 <- mgcv::smoothCon(mgcv::s(tau, bs="cr", k=pDegree), data=data.frame(tau=tau))[[1]]$X
Q1
Q2

I want Q1, but the closest I have been able to get is Q2. I would like to make my code use mgcv alone, but I can't do that until Q2 is the same as Q1

Thanks for the help.

0 Answers
Related