Nothing
normalize.xdate <- function(rwl, series, n, prewhiten, biweight,
leave.one.out = FALSE, nyrs = NULL,
ar.order.max = NULL) {
check.normalize.args(n, nyrs, prewhiten, ar.order.max)
loo <- isTRUE(leave.one.out)
has.neg <- check.negative(if (loo) rwl else list(rwl, series), n, nyrs)
## Run hanning filter over the data if n isn't NULL, divide by a
## smoothing spline if nyrs isn't NULL, divide by mean if both are
## NULL. Data with negative values have the mean subtracted
## instead, as in normalize1().
if(!is.null(nyrs)){
master.df <- nyrs.rwi.mat(rwl, nyrs)
if (is.data.frame(rwl)) {
master.df <- as.data.frame(master.df)
}
if (!loo) {
series.out <- nyrs.rwi(series, nyrs, "'series'")
names(series.out) <- names(series)
}
} else if(is.null(n) && has.neg){
master.stats <- colMeans(rwl, na.rm=TRUE)
master.df <- sweep(rwl, 2, master.stats, "-")
if (!loo) {
series.out <- series - mean(series, na.rm=TRUE)
}
} else if(is.null(n)){
master.stats <- colMeans(rwl, na.rm=TRUE)
master.df <- sweep(rwl, 2, master.stats, "/")
if (!loo) {
series.out <- series / mean(series, na.rm=TRUE)
}
} else {
master.stats <- apply(rwl, 2, hanning, n)
master.df <- rwl / master.stats
if (!loo) {
series.out <- series / hanning(series, n)
}
}
if (loo) {
nseries <- ncol(rwl)
## Apply ar if prewhiten
if(prewhiten){
## mark any columns without at least four observations
goodCol <- colSums(!is.na(master.df)) > 3
series.out <- apply(master.df, 2, ar.prewhiten,
order.max = ar.order.max)
} else {
goodCol <- rep.int(TRUE, nseries)
series.out <- master.df
}
master <- series.out
if (!biweight) {
for (i in seq_len(nseries)) {
goodCol2 <- goodCol
goodCol2[i] <- FALSE
master[, i] <-
rowMeans(series.out[, goodCol2, drop = FALSE], na.rm=TRUE)
}
} else {
for (i in seq_len(nseries)) {
goodCol2 <- goodCol
goodCol2[i] <- FALSE
master[, i] <-
apply(series.out[, goodCol2, drop = FALSE], 1, tbrm, C = 9)
}
}
} else {
## Apply ar if prewhiten
if(prewhiten){
## drop any columns without at least four observations
master.df <- master.df[, colSums(!is.na(master.df)) > 3, drop=FALSE]
master.df <- apply(master.df, 2, ar.prewhiten,
order.max = ar.order.max)
series.out <- ar.prewhiten(series.out, order.max = ar.order.max)
}
if (!biweight) master <- rowMeans(master.df, na.rm=TRUE)
else master <- apply(master.df, 1, tbrm, C = 9)
}
list(master=master, series=series.out)
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.