The most commonly used method of computing the spectrum on unevenly spaced time series is periodogram analysis, see Lomb (1975) and Scargle (1982). The Lomb-Scargle method for unevenly spaced data is known to be a powerful tool to find, and test significance of, weak perriodic signals. The Lomb-Scargle periodogram possesses the same statistical properties of standard power spectra.
spec.ls(x, y=NULL, spans = NULL, kernel = NULL, taper = 0.1, pad = 0,
fast = TRUE, type = "lomb",demean = FALSE, detrend = TRUE, plot.it = TRUE,
na.action = na.fail, ...)
two column data frame or matrix with the first column
being the sampled time and the second column being the observations at
the first column; otherwise x
is a numeric vector of sampled time.
not used if x
has two columns; otherwise y
is a numeric vector of observations at sampled time x
.the time at which x
is observed
vector of odd integers giving the widths of modified Daniell smoothers to be used to smooth the periodogram.
alternatively, a kernel smoother of class
"tskernel"
.
proportion of data to taper. A split cosine bell taper is applied to this proportion of the data at the beginning and end of the series.
proportion of data to pad. Zeros are added to the end of
the series to increase its length by the proportion pad
.
logical; if TRUE
, pad the series to a highly composite
length.
Lomb-Scargle spectrum of Fourier transformation spectrum
logical. If TRUE
, subtract the mean of the
series.
logical. If TRUE
, remove a linear trend from
the series. This will also remove the mean.
plot the periodogram?
NA
action function.
graphical arguments passed to plotSpecLs
.
A list object of class "spec.ls"
with the following additional components:
The kernel
argument, or the kernel constructed
from spans
.
The distribution of the spectral density estimate can be
approximated by a chi square distribution with df
degrees
of freedom.
The equivalent bandwidth of the kernel smoother as defined by Bloomfield (1976, page 201).
The value of the taper
argument.
The value of the pad
argument.
The value of the detrend
argument.
The value of the demean
argument.
The result is returned invisibly if plot.it is true.
The raw Lomb-Scargle periodogram for irregularly sampled time series is not a consistent estimator of the spectral density, but adjacent values are asymptotically independent. Hence a consistent estimator can be derived by smoothing the raw periodogram, assuming that the spectral density is smooth.
The series will be automatically padded with zeros until the series
length is a highly composite number in order to help the Fast Fourier
Transform. This is controlled by the fast
and not the pad
argument.
The periodogram at zero is in theory zero as the mean of the series is removed (but this may be affected by tapering): it is replaced by an interpolation of adjacent values during smoothing, and no value is returned for that frequency.
Bloomfield, P. (1976) Fourier Analysis of Time Series: An Introduction.Wiley.
Lomb, N. R. (1976) Least-squares frequency-analysis of unequally spaced data. Astrophysics and Space Science, 39,447-462
W. H. Press and S. A. Teukolsky and W. T. Vetterling and B.P. Flannery (1992) Numerical Recipes in C: The Art of Scientific Computing., Cambridge University Press, second edition.
Scargle, J.D. (1982) Studies in astronomical time series analysis II. Statistical aspects of spectral analysis of unevenly spaced data, The Astrophysical Journal, 263, volume 2, 835-853.
# NOT RUN {
data(V22174)
spec.ls(V22174)
data(asth)
spec.ls(asth)
# }
Run the code above in your browser using DataLab