sample.z: Sample z

Description Usage Arguments Value

View source: R/SBM_gibbs_functions.R

Description

Sample the vector z containing the membership of each location

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
sample.z(
  ltheta,
  dat,
  dat1m,
  lpsi,
  l1mpsi,
  ngroup.loc,
  ngroup.spp,
  nloc,
  nspp,
  w,
  z
)

Arguments

ltheta

equal to log(theta)

dat

L x S matrix, containing the presence-absence data

dat1m

L x S matrix, calculated as 1-dat

lpsi

equal to log(psi)

l1mpsi

equal to log(1-psi)

ngroup.loc

maximum number of location groups (KL)

ngroup.spp

maximum number of species groups (KS)

nloc

total number of locations (L)

nspp

total number of species (S)

w

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

z

vector of length L, storing the current membership of each locations

Value

this function returns a vector of length L containing z


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