Description Usage Arguments Value
View source: R/simulation_by_model.R
Simulate
X_j = H_jWΛ_j + 1_{n_j}b_j +E_j, j = 1,…, ntask
. The nonnegative matrix is generated as the cluster centers given number of clusters K. H_j is generated as the binary membership matrix, where the labels are generated from a Dirichlet distribution with parameter alpha. Distortion lambda and shift b are generated from truncated normal distribution, Noise matrix E is generate with each entry from iid normal distribution.
1 2 3 4 5 6 7 8 9 10 | generate_data(
n,
ntask,
K,
p,
alpha = NULL,
sig = 1,
cl.sep = 1,
batch.effect.sig = 0.1
)
|
n |
number of data point per dataset |
ntask |
number of batches |
K |
number of clusters |
p |
number of genes |
alpha |
parameter for Dirichilet distribution used to generate the labels (default 10, representing equal cluster size. smaller alpha corresponds to more unbalanced types) |
sig |
with cluster variance |
cl.sep |
Cluster center separation, the higher the clusters are well separated |
batch.effect.sig |
batch effect variance, higher the large batch effects are |
A list of generated data,
a list of n-by-p expression matrix
a list of n-by-K binary membership matrix
a list of length-p vectors of per-dataset scaling
a list of length-p vectors of per-dataset shift
a list of noise matrix
a list of length-n vectors of cluster labels
p-by-K common factor matrix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.