View source: R/normal_block_data_generation.R
| generate_normal_block_var_data | R Documentation |
A function to draw data from the normal block model (see details). The function returns both the generated data and the corresponding model parameters, in a list.
generate_normal_block_var_data(
n = 100,
p = 40,
d = 1,
q = 3,
kappa = 0,
omega_structure = "erdos-renyi",
u_v = c(0.3, 0.1),
SNR = 0.75,
alpha = rep(1/q, q),
range_X = c(0, 10),
range_D = c(0.5, 1.5)
)
n |
number of individuals. Default to 100. |
p |
number of variables. Default to 40. |
d |
number of covariates. Default to 1. |
q |
number of groups. Default to 3. |
kappa |
vector (or scalar) of variable-wise probability of zero inflation. Default to 0. |
omega_structure |
the structure of the graph on which the precision matrix between groups is built. Can be a symmetric matrix with q rows/columns or a character picked in "erdos-renyi", "preferential_attachment", "community" in which case a graph is drawn with sensible generation parameters. See generate_precision_matrix for details. |
u_v |
two-size vector of positive numbers v and u controlling the generation of the precision matrix Omega: v scales the off-diagonal elements of the precision matrix (magnitude of partial correlations), and u is a positive number added to the diagonal elements to ensure positive-definiteness. The default value is c(0.3, 0.1). |
SNR |
signal-to-noise ratio: the regression coefficients B are
rescaled so that the variance of the entries of X B is |
alpha |
the q-size vector of group proportion. Default to rep(1/q, q) |
range_X |
A 2-size vector defining the range of the uniform distribution used to draw values in X, the regressor matrix. Default is c(0, 10) |
range_D |
A 2-size vector defining the range of the uniform distribution used to draw values in D, the diagonal matrix of variances of variables. Default is c(0.5, 1.5) |
A named list with the following element
Y a matrix of responses
X a regressor/design matrix
a list of model parameters, encompassing
B: matrix of regression coefficients
C: matrix of group membership
D: diagonal matrix of variance of the variables
Omega: precision matrix of the groups
Sigma: covariance matrix of the groups
kappa: vector of ZI inflation probabilities (one per variable)
ex <- generate_normal_block_var_data(n = 50, p = 20, d = 1, q = 3)
dim(ex$Y)
colSums(ex$parameters$C) # sizes of the clusters
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.