Commit 600dc930 authored by Dirk Eddelbuettel's avatar Dirk Eddelbuettel

Import Upstream version 0.10-38

parent 4c428e6d
2017-02-20 Kurt Hornik <Kurt.Hornik@wu.ac.at>
* DESCRIPTION: New version is 0.10-38.
* R/*.R:
* src/*c:
Improve registration of native routines.
2017-01-17 Kurt Hornik <Kurt.Hornik@wu.ac.at>
* DESCRIPTION: New version is 0.10-37.
* R/*.R:
* src/*c:
Register native routines.
2016-12-15 Kurt Hornik <Kurt.Hornik@wu.ac.at>
* DESCRIPTION (Version): New version is 0.10-36.
* DESCRIPTION: New version is 0.10-36.
* R/finance.R (get.hist.quote):
* man/get.hist.quote.Rd:
......
Package: tseries
Version: 0.10-37
Version: 0.10-38
Title: Time Series Analysis and Computational Finance
Authors@R: c(person("Adrian", "Trapletti", role = "aut",
email = "adrian@trapletti.org"),
......@@ -12,10 +12,10 @@ Depends: R (>= 2.10.0)
Imports: graphics, stats, utils, quadprog, zoo
License: GPL-2
NeedsCompilation: yes
Packaged: 2017-01-17 11:00:51 UTC; hornik
Packaged: 2017-02-20 18:48:56 UTC; hornik
Author: Adrian Trapletti [aut],
Kurt Hornik [aut, cre],
Blake LeBaron [ctb] (BDS test code)
Maintainer: Kurt Hornik <Kurt.Hornik@R-project.org>
Repository: CRAN
Date/Publication: 2017-01-17 12:33:40
Date/Publication: 2017-02-20 20:21:26
154a044c75cbd08632af4adfc98cd426 *ChangeLog
5903f8b93860508e520faa669c04e58f *DESCRIPTION
b61c9f16b78d5dcb66e11efc9c4c99f3 *ChangeLog
58dd4327ab75e179d28e247adc9b0b52 *DESCRIPTION
5f5a43a566e6cdf8f6f13199c78b399a *NAMESPACE
790c7072074abd1c93f008181ccf4666 *R/arma.R
c5a452ce3d1b330e8f92670ac8f0de83 *R/arma.R
4d47ac4e99712ced9371bedab34386ac *R/finance.R
ee2412ba1dab5f357fb5da7b78051987 *R/garch.R
72ee630e802dbee4b151d9d1efd31ca3 *R/garch.R
decf4a3134c069cf9d2dbc79b1b60706 *R/irts.R
cf77d7d885502dc3d8208ce255b3e411 *R/test.R
b8d00d728728d3a7fc725f222fc372f3 *R/tsutils.R
0ce6494a5006b2e8c4cc5e87e00993f7 *R/test.R
9db11950b82d51c34320a7baea82bd52 *R/tsutils.R
6474314852bc0951b0cc3848febd98dc *R/zzz.R
e311649f01da4c522be8ff61cb4776a2 *README
1b0dd6b7b4405d1674d36ebb260a0e88 *data/NelPlo.rda
......@@ -58,12 +58,12 @@ da83545c6306f8b91dd7f1ba6f9e46b5 *man/tcmd.Rd
345540d936c221018ea0f70147ab8d06 *man/tsbootstrap.Rd
6b89e394a1b8f1d0aedd0ce325dcf28e *man/white.test.Rd
2fa4c7011c2bc0f7449ae151d5cc44ae *src/Makevars
1448096ba1c28220a8e88ab98fbe992f *src/arma.c
ad9369b11b8c8d7f66fee9f80b3058d2 *src/bdstest.c
c47b29e10a2dce353532046d1875ca91 *src/boot.c
3b89f280404ab59ecff6d2e36d8e68a4 *src/arma.c
64118f9c4af2373b23e2b9107dfce886 *src/bdstest.c
8dbd6e977d226eac7f7e18ff39ef47d8 *src/boot.c
aba6a3c63cf4b072d33caf5e10f8c1ff *src/dsumsl.f
d241de1861aa5c67ba732682d2400e3d *src/formats.c
0f28e4e0304e26ee6733839ba9e1a043 *src/garch.c
fbef0e720a93000e09ec177a6999320d *src/init.c
bb845ffd8e0f71eefb50749eed92f249 *src/ppsum.c
010a7adf9c8df331fa379de1c4a7e4da *src/tsutils.c
c3604f9f02fd5ac834363d89b81475a6 *src/garch.c
728b829670d1b3f59d710e6715034966 *src/init.c
49cd32e3a939bf03635388adff3918a7 *src/ppsum.c
82c18ab81d94bec813d53d52819e6f44 *src/tsutils.c
......@@ -30,7 +30,7 @@ function(x, order = c(1, 1), lag = NULL, coef = NULL,
err <- function(coef) {
u <- double(n)
u[seqN(max.order)] <- 0
u <- .C(R_arma,
u <- .C(tseries_arma,
as.vector(x, mode = "double"),
u = as.vector(u),
as.vector(coef, mode = "double"),
......@@ -47,7 +47,7 @@ function(x, order = c(1, 1), lag = NULL, coef = NULL,
resid <- function(coef) {
u <- double(n)
u[seqN(max.order)] <- 0
u <- .C(R_arma,
u <- .C(tseries_arma,
as.vector(x, mode = "double"),
u = as.vector(u),
as.vector(coef, mode = "double"),
......
......@@ -46,7 +46,7 @@ function (x, order = c(1, 1), series = NULL, control = garch.control(...), ...)
if(!is.vector(coef)) stop("coef is not a vector")
if(ncoef != length(coef)) stop("incorrect length of coef")
nlikeli <- 1.0e+10
fit <- .C(R_fit_garch,
fit <- .C(tseries_fit_garch,
as.vector(x, mode = "double"),
as.integer(n),
coef = as.vector(coef, mode = "double"),
......@@ -60,7 +60,7 @@ function (x, order = c(1, 1), series = NULL, control = garch.control(...), ...)
nlikeli = as.double(nlikeli),
as.integer(agrad),
as.integer(control$trace))
pred <- .C(R_pred_garch,
pred <- .C(tseries_pred_garch,
as.vector(x, mode = "double"),
e = as.vector(e, mode = "double"),
as.integer(n),
......@@ -68,7 +68,7 @@ function (x, order = c(1, 1), series = NULL, control = garch.control(...), ...)
as.integer(order[1]),
as.integer(order[2]),
as.integer(FALSE))
com.hess <- .C(R_ophess_garch,
com.hess <- .C(tseries_ophess_garch,
as.vector(x, mode = "double"),
as.integer(n),
as.vector(fit$coef, mode = "double"),
......@@ -257,7 +257,7 @@ function(object, newdata, genuine = FALSE, ...)
n <- nrow(newdata)
if(genuine) h <- double(n+1)
else h <- double(n)
pred <- .C(R_pred_garch,
pred <- .C(tseries_pred_garch,
as.vector(newdata, mode = "double"),
h = as.vector(h, mode = "double"),
as.integer(n),
......
......@@ -74,7 +74,7 @@ function(x, m = 3, eps = seq(0.5*sd(x),2*sd(x),length=4), trace = FALSE)
cstan <- double(m+1)
STATISTIC <- matrix(0,m-1,k)
for(i in (1:k)) {
res <- .C(R_bdstest_main,
res <- .C(tseries_bdstest_main,
as.integer(n),
as.integer(m),
as.vector(x, mode="double"),
......@@ -571,7 +571,7 @@ function(x, alternative = c("stationary", "explosive"),
l <- trunc(4*(n/100)^0.25)
else
l <- trunc(12*(n/100)^0.25)
ssqrtl <- .C(R_pp_sum,
ssqrtl <- .C(tseries_pp_sum,
as.vector(u, mode="double"),
as.integer(n),
as.integer(l),
......@@ -668,7 +668,7 @@ function(x, demean = TRUE, lshort = TRUE)
l <- trunc(n/100)
else
l <- trunc(n/30)
ssqrtl <- .C(R_pp_sum,
ssqrtl <- .C(tseries_pp_sum,
as.vector(k, mode="double"),
as.integer(n),
as.integer(l),
......@@ -742,7 +742,7 @@ function(x, null = c("Level", "Trend"), lshort = TRUE)
l <- trunc(3*sqrt(n)/13)
else
l <- trunc(10*sqrt(n)/14)
s2 <- .C(R_pp_sum,
s2 <- .C(tseries_pp_sum,
as.vector(e, mode="double"),
as.integer(n),
as.integer(l),
......
......@@ -126,7 +126,7 @@ function(xi = 0.2, a = 4.0, n = 1000)
if((xi < 0) || (xi > 1)) stop("xi is not in [0,1]")
if((a < 0) || (a > 4)) stop("a is not in [0,4]")
x <- double(n)
res <- .C(R_quad_map,
res <- .C(tseries_quad_map,
x = as.vector(x),
as.double(xi),
as.double(a),
......@@ -272,7 +272,7 @@ function(x, y, colx = "black", coly = "red", typex = "l",
boot.sample <-
function(x, b, type)
{
return(.C(R_boot,
return(.C(tseries_boot,
as.vector(x, mode = "double"),
x = as.vector(x, mode = "double"),
as.integer(length(x)),
......
......@@ -17,8 +17,8 @@
ARMA estimation */
void R_arma (double *x, double *u, double *a, int *ar, int *ma, int *arl,
int *mal, int *max, int *n, int *intercept)
void tseries_arma (double *x, double *u, double *a, int *ar, int *ma,
int *arl, int *mal, int *max, int *n, int *intercept)
/* compute conditional sum of squares */
{
int i, j;
......
......@@ -528,7 +528,8 @@ arguments are exactly the same.
/* begin front end ---------------------------------- */
void R_bdstest_main (int *N, int *M, double *x, double *c, double *cstan, double *EPS, int *TRACE)
void tseries_bdstest_main (int *N, int *M, double *x, double *c,
double *cstan, double *EPS, int *TRACE)
{
int i;
double k;
......
......@@ -103,7 +103,7 @@ static void BlockBoot (double x[], double xBoot[], int n, int L)
}
}
void R_boot (double *x, double *xb, int *n, double *b, int *type)
void tseries_boot (double *x, double *xb, int *n, double *b, int *type)
{
GetRNGstate();
if (*type == 0) StatBoot (x-1, xb-1, *n, *b);
......
......@@ -131,9 +131,10 @@ static void F77_SUB(ufparm) ()
}
void R_fit_garch (double *y, int *n, double *par, int *p, int *q, int *itmax,
double *afctol, double *rfctol, double *xctol, double *xftol,
double *fret, int *agrad, int *trace)
void tseries_fit_garch (double *y, int *n, double *par, int *p, int *q,
int *itmax, double *afctol, double *rfctol,
double *xctol, double *xftol, double *fret,
int *agrad, int *trace)
/* fit a GARCH (p, q) model
Input:
......@@ -228,7 +229,8 @@ void R_fit_garch (double *y, int *n, double *par, int *p, int *q, int *itmax,
}
void R_pred_garch (double *y, double *h, int *n, double *par, int *p, int *q, int *genuine)
void tseries_pred_garch (double *y, double *h, int *n, double *par,
int *p, int *q, int *genuine)
/* predict cv with a GARCH (p, q) model
Input:
......@@ -267,7 +269,8 @@ void R_pred_garch (double *y, double *h, int *n, double *par, int *p, int *q, in
}
void R_ophess_garch (double *y, int *n, double *par, double *he, int *p, int *q)
void tseries_ophess_garch (double *y, int *n, double *par, double *he,
int *p, int *q)
/* Compute outer product approximation of the hessian of the
negative log likelihood of a GARCH (p, q) model at given parameter
estimates
......
......@@ -2,28 +2,31 @@
#include <Rinternals.h>
#include <R_ext/Rdynload.h>
void R_pp_sum (double* u, int* n, int* l, double* sum);
void R_quad_map (double *x, double *xi, double *a, int *n);
void R_arma (double *x, double *u, double *a, int *ar, int *ma, int *arl,
int *mal, int *max, int *n, int *intercept);
void R_bdstest_main (int *N, int *M, double *x, double *c, double *cstan,
double *EPS, int *TRACE);
void R_boot (double *x, double *xb, int *n, double *b, int *type);
void R_fit_garch (double *y, int *n, double *par, int *p, int *q, int *itmax,
double *afctol, double *rfctol, double *xctol, double *xftol,
double *fret, int *agrad, int *trace);
void R_ophess_garch (double *y, int *n, double *par, double *he, int *p, int *q);
void R_pred_garch (double *y, double *h, int *n, double *par, int *p, int *q, int *genuine);
void tseries_pp_sum (double* u, int* n, int* l, double* sum);
void tseries_quad_map (double *x, double *xi, double *a, int *n);
void tseries_arma (double *x, double *u, double *a, int *ar, int *ma,
int *arl, int *mal, int *max, int *n, int *intercept);
void tseries_bdstest_main (int *N, int *M, double *x, double *c,
double *cstan, double *EPS, int *TRACE);
void tseries_boot (double *x, double *xb, int *n, double *b, int *type);
void tseries_fit_garch (double *y, int *n, double *par, int *p, int *q,
int *itmax, double *afctol, double *rfctol,
double *xctol, double *xftol, double *fret,
int *agrad, int *trace);
void tseries_ophess_garch (double *y, int *n, double *par, double *he,
int *p, int *q);
void tseries_pred_garch (double *y, double *h, int *n, double *par,
int *p, int *q, int *genuine);
static const R_CMethodDef CEntries[] = {
{"R_pp_sum", (DL_FUNC) &R_pp_sum, 4},
{"R_quad_map", (DL_FUNC) &R_quad_map, 4},
{"R_arma", (DL_FUNC) &R_arma, 10},
{"R_bdstest_main", (DL_FUNC) &R_bdstest_main, 7},
{"R_boot", (DL_FUNC) &R_boot, 5},
{"R_fit_garch", (DL_FUNC) &R_fit_garch, 13},
{"R_ophess_garch", (DL_FUNC) &R_ophess_garch, 6},
{"R_pred_garch", (DL_FUNC) &R_pred_garch, 7},
{"tseries_pp_sum", (DL_FUNC) &tseries_pp_sum, 4},
{"tseries_quad_map", (DL_FUNC) &tseries_quad_map, 4},
{"tseries_arma", (DL_FUNC) &tseries_arma, 10},
{"tseries_bdstest_main", (DL_FUNC) &tseries_bdstest_main, 7},
{"tseries_boot", (DL_FUNC) &tseries_boot, 5},
{"tseries_fit_garch", (DL_FUNC) &tseries_fit_garch, 13},
{"tseries_ophess_garch", (DL_FUNC) &tseries_ophess_garch, 6},
{"tseries_pred_garch", (DL_FUNC) &tseries_pred_garch, 7},
{NULL, NULL, 0}
};
......
......@@ -17,7 +17,7 @@
efficient computation of the sums involved in the Phillips-Perron tests */
void R_pp_sum (double* u, int* n, int* l, double* sum)
void tseries_pp_sum (double* u, int* n, int* l, double* sum)
{
int i, j;
double tmp1, tmp2;
......
......@@ -17,7 +17,7 @@
Support functions for time series utilities */
void R_quad_map (double *x, double *xi, double *a, int *n)
void tseries_quad_map (double *x, double *xi, double *a, int *n)
{
int i;
......
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