How to get the expected Hessian variance-covariance matrix from vgxvarx?

7 次查看(过去 30 天)
I wish to perform a Wald test on a VAR model and I need the parameter covariance estimate. On the page http://de.mathworks.com/help/econ/model-comparison-tests.html I read the following: "The estimation function for multivariate models, vgxvarx, returns the expected Hessian variance-covariance matrix". However, I can only find the standard errors in EstStdErrors. How to get the expected Hessian variance-covariance matrix from vgxvarx?

采纳的回答

Hang Qian
Hang Qian 2015-11-4
Hi Lisa,
The parameter covariance matrix is not an output variable of VGXVARX, while the standard errors are returned as the second output argument. The parameter covariance matrix is indeed computed inside VGXVARX using the expected Hessian variance-covariance matrix.
There is a simple way that you may retrieve the covariance matrix.
In the command window, type: edit vgxvarx
Then save a copy of the function in a folder that MATLAB can recognize, say the current directory. It is up to you whether to rename it or not.
Replace the first line [EstSpec,EstSE,logL,W] = vgxvarx(Spec,Y,X,Y0,varargin) by an additional output argument “xvar”:
[EstSpec,EstSE,logL,W,xvar] = vgxvarx(Spec,Y,X,Y0,varargin)
The last output argument is the estimated parameter covariance matrix. It does not change anything inside VGXVARX, but just requests the function to return the intermediate variable xvar, as you might need it for hypothesis testing.
Thank you.
Hang Qian
  2 个评论
Lisa J.
Lisa J. 2015-11-5
I was wondering if it would be possible to get the same matrix ( or at least the pvalues) as output of ejcitest, when a VECM has to be estimated. I would need this matrix to assess parameters significance. Or maybe there is a smarter way to test for significance in this case? Thank you.

请先登录,再进行评论。

更多回答(4 个)

Nick Hobbs
Nick Hobbs 2015-10-28
When I follow the example on the 'vgxvarx' documentation page at the following link.
When I check 'EstSpec' I see an item called 'Q' which is labeled as a 'covariance matrix'. Is this the information you are looking for?

Lisa J.
Lisa J. 2015-10-29
Hi, thank you for answering. I really appreciate your help. Unfortunately Q is not what I am looking for. Q is the innovations covariance matrix. Instead, what is required for the Wald test is the covariance matrix of the estimated parameters. On the web page I've linked, I can read:
"The estimation function for multivariate models, vgxvarx, returns the expected Hessian variance-covariance matrix."
Computing the Hessian variance-covariance matrix, as explained, is one way to get the the covariance matrix of the estimated parameters. However, it seems that it is not among the vgxvarx output. The only thing that I can find is the square root of the diagonal of such matrix in EstStdErrors.

Torsten
Torsten 2015-10-29
Spec = vgxset(...,'Qsolve',true);
Best wishes
Torsten.

Lisa J.
Lisa J. 2015-10-29
编辑:Lisa J. 2015-10-29
Thank you.
Anyway, as I've already written in my previous answer, Q is not the matrix I am looking for. Just look at the dimension: Q is n x n where n = number of time series. The matrix I am looking for is k x k, where k = number of parameters, and the square diagonal indeed is a k x 1 vector returned in EstStdErrors. For example, this matrix is what is called "EstParamCov" for arima models output.

类别

Help CenterFile Exchange 中查找有关 Solver Outputs and Iterative Display 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by