Draw random numbers from posterior distribution
draw_from_posterior(
survey,
nsim = 10000,
seed = as.numeric(now()),
prior = NULL,
correction = NULL
)
data.frame
containing random draws from Dirichlet distribution
which can be interpreted as election results.
survey object as returned by as_survey
or getSurveys
number of simulations
sets seed
optional prior information. Defaults to 1/2 (Jeffrey's prior).
A positive number. If not NULL
, each sample from the
Dirichlet distribution will be additionally "corrected" by a random number
from U(-1*correction, 1*correction). This can be used to introduce extra
variation which might be useful due to rounding errors from reported survey
results (or add an additional source of variation in general).
as_survey