我遇到了一个问题,我的特定输入会产生错误。
library(kriging)
x <- c(0.65,0.45,0.25,0.65,0.45,0.25,0.55,0.4,0.25,0.55,0.4,0.25,0.6,0.45,0.25,0.6,0.45,0.25,0.5,0.4,0.25,0.5,0.4,0.25,0.55,0.4,0.25,0.55,0.4,0.25,0.5,0.35,0.25,0.5,0.35,0.25)
y <- c(0.25,0.45,0.65,0.2,0.4,0.6,0.25,0.4,0.55,0.2,0.35,0.5,0.25,0.4,0.6,0.2,0.35,0.55,0.25,0.35,0.5,0.2,0.3,0.45,0.25,0.4,0.55,0.2,0.35,0.5,0.2,0.35,0.45,0.15,0.3,0.4)
r <- c(241.5,236.8333333,229.875,242,235.5,231.3333333,238,236.875,225.75,238.5,233.25,228.5,24,0.5,237.1666667,229.5,241.3333333,236.8333333,227.75,237.625,233.7,228.3333333,236.8,235,229.8333333,238.1,234.6,228.6666667,237.375,235.1,228.6666667,236.4,231.6666667,227.3,236.5,232.625,227.3571429)
x <- data.matrix(x)
x <- sweep(x,1,100,"*")
y <- data.matrix(y)
y <- sweep(y,1,100,"*")
krig <- kriging(x,y,r,lag=3)
Error in solve.default(matrix(A, n + 1, n + 1)) :Lapack routine dgesv: system is exactly singular: U[26,26] = 0
老实说,我不知道出了什么问题。我的格式似乎与我看到的示例代码非常一致。