Skip to contents

Which climatic variables account for movement towards or away from the species’ average climate, and does their contribution vary geographically? The analysis partitions the change in squared distance from the reference centre among the fitted climatic variables at each location.

Cell level contributions

The object spatial_fit is the European anchovy fit constructed in the Mediterranean example. Contributions are restricted to cells with positive current reference weight.

contribution <- climniche_dominant_contribution(
  spatial_fit,
  scope = "current"
)

summary(contribution)
head(contribution[["table"]])

Let \(z_{0i}\) and \(z_{1i}\) be the centred current and future climate vectors for cell \(i\), and let \(A\) be the fitted metric matrix. The contribution of variable \(j\) is

\[ V_{ij} = z_{1ij}(A z_{1i})_j - z_{0ij}(A z_{0i})_j, \]

so that

\[ \sum_j V_{ij} = r_{1i}^2 - r_{0i}^2 = R_i(r_{1i} + r_{0i}), \]

where \(r_{0i}\) and \(r_{1i}\) are current and future distances from the reference centre, and \(R_i\) is Niche Distance Shift. Positive contributions increase squared distance and negative contributions reduce it. The dominant variable has the largest \(\lvert V_{ij}\rvert\). Its dominance share is

\[ H_i = \frac{\max_j \lvert V_{ij}\rvert} {\sum_j \lvert V_{ij}\rvert}. \]

Values near one indicate that a single variable accounts for most of the total absolute contribution at that cell. Equal largest contributions are retained as ties.

Mediterranean pattern

variable_labels <- c(
  temperature_mean = "Mean temperature",
  temperature_range = "Temperature range",
  salinity_range = "Salinity range",
  ph_mean = "Mean pH",
  sea_water_speed_mean = "Mean current speed",
  sea_water_speed_range = "Current speed range"
)
variable_colours <- c(
  temperature_mean = "#0072B2", temperature_range = "#D55E00",
  salinity_range = "#009E73", ph_mean = "#CC79A7",
  sea_water_speed_mean = "#56B4E9", sea_water_speed_range = "#6A3D9A"
)

contribution_maps <- plot_climniche_dominant_contribution(
  contribution,
  type = "both",
  variable_labels = variable_labels,
  colours = unname(variable_colours[contribution[["variables"]]]),
  legend_variables = names(variable_labels),
  study_region = mediterranean_boundary,
  degree_labels = "hemisphere"
)

# Compare the mean absolute contribution shares across the current distribution.
contribution_summary <- summary(contribution)
contribution_summary[["label"]] <- variable_labels[contribution_summary[["variable"]]]
contribution_bar <- ggplot2::ggplot(
  contribution_summary,
  ggplot2::aes(x = mean_absolute_share, y = reorder(label, mean_absolute_share),
               fill = variable)
) +
  ggplot2::geom_col() +
  ggplot2::scale_fill_manual(values = variable_colours, guide = "none") +
  ggplot2::scale_x_continuous(labels = function(x) paste0(round(100 * x), "%")) +
  ggplot2::labs(
    title = "(a) Distribution-wide climatic contributions",
    x = "Mean absolute contribution share", y = NULL
  ) +
  ggplot2::theme_classic()

contribution_maps[[1]] <- contribution_maps[[1]] +
  ggplot2::labs(title = "(b) Dominant climatic contribution")
contribution_maps[[2]] <- contribution_maps[[2]] +
  ggplot2::labs(title = "(c) Dominance share")
contribution_bar / contribution_maps + patchwork::plot_layout(heights = c(0.9, 1.05))

Mean pH accounts for 68.3% of the absolute contribution on average across the current modelled distribution (a). Each variable’s share is calculated at each location before averaging with suitability weights. Temperature range dominates in the northern Adriatic and salinity range in much of the Aegean (b). Panel (c) shows the share attributable to the dominant variable at each location.

The weighted dominance frequency is the reference-weighted fraction of cells with non-zero contribution for which a variable is uniquely dominant.

Climate variable Mean absolute share Weighted dominance frequency
Mean pH 0.683 0.827
Temperature range 0.131 0.071
Salinity range 0.107 0.100
Mean temperature 0.041 0.000
Current speed range 0.029 0.002
Mean current speed 0.009 0.000

These contributions describe climatic distance change, not SDM predictor importance. With a non-diagonal metric matrix, each contribution also includes the variable’s allocated cross-variable terms.