Generate a random sample from the distribution encoded
in a staged event tree object.
Usage
sample_from(object, size = 1, seed = NULL)
Value
A data frame containing size observations from the
variables in object.
Arguments
object
an object of class sevt with fitted probabilities.
size
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.
Details
It samples size observations according to
the transition probabilities (object$prob) in the model.