Page 1 of 2
Multivariate Ljung-Box tests
Posted: Tue Mar 19, 2013 12:36 pm
by yli725
Dear Tom,
I use a BEKK model in my research, after estimating, I want to make sure my model was proper specified, so I applied multivariate Ljung-Box tests for both residuals for mean equation and squared residuals for variance equation. My codes are
Code: Select all
dec vect[series] zu(%nvar)
do time=%regstart(),%regend()
compute %pt(zu,time,%solve(%decomp(hh(time)),rd(time)))
end do time
set z1s = (zu(1))**2
set z2s = (zu(2))**2
set z3s = (zu(3))**2
@mvqstat(lags=6)
# z1s z2s z3s
Since the entire residual vector needs to be standardized, I want to make sure that I make it right.
Also, the user guide says that the results will be different if I choose a different facrorization. I want to know what other facrorizations I can choose.
I appreciate that your kindly help.
Re: Multivariate Ljung-Box tests
Posted: Wed Mar 20, 2013 10:07 am
by TomDoan
What you want is to do is
@MVARCHTEST applied to the standardized residuals:
Code: Select all
dec vect[series] zu(%nvar)
do time=%regstart(),%regend()
compute %pt(zu,time,%solve(%decomp(hh(time)),rd(time)))
end do time
@MVARCHTest(lags=6)
# zu
The two (Q test applied to the squares and the ARCH test) will do similar things to the diagonals, but the ARCH test treats the interactions correctly.
Re: Multivariate Ljung-Box tests
Posted: Wed Mar 20, 2013 4:07 pm
by yli725
TomDoan wrote:What you want is to do is
@MVARCHTEST applied to the standardized residuals:
Code: Select all
dec vect[series] zu(%nvar)
do time=%regstart(),%regend()
compute %pt(zu,time,%solve(%decomp(hh(time)),rd(time)))
end do time
@MVARCHTest(lags=6)
# zu
The two (Q test applied to the squares and the ARCH test) will do similar things to the diagonals, but the ARCH test treats the interactions correctly.
Thank you very much, Tom.
When I appiled @mvarchtest, I noticed the degrees is 864, if my subsample's observation is only 800, does this test still valid?
Re: Multivariate Ljung-Box tests
Posted: Wed Mar 20, 2013 4:44 pm
by TomDoan
yli725 wrote:TomDoan wrote:What you want is to do is
@MVARCHTEST applied to the standardized residuals:
Code: Select all
dec vect[series] zu(%nvar)
do time=%regstart(),%regend()
compute %pt(zu,time,%solve(%decomp(hh(time)),rd(time)))
end do time
@MVARCHTest(lags=6)
# zu
The two (Q test applied to the squares and the ARCH test) will do similar things to the diagonals, but the ARCH test treats the interactions correctly.
Thank you very much, Tom.
When I appiled @mvarchtest, I noticed the degrees is 864, if my subsample's observation is only 800, does this test still valid?
LAGS=6 may be a bit much, but it's still OK. It's a multiple regression on cross products of the residuals, so the potential degrees of freedom is 6 (=n(n+1)/2) x 800.
Re: Multivariate Ljung-Box tests
Posted: Thu Jun 30, 2016 9:20 pm
by debbysoraya
Hey Tom,
I also do var bekk garch model, and then
for the mvqstat i got
@mvqstat(lags=6)
# zu
Multivariate Q(6)= 716.02087
Significance Level as Chi-Squared(726)= 0.59700
I keep going back and forth to tr whether this number actually mean that I have a VAR problem or not, but there was no clear benchmark whether it means my model is okay, or my model is not
and I try to do the mvartch test
for lag 1
@mvarchtest(lags=1)
# zu
Test for Multivariate ARCH
Statistic Degrees Signif
206086.60 4356 0.00000
it gives me this which I think means my model is not adequate, when I try to put higher lag,
it send me this message;
## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC.
The Error Occurred At Location 587, Line 55 of MVARCHTEST
C:\Users\Public\Documents\Estima\WinRATS Pro 9.1 Trial\mvarchtest.src Line 77
In this case what should I do ?
Thanks a lot!
Re: Multivariate Ljung-Box tests
Posted: Fri Jul 01, 2016 10:47 am
by TomDoan
debbysoraya wrote:Hey Tom,
I also do var bekk garch model, and then
for the mvqstat i got
@mvqstat(lags=6)
# zu
Multivariate Q(6)= 716.02087
Significance Level as Chi-Squared(726)= 0.59700
I keep going back and forth to tr whether this number actually mean that I have a VAR problem or not, but there was no clear benchmark whether it means my model is okay, or my model is not
I'm not sure what "VAR problem" means. However, if these are the standardized residuals from the GARCH, then this is what you want to see---there's no real sign of residual autocorrelation.
debbysoraya wrote:
and I try to do the mvartch test
for lag 1
@mvarchtest(lags=1)
# zu
Test for Multivariate ARCH
Statistic Degrees Signif
206086.60 4356 0.00000
it gives me this which I think means my model is not adequate, when I try to put higher lag,
it send me this message;
## MAT14. Non-invertible Matrix. Using Generalized Inverse for SYMMETRIC.
The Error Occurred At Location 587, Line 55 of MVARCHTEST
C:\Users\Public\Documents\Estima\WinRATS Pro 9.1 Trial\mvarchtest.src Line 77
In this case what should I do ?
Thanks a lot!
If you're applying @MVARCHTEST to the standardized residuals from the GARCH, then you have a
very serious problem. That looks more like the results from applying it to the residuals from a OLS VAR, where a strongly significant result would be expected if the data showed GARCH properties. More lags won't help that---if you reject at one, there isn't really a point in using more. You're probably using enough that the auxiliary regression that @MVARCHTEST does runs out of degrees of freedom.
Re: Multivariate Ljung-Box tests
Posted: Sat Feb 17, 2018 12:07 am
by humyra
Tom, I'm having a similar problem. The MVARCHTEST applied to zu (where zu is the stdresiduals in the BEKK GARCH command) gives a highly significant result. Does this indicate that the VAR-BEKK-GARCH model I'm using is mispecified?
Re: Multivariate Ljung-Box tests
Posted: Tue Feb 27, 2018 2:26 pm
by TomDoan
humyra wrote:Tom, I'm having a similar problem. The MVARCHTEST applied to zu (where zu is the stdresiduals in the BEKK GARCH command) gives a highly significant result. Does this indicate that the VAR-BEKK-GARCH model I'm using is mispecified?
Something is. First make sure you have the serial correlation
in the mean handled. Until you do that, anything you do with a GARCH model is pretty much meaningless.
Re: Multivariate Ljung-Box tests
Posted: Wed Feb 28, 2018 6:54 am
by humyra
How do I handle the serial correlation in the mean model?
Re: Multivariate Ljung-Box tests
Posted: Wed Feb 28, 2018 8:29 am
by TomDoan
Usually a low order VAR. If that doesn't work, it usually means that you have a major structural break and can't really fit a standard GARCH model across the whole sample.
Re: Multivariate Ljung-Box tests
Posted: Wed Feb 28, 2018 8:42 am
by humyra
Thanks a lot Tom! I used weekly returns instead of daily and that also helped in correcting this to a large extent.
Re: Multivariate Ljung-Box tests
Posted: Wed Feb 28, 2018 7:57 pm
by humyra
TomDoan wrote:Usually a low order VAR. If that doesn't work, it usually means that you have a major structural break and can't really fit a standard GARCH model across the whole sample.
Tom, is it possible to estimate a structural VAR-BEKK-GARCH model is RATS? And perform the tests for detecting structural breaks?
Re: Multivariate Ljung-Box tests
Posted: Wed Feb 28, 2018 9:54 pm
by TomDoan
The term "structural" in those means completely different things. "Structural VAR" in the context of a BEKK-GARCH really makes no sense---there's no sensible way to combine orthogonalization of residuals with the BEKK covariance calculations. You can do a quick check for structural breaks using the
@FLUX procedure. Unless you have a specific type of break that you are expecting, a general search for breaks in a complicated non-linear model is a very complicated and time-consuming process.
Re: Multivariate Ljung-Box tests
Posted: Wed Sep 26, 2018 1:57 am
by sanjeev
Dear Tom,
I am trying to conduct MVARCH test on my VAR model to check first if an ARCH effect is present or not using following codes:
system(model=mvmean)
variables x1 x2 x3
lags 1
det constant
end(system)
estimate (resids=resids)
@mvarchtest
# resids
However, I am getting following error message:
## SX11. Identifier RESIDS is Not Recognizable. Incorrect Option Field or Parameter Order?
>>>>ate (resids=resids)<<<<
Is it possible you meant
%RESIDS
If the name isn't mistyped, it's possible that you have a poorly formatted instruction
Common errors are
* a space before the ( in an option field
* a missing space before = in a SET or FRML
* a missing $ at the end of a long line which continues to the next
Please help!
Please reply soon!
Thanks.
Regards.
Re: Multivariate Ljung-Box tests
Posted: Wed Sep 26, 2018 10:15 am
by TomDoan
As the message says:
If the name isn't mistyped, it's possible that you have a poorly formatted instruction
Common errors are
* a space before the ( in an option field
That's your problem.