Description Usage Arguments Value
Runs the Gibbs sampler and returns samples from the posterior distribution
1 | gibbs.SAM(y, xmat, ngroups, ngibbs, burnin)
|
y |
this matrix has L rows (locations) and S columns (species) and contains the presence-absence data |
xmat |
L X P design matrix containing the covariates (columns) for each location (rows). Notice that this matrix does not contain a column of 1's for the intercept |
ngroups |
maximum number of species groups (K) |
ngibbs |
number of Gibbs sampler iterations |
burnin |
number of iterations to discard as part of burn-in phase |
this function returns a list containing several matrices, all of which have ngibbs-burnin rows, containing samples from the posterior distribution of:
logl: log-likelihood for each iteration
theta: probability associated with each species group
betas: slope parameters for each group
cs: cluster assignment of each species
alpha: intercept of each species
gamma: TSB prior parameter
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.