Description Usage Arguments Value
View source: R/hpy_functions.R
Hierarchical Pitman-Yor Gibbs sampler
1 2 3 4 5 6 7 8 9 10 11 |
Y |
Matrix of taxon counts (rows are populations, columns are species) |
n.iter |
Number of MCMC iterations (after burn-in) |
n.burn |
Number of burn-in iterations |
p.shape |
Shape parameter for gamma prior on top-level concentration parameter |
p.scale |
Scale parameter for gamma prior on top-level concentration parameter |
p.shape.pop |
Vector with length equal to number of populations containing shape parameters for gamma priors on population-level concentration parameter |
p.scale.pop |
Vector with length equal to number of populations containing scale parameters for gamma priors on population-level concentration parameter |
type |
Type of hierarchical process: "py" for Pitman-Yor process, "dp" for Dirichlet process |
quiet |
Set to TRUE to suppress console output |
Returns a list containing the following elements:
gamma, alpha, theta, sigma - Vectors containing posterior samples for each of the HPY parameters.
tab - List with table indicators for each population.
t.c - Table counts (and species corresponding to each table)
n.tab - Number of tables in each population
n.s.tab - Number of tables for a given species in each population
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.