The **covariance** is a measure of the joint variability of two variables.
The covariance can take any value in the interval $(-\infty, \infty)$.
The covariance is positive, if the greater/smaller values of one variable mainly correspond to the greater/smaller values of the other variable.
The covariance is negative, if the variables tend to show opposite behavior, i.e. if greater values of one variable mainly correspond to the lesser values of the other.

The covariance, $s_{xy}$, is defined by the equation

$$s_{xy}=\frac{\sum_{i=1}^n(x_i-\bar x)(y_i-\bar y)}{n-1}\, . $$The **normalized version of the covariance**, is called the **correlation coefficient**.
The magnitude of the correlation coefficient indicates the strength of a linear relationship between two variables.

**Citation**

The E-Learning project SOGA-Py was developed at the Department of Earth Sciences by Annette Rudolph, Joachim Krois and Kai Hartmann. You can reach us via mail by soga[at]zedat.fu-berlin.de.

You may use this project freely under the Creative Commons Attribution-ShareAlike 4.0 International License.

Please cite as follow: *Rudolph, A., Krois, J., Hartmann, K. (2023): Statistics and Geodata Analysis
using Python (SOGA-Py). Department of Earth Sciences, Freie Universitaet Berlin.*