Closed catapulta closed 3 years ago
Dear Mr Pfaff,
I'm also running into this issue. Seems that the Error ...
vs NaN
behaviour is inconsistent. Would be nice if NaN is always returned when no value can be calculated.
Thank you in advance and kind regards, Jan Blans
ts <- as.ts(c(0,0))
urca::ur.pp(ts)
# Error in coef(test.reg)[2, 1] : subscript out of bounds
ts <- as.ts(c(1,1))
urca::ur.pp(ts)
# Error in coef(test.reg)[2, 1] : subscript out of bounds
ts <- as.ts(c(0,1))
urca::ur.pp(ts)
# Error in coef(test.reg)[2, 1] : subscript out of bounds
ts <- as.ts(c(1,1,0))
urca::ur.pp(ts)
# Error in coef(test.reg)[2, 1] : subscript out of bounds
ts <- as.ts(c(1,1,1,0))
urca::ur.pp(ts)
# Error in coef(test.reg)[2, 1] : subscript out of bounds
ts <- as.ts(c(1,0,1))
urca::ur.pp(ts)
# no error, result:
# ##################################################
# # Phillips-Perron Unit Root / Cointegration Test #
# ##################################################
#
# The value of the test statistic is: -4
ts <- as.ts(c(0, 1, 1))
urca::ur.pp(ts)
# no error, result:
# ##################################################
# # Phillips-Perron Unit Root / Cointegration Test #
# ##################################################
#
# The value of the test statistic is: NaN
ts <- as.ts(c(1,1,0,0))
urca::ur.pp(ts)
# no error, result :
# ##################################################
# # Phillips-Perron Unit Root / Cointegration Test #
# ##################################################
#
# The value of the test statistic is: -0.9375
ts <- as.ts(c(0,0,0,0,0))
urca::ur.pp(ts)
# Error in coef(test.reg)[2, 1] : subscript out of bounds
Will this problem be solve ? For so many years?
Honestly, fixing senseless user input is not a top priority; patches are welcome.
@bpfaff I'd be glad to put in time to fix the issue -- any guidance would be much appreciated (eg how to contribute, what's the preferred output).
Return of sensible and consistent output should be a priority.
Hello, thanks for developing this package. I'm getting an error when running the following:
Env: R 3.6.1 urca_1.3-0