From: Tom Braukmann on
Hi,
I want to compute a Covarianze Matrix from a large Dataset (N=400) with a lot of Observations (T=400). However some of the Observations have NaN. Thus I want to compute the Covariances individually and only for the times where two Variables have observations at the same time. Then I want to fill in these Covariances in a Matrix and have another Matrix with the number of the observations for ech individual Covariance.
I have no idea how to do this- any suggestions?

Best
tom
From: Peter Perkins on
On 6/28/2010 8:05 AM, Tom Braukmann wrote:
> Hi, I want to compute a Covarianze Matrix from a large Dataset (N=400)
> with a lot of Observations (T=400). However some of the Observations
> have NaN. Thus I want to compute the Covariances individually and only
> for the times where two Variables have observations at the same time.

If you have access to the Statistics Toolbox, use the NANCOV function.
If not, use a combination of CORRCOEF (with the 'rows' parameter') and STD.

Hope this helps.