Tuesday, February 27, 2018

Interactive species and model plots

Russell Dinnage has just added a really cool feature: interactive plotting of enmtools.species and enmtools.model objects.  Here's a species:

And here's a model:

The maps are zoom-able and pan-able, and draw very quickly.  Source maps are downloaded from the internet on the fly, though, which means you do need an internet connection to use these functions.

The functions in question are "interactive.plot.enmtools.species" and "interactive.plot.enmtools.model", respectively.  All are now implemented on the master branch of ENMTools on GitHub.

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.

Monday, November 20, 2017

Pardon our dust

We're doing a whole bunch of stuff to the ENMTools R package right now.  A lot of it is below the hood (cleaning up dependencies for CRAN and whatnot), but some of it is in service of implementing new functionality.  Anyway, in the process of fixing a few things we also broke a few things, so if you've downloaded ENMTools from the main branch in the past few days you might be having some trouble.  I've fixed the bits that I have found so far, and the new code is now up on the main branch.  We're going to make a real push over the next little while to get some testthat code working and get set up with continuous integration to avoid these mishaps in the future. 

Monday, October 16, 2017

Model-based inference in historical and ecological biogeography 2017!

Matthew van Dam and I will be offering a new class in Barcelona with Transmitting Science this year, based in large part on the class that Nick Matzke and I taught last year.  It's called Model-based Inference in Historical and Ecological Biogeography, and if last year was any indication it's going to be a lot of fun.  We'll mostly be focusing on BioGeoBEARS and the new ENMTools R package, and there's a whole lot of very cool stuff going on with both.  Join us if you can!