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?

Roman Luštrik
  • 69,533
  • 24
  • 154
  • 197
AnkeS
  • 3
  • 3

1 Answers1

4

Not perhaps the clearest way of putting this, but the documentation says:

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

It should be a number of sampling units you had. A single number or a vector of numbers will do. However, the predict function cannot extrapolate, but it only interpolates. The nonlinear regression models of fitspecaccum may be able to extrapolate, but should you trust them?

Here a bit about dangers of extrapolation: the non-linear regression models are conventionally used analysing species accumulation data, but none of these is really firmly based on theory -- they are just some nice non-linear regression models. I know of some models that may have a firmer basis, but we haven't implemented them in vegan, neither plan to do so (but contributions are welcome). However, it is possible to get some idea of problems by subsampling your data and seeing if you can estimate the overall number of species with an extrapolation from your subsample. The following shows how to do this with the BCI data in vegan. These data have 50 sample plot with 225 species. We take subsamples of 25 plots and extrapolate to 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
   } 
}

When I tried this, most extrapolation models did not include the correct number of species among their predictions, but all values were either higher than correct richness (from worst: Arrhenius, Gitay, Gleason) or lower than correct richness (from worst: logistic, Gompertz, asymptotic, Michaelis-Menten, Lomolino, Weibull; only these two last included the correct richness in their range).

In summary: in lack of theory and adequate model, beware extrapolation.

Jari Oksanen
  • 3,287
  • 1
  • 11
  • 15
  • You should trust them, as much as all other models. :) – Roman Luštrik Mar 21 '16 at 13:46
  • Thank you for your help. I did not manage to figure out fitspecaccum, I guess my knowledge is not good enough and I don't understand the help manual. Do you have any suggestions on how I could predict the number of new species found with a set of additional samples? I can see that specslope(object, at) gives me the increase of new species within the sampled range but what I really need is an extrapolate. I have taken 47 samples and would like to know likely numbers of new species found at, lets say, 50 samples... – AnkeS Mar 22 '16 at 04:31
  • You need to define two things: the kind of accumulation model you use in specaccum and the non-linear regression model you are going to apply in fitspecaccum. Again, the newdata needs only be a number of new sites. The following example uses BCI data of vegan. These data have 50 plots, and we extrapolate to double that number using "exact" accumulation method and Michaelis-Menten fitted model: `predict(fitspecaccum(BCI, "mich", "exact"), newdata=100)`. However, this is an **extrapolation** and I would not trust this at all: try changing `"mich"` or `"exact"` to alternatives. – Jari Oksanen Mar 22 '16 at 09:30
  • 1
    @RomanLuštrik some models are based on something. Some models are based on nothing. A lot of justifying theory is needed to build a basis for extrapolation of species accumulation model, but I won't go into detail. – Jari Oksanen Mar 22 '16 at 12:52
  • Hi Jari, thank you for your help and patience. I have extrapolated my sample of 50 plants to 100 and have run all the different models available which produced exactly the same outcomes (an additional 10 pollinators found with an extra of 50 plants sampled). Visually the extrapolated curve follows the trend of my accumulation curve. Do you think it is reasonable to say that by doubling the sample size I can expect to find approximately 10 new species? – AnkeS Mar 23 '16 at 06:43