Learn R Programming

hierarchicalDS (version 3.0)

switch_sample_prior: function to sample from hyperpriors of a specified probability density function; note that initial values for sigma of lognormal random effects are fixed to a small value (0.05) to prevent numerical errors

Description

function to sample from hyperpriors of a specified probability density function; note that initial values for sigma of lognormal random effects are fixed to a small value (0.05) to prevent numerical errors

Usage

switch_sample_prior(pdf, cur.par)

Arguments

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

Value

a vector of length n samples from the desired distribution