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
How to form coefficients covariance matrix object
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
strongbarce
- Posts: 5
- Joined: Thu Jan 06, 2011 5:51 pm
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13603
- Joined: Tue Sep 16, 2008 5:38 pm
Re: How to form coefficients covariance matrix object
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.
-
EViews Glenn
- EViews Developer
- Posts: 2682
- Joined: Wed Oct 15, 2008 9:17 am
Re: How to form coefficients covariance matrix object
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
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
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
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
Code: Select all
sym subcov = select*COEFCOV*@transpose(select)Code: Select all
sym subcov = select*EQ1.@coefcov*@transpose(select)Who is online
Users browsing this forum: No registered users and 1 guest
