Page 1 of 1

Compute a covariance matrix

Posted: Wed Sep 23, 2015 1:48 pm
by yelena
Dear Tom,

I have a question about what exactly VCV procedure calculates. I have two series, RGDP and UR. In Excel, CORREL function gives me one result (0.50225) and in RATS VCV command gives me a different result (0.97051).

I read in the manual that VCV computes a residual covariance matrix. But what is the exact formula? What residuals do they take as series? From LINREG?

The excel file with the raw data is attached.

I have tried

cross(org=column,from=0,to=0) UR RGDP

and

CMOMENT(CORR,PRINT)
# RGDP UR
WRITE %CMOM

and then received the same results as in Excel file. So now my question is what VCV is calculating.

Thank you very much.

Yelena

Re: Compute a covariance matrix

Posted: Wed Sep 23, 2015 2:57 pm
by TomDoan
Without any other options, VCV computes the raw, uncentered covariance of the input series. The formula is in the User's Guide. It does not, itself, take residuals---it's usually applied to residuals. The Excel calculation subtracts means, which VCV will as well, if you use the CENTER option.

Re: Compute a covariance matrix

Posted: Wed Sep 23, 2015 8:22 pm
by yelena
Oh, thank you, Tom. It works now.