{ "cells": [ { "cell_type": "markdown", "id": "20fce00f", "metadata": {}, "source": [ "# ML, Data Analysis\n", "### Probability: covariance matrix\n", "\n", "The **covariance matrix** extends the idea of variance and covariance for n-dimensional random vectors. Thus, the vocariance matrix for an n-dimensional random vector $X$ is $n\\times n$ symmetric matrix where:\n", "- diagonal elements are variance of each component of vector $X$\n", "- off-diagonal elements are covariance between componets of vector $X$\n", "\n", "Formally, the **covariance matrix** $cov(X)$, also called **auto-covariance matrix**, for a random vector $\\boldsymbol{X}=[X_1,X_2,...,X_n]^T$ is computed by:\n", "
\n", "$\\large cov(\\boldsymbol{X})=E[(\\boldsymbol{X}-E[\\boldsymbol{X}])(\\boldsymbol{X}-E(\\boldsymbol{X}))^T]$\n", "