Problems using background points or bias file with DISMO

280 views
Skip to first unread message

Eveliina

unread,
Aug 10, 2016, 11:19:46 AM8/10/16
to Maxent

               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

Eveliina

unread,
Aug 11, 2016, 4:56:44 AM8/11/16
to Maxent
 Hey,

Just an update so I will not waste anybodys time on this. I found solution although I don't quite understand where the second warning came from. What I did was to create a bias file using kernel density estimate based on Scott's code  (https://scottrinnan.wordpress.com/2015/08/31/how-to-construct-a-bias-file-with-r-for-use-in-maxent-modeling/) and this way going around the problem with too few observations for background points. Also, I found out that when cropping and masking and then saving the environmental files to be same extent in some layers zero's were saved as NA's which produced the large amount of NA predictor values.

Cheers,
Eveliina
Reply all
Reply to author
Forward
0 new messages