gibbs.SAM: Main function of the Species Archetype Model (SAM)

Description Usage Arguments Value

View source: R/SAM_main.R

Description

Runs the Gibbs sampler and returns samples from the posterior distribution

Usage

1
gibbs.SAM(y, xmat, ngroups, ngibbs, burnin)

Arguments

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

Value

this function returns a list containing several matrices, all of which have ngibbs-burnin rows, containing samples from the posterior distribution of:


drvalle1/EcoCluster documentation built on Jan. 25, 2022, 12:46 a.m.