Description Usage Arguments Value
Runs the Gibbs sampler and returns samples from the posterior distribution
1 | mixture.gibbs(dat, ngroup, nl, ngibbs, burnin, a.prior, b.prior)
|
dat |
this matrix has L rows (locations) and S columns (species) and contains the presence-absence data (i.e., number of times a given species was observed at a given location) |
ngroup |
maximum number of location groups (K) |
nl |
this vector has L elements (locations) and contains the number of observation opportunities at each location |
ngibbs |
number of Gibbs sampler iterations |
burnin |
number of iterations to discard as burn-in |
a.prior |
'a' parameter for prior beta distribution |
b.prior |
'b' parameter for prior beta distribution |
this function returns a list containing several matrices. These matrices have ngibbs-burnin rows and contain samples from the posterior distribution for:
phi: probability of observing each species in each group
theta: probability of each location group
logl: log-likelihood
z: cluster assignment of each location
gamma: TSB prior parameter
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.