x
(usually a periodogram).
The input
x
is by default assumed to be symmetric about its endpoints.
spec.smo(x, span=3, iter=1, symmetry="even")
1
.
The default is to consider only the two neighboring values and
x[i]
in
smoothing
x[i]
.
This must be a single number in the univariate case.
For multivariate time series,
span
can either be a scalar
or a vector with as many elements as columns in the series.
If a scalar, each column will be smoothed using the same value of
span
.
x
.
x
about its endpoints.
If
symmetry = "even"
, even symmetry is assumed: x(k) = x(-k);
if
symmetry = "odd"
, odd symmetry is assumed: x(k) = -x(-k);
if
symmetry = "zero"
, the values extended from the endpoints of
x
are
0
.
The default value of
"even"
is correct for smoothing periodograms
and the real part of cross periodograms;
symmetry = "odd"
is needed for the imaginary part of cross periodograms.
x
containing the smoothed values.
If span>1 and
iter=1
,
x[i]
is replaced by
(0.5 * x[i-(span-1)/2] + x[i-(span-1)/2+1] +...+ x[i+(span-1)/2-1] +
0.5 * x[i+(span-1)/2] ) / (span-1))
so the smoothing window or average actually includes
span
points
with half-weights on the ends.
In the multivariate case, the same process is repeated for
each column of
x
.
span
must be greater than
1
for
x
to be smoothed.
Bloomfield, P. (1976).
Fourier Analysis of Time Series: An Introduction.
Wiley, New York.
The Time Series chapters of the S-PLUS Programmer's Guide.
spec.smo(x) # returns vector with ith element 0.25x(i-1)+0.5x(i)+0.25x(i+1) spec.smo(x, 3, 2) # returns vector with ith element # .0625x(i-2)+0.25x(i-1)+0.375x(i)+0.25x(i+1)+.0625x(i+2)