Compute a covariance matrix

Econometrics questions and discussions
yelena
Posts: 31
Joined: Wed Sep 09, 2015 8:49 pm

Compute a covariance matrix

Unread post 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
Attachments
RGDP_UR_Raw_Data.xlsx
(10.97 KiB) Downloaded 760 times
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Compute a covariance matrix

Unread post 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.
yelena
Posts: 31
Joined: Wed Sep 09, 2015 8:49 pm

Re: Compute a covariance matrix

Unread post by yelena »

Oh, thank you, Tom. It works now.
Post Reply