Learn R Programming

skipTrack (version 0.1.2)

postPi: Sample a value from the full conditional posterior of pi

Description

In our model the data are drawn from LogN(mu_i + log(c_ij), tau_i) The prior for c_ij is a categorical prior with category probabilities pi1, ..., pik, and c_ij can take values 1, ..., k where k is the length of pi. This function samples from the posterior of pi = pi1, ..., pik, assuming that pi follows Dirichlet(priorAlphas)

Usage

postPi(ci, priorAlphas)

Value

Numeric vector

Arguments

ci

Integer vector, all of the sampled cij values for all individuals

priorAlphas

Numeric vector, prior dirichlet parameters for pi