R/noise.R

noise <- function (x, span = 5) 
{
    n <- length(x)
    z <- embed(x, span)
    s <- span%/%2
    mmn <- rowMeans(z)
    c(x[1:s]-mmn[1], z[,1+s]-mmn, x[(n-s+1):n]-mmn[n-2*s])
}

Try the PROcess package in your browser

Any scripts or data that you put into this service are public.

PROcess documentation built on Nov. 8, 2020, 5:44 p.m.