sparsernorm | R Documentation |
A sparse version of stats::rnorm
Outputs a vector where a fraction of values are zeros (determined by sparseness
)
and the rest are drawn from a random normal distribution using stats::rnorm
sparsernorm(n, sparseness = 0.1, mean = 0, sd = 1)
n |
Integer: Length of output vector |
sparseness |
Float (0, 1): Fraction of required nonzero elements, i.e. output will have
|
mean |
Float: Target mean of nonzero elements, passed to |
sd |
Float: Target sd of nonzero elements, passed to |
E.D. Gennatas
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.