Learn R Programming

ctmm (version 0.2.8)

periodogram: Calculate the Lomb-Scargle periodogram of animal-tracking data

Description

This function calculates the exact, isotropic Lomb-Scargle periodogram (LSP, Scargle, 1982) from a telemetry object.

Usage

periodogram(data,T=NULL,dt=NULL,resolution=1)

## S3 method for class 'periodogram':
plot(x,diagnostic=FALSE,col="black",transparency=0.25,...)

Arguments

data
telemetry data object of the 2D timeseries data.
T
Sampling period for frequency resolution.
dt
Sampling interval for frequency cutoff.
resolution
Multiplier to inflate the frequency resolution.
x
Output object of periodogram.
diagnostic
Plot the sampling schedule's periodogram to check for spurious periodicities.
col
Color of periodogram.
transparency
Adds transparency to clustered data if greater than zero. Should be less than one.
...
Optional arguments fed to plot.

Value

  • Returns a periodogram object (class periodogram) which is a dataframe containing the frequency, f, the Lomb-Scargle periodogram at that frequency, LSP, and the approximate number of degrees of freedom associated with that value, DOF, with which its confidence intervals can be estimated.

Details

If no dt is specified, the median sampling interval is used. This is typically a good assumption for most data, even when there are gaps and this choice corresponds to the discrete Fourier transform (DFT) periodogram for evenly-sampled data. If no T is specified, the full sampling period is used. The frequency grid interval is finally given by 1/(resolution*2*(T+dt)) and the frequency cutoff is given by 1/(2*dt), both in accordance with the DFT periodogram. Increasing resolution will make for a smooth periodogram, but sequential frequencies will be highly correlated.

References

J. D. Scargle. (1952). Studies in astronomical time-series analysis. II. Statistical aspects of spectral analysis of unevenly-sampled data. The Astrophysical Journal, 263, 835-853.

Examples

Run this code
#Load package and data
library(ctmm)
data(buffalo)

#Extract movement data for a single animal
cilla <- buffalo[[1]]

#Calculate periodogram
per <- periodogram(cilla)

#Plot the periodogram
plot(per)

Run the code above in your browser using DataLab