Page 1 of 1

PP test for Unit root

Posted: Thu Aug 25, 2011 4:28 am
by irulishka
I try to estimate unit roots using the Philips Perron(PP) test. So I calculate the value f_0 (HAC corrected variance) for it, using EViews 7 User Guide formulas. Here is the example:
y = c(5, 6, 7, 1, 2, 3, 5, 8, 2, 9, 6, 3, 4, 1, 7, 8, 7, 3, 3, 2)

Adj. t-Stat Prob.*

Phillips-Perron test statistic -3.965202 0.0076
Test critical values: 1% level -3.831511
5% level -3.029970
10% level -2.655194

*MacKinnon (1996) one-sided p-values.
Warning: Probabilities and critical values calculated for 20 observations
and may not be accurate for a sample size of 19

Residual variance (no correction) 45.73460
HAC corrected variance (Bartlett kernel) 45.78905

Phillips-Perron Test Equation
Dependent Variable: D(Y)
Method: Least Squares
Date: 08/25/11 Time: 17:24
Sample (adjusted): 2 20
Included observations: 19 after adjustments

Variable Coefficient Std. Error t-Statistic Prob.

Y(-1) -0.970802 0.244847 -3.964942 0.0010
C 6.075679 2.272003 2.674151 0.0160

R-squared 0.480452 Mean dependent var -0.157895
Adjusted R-squared 0.449891 S.D. dependent var 9.639405
S.E. of regression 7.149485 Akaike info criterion 6.871258
Sum squared resid 868.9573 Schwarz criterion 6.970673
Log likelihood -63.27696 Hannan-Quinn criter. 6.888083
F-statistic 15.72076 Durbin-Watson stat 1.977052
Prob(F-statistic) 0.001000

For the example I choose lag 1 and get the following values (calculated manually):

Residual variance (no correction) 45.73460
HAC corrected variance (Bartlett kernel) 45.73460

But EViews show me a bit different results:
Residual variance (no correction) 45.73460
HAC corrected variance (Bartlett kernel) 45.78905

Perhaps, I was mistaken in calculation of gamma(j). For lag 1 gamma(j)= 868,9573/19=45,73459474, and K=1 only in case 0, and K=0 in other cases.

why?

Re: PP test for Unit root

Posted: Fri Aug 26, 2011 1:28 am
by irulishka
Maybe you tell me how calculated HAC corrected variance (Bartlett kernel)? show me an example please.

Re: PP test for Unit root

Posted: Sun Aug 28, 2011 10:09 pm
by irulishka
Helloooo? why you don't ask me? may be you don"t understand me?

Re: PP test for Unit root

Posted: Mon Aug 29, 2011 4:04 pm
by EViews Glenn
Do be honest, I don't understand you. How are you calculating your HAC variance?

Re: PP test for Unit root

Posted: Wed Sep 07, 2011 4:23 am
by irulishka
Hello! I want to check your calculation of quadratic Spectral kernel. When I use PP test on my data with quadratic spectral kernel method on HAC variance, I get an answer 45,48811. But when I calculate it myself using formulas, I can't get the answer because the kernel does not exist at point 0. I send the file with calculations, please, check it. Thank you!

Re: PP test for Unit root

Posted: Wed Sep 07, 2011 11:59 am
by EViews Glenn
Set it equal to one since that's what the function goes to in the limit.

Re: PP test for Unit root

Posted: Wed Sep 07, 2011 10:25 pm
by irulishka
Ok. but if kernel QS=1 in point 0 => Hac variance = 45,17962593( red cell № AA49), when EViews show me what Hac variance = 45,48811 (yellow cell № H51). Why?

Re: PP test for Unit root

Posted: Thu Sep 08, 2011 10:21 am
by EViews Glenn
To be honest, it's difficult for us to follow your Excel spreadsheet without a bit more help, especially since it doesn't have many comments (for example, I don't know what bandwidth you are using in your calculations, are you assuming 1 or 2?). We are certainly willing to try (and are trying) to figure out what's going on, but I just want you to know that given what we have it's difficult to follow, and may take some time.

Re: PP test for Unit root

Posted: Thu Sep 08, 2011 2:06 pm
by EViews Glenn
After a bit of work, I believe I have figured out the discrepancy.

There are a couple of problems with your spreadsheet...

1. The resids that you have are entered at a low precision

2. Your evaluation points for the quadratic spectral are not correct. You are evaluating the quadratic spectral kernel K at lag/2, when you should be evaluating at lag/bandwidth (=lag/1) since the rest of your calculations appear to be assuming a bandwidth of 1. Note that this error doesn't affect the truncated weights for the other kernels.

---

Changing these two things, then updating all of the copied kernel weights values in row 47 yields a cell AA49 that matches the EViews calculation of 45.48811.

I hope that this answers your question.