Apply Split Cosine Bell Taper to a Time Series

DESCRIPTION:
Tapers a time series by means of a split-cosine-bell window. In multivariate series, each component series can have a different fraction of the data tapered.

USAGE:
spec.taper(x, p=0.1)

REQUIRED ARGUMENTS:
x:
univariate or multivariate time series, or a vector, or a matrix with columns representing univariate series. Missing values are not accepted.

OPTIONAL ARGUMENTS:
p:
value between 0 and 0.5 giving the fraction of the data to be tapered on each end of the series. In the case of a multivariate time series, p can either be a scalar or a vector with as many elements as columns in the series, each element of the vector p gives the proportion of the data to be tapered in the respective column.

VALUE:
a time series like x containing the result of tapering the input x. Values of the result that are inside the tapering window will be smaller in absolute value than the corresponding values in the input.

DETAILS:
Implements a split cosine bell taper. Let p be the portion to be tapered at each end of the series by n the length of the series, then for m=np the split cosine bell taper is


REFERENCES:
Bloomfield, P. (1976). Fourier Analysis of Time Series: An Introduction. Wiley, New York.

The chapter "Analyzing Time Series" of the S-PLUS Guide to Statistical and Mathematical Analysis.


SEE ALSO:
spec.pgram , spectrum .

EXAMPLES:
# taper 10% of each end of the housing start data
hstaper <- spec.taper(hstart)

hstart3 <- tsmatrix(hstart, hstart, hstart) # replicate hstart three times # taper 10%, 20% and 40% of each end hstaper3 <- spec.taper(hstart3, c(.1, .2, .4))

# the split-cosine-bell window for p=.25 tsplot(spec.taper(rep(1, 100), p=.25))