periodogram: Periodogram Power Spectral Density

Description Usage Arguments Value Author(s) See Also Examples

View source: R/avgp.R

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

1
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).

Author(s)

Konstantinos Fokianos and Korbinian Strimmer (https://www.strimmerlab.org/).

See Also

spectrum, avgp, fisher.g.test.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# 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])

Example output

Loading required package: MASS
Loading required package: longitudinal
Loading required package: corpcor
Loading required package: fdrtool
[1]   11 1444
$spec
           [,1]        [,2]        [,3]        [,4]       [,5]        [,6]
[1,] 0.44284739 1.130357356 1.068349960 1.419206295 2.27775109 1.639187395
[2,] 0.17385272 0.115400249 0.104251846 0.130276223 0.20037570 0.274096460
[3,] 0.29355408 0.003969141 0.001325152 0.002410588 0.09710114 0.052439716
[4,] 0.23226646 0.005259707 0.001714942 0.006475784 0.09488164 0.001921288
[5,] 0.01466026 0.010919571 0.003348493 0.002697767 0.06143642 0.006730472
             [,7]        [,8]        [,9]     [,10]
[1,] 0.0023735707 2.019760704 0.075547591 0.9021377
[2,] 0.0078230143 0.134738578 0.018713563 0.5507906
[3,] 0.0199583163 0.017368141 0.029188321 0.2945531
[4,] 0.2256001470 0.003061959 0.002084201 0.3577172
[5,] 0.0005818419 0.014593731 0.029949666 0.2678070

$freq
[1] 0.09090909 0.18181818 0.27272727 0.36363636 0.45454545

GeneCycle documentation built on Jan. 6, 2021, 1:10 a.m.