simData | R Documentation |
Simulate data from a multivariate normal mixture using a mixture of factor analyzers mechanism.
simData(sameSigma, sameLambda, p, q, K.true, n, loading_means, loading_sd, sINV_values)
sameSigma |
Logical. |
sameLambda |
Logical. |
p |
The dimension of the multivariate normal distribution ( |
q |
Number of factors. It should be strictly smaller than p. |
K.true |
The number of mixture components (clusters). |
n |
Sample size. |
loading_means |
A vector which contains the means of blocks of factor loadings. Default: |
loading_sd |
A vector which contains the standard deviations of blocks of factor loadings. Default: |
sINV_values |
A vector which contains the values of the diagonal of the (common) inverse covariance matrix, if Default: |
A list with the following entries:
data |
|
class |
|
factorLoadings |
|
means |
|
variance |
|
factors |
|
weights |
|
The marginal variance for cluster k
is equal to \Lambda_k\Lambda_k^{T} + \Sigma
.
Panagiotis Papastamoulis
library('fabMix')
n = 8 # sample size
p = 5 # number of variables
q = 2 # number of factors
K = 2 # true number of clusters
sINV_diag = 1/((1:p)) # diagonal of inverse variance of errors
set.seed(100)
syntheticDataset <- simData(sameLambda=TRUE,K.true = K, n = n, q = q, p = p,
sINV_values = sINV_diag)
summary(syntheticDataset)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.