search for: mywinfun

Displaying 2 results from an estimated 2 matches for "mywinfun".

2005 Apr 02
1
Survey of "moving window" statistical functions - still looking f or fast mad function
...e 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=mean) - (fSeries package) 7. rollMean(x, k) - (fSeries package) 8. SimpleMeanLoop = functio...
2004 Oct 08
1
Survey of "moving window" statistical functions - still looking f or fast mad function
...= 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=mean) - (fSeries package) 7. rollMean(x, k) - (fSeries package)...