This function arises because using spectral estimation functions,
like ewspec
from the wavethresh
package doesn't
always work that well at the boundaries. This is because
the wavelet functions in wavethresh
usually assume
periodic boundary conditions and this is not appropriate for
a discrete time series where time 1 and time T are usually
very different (and cannot be assumed to be the same).
Hence, a previous function could generate a new time series by taking the
original, e.g. x
, reflecting it with rev(x)
and then
sticking the reflected onto the right-hand end of the original.
Spectral estimation, (e.g. using ewspec
) can then be applied
to this new reflected/augmented series and the boundaries are now
roughly correct as the start and end of the series correspond to time 1.
The spectral estimate so obtained though is double the size of the
the one that is needed, and contains the spectrum of the reflected series.
Hence, this function obtains the first half of the estimate and returns
it.
Not usually intended for the casual user