spec.ls: Compute Lomb-Scargle periodogram of (un)evenly spaced data

Description Usage Arguments Value Examples

View source: R/spec.ls.R

Description

Computes the Lomb-Scargle periodogram for a time series with irregular (or regular) sampling intervals.

Usage

1
2
spec.ls(x, t = NULL, over = 1, demean = TRUE, detrend = FALSE,
  plot = TRUE, ...)

Arguments

x

The data to be analysed. x can be either a two-column numerical dataframe or matrix, with sampling times in columnn 1 and measurements in column 2, a single numerical vector containing measurements, or a single vector ts object (which will be converted to a numerical vector).

t

If x is a single vector, t can be provided as a numerical vector of equal length containing sampling times. If x is a vector and times is NULL, the data are assumed to be equally sampled and times is set to 1:length(x).

over

The oversampling factor. Must be an integer >= 1. Larger values of over lead to finer scanning of frequencies.

demean

remove mean from timeseries prior to spectral estimation

detrend

remove linear trend from timeseries prior to spectral estimation

plot

Logical. If plot = TRUE, the spectrum is plotted.

...

Additional arguments passed to gplot.mtm.

Value

object of class spec with the following list items:

"freq"

A vector with spectrum frequencies

"spec"

A vector with spectral power estimates corresponding to "freq"

"series"

Name of input time series

"method"

Method name: "Lomb-Scargle"

Examples

1
2
x <- rnorm( 256 )
s <- spec.ls( x, 1:256, plot = TRUE )

jrevenaugh/TSAUMN documentation built on Nov. 8, 2019, 2:20 p.m.