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.
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.
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 = "(c) Distribution-wide climatic contributions",
x = "Mean absolute contribution share", y = NULL
) +
ggplot2::theme_classic()
contribution_maps / contribution_bar + patchwork::plot_layout(heights = c(1, 0.95))Panel (a) maps the variable with the largest absolute contribution and retains all six fitted climate variables in its legend. Panel (b) maps the dominant variable’s share of the total absolute contribution at the same cell. Panel (c) shows the suitability-weighted mean of each variable’s absolute share, calculated at each location before averaging. Mean pH has the largest absolute term in most cells with positive anchovy reference weight. Temperature range and salinity range have the largest term in smaller, geographically distinct areas.
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.