environmentaltools.spatiotemporal.indicators.directional_coevolution

environmentaltools.spatiotemporal.indicators.directional_coevolution(cube_x, cube_y)[source]

Calculate directional coevolution between two variables.

Measures how often two variables change in the same direction over time. This identifies areas where variables have coordinated temporal dynamics versus areas where they evolve independently or oppositely.

Parameters:
  • cube_x (np.ndarray) – 3D arrays with shape (time, lat, lon) for the two variables.

  • cube_y (np.ndarray) – 3D arrays with shape (time, lat, lon) for the two variables.

Returns:

coevolution_map – 2D map of directional agreement (0-1 scale).

Return type:

np.ndarray

Notes

The function computes temporal differences (changes) for both variables, then calculates the proportion of time when both variables change in the same direction (both increase or both decrease).

Values near 1 indicate strong coevolution, values near 0 indicate independent evolution, and values near 0.5 suggest random relationships.

Examples

>>> import numpy as np
>>> cube_x = np.random.random((100, 20, 20))
>>> cube_y = np.random.random((100, 20, 20))
>>> coevolution = directional_coevolution(cube_x, cube_y)