# [R] help computing a covariance

Spencer Graves spencer.graves at pdf.com
Fri Jul 2 19:23:54 CEST 2004

```Another thought:  Do you really need A to be an arbitrary k-vector?
Might it have other structure that you can use?  spencer graves

#################
Have you tried simulating several special cases?  The right set of
simulations should suggest an answer, which might then lead you to a
proof.

hope this helps.  spencer graves

Eugene Salinas (R) wrote:

> Thanks. This is sort of what I have been trying to do... but I keep
> ending up with products of non-independent chi-squares where I am sort
> of getting stuck. I knew this Theorem just never knew it was called
> Cochran's Thm. Btw, do you know of a good book that deals with
> multivariate statistics using vector notation etc. All the books I
> have seem to be focused on scalar random variables and they don't even
> mention it.)
>
> thanks, eugene.
>
>
> Spencer Graves wrote:
>
>>      Have you considered Cochran's theorem?  (A Google search just
>> produce 387 hits for this, the second of which
>> "http://mcs.une.edu.au/~stat354/notes/node37.html" provided details
>> that might help.)  By construction, P is n x n, idempotent of rank k,
>> so y'Py is chi-square(k).  Also, xA is an n-vector in the (rank k)
>> column space of x;  indeed, PxA = [x*inv(x'x)*x]xA = xA.  I can't see
>> the details now but I believe you can write (A'x'y)^2 = y'xAA'x'y as
>> a weighted sum of k independent chi-squares each with one degree of
>> freedom (since x and P have rank k), and then get what you want from
>> the sum of the weights.  Then check your result using Monte Carlo.
>>      hope this helps.  spencer graves
>>
>> Eugene Salinas (R) wrote:
>>
>>> Hi everyone,
>>>
>>> (This is related to my posting on chi-squared from a day ago. I have
>>> tried simulating this but I am still unable to calculate it
>>> analytically.)
>>>
>>> Let y be an n times 1 vector of random normal variables mean zero
>>> variance 1 and x be an n times k vector of random normal variables
>>> mean zero variance 1. x and y are independent.
>>>
>>> Then P is the projection matrix  P=x*inv(x'*x)*x'
>>>
>>> I need to figure out the covariance
>>>
>>> Cov ( y'*P*y , (A'*x'*y)^2 ) where A is a constant of dimension k
>>> times 1.
>>>
>>> thanks, eugene.
>>>
>>> ______________________________________________
>>> R-help at stat.math.ethz.ch mailing list
>>> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
>>> http://www.R-project.org/posting-guide.html
>>
>>
>>
>>
>>
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help