incomplete.generator {eimpute} | R Documentation |
Incomplete data generator
Description
Generate a matrix with missing values, where the indices of missing values are uniformly randomly distributed in the matrix.
Usage
incomplete.generator(m, n, r, snr = 3, prop = 0.5, seed = 1)
Arguments
m |
the rows of the matrix. |
n |
the columns of the matrix. |
r |
the rank of the matrix. |
snr |
the signal-to-noise ratio in generating the matrix. Default |
prop |
the proportion of missing observations. Default |
seed |
the random seed. Default |
Details
We generate the matrix by UV + \epsilon
, where U
, V
are m
by r
, r
by n
matrix satisfy standard normal
distribution. \epsilon
has a normal distribution with mean 0 and variance \frac{r}{snr}
.
Value
A matrix with missing values.
Examples
m <- 100
n <- 100
r <- 10
x_na <- incomplete.generator(m, n, r)
head(x_na[, 1:6])
[Package eimpute version 0.2.4 Index]