# Difference between revisions of "/Segment18"

Jump to navigation Jump to search

#### To Calculate

1. Random points i are chosen uniformly on a circle of radius 1, and their $(x_i,y_i)$ coordinates in the plane are recorded. What is the 2x2 covariance matrix of the random variables $X$ and $Y$? (Hint: Transform probabilities from $\theta$ to $x$. Second hint: Is there a symmetry argument that some components must be zero, or must be equal?)

$\theta ~ Unif(0, 2\pi)$

so the Pdf of \theta is:

$p(\theta) =1/2\pi$

$x=cos(\theta), y=sin(\theta)$

$E(x) = \int_0^{2\pi} cos\theta * 1/2\pi= 0$

$E(y) = \int_0^{2\pi} sin\theta * 1/2\pi= 0$

$E(x^2) = \int_0^{2\pi} cos^2\theta * 1/2\pi= 1/2$

$E(y^2) = \int_0^{2\pi} sin^2\theta * 1/2\pi= 1/2$

so, $Var(x)=E(x^2)-E^2(x)= 1/2$

$Var(y)=E(y^2)-E^2(y)= 1/2$

$Cov(x,y)= E(x-\mu_x)(y-\mu_y) =E(xy)$

$=\int_0^{2\pi} {sin\theta * cos\theta * \frac 1{2\pi} } d \theta = 0$

so $\Sigma= \begin{bmatrix} {Var(x)} & {Cov(x,y)}\\[0.4em] {Cov(y,x)} & {Var(y)} \end{bmatrix} = \begin{bmatrix} {\frac 12} & {0}\\[0.4em] {0} & {\frac 12} \end{bmatrix}$

2. Points are generated in 3 dimensions by this prescription: Choose $\lambda$ uniformly random in $(0,1)$. Then a point's $(x,y,z)$ coordinates are $(\alpha\lambda,\beta\lambda,\gamma\lambda)$. What is the covariance matrix of the random variables $(X,Y,Z)$ in terms of $\alpha,\beta,\text{ and }\gamma$? What is the linear correlation matrix of the same random variables?

$\lambda ~ Unif(0,1), so P(\lambda)=1,$

$E(x)= E(\alpha \lambda) =\int_0^1 \alpha \lambda d\lambda =\alpha/2$

similarly,

$E(y)= \beta/2, E(z)=\gamma/2$

$E(x^2) =E(\alpha^2 \lambda^2) =\int_0^1 \alpha^2 \lambda^2 d\lambda =\frac {\alpha^2}3$

similarly,

$E(y^2) = \frac {\beta^2}3, E(z^2) =\frac {\gamma^2}3$

So, $Var(x)=E(x^2)-E^2(x) =\frac {\alpha^2}{12}$

Similarly, $Var(y)= \frac {\beta^2}{12} , Var(z)= \frac {\gamma^2}{12}$

$Cov(x, y) =E(x-\mu_x)(y-\mu_y) = E(\alpha \lambda - \frac \alpha2) (\beta \lambda - \frac {beta}2 = \int_0^1 (\alpha \beta \lambda^2-\alpha \beta \lambda + \frac {\alpha\beta}4 ) d{\lambda} = \frac {\alpha \beta}{12}$

simiarly, $Cov(x, z)= \frac {\alpha \gamma}{12}, Cov(y, z) =\frac {\beta \gamma}{12}$

So,

$\Sigma= \begin{bmatrix} {Var(x)} & {Cov(x,y)}& {Cov(x, z)} \\[0.4em] {Cov(y,x)} & {Var(y)} & {Cov (y, z)}\\[0.4em] {Cov(z,x)} & {Cov(y, z)} & {Var(z)} \end{bmatrix} = \begin{bmatrix} {\frac {\alpha^2}{12}} & {\frac {\alpha\beta}{12}}&{\frac {\alpha\gamma}{12}}\\[0.4em] {} & {\frac {\beta^2}{12}}&{\frac {\beta\gamma}{12}}\\[0.4em] {} & {}&{\frac {\gamma^2}{12}} \end{bmatrix}$