Clarifying the formulas in unit root tests

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

kiber_master
Posts: 94
Joined: Fri Sep 23, 2011 3:56 am

Clarifying the formulas in unit root tests

Postby kiber_master » Fri Nov 23, 2012 6:51 am

Hello, it's me again

I think, the formulas in User Guide II are not correct. Look at (13.21)-(13.22). They are for HAC corrected variance using Kernel. There is T in indexes and in sum, but really (I've checked it) T in index in (13.22) is not equal to T in the same formula but in sum. First T is a length of input series, because autocovariation is calculated on all observations. But sum is divided on the number of resids, in the model it less, than input series length.

Moreover, I don't understand, why you calculate (13.21) for T-1, where T is the number of resids, not the length of input serie. In case when we have missing values in the middle of series, we will calculate HAC using fewer values. Why?

If you need an example, please, let me know, I'll prepare it. Now I investigate Quadratic Spectral kernel.

Thank you!

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Clarifying the formulas in unit root tests

Postby EViews Glenn » Mon Nov 26, 2012 10:33 am

I can't find the equations to which you are referring and am not entirely certain what you are saying [edit - Gareth thinks they are the ones in Chapter 30, which makes sense - in that case the next sentence about needing more clarification is even more relevant]. Could you please double check the printed documentation and offer a bit more explanation. Thanks.

kiber_master
Posts: 94
Joined: Fri Sep 23, 2011 3:56 am

Re: Clarifying the formulas in unit root tests

Postby kiber_master » Tue Nov 27, 2012 7:11 am

I didn't find Chapter 30 in my User Guide... :(
I mean EViews 7 User Guide II.pdf, Chapter 13. Univariate Time Series Analysis, Unit Root Tests, Kernel Sum-of-Covariances Estimation, pp. 388-389
(13.21) is for f0, (13.21) if for gamma(j). Formulas, captured from that pdf are attached.
Attachments
f0.png
formulas (13.21)-(13.22)
f0.png (4.63 KiB) Viewed 8044 times

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Clarifying the formulas in unit root tests

Postby EViews Glenn » Tue Nov 27, 2012 7:55 am

You're using the PDF numbering which is off in some versions.

The formulas all assume no internal missings. It would be more confusing for users if we were to make every equation in the manual general enough so that it is valid for missings. In cases where it is not obvious we try to add the generality. In this case you simply set T equal to the number of valid observations in the residual sample.

Note also that the samples here refer to the residual samples as these are generic formulae for computing long-run variances given data. I'll see about making this clearer.

kiber_master
Posts: 94
Joined: Fri Sep 23, 2011 3:56 am

Re: Clarifying the formulas in unit root tests

Postby kiber_master » Tue Nov 27, 2012 11:57 pm

Ok, for the second formula it's clear for me now.

But for the first - I've prepared excel calculation of f0 for the test, to understand the algorithm. And discovered the following: though I can calculate gamma(j) for sample length, you use only first T-1 values, where T is the number of valid observations in the residual sample. So, my question is - why don't you use all gamma, which can be calculated?
Attachments
kernel.xlsx
(27.76 KiB) Downloaded 344 times
testPP.WF1
(22.84 KiB) Downloaded 330 times

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Clarifying the formulas in unit root tests

Postby EViews Glenn » Wed Nov 28, 2012 5:49 pm

What bandwidth are you using?

kiber_master
Posts: 94
Joined: Fri Sep 23, 2011 3:56 am

Re: Clarifying the formulas in unit root tests

Postby kiber_master » Thu Nov 29, 2012 12:13 am

bandwidth = 1

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Clarifying the formulas in unit root tests

Postby EViews Glenn » Thu Nov 29, 2012 12:12 pm

Thanks. This was helpful. It's a bug.

As you noted, for the QS kernel, the number of lags was calculated for the number of observations not the potential range of the lags. In cases where there are no internal missing values, these two numbers are the same. In your case, there are 41 possible lags to compute and 34 observations so EViews was dropping the final 7 terms in the autocovariance sum. The largest of these autocovariance terms was on the order of 1.8e-06 and the total discrepancy was on the order of -4.94e-6. In general, unless you have a very large fraction of internal missing values you'd never see the discrepancy, which is probably why it was missed in testing. Note again that this is generally only relevant for the QS kernel and other kernels with infinite support like the Daniell or for very large bandwidths (except in highly perverse circumstances with large amounts of internal missing data).

That said, I'm very glad that you pointed this one out. I've got a tentative fix in the code. I'm going to do some additional testing, but it should make it's way into a patch in the next few days.

kiber_master
Posts: 94
Joined: Fri Sep 23, 2011 3:56 am

Re: Clarifying the formulas in unit root tests

Postby kiber_master » Fri Nov 30, 2012 5:42 am

Thank you. Glad to be helpful. :)

EViews Glenn
EViews Developer
Posts: 2682
Joined: Wed Oct 15, 2008 9:17 am

Re: Clarifying the formulas in unit root tests

Postby EViews Glenn » Fri Nov 30, 2012 3:43 pm

The fix has been posted to the main code base and will appear in the next update. [Edit: Patch is up]

Abiselom
Posts: 1
Joined: Fri Jan 04, 2013 2:26 am

Re: Clarifying the formulas in unit root tests

Postby Abiselom » Sun Jan 06, 2013 5:48 am

Friends,
When I test for unit root for my data I found some of my data to be in order of I(0) and others in I(1). To have stationary time series at the same order for all the series is it possible to have the test at the first difference for those that are already stationary at their levels?


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests