From 332c8297bee3d311b534091c4f3ed7ea13e6546a Mon Sep 17 00:00:00 2001 From: ceschi Date: Tue, 7 Nov 2017 17:44:00 +0100 Subject: [PATCH 1/3] modified class & ur.df --- R/All-classes.R | 1 + R/ur-df.R | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/R/All-classes.R b/R/All-classes.R index f672f83..dad7e2f 100644 --- a/R/All-classes.R +++ b/R/All-classes.R @@ -95,6 +95,7 @@ setClass("ur.pp", representation(y="vector", setClass("ur.df", representation(y="vector", model="character", lags="integer", + optilags='integer' cval="matrix", res="vector", teststat="matrix", diff --git a/R/ur-df.R b/R/ur-df.R index c28e8f9..baed9ba 100644 --- a/R/ur-df.R +++ b/R/ur-df.R @@ -36,7 +36,7 @@ ur.df <- function (y, type = c("none", "drift", "trend"), lags = 1, selectlags = result <- lm(z.diff ~ z.lag.1 + 1 + tt + z.diff.lag) critRes[i]<-AIC(result, k = switch(selectlags, "AIC" = 2, "BIC" = log(length(z.diff)))) } - lags<-which.min(critRes) + lags <- optimaxlags <- which.min(critRes) } z.diff.lag = x[, 2:lags] if (type == "none") { @@ -168,5 +168,6 @@ ur.df <- function (y, type = c("none", "drift", "trend"), lags = 1, selectlags = colnames(cvals) <- c("1pct", "5pct", "10pct") rownames(cvals) <- testnames - new("ur.df", y = y, model = type, cval=cvals, lags=lag, teststat = teststat, testreg=testreg, res=res, test.name="Augmented Dickey-Fuller Test") + new("ur.df", y = y, model = type, cval=cvals, lags=lag, optilags = optimaxlags, + teststat = teststat, testreg=testreg, res=res, test.name="Augmented Dickey-Fuller Test") } From 99ce0392e4b5e1155b6f7fc45d0f8a063b07391e Mon Sep 17 00:00:00 2001 From: ceschi Date: Mon, 20 Nov 2017 17:32:30 +0100 Subject: [PATCH 2/3] blip --- R/All-classes.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/All-classes.R b/R/All-classes.R index dad7e2f..ec9d718 100644 --- a/R/All-classes.R +++ b/R/All-classes.R @@ -95,7 +95,7 @@ setClass("ur.pp", representation(y="vector", setClass("ur.df", representation(y="vector", model="character", lags="integer", - optilags='integer' + optilags='integer', cval="matrix", res="vector", teststat="matrix", From aeb1bdcd5f67ec8d01e5e61ebc45364cce5d4606 Mon Sep 17 00:00:00 2001 From: ceschi Date: Tue, 21 Nov 2017 15:08:53 +0100 Subject: [PATCH 3/3] Update README.md --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index c2fd2cc..7a53771 100644 --- a/README.md +++ b/README.md @@ -6,4 +6,7 @@ book [Analysis of Integrated and Cointegrated Time Series with R](http://www.springer.com/us/book/9780387759661). The package is hosted on [CRAN](https://CRAN.R-project.org/package=urca). +#### !! - Important Disclaimer - !! + +This package is a slightly modified version of the officially released ```urca``` package, which I modified for my own specific purposes. I modified the ```ur.df``` class and function so to store optimal lags and extract them for later use. This modification has not been tested outside the limited scope of my code and machine. Additional, minor modifications are planned but not high in priority.