gforce.generator: Data generator.

Description Usage Arguments Value Examples

View source: R/generator.R

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

1
2
3
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 Δ 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

1
2
3
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)

GFORCE documentation built on May 2, 2019, 3:44 a.m.