chebpol包已存档在 CRAN 上,因此我正在寻找
chebpol::ipol(..., method = "polyharmonic").
我正在尝试在四维、规则、均匀网格上插入(和推断)一个函数,但缺少一些点。上面提到的chebpol::ipol函数非常适合:
known <- data.table::data.table(
a = c(1, 1, 1, 1, 2, 2, 2, 2),
b = c(1, 1, 2, 2, 1, 1, 2, 2),
c = c(1, 1, 2, 3, 2, 2, 3, 4),
d = c(1, 2, 3, 4, 1, 2, 3, 4)
)
known[, score := a + b + c + d] # example values
f <- chebpol::ipol(
val = known[, score],
knots = t(as.matrix(known[, c("a", "b", "c", "d")])),
method = "polyharmonic"
)
f(c(1, 2, 4, 3)) # expected result: 10
Run Code Online (Sandbox Code Playgroud)
如果没有chebpol包,如何实现上述目标?