spec.mtls: Compute Multi-taper Averaged Lomb-Scargle periodogram of...

Description Usage Arguments Value Examples

View source: R/spec.mtls.R

Description

Computes the Lomb-Scargle periodogram for a time series with irregular (or regular) sampling intervals using a series of "Slepian"-like tapers (the tapers are not orthogonal on the irregular sampling grid). The ensemble is averaged to produce a consistent estimator.

Usage

1
2
spec.mtls(x, t = NULL, nw = 4, k = NULL, 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).

nw

Thompson's frequency bandwidth parameter (>= 1)

k

Number of tapers, usually 2nw or 2nw - 1 (defaults to 2 nw)

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: "MTLS"

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.