powered by
smoothrb
smoothrb smoothes a time series robustly by using Huber's psi-function. The initialisation uses a moving median.
smoothrb(y, beta = 0, q = NA)
the series, a vector or a time series
smoothing parameter (The larger beta is, the smoother will the smooth component g be.)
length of running median which is used to get initial values
g vector, the smooth component
# NOT RUN { data(GDP) g <- smoothrb(GDP,8,q=8) # } # NOT RUN { plot(GDP) ; t <- seq(from = 1970, to = 2009.5,by=0.25) ; lines(t,g,col="red") # }
Run the code above in your browser using DataLab