First question

Consider the following mean vector and covariance matrix corresponding to the random vector \((Y = Y_1, Y_2, Y_3)\):

\(\mu\)=

[2

7

6]

and

\(\sigma\)=

[4 3 -3

2 4 -1

-3 -1 6]

Use proc iml to answer the following:

a)determine the elements of the matrix G such that:

GY = (\(Y_1+Y_2+Y_3, Y_3-Y_1, 0.5Y_1-0.5Y_3+2Y_2\))` (I refer to this product as Z)

c)Find the unique symmetric matrix A so that Y'AY=Y'GY

\(\mu\)=

[2

7

6]

and

\(\sigma\)=

[4 3 -3

2 4 -1

-3 -1 6]

Use proc iml to answer the following:

a)determine the elements of the matrix G such that:

GY = (\(Y_1+Y_2+Y_3, Y_3-Y_1, 0.5Y_1-0.5Y_3+2Y_2\))` (I refer to this product as Z)

c)Find the unique symmetric matrix A so that Y'AY=Y'GY

[1 1 1

-1 0 1

.5 2 -.5]

However, solving algebraically for G:

\(GY=Z

GYY'=ZY'

G(YY')(YY')^{-1}=ZY'(YY')^{-1}

G=ZY'(YY')^{-1}\)

I use the following SAS code to solve for G:

Code:

```
proc iml;
y={2, 7, 6};
sigma={4 3 -3,2 4 -1,-3 -1 6};
z={15, 4, 12};
print y sigma z;
zyt=z*y`;
inv=inv(y*y`);
g=zyt*inv;
check= g*y;
print g check;
run;
quit;
```

I know that only singular square matrices can have inverses, but I don't know why this matrix would be non singular.

I also ran similar code and actually got it to work, but it was a weird matrix, just a bunch of decimals.

For c), I tried solving it algebraically again, and eventually it gets to A = G. However, G isn't symmetric. I'm not sure what else to do.

Question 2

Suppose that \(Y_n~N_n(\mu, \sigma)\) and \(A=\sigma^{-1} - \frac{(\sigma^{-1}J\sigma)}{1'_n\sigma^{-1}1_n}\). WHat distribution does Y'AY have?

Any help would be greatly appreciated.