Multivariate Ljung-Box tests

Discussions of ARCH, GARCH, and related models
yli725
Posts: 4
Joined: Mon Mar 11, 2013 4:39 pm

Multivariate Ljung-Box tests

Unread post 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.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Multivariate Ljung-Box tests

Unread post 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.
yli725
Posts: 4
Joined: Mon Mar 11, 2013 4:39 pm

Re: Multivariate Ljung-Box tests

Unread post 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?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Multivariate Ljung-Box tests

Unread post 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.
debbysoraya
Posts: 5
Joined: Sun Jun 26, 2016 11:09 am

Re: Multivariate Ljung-Box tests

Unread post 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!
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Multivariate Ljung-Box tests

Unread post 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.
humyra
Posts: 30
Joined: Fri Jun 02, 2017 4:26 am

Re: Multivariate Ljung-Box tests

Unread post 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?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Multivariate Ljung-Box tests

Unread post 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.
humyra
Posts: 30
Joined: Fri Jun 02, 2017 4:26 am

Re: Multivariate Ljung-Box tests

Unread post by humyra »

How do I handle the serial correlation in the mean model?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Multivariate Ljung-Box tests

Unread post 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.
humyra
Posts: 30
Joined: Fri Jun 02, 2017 4:26 am

Re: Multivariate Ljung-Box tests

Unread post by humyra »

Thanks a lot Tom! I used weekly returns instead of daily and that also helped in correcting this to a large extent.
humyra
Posts: 30
Joined: Fri Jun 02, 2017 4:26 am

Re: Multivariate Ljung-Box tests

Unread post 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?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Multivariate Ljung-Box tests

Unread post 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.
sanjeev
Posts: 191
Joined: Mon Jun 18, 2012 6:51 am

Re: Multivariate Ljung-Box tests

Unread post 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.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Multivariate Ljung-Box tests

Unread post 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.
Post Reply