<aside> 📦

You have to first install and load these packages in R

</aside>

  1. Illegal wildlife trade amounts to USD 6 - 20 billion annually. Rosewoods alone amount to nearly 40%, more than all animal products added together. Southeast Asian rosewoods are the most exploited ones. In this practical, we will predict the species distribution model of Dalbergia oliveri.
    1. GBIF (Global Biodiversity Information Facility) is a very important data source that contains > 3 billion occurrence records globally.

      occ <- occ(query = "Dalbergia oliveri", from = "gbif", has_coords = TRUE)
      occ.df <- occ2df(occ)
      
    2. We will convert the occ.df to a sf object by extracting the second and third column with st_as_sf.

      • Answer
    3. We also download the map for five countries in southeast Asia using ne_countries() from rnaturalearth package. Specify country = c("Thailand", "Laos", "Cambodia", "Vietnam", "Myanmar").

      • Answer
    4. With ggplot2, plot the occurrences on the southeast Asia map.

      • Answer
    5. This looks weird… apparently there are many wrong records that are outside the expected range. We will remove everything beyond these five countries using st_filter.

      • Answer
    6. We have to chose a projected CRS, as point process models live in continuous space. distance and areas must be in metres, not degrees. We will pick a UTM zone and re-project is using st_transform(). Google UTM zones. Which should we pick and what is its corresponding EPSG code?

      • Answer
    7. Now, we will construct a matrix with the locations where we want to predict the point process intensity. We first create a raster of 100 x 100 cells covering the map with the rast(). Then we will retrieve the coordinates of the cells with the xyFromCell() function. You should have learned how to do this in the previous exercise.

      • Answer
    8. We will transform the coordinates of all cells to a sf object.

      • Answer
    9. Only retain these points inside the study region.

      • Answer
    10. We will then produce a point pattern ppp object. We need a window owin (study region).

      seasia_union <- st_union(seasia_proj)
      w <- as.owin(seasia_union)
      
      do.coords <- st_coordinates(do_proj)
      
      pp <- ppp(
        x = do.coords[, "X"],
        y = do.coords[, "Y"],
        window = w
      )
      
    11. We will point process models. First, we will fit a homogeneous Poisson model (with no covariates). This is a null model, where intensity is constant over space.

      fit0 <- ppm(pp, ~ 1)
      summary(fit0)
      
    12. Now we will model intensity as a log-linear function of x and y of the occurrence points.

      fit1 <- ppm(pp, ~ x + y)
      summary(fit1)
      
    13. We will use Akaike’s Information Criterion (AIC) to determine with model is the simplest but the most informative. The lower the AIC score, the better the model.

      AIC(fit0)
      AIC(fit1)
      
    14. We can then predict the species intensity across the region, using the predict() function with type = "trend".

      • Answer
    15. We then convert this prediction to a raster and visualise it together with the country boundaries.

      lambda.im.r <- raster(lambda.im)
      plot(lambda.im.r, main = "Predicted intensity (raster)")
      plot(st_geometry(seasia_proj), add = T)
      

      Is this what you expected? Do you think the prediction looks overly simplified? Why?

      • Answer

<aside> 🎊

Big big congratulations! You have competed this set of practicals and learned about all the fundamentals in spatial models and analyses.

Well, spatial analysis is not only about maps, but…

image.png

</aside>