Generate True Model Parameters

Description

Generate matrices of true model parameters for the supported true models. These matrices are intended to passed to the model_matrix argument of the powerly function.

Usage

generate_model(type, ...)

Arguments

NameDescription
typeCharacter string representing the type of true model. See the True Models section for possible values.
...Required arguments used for the generation of the true model. See the True Models section for the arguments required for each type of true model.

Return

A matrix containing the model parameters.

True Models

Gaussian Graphical Model

Type: ggm

... arguments:

NameDescription
nodesA single positive integer representing the number of nodes in the network (e.g., 10).
densityA single numerical value indicating the density of the network (e.g., 0.4).
positiveA single numerical value representing the proportion of positive edges in the network (e.g., 0.9 for positive edges).
rangeA length two numerical value indicating the uniform interval from where to sample values for the partial correlations coefficients (e.g., c(0.5, 1)).
constantA single numerical value representing the constant described by Yin and Li (2011)open in new window.

Note. For more information see the arguments of the genGGMopen in new window function in the bootnetopen in new window package.

Compatible performance measures:

  • sen (sensitivity)
  • spe (specificity)
  • mcc (Matthews correlation)
  • rho (Pearson correlation)

See the Performance Measures section for the powerly function for more information on the compatible performance measures.

Examples

The example below shows how to generate a true network model based on a random architecture (Barabási & Albert, 1999open in new window) with nodes, positive edge weights, and an edge density of .

# Generate true model.
true_model <- generate_model(
    type = "ggm",
    nodes = 10,
    density = 0.4,
    positive = 0.9
)

# Load the `qgraph` package.
library(qgraph)

# Plot the model.
qgraph(true_model)

See Also

Functions powerly and validate.

References

Barabási, A.-L., & Albert, R. (1999). Emergence of Scaling in Random Networks. Science, 286(5439), 509–512. https://doi.org/10.1126/science.286.5439.509open in new window

Yin, J., & Li, H. (2011). A sparse conditional Gaussian graphical model for analysis of genetical genomics data. The Annals of Applied Statistics, 5(4), 2630–2650. https://doi.org/10.1214/11-AOAS494open in new window