spec.lomb | R Documentation |
The function to estimate the Lomb periodogram for a spectral analysis of unevenly sampled data.
spec.lomb(y = stop("no data arg"), x = stop("no time arg"),
freq = NULL)
y |
vector of length n representing the unevenly sampled time series. |
x |
the a vector (of length n) representing the times of observation. |
freq |
the frequencies at which the periodogram is to be calculated. If NULL the canonical frequencies (the Fourier frequencies) are used. |
This is the Lomb periodogram to test for periodicity in time series of unevenly sampled data.
Missing values should be deleted in both x and y before execution.
An object of class "lomb" is returned consisting of the following components:
freq |
the frequencies as supplied. |
spec |
the estimated amplitudes at the different frequencies. |
f.max |
the frequency of maximum amplitude. |
per.max |
the corresponding period of maximum amplitude. |
p |
the level of significance associated with the max period. |
Lomb, N.R. (1976) Least-squares frequency-analysis of unequally spaced data. Astrophysics and Space Science 39, 447-462.
data(plodia)
y <- sqrt(plodia)
x <- 1:length(y)
#make some missing values
y[10:19] <- NA; x[10:19] <- NA
#omit NAs
y <- na.omit(y); x <- na.omit(x)
#the lomb p'gram
fit <- spec.lomb(y, x)
summary(fit)
## Not run: plot(fit)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.