The covariance between two jointly distributed real-valued random variables X and Y with finite second moments is defined as the expected product of their deviations from their individual expected values.
协方差,是用来度量两种随机变量之间关系的统计量。在数学中,描述一类数据的概念有均值,方差还有标准差,它们都是只在同一类数据中起到描述作用。但是对于不同类的数据呢?比方说我每天在食物上的花销和我的学习成绩是否有关系?是正相关(吃得越好成绩越好),负相关(吃得越好成绩越差)还是彼此独立(吃什么和成绩无关)?
均值,方差,标准差
X=(x1,x2,...,xn)
均值: X⎯⎯⎯=∑i=1nxin
方差: D=∑i=1n(xi−x⎯)2n−1=E(X−E(X))2,E(X)是期望
标准差: S=D‾‾√=∑i=1