Commit 1fba4279 authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

Import Upstream version 0.10-32

parent e6a74629
2013-05-07 Adrian Trapletti <adrian@trapletti.org>
* DESCRIPTION (Version): New version is 0.10-32.
* README: Update contributers.
* R/test.R (adf.test, pp.test, kpss.test):
Convert time series argument in order to correctly handle xts
inputs as pointed out by Matthieu Stigler.
2013-04-16 Kurt Hornik <Kurt.Hornik@wu.ac.at>
* DESCRIPTION (Version): New version is 0.10-31.
......
Package: tseries
Version: 0.10-31
Version: 0.10-32
Title: Time series analysis and computational finance
Authors@R: c(person("Adrian", "Trapletti", role = "aut", email =
"adrian@trapletti.org"), person("Kurt", "Hornik", role =
......@@ -11,10 +11,10 @@ Depends: R (>= 2.10.0)
Suggests: its
Imports: graphics, stats, utils, quadprog, zoo
License: GPL-2
Packaged: 2013-04-16 11:07:17 UTC; hornik
Packaged: 2013-05-13 14:34:48 UTC; hornik
Author: Adrian Trapletti [aut], Kurt Hornik [aut, cre], Blake LeBaron
[ctb] (BDS test code)
Maintainer: Kurt Hornik <Kurt.Hornik@R-project.org>
NeedsCompilation: yes
Repository: CRAN
Date/Publication: 2013-04-16 13:09:55
Date/Publication: 2013-05-13 17:06:23
7b0474de5058087c493778f1eacb7c85 *ChangeLog
35d32f9cfce95a32972d1a8ff8ed2420 *DESCRIPTION
15a4bd5b3846c6a61657346c7c97c185 *ChangeLog
6178a924f1c07d74a6eae52f8adb9f5f *DESCRIPTION
2b3f182ac38fa94b06b0950bda63e2a1 *NAMESPACE
434cfb7f2cdc1fe1cab1922e3fb0e3d8 *R/arma.R
aba45885115ec20161ec3292223d0c8d *R/finance.R
f3d8df961e5a15c7e356a4566424e175 *R/garch.R
decf4a3134c069cf9d2dbc79b1b60706 *R/irts.R
983c115f3a9894fd4eab6b8892a8171a *R/test.R
d8a4828240a6352c63178d67daa65578 *R/test.R
ebc29d93799680f40e284960a8cd6950 *R/tsutils.R
6474314852bc0951b0cc3848febd98dc *R/zzz.R
a438e352affac23cc870d81b8fc5d22f *README
e311649f01da4c522be8ff61cb4776a2 *README
50675eb730e7958562b9e2296e17086e *data/NelPlo.rda
3133f915ede00127ef4477d99ebc4a5b *data/USeconomic.rda
8376a1b77cc2abb1f04aebd8319d0aaa *data/bev.rda
......
......@@ -13,7 +13,7 @@
## A copy of the GNU General Public License is available via WWW at
## http://www.gnu.org/copyleft/gpl.html. You can also obtain it by
## writing to the Free Software Foundation, Inc., 59 Temple Place,
## Suite 330, Boston, MA 02111-1307 USA.
## Suite 330, Boston, MA 02111-1307 USA.
##
## Mostly time series tests
......@@ -96,7 +96,7 @@ function(x, m = 3, eps = seq(0.5*sd(x),2*sd(x),length=4), trace = FALSE)
p.value = PVAL,
method = METHOD,
data.name = DNAME,
parameter = PARAMETER),
parameter = PARAMETER),
class = "bdstest")
}
......@@ -152,6 +152,7 @@ function(x, alternative = c("stationary", "explosive"),
alternative <- match.arg(alternative)
DNAME <- deparse(substitute(x))
k <- k+1
x <- as.vector(x, mode="double")
y <- diff(x)
n <- length(y)
z <- embed(y, k)
......@@ -159,7 +160,7 @@ function(x, alternative = c("stationary", "explosive"),
xt1 <- x[k:n]
tt <- k:n
if(k > 1) {
yt1 <- z[,2:k]
yt1 <- z[,2:k]
res <- lm(yt ~ xt1 + 1 + tt + yt1)
}
else
......@@ -191,7 +192,7 @@ function(x, alternative = c("stationary", "explosive"),
PVAL <- interpol
else if(alternative == "explosive")
PVAL <- 1 - interpol
else stop("irregular alternative")
else stop("irregular alternative")
PARAMETER <- k-1
METHOD <- "Augmented Dickey-Fuller Test"
names(STAT) <- "Dickey-Fuller"
......@@ -201,7 +202,7 @@ function(x, alternative = c("stationary", "explosive"),
alternative = alternative,
p.value = PVAL,
method = METHOD,
data.name = DNAME),
data.name = DNAME),
class = "htest")
}
......@@ -220,9 +221,9 @@ function(x, y, qstar = 2, q = 10, range = 4,
if(any(is.na(y))) stop("NAs in y")
nin <- dim(x)[2]
t <- dim(x)[1]
if(dim(x)[1] != dim(y)[1])
if(dim(x)[1] != dim(y)[1])
stop("number of rows of x and y must match")
if(dim(x)[1] <= 0)
if(dim(x)[1] <= 0)
stop("no observations in x and y")
if(dim(y)[2] > 1)
stop("handles only univariate outputs")
......@@ -274,7 +275,7 @@ function(x, y, qstar = 2, q = 10, range = 4,
METHOD <- "White Neural Network Test"
structure(list(statistic = STAT,
parameter = PARAMETER,
p.value = PVAL,
p.value = PVAL,
method = METHOD,
data.name = DNAME,
arguments = ARG),
......@@ -291,7 +292,7 @@ function(x, lag = 1, qstar = 2, q = 10, range = 4,
stop("x is not a vector or univariate time series")
if(any(is.na(x)))
stop("NAs in x")
if(lag < 1)
if(lag < 1)
stop("minimum lag is 1")
if(!missing(type) && !is.na(pmatch(type, "chisq"))) {
warning(paste("value 'chisq' for 'type' is deprecated,",
......@@ -340,7 +341,7 @@ function(x, lag = 1, qstar = 2, q = 10, range = 4,
METHOD <- "White Neural Network Test"
structure(list(statistic = STAT,
parameter = PARAMETER,
p.value = PVAL,
p.value = PVAL,
method = METHOD,
data.name = DNAME,
arguments = ARG),
......@@ -363,9 +364,9 @@ function(x, y, type = c("Chisq", "F"), scale = TRUE, ...)
if(nin < 1)
stop("invalid x")
t <- dim(x)[1]
if(dim(x)[1] != dim(y)[1])
if(dim(x)[1] != dim(y)[1])
stop("number of rows of x and y must match")
if(dim(x)[1] <= 0)
if(dim(x)[1] <= 0)
stop("no observations in x and y")
if(dim(y)[2] > 1)
stop("handles only univariate outputs")
......@@ -430,7 +431,7 @@ function(x, y, type = c("Chisq", "F"), scale = TRUE, ...)
names(ARG) <- "scale"
structure(list(statistic = STAT,
parameter = PARAMETER,
p.value = PVAL,
p.value = PVAL,
method = METHOD,
data.name = DNAME,
arguments = ARG),
......@@ -446,7 +447,7 @@ function(x, lag = 1, type = c("Chisq", "F"), scale = TRUE, ...)
stop("x is not a vector or univariate time series")
if(any(is.na(x)))
stop("NAs in x")
if(lag < 1)
if(lag < 1)
stop("minimum lag is 1")
if(!missing(type) && !is.na(pmatch(type, "chisq"))) {
warning(paste("value 'chisq' for 'type' is deprecated,",
......@@ -510,7 +511,7 @@ function(x, lag = 1, type = c("Chisq", "F"), scale = TRUE, ...)
names(ARG) <- c("lag","scale")
structure(list(statistic = STAT,
parameter = PARAMETER,
p.value = PVAL,
p.value = PVAL,
method = METHOD,
data.name = DNAME,
arguments = ARG),
......@@ -555,6 +556,7 @@ function(x, alternative = c("stationary", "explosive"),
type <- match.arg(type)
alternative <- match.arg(alternative)
DNAME <- deparse(substitute(x))
x <- as.vector(x, mode="double")
z <- embed(x, 2)
yt <- z[,1]
yt1 <- z[,2]
......@@ -622,7 +624,7 @@ function(x, alternative = c("stationary", "explosive"),
if(interpol == min(tablep))
warning("p-value smaller than printed p-value")
else
warning("p-value greater than printed p-value")
warning("p-value greater than printed p-value")
if(alternative == "stationary")
PVAL <- interpol
else if(alternative == "explosive")
......@@ -696,12 +698,12 @@ function(x, demean = TRUE, lshort = TRUE)
}
table <- -table
tablep <- c(0.01, 0.025, 0.05, 0.075, 0.10, 0.125, 0.15)
PVAL <- approx(table[dimx-1,], tablep, STAT, rule=2)$y
PVAL <- approx(table[dimx-1,], tablep, STAT, rule=2)$y
if(is.na(approx(table[dimx-1, ], tablep, STAT, rule=1)$y))
if(PVAL == min(tablep))
warning("p-value smaller than printed p-value")
else
warning("p-value greater than printed p-value")
warning("p-value greater than printed p-value")
PARAMETER <- l
METHOD <- "Phillips-Ouliaris Cointegration Test"
if(demean)
......@@ -724,6 +726,7 @@ function(x, null = c("Level", "Trend"), lshort = TRUE)
stop("x is not a vector or univariate time series")
DNAME <- deparse(substitute(x))
null <- match.arg(null)
x <- as.vector(x, mode="double")
n <- length(x)
if(null == "Trend") {
t <- 1:n
......@@ -754,7 +757,7 @@ function(x, null = c("Level", "Trend"), lshort = TRUE)
if(PVAL == min(tablep))
warning("p-value smaller than printed p-value")
else
warning("p-value greater than printed p-value")
warning("p-value greater than printed p-value")
PARAMETER <- l
METHOD <- paste("KPSS Test for", null, "Stationarity")
names(STAT) <- paste("KPSS", null)
......
......@@ -8,7 +8,8 @@ Authors:
In addition, the following people have contributed
code, bug reports, and documentation:
P. Buehlmann, D. Eddelbuettel, X. G. Fan, K. Hornik, W. Koller,
F. Leisch, M. Maechler, D. Murdoch, M. Parzen, A. Shah, A. Zeileis
F. Leisch, M. Maechler, D. Murdoch, M. Parzen, A. Shah, Matthieu Stigler,
A. Zeileis
License: GPL-2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment