View source: R/6-sampling-functions.R
sample_from | R Documentation |
Generate a random sample from the distribution encoded in a staged event tree object.
sample_from(object, nsim = 1, seed = NULL)
object |
an object of class |
nsim |
number of observations to sample. |
seed |
an object specifying if and how the random number generator should be initialized (‘seeded’). Either NULL or an integer that will be used in a call to set.seed. |
It samples nsim
observations according to
the transition probabilities (object$prob
) in the model.
A data frame containing nsim
observations from the
variables in object
.
model <- stages_fbhc(full(PhDArticles, lambda = 1)) sample_from(model, 10)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.