I am trying to apply Spencer's 15-point weighted moving average filter
to the time series "shampoo," using the filter command, but I am not
sure if I am using the filter correctly:
 
library(fma)
sma15 <- c(-.009, -.019, -.016, .009, .066, .144, .209, .231, 
                                .209, .144, .066, .009, -.016, -.019,
-.009)
(s1 <- filter(shampoo, sma15))
 
This result does not match the "spence.15" command from package locfit
 
library(locfit)
spence.15(shampoo)
 
Any help understanding why these are different (or what I am doing wrong
with filter) would be appreciated.
 
Thanks, 
 
Sam Thomas 
	[[alternative HTML version deleted]]