Due: 5pm Mon, Feb 23 2015 via GauchoSpace

Introduction

In this lab, you’ll predict the distribution of a species using the software package Maxent, short for “maximum entropy” – the statistical technique used to fit a model differentiating species observations from the background environmental data. You’ll use “presence” points from the Global Biodiversity Information Facility (GBIF), and bioclimatic environmental predictors from WorldClim.org.

Here’s a figure of the overall process:

1 Species Response Data from GBIF

1.1 Choose Species

Choose a species from this Species List and enter your name in the student column so we all do different species. This list was derived from the species listed in tables 24 and 27 from Santa Barbara County’s Burton Mesa Ecological Reserve Final Land Management Plan and Environmental Impact Report where at least 100 occurence records are found for Santa Barbara County’s extent (longitude: -121 to -119; latitude: 34 to 36) in the Global Biodiversity Information Facility GBIF.org.

Set your working directory (wd) and scientific species name (sp_scientific) of your chosen species (Genus species only) in the set_vars R chunk below.

wd = 'H:/esm215/lab6_species'
sp_scientific = 'Amphispiza belli'

1.2 Fetch GBIF Occurrences (automatic)

The next R chunk fetches the first 1000 occurrences from GBIF using the rgbif R package.

1.3 Filter by Bounding Box (interactive)

You’ll want to restrict observations to those in the Americas, so we can later predict to Santa Barbara County. To do this, you’re provided with an interactive map to draw a bounding box extent around the points of interest.

For the interactive drawing to work, you’ll want to go to upper right RStudio menu Chunks -> Run All so the R code is run from the Console. (Note: Knitting the R Markdown document is not interactive.)

The bounding box extent is saved to spp/*_extent.csv which is read in next time the code runs. (The interactive drawing of bounding box is presented if the file’s not found, or defaults to global extent if not run interactively.).

plot of chunk draw_bboxplot of chunk draw_bbox

If only a few points are within the Americas (and most in other continents), please update Species List and the set_vars R chunk with a new species selection, delete the spp folder, go to menu Chunks -> Run All again.

1.4 Partition Points into Training and Test (automatic)

The next R chunk:

  1. Filters the GBIF observation points based on the drawn extent from the previous step, and

  2. Partitions these points randomly into:

  1. train for model fitting (80% of filtered points), and

  2. test for model evaluation (20%).

  1. Plots train (red) and test (blue) points onto a map.

plot of chunk partition_plot_pts