{ "cells": [ { "cell_type": "markdown", "id": "329b70ac-fb96-46f9-93a5-a935043d835d", "metadata": {}, "source": [ "
Prof. Dr. Markus Meier
\n",
" Leibniz Institute for Baltic Sea Research Warnemünde (IOW)
\n",
" E-Mail: markus.meier@io-warnemuende.de
Figure 1: Three examples of 2-dimensional normal distributions for uncorrelated variables (left) and for correlated variables (middle and right). Note that the covariance is proportional to the correlation.
\n", "```\n", "\n", "- covariance matrix = covariance between all possible pairs of the components $X_i$ and $Y_j$ of the vectors $\\vec{X}$ and $\\vec{Y}$, with i=1..m and j=1..n the covariance matrix is a (m x n)-matrix\n", "```{math}\n", "\\Sigma^2_{\\vec{X},\\vec{Y}} = \\int_{\\mathbb{R}^m}\\int_{\\mathbb{R}^n} (\\vec{x}-\\vec{\\mu_x})(\\vec{y}-\\vec{\\mu_y})^T f_{\\vec{X},\\vec{Y}}(\\vec{x},\\vec{y})~d\\vec{x}d\\vec{y}\n", "```\n", "- characteristics of the covariance matrix:\n", " 1. the covariance describes the tendency of jointly continous random variables to vary in concert. If deviations of $X_i$ and $Y_j$ from their respective means tend to be of the same sign, the covariance between them will be positive and vice versa\n", " 2. $X_i$ and $Y_j$ are said to be independent if the covariance is zero\n", " 3. The covariance is only a good measure of the joint variability of two continous random variables if each of them is nearly normal distributed (as the variance of a pdf for the spread)\n", " 4. auto covariance $\\Sigma^2_{\\vec{X},\\vec{X}}$ is symmetric\n", "```{figure} figures/L11/L11_2_covariance_2m.PNG\n", "---\n", "width: 40%\n", "---\n", "Figure 2: The global standard deviation of the NCEP monthly mean 2m temperature field. An illustration of the square root of the diagonal elements of the covariance matrix. Units are in Kelvin.
\n", "```\n", "\n", "## Correlation\n", "- scale invariant correlatiion:\n", "```{math}\n", "\\rho_{x,y} = \\frac{Cov(X,Y)}{\\sqrt{Var(X)Var(Y)}} = \\frac{Cov(X,Y)}{\\sigma(X)\\sigma(Y)}\n", "```\n", "- characteristics of the correlation:\n", " 1. The correlation coefficient takes values in the interval [-1,1].\n", " 2. $\\rho_{x_iy_j}$ builds the (i,j)-th element of the correlation matrix between $\\vec{V}$ and $\\vec{Y}$.\n", " 3. As for the covariance, the correlation coefficients are an indication of the extent to which two variables X and Y are linearly related; that is $Y=a+bx$.\n", " 4. $\\rho^2_{xy}$ can be interpreted as the explained variance. Is is the proportion of the variance of one of the variables that can be represented by a linear model of the other.\n", " 5. Note, that two variables with zero correlation can still be related by a non-linear relation\n", " 6. Note, that two variables with non-zero correlation are not necessarily directly related to each other. Both can depend on a third variable.\n", " 7. As for the covariance, the correlation is only a good measure to covariability if both variables are nearly normal distributed.\n", " 8. $\\rho_{X_iX_j}$ refers to the auto-correlation if $X_i$ and $X_j$ are variables of the same quantity (e.g. temperature). The cross-correlation otherwise.\n", " 9. We refer to lag/lead correlations if the indices $i,j$ refer to different in time.\n", " \n", "```{figure} figures/L11/L11_3_correlation.PNG\n", "---\n", "width: 40%\n", "---\n", "Figure 3: Illustration of correlation values by a scatter and time-series plot.
\n", "```\n", "\n", "```{figure} figures/L11/L11_4_correlation.PNG\n", "---\n", "width: 30%\n", "---\n", "Figure 4: Illustration of a non linear relation between x1 and x2 with a correlation coefficient of zero.
\n", "```\n", "\n", "- statistics can deliver the indication of interrelation between two variabes, but to really confirm a connection one has to create a model and vary some parameters and analyse the outcome\n", "- there are different types of correlatio coefficients but the pearson correlation coefficient assuming a linear interrelation between two variables is the most common one. others woulld be: Spearman's rank correlation coefficient $\\rho$, Kendall's tau $\\tau$, Point-Biserial correlation coefficient $r_{pb}$ or Phoi coefficient $\\phi$.\n", "\n", "- diagonal elements of the correlation matrix: insert explanatory text\n", "```{figure} figures/L11/L11_5_pttopt_correlation.PNG\n", "---\n", "width: 30%\n", "---\n", "Figure 5: Correlation of monthly mean 2m-temperature with 1000hPa geopotential height. Data from the NCEP period.
\n", "```\n", "\n", "- box correlation: insert explanatory text\n", "```{figure} figures/L11/L11_6_box_correlation.PNG\n", "---\n", "width: 50%\n", "---\n", "Figure 6: Global auto-correlation fields of one point (box) with the global field of monthly mean sea surface temperature (left) and NCEP 500hPa geopotential height (right).
\n", "```\n", "\n", "- teleconnections: insert explanatory text\n", "```{figure} figures/L11/L11_7_teleconnections.PNG\n", "---\n", "width: 40%\n", "---\n", "Figure 7: Correlation of monthly mean sea surface temperature with NINO3-index region. Data from HADISST 1950 to 2010; linearly detrended.
\n", "```\n", "```{figure} figures/L11/L11_8_NAO.PNG\n", "---\n", "width: 50%\n", "---\n", "Figure 8: Correlation of monthly mean 1000hPa geopotential height field with the NAO-index (Azores - Iceland).
\n", "```\n" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.6" } }, "nbformat": 4, "nbformat_minor": 5 }