2
$\begingroup$

I'm doing an unit root test using Phillips-Perron in the tseries library (pp.test).

I tried this code:

> pp.test(c(1:1000))

and the result is:

Error in pp.test(c(1:1000)) : Singularities in regression

doing a research I found the lines on the pp.test function with this error:

if (res$rank < 3)
   stop ("singularities in regression")

where res is the linear model (lm).

Why i get this kind of error?

If I do the same thing with another unit root test (in the same library) like ADF I don't get errors.

Thank you

$\endgroup$

1 Answer 1

5
$\begingroup$

You get this error because the model matrix in the linear model is exactly colinear (i.e., one of the predictor variables can be written as linear combination of the other predictor variables). If you add some noise to the time-series, then your example will run:

> pp.test(jitter(1:1000))

        Phillips-Perron Unit Root Test

data:  jitter(1:1000)
Dickey-Fuller Z(alpha) = -1083,254, Truncation lag parameter = 7,
p-value = 0.01
alternative hypothesis: stationary

Warning message:
In pp.test(jitter(1:1000)) : p-value smaller than printed p-value
$\endgroup$
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.