我想在使用张量积的gam函数中手动设置一些 node 位置.
例如:
set.seed(0)
n <- 500
x <- runif(n)
z <- runif(n)
y <- runif(n)
gam(y ~ te(x, z), knots = list(x = c(0.2, 0.5, 0.8), y=c(0.2, 0.5, 0.8)))
但我有一个错误:
Error in smooth.construct.cr.smooth.spec(object$margin[[i]], dat, knt) :
number of supplied knots != k for a cr smooth
我试着在张量中增加一个k值,但误差还是一样 我该怎么解决这个问题?感谢你的帮助.