samp_from_mat | R Documentation |
Takes a matrix in which rows sum to one. For each row, performs a single multinomial draw from amongst the columns, weighted by their values in that column
samp_from_mat(M)
M |
a matrix whose rows are reals, each summing to one |
a vector length = nrow(M)
of indices, with each element being
the column that was chosen in that row's sampling
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.