ENMevaluate NA and occurrence localities error

181 views
Skip to first unread message

Jessica Tax

unread,
Sep 30, 2022, 7:11:18 PM9/30/22
to Maxent
Hi all,

My apologies if I am posting this twice, I cannot see my earlier post and want to make sure that it has been sent.

I am currently using the ENMevaluate function to prepare my data for Maxent. The function itself runs fine and I receive an output, but it is excluding most of my data. My data contains 1157 datapoints. Please see the following script:

> enmeval_results <- ENMevaluate(occ, veg, bg, tune.args = list(fc = c("L","LQ","H", "LQH", "LQHP", "LQHPT"), rm = 1:5), partitions = "randomkfold", partition.settings = list(kfolds = 10), algorithm = "maxnet")
Package ecospat is not installed, so Continuous Boyce Index (CBI) cannot be calculated.
*** Running initial checks... ***

* Found 505 raster cells that were NA for one or more, but not all, predictor variables. Converting these cells to NA for all predictor variables.
* Removed 782 occurrence localities that shared the same grid cell.


I am now wondering if my output is still valid and if it can still be used with Maxent. Does anyone have any input? If it is not valid anymore, is anyone aware of any solutions? 

Best,
Jess

Jamie M. Kass

unread,
Sep 30, 2022, 7:32:30 PM9/30/22
to Maxent
Jess,

Sorry for having to post twice -- I monitor posts from new emails and sometimes I am a little slow. Everything you submit from now will be posted directly.

It looks like you:

1) Don't have the ecospat package installed, so you can't calculate the Continuous Boyce Index (not a big deal unless you want to use this metric for model selection).
2) Have 505 raster grid cells that are NA for at least one of your predictor variable rasters. It would be a good idea to check your rasters in a GIS (ArcGIS, QGIS) to investigate why this is and if it's a problem. If you have high resolution, 505 cells may be next to nothing and could be due to missing water bodies, etc., in one layer, so maybe not a problem. But I would check anyway. ENMevaluate() automatically makes those grid cells NA for all rasters (just like maxent.jar does) because Maxent will simply skip a grid cell if even one of your variables is NA for that cell.
3) You also have 782 occurrence records that share a grid cell. Maxent can treat these as valid cell replicates and use them for training, and there are ways to change the default settings in maxent.jar to do this, but for most typical applications, we want to remove these duplicate records to avoid sampling bias and pseudoreplication (unless they represent a true observation of higher abundance in that area, which is probably only possible to be certain about given a structured sampling design). To further address sampling bias and remove clustering, you can use a package like spThin to remove records close to others, which also lowers spatial autocorrelation of the model residuals.

Although your models will still run because these are warnings, I highly suggest you investigate before going any further.

Jamie

Thanh Trang Pham

unread,
Oct 1, 2022, 7:38:33 AM10/1/22
to Maxent
Dear all,
I have an issue when running R:
e.mx.l <- ENMevaluate(occs = occs, envs = envs, bg = bg, algorithm = 'maxnet', partitions = 'randomkfold', partition.settings = list(kfolds = 10), tune.args = list(fc = c("L", "LQ", "H", "LQH", "LQHP", "LQHPT"), rm = 1:5))

Error: cannot allocate vector of size 13.3 Gb
Can you all please help me to resolve this issue? 
Thank you so much.

Bede-Fazekas Ákos

unread,
Oct 1, 2022, 2:49:04 PM10/1/22
to max...@googlegroups.com
Hello,

This error message mean that
a) you do not have enough RAM+swap/virtual memory to run the code; or
b) the arguments of the function (i.e. the variables "occs", "envs" and "bg") are not in a shape/format as ENMevaluate() expect them.

So to solve the problem, you should first double check the str() of occs, envs and bg, and if all of them are correct, then you should buy more RAM, allocate more swap/virtual memory, or reduce the memory demand of the function call by changing the parameterization (e.g. the tune.args parameter).

HTH,
Ákos
_______
Ákos Bede-Fazekas
Centre for Ecological Research, Hungary
--
You received this message because you are subscribed to the Google Groups "Maxent" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maxent+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/maxent/c762af43-becf-41bc-b4c2-759105ccc509n%40googlegroups.com.

Thanh Trang Pham

unread,
Oct 11, 2022, 12:13:30 AM10/11/22
to Maxent
Hi Asskos Bede-Fazekas, thank you so much for your help. 
Reply all
Reply to author
Forward
0 new messages