Learn R Programming

nlts (version 0.1-9)

spec.lomb: The funcion to estimate the Lomb periodogram for unevenly sampled data

Description

The function to estimate the Lomb periodogram for a spectral analysis of unevenly sampled data.

Usage

spec.lomb(y, x, freq = NULL)

Arguments

Value

An object of class "lomb" is returned consisting of the following components:freqthe frequencies as supplied.specthe estimated amplitudes at the different frequencies.f.maxthe frequency of maximum amplitude.per.maxthe corresponding period of maximum amplitude.pthe level of significance associated with the max period.

Details

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.

References

Lomb, N.R. (1976) Least-squares frequency-analysis of unequally spaced data. Astrophysics and Space Science 39, 447-462.

See Also

plot.lomb summary.lomb

Examples

Run this code
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.lomb(fit)
    plot.lomb(fit)

Run the code above in your browser using DataLab