lfmm_sampler: LFMM generative data sampler

Description Usage Arguments Details Value Author(s) Examples

View source: R/sampler.R

Description

Simulate data from the latent factor model.

Usage

1
2
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 with 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_sample() 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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
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)

cayek/MatrixFactorizationR documentation built on June 17, 2020, 4:39 p.m.