pgff.test: Unit root test of Pantula, Gonzales-Farias and Fuller

View source: R/pgff.R

pgff.testR Documentation

Unit root test of Pantula, Gonzales-Farias and Fuller


Unit root test based upon the weighted symmetric estimator of Pantula, Gonzales-Farias and Fuller


pgff.test(Y, detrend = FALSE)
pgff_rho_ws(Y, detrend = FALSE)



A vector or zoo-vector


A boolean, which if TRUE, indicates that the test should be performed after removing a linear trend from Y


The weighted symmetric estimator rho_ws of Pantula, Gonzales-Farias and Fuller is given as follows:

rho_ws = sum(Y[1:(n-1)]*Y[2:n])/(sum(Y[2:(n-1)]^2) + (1/n)*sum(Y^2)

where n is the length of the sequence Y.

The authors give an associated pivotal statistic and derive the limiting distribution for it, however the approach taken in this implementation was simply to determine the distribution of rho_ws through simulation. Table lookup is used to determine the p-value associated with a given value of the statistic.

If detrend=TRUE, then a linear trend is removed from the data prior to computing the estimator rho_ws. A separate table has been computed of the distribution of values of rho_ws after detrending.

This unit root test is intended to identify autoregressive sequences of order one. However, the authors state that, "A Monte Carlo study indicates that the weighted symmetric estimator performs well in second order processes."


pgff_rho_ws returns the value rho_ws of the weighted symmetric estimator.

pgff.test returns a list with class "htest" containing the following components:


the value of the test statistic.


the truncation lag parameter.


the p-value of the test.


a character string indicating what type of test was performed.

a character string giving the name of the data.


Matthew Clegg


Pantula, S. G., Gonzalez-Farias, G., and Fuller, W. A. (1994). A comparison of unit-root test criteria. Journal of Business & Economic Statistics, 12(4), 449-459.

See Also

adf.test egcm


# The following should produce a low p-value

# The following should produce a high p-value

# Test with an autoregressive sequence where rho = 0.8
pgff.test(rar1(100, a1=0.8))

# If there is a linear trend, pgff.test with detrend=FALSE
# is likely to find a unit root when there is none:
pgff.test(1:100 + rnorm(100))
pgff.test(1:100 + rnorm(100), detrend=TRUE)

# Display the power of the test for various values of rho and n:
pgff_power(a1=0.8, n=100, nrep=100)
pgff_power(a1=0.9, n=250, nrep=100)
pgff_power(a1=0.95, n=250, nrep=100)

# This is to be compared to the power of the adf.test at this level:
adf_power(a1=0.8, n=100, nrep=100)
adf_power(a1=0.9, n=250, nrep=100)
adf_power(a1=0.95, n=250, nrep=100)

matthewclegg/egcm documentation built on March 5, 2023, 6:33 a.m.