Learn R Programming

nlts (version 0.2-0)

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

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.

Value

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.

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
# NOT RUN {
   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)
    
# }
# NOT RUN {
plot.lomb(fit)
# }
# NOT RUN {
 
# }

Run the code above in your browser using DataLab