0

I'm having a matrix of plants(rows) and pollinators(columns) and interaction frequencies within (converted to 0 (no interaction) and 1 (interaction/s present) for this analysis). I'm using the vegan package and have produced a species accumulation curve.

accum <- specaccum(mydata[1:47,], method = "random", permutations = 1000)

plot(accum)

I now would like to predict how many new pollinator species I would be likely to find with additional plant sampling but can't figure in what format I have to include "newdata" within the predict command. I have tried empty rows and rows with zeros within the matrix but was not able to get results. This is the code I've used for the prediction:

predictaccum1 <- predict(accum, newdata=mydata[48:94,])

The error message:

Error in UseMethod("predict") : 
no applicable method for 'predict' applied to an object of class "specaccum"

The error message does not change if I specify: interpolation = c("linear") or "spline".

Could anyone help please?

4

1 回答 1

4

这可能不是最清晰的表达方式,但文档说:

newdata: Optional data used in prediction interpreted as number of
          sampling units (sites).

它应该是您拥有的多个采样单元。一个数字或一个数字向量就可以了。但是,该predict函数不能外推,而只能进行内插。的非线性回归模型fitspecaccum也许可以推断,但你应该相信它们吗?

这里有一点关于外推的危险:非线性回归模型通常用于分析物种积累数据,但这些模型都不是真正基于理论的——它们只是一些很好的非线性回归模型。我知道一些模型可能有更坚实的基础,但我们还没有在vegan中实现它们,也不打算这样做(但欢迎贡献)。但是,可以通过对数据进行二次抽样并查看是否可以通过从子样本外推来估计物种的总数来了解问题。下面显示了如何使用veganBCI中的数据执行此操作。这些数据有 225 个物种的 50 个样地。我们抽取 25 个图的子样本并推断为 50:

mod <- c("arrhenius", "gleason", "gitay", "lomolino", "asymp", "gompertz", 
      "michaelis-menten", "logis", "weibull")
extraps <- matrix(NA, 100, length(mod))
colnames(extraps) <- mod
for(i in 1:nrow(extraps)) {
   ## use the same accumulation for all nls models 
   m <- specaccum(BCI[sample(50,25),], "exact") 
   for(p in mod) { 
      ## need try because some nls models can fail
      tmp <-  try(predict(fitspecaccum(m, p), newdata=50))
      if(!inherits(tmp, "try-error")) extraps[i,p] <- tmp
   } 
}

当我尝试这个时,大多数外推模型没有在他们的预测中包含正确的物种数量,但所有值要么高于正确的丰富度(从最差开始:Arrhenius、Gitay、Gleason)或低于正确的丰富度(从最差开始:逻辑、 Gompertz, asymptotic, Michaelis-Menten, Lomolino, Weibull;只有最后两个在他们的范围内包含了正确的丰富度)。

综上所述:在缺乏理论和充分模型的情况下,谨防外推。

于 2016-03-21T12:34:48.130 回答