incomplete.generator | R Documentation |
Generate a matrix with missing values, where the indices of missing values are uniformly randomly distributed in the matrix.
incomplete.generator(m, n, r, snr = 3, prop = 0.5, seed = 1)
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 |
We generate the matrix by UV + ε, where U, V are m by r, r by n matrix satisfy standard normal distribution. ε has a normal distribution with mean 0 and variance \frac{r}{snr}.
A matrix with missing values.
m <- 100 n <- 100 r <- 10 x_na <- incomplete.generator(m, n, r) head(x_na[, 1:6])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.