Unlimited learning, half price | 50% off

Last chance! 50% off unlimited learning

Sale ends in


hierarchicalDS (version 3.0)

switch_sample: function to sample from a specified probability density function

Description

function to sample from a specified probability density function

Usage

switch_sample(n, pdf, cur.par, RE)

Arguments

n

number of samples desired

pdf

probability density function (pois1, poisson, normal, unif.disc, unif.cont)

cur.par

a vector giving parameters for the specified distribution; only the first is used for single parameter distributions

RE

random effects, if present

Value

a vector of length n samples from the desired distribution