Inverse of the covariance matrix of the residuals
Inverse of the covariance matrix of the residuals
Dear Tom,
I have a problem with the CVOUT option of the ESTIMATE instruction. I am trying to estimate a large VAR (including over 50 variables) and for further calculations I need to compute the inverse of the symmetric covariance matrix of the residuals that I get by using the CVOUT option. When I include up to 51 variables in the VAR this works totally fine, but if I increase the number of variables above 51 I always get an error message that the covariance matrix is non-invertible. So, is there a limit in the number of variables? Or do you have an idea what could be the problem? Maybe the INV function? Any help would be highly appreciated.
Best wishes
Trebor
I have a problem with the CVOUT option of the ESTIMATE instruction. I am trying to estimate a large VAR (including over 50 variables) and for further calculations I need to compute the inverse of the symmetric covariance matrix of the residuals that I get by using the CVOUT option. When I include up to 51 variables in the VAR this works totally fine, but if I increase the number of variables above 51 I always get an error message that the covariance matrix is non-invertible. So, is there a limit in the number of variables? Or do you have an idea what could be the problem? Maybe the INV function? Any help would be highly appreciated.
Best wishes
Trebor
Re: Inverse of the covariance matrix of the residuals
How many data points do you have? If it's right around 50, then you probably have a covariance matrix that's forcibly singular---the rank of a cross product matrix can't be greater than the number of data points. Now, you will also have problems estimating a VAR with that many variables, but RATS is set up to allow for singular cross product matrices in regressions (it just zeros out the excess coefficients) as the inversion is part of a larger calculation. But if you just invert a singular matrix, it will give an error.
Re: Inverse of the covariance matrix of the residuals
Dear Tom,
Thank you very much for the quick reply.
Actually I have 103 data points for each variable included in the VAR. So, I guess this should be enough? Do you have an idea what else could be going wrong?
Best wishes
Trebor
Thank you very much for the quick reply.
Actually I have 103 data points for each variable included in the VAR. So, I guess this should be enough? Do you have an idea what else could be going wrong?
Best wishes
Trebor
Re: Inverse of the covariance matrix of the residuals
Residuals aren't full rank. In fact, if you have 103 data points and 51 variables + constant, each set of residuals has only 51 degrees of freedom (103-51-1). However, because each residual is constructed using a different LHS variable that appears nowhere else, that usually is enough to give you an overall full rank matrix (probably not well-conditioned, but at least nominally full rank). If you're trying to do 2 lags rather than 1, then your problem would be that once you hit 51 variables, you have exact fits throughout and thus a zero covariance matrix.
Is there a reason you're trying to do a VAR with 51 variables? Wouldn't some form of factor model make more sense?
Is there a reason you're trying to do a VAR with 51 variables? Wouldn't some form of factor model make more sense?
Re: Inverse of the covariance matrix of the residuals
Thank you very much.
I fact I am using a factor model, but in order to initialize the Gibbs sampling algorithm I wanted use the covariance matrix of the full model. But I think I have to change the setup a bit. Thanks again.
I fact I am using a factor model, but in order to initialize the Gibbs sampling algorithm I wanted use the covariance matrix of the full model. But I think I have to change the setup a bit. Thanks again.
Re: Inverse of the covariance matrix of the residuals
Since you just need an initializer for Gibbs sampling, use the covariance matrix from the residuals from a set of univariate AR's.