Page 1 of 1

How to form coefficients covariance matrix object

Posted: Sun Jan 09, 2011 8:55 pm
by strongbarce
Hi,

I wonder how to form a covariance matrix object for selected coefficients after estimation. For example, I got c(1) to C(10), ten coefficients from an estimation commend, but I only need form a matrix object which is the covariance matrix of C(1), C(5), and c(10). How can I achieve it?


Thanks

Re: How to form coefficients covariance matrix object

Posted: Mon Jan 10, 2011 9:39 am
by EViews Gareth
That's actually quite tricky. You'll have to extract the entire matrix, using the @coefcov data member. Once you have the entire matrix, you'll have to take out the pieces you want into a new matrix using the @subextract command.

Re: How to form coefficients covariance matrix object

Posted: Mon Jan 10, 2011 1:29 pm
by EViews Glenn
You can simplify Gareth's suggestion somewhat by using the method you would use if doing a Wald test by hand.

Suppose that you extract the @coefcov into the matrix COEFCOV. Then to get the 3 x 3 matrix of coefficients for C(1), C(5) and C(10) (assuming that they coefficients are ordered 1-10), you can create the selection matrix

Code: Select all

matrix(3,10) select select = 0 select(1,1) = 1 select(2,5) = 1 select(3,10) = 1
which is the restriction matrix for the corresponding joint Wald test. This matrix has the number of rows equal to the number of subcoefficient elements you have and the number of columns corresponding to the original coefficient matrix, and has 1's in the columns of interest (1, 5, 10). Then form the matrix expression

Code: Select all

sym subcov = select*COEFCOV*@transpose(select)
You should be able to verify that this gives you the desired matrix. Given SELECT and the equation EQ1, you can do this in one line as

Code: Select all

sym subcov = select*EQ1.@coefcov*@transpose(select)