Learn R Programming

tsapp (version 1.0.4)

movemed: movemed smoothes a time series by moving medians

Description

movemed smoothes a time series by moving medians

Usage

movemed(y, q)

Arguments

y

the series, a vector or a time series

q

scalar, span of moving median

Value

g vector, smooth component

Examples

Run this code
# NOT RUN {
data(BIP)
g <- movemed(GDP,12) 
# }
# 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