Learn R Programming

GeneCycle (version 1.1.5)

periodogram: Periodogram Power Spectral Density

Description

periodogram is a wrapper function for spectrum with some special options set. It returns the power spectral density, i.e. the squared modulus of the Fourier coefficient divided by the length of the series, for multiple time series as well as the corresponding Fourier frequencies. The frequencies range between 0 and the Nyquist critical frequency fc = frequency(x)/2.

periodogram is used by the functions avgp and fisher.g.test. For general periodogram functions please refer to spectrum.

Usage

periodogram(x, method = "builtin")

Arguments

x

vector or matrix containing the time series data (one time series per column)

method

a string that specifies which method should be used to compute the spectral density: "builtin" employs the function spectrum with the options taper=0, plot=FALSE, fast=FALSE, detrend=FALSE, and demean=TRUE; "clone" employs directly the Fourier transform function fft (with sames results as "builtin"); and "smooth" uses the function spectrum with options as above plus span=3.

Value

A list object with the following components:

spec

A vector or matrix with the estimated power spectral densities (one column per time series).

freq

A vector with frequencies f ranging from 0 to fc (if the sampling rate frequency(x)) equals 1 then fc = 0.5). Angular frequencies may be obtained by multiplication with 2*pi (i.e. omega = 2*pi*f).

See Also

spectrum, avgp, fisher.g.test.

Examples

Run this code
# NOT RUN {
# load GeneCycle library
library("GeneCycle")

# load data set
data(caulobacter)

# how many genes and how many samples?
dim(caulobacter)

# periodograms of the first 10 genes
periodogram(caulobacter[,1:10])
# }

Run the code above in your browser using DataLab