Last data update: 2014.03.03

R: Average Periodogram for Multiple (Genetic) Time Series
avgpR Documentation

Average Periodogram for Multiple (Genetic) Time Series

Description

avgp calculates and plots the average periodogram as described in Wichert, Fokianos and Strimmer (2004).

Usage

avgp(x, title = deparse(substitute(x)), plot = TRUE, angular = FALSE, ...)

Arguments

x

multiple (genetic) time series data. Each column of this matrix corresponds to a separate variable/time series

title

name of the data set (default is the name of the data object)

plot

plot the average periodogram?

angular

convert frequencies to angular frequencies?

...

arguments passed to plot and to periodogram

Details

The average periodogram is simply the frequency-wise average of the spectral density (as estimated by the Fourier transform) over all times series. To calculate the average periodogram the function periodogram is used. See Wichert, Fokianos and Strimmer (2004) for more details.

Value

A list object with the following components:

freq

A vector with the discrete Fourier frequencies (see periodogram). If the option angular=TRUE then the output are angular frequencies (2*pi*f).

avg.spec

A vector with the average power spectral density at each frequency.

title

Name of the data set underlying the average periodogram.

The result is returned invisibly if plot is true.

Author(s)

Konstantinos Fokianos (http://www.ucy.ac.cy/~fokianos/) and Korbinian Strimmer (http://strimmerlab.org).

References

Wichert, S., Fokianos, K., and Strimmer, K. (2004). Identifying periodically expressed transcripts in microarray time series data. Bioinformatics 20:5-20.

See Also

periodogram, spectrum.

Examples

# load GeneCycle library
library("GeneCycle")

# load data set
data(caulobacter)

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

# average periodogram
avgp.caulobacter <- avgp(caulobacter, "Caulobacter")
avgp.caulobacter

# just compute and don't plot 
avgp(caulobacter, "Caulobacter", plot=FALSE)

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(GeneCycle)
Loading required package: MASS
Loading required package: longitudinal
Loading required package: corpcor
Loading required package: fdrtool
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/GeneCycle/avpg.Rd_%03d_medium.png", width=480, height=480)
> ### Name: avgp
> ### Title: Average Periodogram for Multiple (Genetic) Time Series
> ### Aliases: avgp avpg
> ### Keywords: ts
> 
> ### ** Examples
> 
> # load GeneCycle library
> library("GeneCycle")
> 
> # load data set
> data(caulobacter)
> 
> # how many samples and how many genes?
> dim(caulobacter)
[1]   11 1444
> 
> # average periodogram
> avgp.caulobacter <- avgp(caulobacter, "Caulobacter")
> avgp.caulobacter
$freq
[1] 0.09090909 0.18181818 0.27272727 0.36363636 0.45454545

$avg.spec
[1] 1.0194294 0.4531051 0.3946281 0.3072837 0.5645783

$title
[1] "Caulobacter"

> 
> # just compute and don't plot 
> avgp(caulobacter, "Caulobacter", plot=FALSE)
$freq
[1] 0.09090909 0.18181818 0.27272727 0.36363636 0.45454545

$avg.spec
[1] 1.0194294 0.4531051 0.3946281 0.3072837 0.5645783

$title
[1] "Caulobacter"

> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>