ggm.simulate.pcor {GeneTS}R Documentation

Graphical Gaussian Models: Simulation of Networks

Description

ggm.simulate.pcor generates a random matrix of partial correlations that corresponds to a GGM network of a given size (num.nodes) with a specified fraction of non-zero edges.

Usage

ggm.simulate.pcor(num.nodes, etaA=0.05)

Arguments

num.nodes number of nodes in the network
etaA fraction of edges with non-zero partial correlation (default: 0.05)

Details

The output of ggm.simulate.pcor is always positive definite. This is ensured by using diagonally dominant matrices when generating the random GGM model. For the full algorithm see Schaefer and Strimmer (2004).

Value

A positive definite partial correlation matrix.

Author(s)

Juliane Schaefer (http://www.stat.uni-muenchen.de/~schaefer/) and Korbinian Strimmer (http://www.stat.uni-muenchen.de/~strimmer/).

References

Schaefer, J., and Strimmer, K. (2004). An empirical Bayes approach to inferring large-scale gene association networks. Bioinformatics in press.

See Also

ggm.simulate.data,ggm.estimate.pcor.

Examples

# load GeneTS library
library(GeneTS)

# generate random network with 40 nodes 
# it contains 780=40*39/2 edges of which 5 percent (=39) are non-zero
true.pcor <- ggm.simulate.pcor(40)
  
# simulate data set with 40 observations
m.sim <- ggm.simulate.data(40, true.pcor)

# simple estimate of partial correlations
estimated.pcor <- partial.cor(m.sim)

# comparison of estimated and true model
sum((true.pcor-estimated.pcor)^2)

# a slightly better estimate ...
estimated.pcor.2 <- ggm.estimate.pcor(m.sim, method = c("bagged.pcor"))
sum((true.pcor-estimated.pcor.2)^2)

[Package GeneTS version 2.3 Index]