# 相关系数

1，相关系数：$\rho_{XY}=\frac{\text{Cov}(X,Y)}{\sqrt{D(X)}\cdot\sqrt{D(Y)}}=\frac{E(XY)-E(X)E(Y)}{\sqrt{D(X)}\cdot\sqrt{D(Y)}}$

2，$$\rho_{XY}=1$$：$$X,Y$$ 完全线性相关，$$Y=aX+b$$；

$$\rho_{XY}=-1$$：$$X,Y$$ 完全线性相关，$$Y=-aX+b$$；

$$\rho_{XY}=0$$：$$X,Y$$ 不相关（没有线性关系）。

$D(U)=D(2X+Y)=4D(X)+D(Y)=5\lambda$

$D(V)=D(2X-Y)=4D(X)+D(Y)=5\lambda$

$\rho_{UV}=\frac{\text{Cov}(U,V)}{\sqrt{D(U)}\cdot\sqrt{D(V)}}=\frac{3\lambda}{5\lambda}=\frac{3}{5}$

\begin{align*}E(X)&=\int_{-\infty}^{\infty}xf(x,y)dydx=\int_0^1\int_0^x3x^2dydx\\ &=\int_0^13x^2y\Big|_0^xdx=\int_0^13x^3dx\\ &=\frac{3x^4}{4}\Big|_0^1=\frac{3}{4}\end{align*}

\begin{align*}E(X^2)&=\int_{-\infty}^{\infty}x^2f(x,y)dydx=\int_0^1\int_0^x3x^3dydx\\ &=\int_0^13x^3y\Big|_0^xdx=\int_0^13x^4dx\\ &=\frac{3x^5}{5}\Big|_0^1=\frac{3}{5}\end{align*}

\begin{align*}E(Y)&=\int_{-\infty}^{\infty}yf(x,y)dxdy=\int_0^1\int_y^13xydxdy\\ &=\int_0^1\frac{3yx^2}{2}\Big|_y^1dy=\int_0^1\frac{3y}{2}(1-y^2)dy\\ &=\frac{3y^2}{4}-\frac{3y^4}{8}\Big|_0^1=\frac{3}{8}\end{align*}

\begin{align*}E(Y^2)&=\int_{-\infty}^{\infty}y^2f(x,y)dxdy=\int_0^1\int_y^13xy^2dxdy\\ &=\int_0^1\frac{3y^2x^2}{2}\Big|_y^1dy=\int_0^1\frac{3y^2}{2}(1-y^2)dy\\ &=\frac{y^3}{2}-\frac{3y^5}{10}\Big|_0^1=\frac{1}{5}\end{align*}

\begin{array}{l}D(X)=E(X^2)-(E(X))^2=\frac{3}{5}-\frac{9}{16}=\frac{3}{80}\\ D(Y)=E(Y^2)-(E(Y))^2=\frac{1}{5}-\frac{9}{64}=\frac{19}{320}\\ \text{Cov}(X,Y)=E(XY)-E(X)E(Y)=\frac{3}{10}-\frac{3}{4}\cdot\frac{3}{8}=\frac{3}{160}\end{array}

\begin{align*}\rho_{XY}&=\frac{\text{Cov}(X,Y)}{\sqrt{D(X)}\cdot\sqrt{D(Y)}}\\ &=\frac{3/160}{\sqrt{3/80}\cdot\sqrt{19/320}}=\sqrt{\frac{6}{38}}\end{align*}