Hello,
I am using dismo to create distribution models for butterflies in Norway but I would need some advice and pointers for troubleshooting. I wanted to account for the observation bias by including bias file based on all butterfly species observations. When I included the bias file in the code the models produce same results with and without the bias file. Here is the code I used:
me <- maxent(x=pred_nf, p=occtrain, remove.duplicates=T, bias=bbias,
args=c('outputformat=raw','jackknife=true', "responsecurves=true" ), path=path)
I then tried accounting for the bias by creating background points based on the bias file and then re-run the maxent with the background points instead of bias file
bgpoints <- randomPoints(bbias, n=7994, prob=FALSE) # there are 7994 spatially unique observations in my data so here using all of them
me <- maxent(x=pred_nf, p=occtrain, a=bgpoints, remove.duplicates=T,
args=c('outputformat=raw','jackknife=true', "responsecurves=true" ), path=path)
This however produces error about predictor values.
Warning messages:
1: In .local(x, p, ...) :
1 (0.14%) of the presence points have NA predictor values
2: In .local(x, p, ...) :
17 (0.21%) of the presence points have NA predictor values
With some species there are few observations that are falling outside the environmental data and these I can remove by extracting
v <- extract(pred_nf, occtrain) )
i <- which(apply(
is.na(v), 1, sum) > 0)
inside <-occtrain[-i,]
This gets rid of the first warning but the second one warning remains and I don't understand why it is produced.
1. Is there something obviously wrong with how I am including the bias file as it does not seem to influence the results.
2. Would it be ok to use the ~ 8000 points as background? Is this high enough number (the default would be 10 000)? Also, this is obviously not now random anymore as all the points where some species have been observed are used.
3. How can I troubleshoot for the 2. warning about the precence points? Using the same code for extracting and removing observations does not work.
I am new with species distribution modelling and I might have easily misunderstood something so any ideas or suggestions would be greatly appreciated.
Best,
Eveliina