sample.phi: Sample phi and uk parameters

Description Usage Arguments Value

View source: R/SBM_gibbs_functions.R

Description

Sample uk parameters from their full conditional distributions and then calculate the implied phi parameters

Usage

1
sample.phi(ngroup.spp, gamma.u, burnin, gibbs.step, phi, psi, w)

Arguments

ngroup.spp

maximum number of groups for species (KS)

gamma.u

the truncated stick-breaking prior parameter for species groups. This value should be between 0 and 1, and small values enforce more parsimonius results (i.e., fewer groups)

burnin

number of MCMC samples that are going to be thrown out as part of the burn-in phrase

gibbs.step

current iteration of the gibbs sampler

phi

vector of size KS containing the current estimate of phi (i.e., probability of each species group)

psi

matrix of size KL x KS containing the current estimate of psi

w

vector of length S, storing the current membership of each species

Value

this function returns a list with 4 items (phi, uk, w, psi)


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