Add: In the simulations, add the mean structure and the noise...

View source: R/Add.R

AddR Documentation

In the simulations, add the mean structure and the noise structure to the original co-variance stucture

Usage

Add(inidata, cluster_assign, cluster_num, prob, p_noise)

Arguments

inidata

The generated data that includes cluster differences in co-variance structure (i.e. loading matices). The input should be a matrix with the number of rows should be equal to the number of entries N while the number of columns should be equal to the total amount of variables p (over all blocks).

cluster_assign

A vector indicates the assignment of each entry to one of the cluster. The vector should be of length N, and the nth element refers to the number of cluster that the nth entry belong to.

cluster_num

A non-negive interger indicates the total number of clusters that would be generated.

prob

A number within the range of [0,1] that indicates the proportion of mean-level differences in the total cluster difference; the proportion of total difference that is accounted by co-variance difference would therefore be (1 - prob).} \item{p_noise}{A number within the range of [0,1] that indicates the percentage of noise structrue that should be added to the final data.} } { a list of two elements. The first element is the generated final data and the second element is the noise structure } { In the simulations, add the mean structure and the noise structure to the original co-variance stucture } { m <- matrix(1:6,2,3) #N = 2 n_cluster <- 2 cluster_assignment <- c(2,1) p_mean <- 0.9 #90% mean structure p_noise <- 0.1 # 10% noise Add(m, n_cluster, cluster_assignment, p_mean, p_noise) }


syuanuvt/CSSCA documentation built on Nov. 28, 2022, 7:58 p.m.