sampling | R Documentation |
This function samples a Gaussian mixture model.
sampling(gmm, data_x = NULL, n = 1)
gmm |
An object of class |
data_x |
A data frame or numeric matrix containing observations of the
explanatory variables if conditional sampling is performed. Its columns must
explicitly be named after the explanatory variables. If |
n |
A non-negative integer corresponding to the number of samples. If conditional sampling is performed, this argument is ignored. |
A numeric matrix containing the samples.
density
, expectation
set.seed(0) data(gmm_body, data_body) sampl_1 <- sampling(gmm_body, n = 500) sampl_2 <- sampling(gmm_body, data_body[, c("WEIGHT", "FAT", "HEIGHT", "AGE")])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.