Thursday, February 1, 2018

Playing around with a new version of response plots

On the develop branch of the R version of ENMTools, I've been playing around with a new way of plotting marginal response functions.  In the figure above, the solid blue line represents the relative suitability of habitat as a function of an environmental gradient, with all other variables being held constant at their mean value for all presence and background points.  The green and red dashed lines represent the relative frequency of occurrence of different values of the environmental variable.  This is a Bioclim model, which is why it looks so chunky.

The goal here is to give you some idea of what your model is saying in the context of the data that generated it, instead of just plotting the response function.  Currently it's been tested on GAM, GLM, Bioclim, and Domain models.  I'll do some more testing and probably move it over to the main branch before the weekend.

Wednesday, January 31, 2018

Correlation MDS-space plots added to raster.cor.plot

Here's a handy little visualization when you're interested in the correlations between your rasters.  Basically it takes the matrix of absolute values of correlation coefficients for a set of rasters, turns it into a distance matrix, and then does MDS scaling on it.  The resulting coordinates are turned into a nice little plot, where highly correlated variables are plotted closer to each other than more uncorrelated variables.  It's a good way to eyeball relationships during variable selection.  Here's one for a set of 20 bioclimatic variables.

Currently this is on the develop branch on GitHub, but I'll be merging it into the master branch as soon as it passes through testing.


Massive wad of ENMTools-R updates just published

I've spent the last month relentlessly tweaking ENMTools-R's code to make it CRAN-compatible, and we're pretty much there now.  Most of the changes aren't visible from the user's end of things, but they're necessary to make sure that it's suitable for wider distribution.  I've tested everything, and it seems to all be working.

THAT SAID, it's entirely possible that something has been borked up that isn't popping up in my own code.  If you download ENMTools from the GitHub repository and notice it acting weird in some way, please don't hesitate to raise a GitHub issue about it.

Also, there's a nice new function called raster.cor.plot that does this:


Which is pretty darn cute if I do say so myself.  It's visualizing the correlations between a set of predictor rasters.


Friday, January 5, 2018

Best to avoid using B1 breadth metric in environment space

This just came to light relatively recently: the latin hypercube version of the B1 metric in environment space is probably not trustworthy as currently implemented.  Due to the combination of standardizing the distribution and the use of logs in the calculation, there's a dependence on sample size that makes the metric fail to converge.  For an illustration, here's B2 as a function of sample size:


That's behaving as you'd like it to - seems to be converging on a relatively stable value, not changing much with additional sampling (note the scale of the Y axis).

Now look at B1:

There's an obvious trend here with increasing sample size, and the scale of the Y axis is such that those differences could be quite significant. 

At some future date we may figure out how to adjust for this, but for now I'd say just avoid using B1 in environment space altogether.