sample_stochastic_vector {MicroMoB} | R Documentation |
Sample a stochastic vector
Description
Given a vector of counts in cells, x
and a stochastic matrix prob
, each
row of which describes a probability distribution of how that cell should be
distributed among bins, sample destination bins for each cell count, and return
a vector giving the number of counts in bins. It is conceptually similar to
"stochastically" distributing the vector as x %*% prob
, which gives the
expectation.
Usage
sample_stochastic_vector(x, prob)
Arguments
x |
a vector |
prob |
a matrix, it must have number of rows equal to |
Value
a vector of length equal to the number of columns of prob
[Package MicroMoB version 0.1.2 Index]