Learn R Programming

GFORCE (version 0.1.4)

gforce.generator: Data generator.

Description

Generates \(n\) random samples from a \(G\)-Latent Variable Model. The caller can specify the graph structure on the latent variables via several parameters. The magnitude of the non-zero entries in the population precision matrix can also be specified. Observed variables are assigned uniformly at random to \(K\) groups with minimum size \(m\).

Usage

gforce.generator(K, d, n, m, graph = "DeltaC", num_hubs = NULL,
  band_size = 3, cov_gap_mult = 1, error_base = 0.25,
  error_add = 0.25, corr_value = 0.3, normalize = TRUE)

Arguments

K

number of clusters.

d

dimension of the observed random vector.

n

number of samples.

m

minimal group size.

graph

latent graph structure. Can be 'scalefree', 'hub', 'band', 'identity' or 'DeltaC'.

num_hubs

number of hubs in the latent graph. Ignored unless graph == 'hub'.

band_size

size of bands in the latent graph. Ignored unless graph=='band'.

cov_gap_mult

scales the size of \(\Delta C\). Ignored unless graph == 'DeltaC'.

error_base

minimum variance of errors.

error_add

size of range of possible variances for errors.

corr_value

size of off diagonal entries in latent precision matrix.

normalize

logical. If normalize == TRUE, the covariance matrix for the latent graph will be normalized so that it is also a correlation matrix.

Value

An S3 object with the slots Z,E,X,group_assignments,CStar,Theta_Star

Examples

Run this code
# NOT RUN {
dat <- gforce.generator(5,20,20,3)
dat <- gforce.generator(10,100,100,3,graph='hub',num_hubs=2)
dat <- gforce.generator(10,100,100,3,graph='band',band_size=3)
# }

Run the code above in your browser using DataLab