Example I

The inference process described in the section on per-cell extirpation has resulted in per-cell parameters $ (\alpha_t, \beta_t) $ for the beta distribution for extirpation from which we can infer a central estimate of extirpation in that cell by computing the mean of the distribution as $ (\alpha_t + \beta_t) / 2$

This map plots this mean per-cell posterior extirpation likelihood for Primula pauciflora over its historical habitat covering 9 grid cells in Bellhouse Park.

prim_accepted_sf <- st_read("Analysis_outputs/Primula pauciflora_Solow_low.shp", quiet=TRUE)
# Filter for region
prim_historical_sf <- prim_accepted_sf %>% dplyr::filter(assgnd_ == 77)
# Convert from mean likelihood of presence to mean likelihood of extirpation
prim_historical_sf$mean_ep <- 1 - prim_historical_sf$mean

pal <- colorNumeric(palette = "viridis", domain = range(c(0, prim_historical_sf$mean_ep), na.rm = TRUE))
m <- leaflet(data = prim_historical_sf) %>%
  # Add a Tiles layer to the map
  addProviderTiles("Esri.WorldImagery") %>%
  # Add the grid layer to the map
  addPolygons(fillColor = ~pal(mean_ep), fillOpacity = 0.8, 
              color = "#BDBDC3", weight = 1) %>%
  # Add a legend
  addLegend(pal = pal, values = c(0, max(prim_historical_sf$mean_ep, na.rm = TRUE)),
            opacity = 0.8, title = "Mean likelihood of extirpation")

# Print the map
m

This gridded search data is then passed for computing regional statistics as the second argument to the analyse_accepted function in Analyse.R:

analyse_accepted(thisTarget, accepted_grouped_merged, habitat_to_centres, exp_weight = exp_weight, solow_prob = solow_low)

Here exp_weight is the exponential kernel distance weighting parameter and solow_prob is the Solow prior probability of sighting. This produces posterior regional statistics for extirpation in historical habitat as follows:

target_stats <- read.csv("Analysis_outputs/Intermediate/Primula pauciflora_stats.csv")
target_stats_historical <- target_stats %>% dplyr::filter(Population == "PP1")
paged_table(target_stats_historical)

These show the computed parameters of the posterior beta distribution for extirpation expressed in two different forms - the standard (alpha, beta) representation and (mu, var) as parameters for the central estimate for sighting probability and its dispersion. Confidence bands are placed for this at [91.8%, 99.9%].

Here is this posterior distribution graphed out: