lfmm_sampler {lfmm} | R Documentation |
LFMM generative data sampler
Description
Simulate data from the latent factor model.
Usage
lfmm_sampler(
n,
p,
K,
outlier.prop,
cs,
sigma = 0.2,
B.sd = 1,
B.mean = 0,
U.sd = 1,
V.sd = 1
)
Arguments
n |
number of observations. |
p |
number of response variables. |
K |
number of latent variables (factors). |
outlier.prop |
proportion of outlier. |
cs |
correlation between X and U. |
sigma |
standard deviation of residual errors. |
B.sd |
standard deviation for the effect size (B). |
B.mean |
mean of B. |
U.sd |
standard deviations for K factors. |
V.sd |
standard deviations for loadings. |
Details
lfmm_sampler()
sample a response matrix Y and a primary variable X such that
Y = U t(V) + X t(B) + Epsilon.
U,V, B and Epsilon are simulated according to normal multivariate distributions.
Moreover U and X are such that cor(U[,i], X) = cs[i]
.
Value
A list with simulated data.
Author(s)
kevin caye, olivier francois
Examples
dat <- lfmm_sampler(n = 100,
p = 1000,
K = 3,
outlier.prop = 0.1,
cs = c(0.8),
sigma = 0.2,
B.sd = 1.0,
B.mean = 0.0,
U.sd = 1.0,
V.sd = 1.0)
[Package lfmm version 1.1 Index]