search for: kernapply

Displaying 9 results from an estimated 9 matches for "kernapply".

2011 Nov 02
1
kernapply.ts
I have a suggestion for kernapply for ts objects. When we choose the option circular=F, the returned series don't have the correct dates. The removed dates are all at the beginning instead of half at the beginning and half at the end. It is particularly useful when we need to smooth the series (or remove a trend using a fil...
2019 Feb 14
0
Proposed speedup of spec.pgram from spectrum.R
...ft[, i] * Conj(xfft[, j])/(N0*xfreq) ## value at zero is invalid as mean has been removed, so interpolate: pgram[1, i, j] <- 0.5*(pgram[2, i, j] + pgram[N, i, j]) } } if(!is.null(kernel)) { for (i in 1L:ncol(x)) for (j in i:ncol(x)) pgram[, i, j] <- kernapply(pgram[, i, j], kernel, circular = TRUE) df <- df.kernel(kernel) bandwidth <- bandwidth.kernel(kernel) } else { # raw periodogram df <- 2 bandwidth <- sqrt(1/12) } df <- df/(u4/u2^2) df <- df * (N0 / N) ## << since R 1.9.0 bandwidth <- bandwidth * xfre...
2007 Nov 25
1
spec.pgram() - circularity of kernel
...ime series hence the question. The code for spec.pgram() seems to involve a circularity of the kernel (see below) yielding new power estimates to all frequencies computed by FFT. " if (!is.null(kernel)) { for (i in 1:ncol(x)) for (j in 1:ncol(x)) pgram[, i, j] <- kernapply(pgram[, i, j], kernel, circular = TRUE) " Can anyone comment on whether the extreme frequencies (low and high) of the spectrum are still reliable with this circularity option? At the extremes, values seem to result from kernel application to collections of high and low frequencies. Related to...
2024 Jul 10
1
Implementation for selecting lag of a lag window spectral estimator using generalized cross validation (using deviance)
...bias as: plot(spectrum(lh*mytaper$v,method="pgram"),log="dB") # We now focus on the variance # For a fixed m = 10, using a Parzen window. library(gsignal) parzenwin(10) # The following 2 lines of code, where I try to do the same thing in 2 different ways, did not work for me: kernapply( spectrum(lh*mytaper$v,method="pgram")$spec,parzenwin(10),circular=TRUE) spectrum(lh*mytaper$v,kernel = parzenwin(10),method="pgram") # ?spec.pgram says kernel: alternatively, a kernel smoother of class ?"tskernel"?. How can I see all available kernels of class tske...
2005 Apr 02
1
Survey of "moving window" statistical functions - still looking f or fast mad function
...nction(x, k) { n = length(x) y = x[ k:n ] - x[ c(1,1:(n-k)) ] # this is a difference from the previous cell y[1] = sum(x[1:k]); # find the first sum y = cumsum(y) # apply precomputed differences return(y/k) # return mean not sum } 2. filter(x, rep(1/k,k), sides=2, circular=T) - (stats package) 3. kernapply(x, kernel("daniell", m), circular=T) 4. apply(embed(x,k), 1, mean) 5. mywinfun <- function(x, k, FUN=mean, ...) { # suggested in news group n <- length(x) A <- rep(x, length=k*(n+1)) dim(A) <- c(n+1, k) sapply(split(A, row(A)), FUN, ...)[1:(n-k+1)] } 6. rollFun(x, k, FUN=me...
2004 Oct 08
1
Survey of "moving window" statistical functions - still looking f or fast mad function
...fference from the previous cell y[1] = sum(x[1:k]); # find the first sum y = cumsum(y) # apply precomputed differences return(y/k) # return mean not sum } 2. filter(x, rep(1/k,k), sides=2, circular=T) - (stats package) 3. kernapply(x, kernel("daniell", m), circular=T) 4. apply(embed(x,k), 1, mean) 5. mywinfun <- function(x, k, FUN=mean, ...) { # suggested in news group n <- length(x) A <- rep(x, length=k*(n+1)) dim(A) <- c(n+1, k) sapply(split(A, row(A)), FUN, ...)[1:(n-k...
2008 Mar 19
0
Time Series Object
...ect that is made up of readings at 15 minutes for two years (this is why I am not posting data series). I have made this a time series with y = ts(x, frequency=96) ninety six is the number of 15minutes in a day. I want to smooth this series with k = kernel("modified.daniell", #) y.s = kernapply(y, k) if I want to smooth it for ~month windows do I use # = (30*96)/2 or 30/2 I will then take this and use spectrum(y.s, log="no") the peaks that are generated are now in days even thought it is smoothed to monthly because the underlying points that the smoother is applied to are gr...
2000 Feb 17
2
Installation of rpm file on Suse Linux 6.2 (PR#449)
...l/lib/R/library/ts/R-ex/cpgram.R action: create D: file: /usr/local/lib/R/library/ts/R-ex/diffinv.R action: create D: file: /usr/local/lib/R/library/ts/R-ex/embed.R action: create D: file: /usr/local/lib/R/library/ts/R-ex/filter.R action: create D: file: /usr/local/lib/R/library/ts/R-ex/kernapply.R action: create D: file: /usr/local/lib/R/library/ts/R-ex/kernel.R action: create D: file: /usr/local/lib/R/library/ts/R-ex/lag.R action: create D: file: /usr/local/lib/R/library/ts/R-ex/na.omit.ts.R action: create D: file: /usr/local/lib/R/library/ts/R-ex/pp.test.R action: create D:...
2002 Jul 11
1
dyn.load tcl/tk (PR#1774)
...html latex example decompose text html latex example diffinv text html latex example embed text html latex example filter text html latex example kernapply text html latex example kernel text html latex example lag text html latex example lag.plot text html latex example lh tex...