sample.w: Sample w

Description Usage Arguments Value

View source: R/SBM_gibbs_functions.R

Description

Sample the vector w containing the membership of each species

Usage

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

Arguments

lphi

equal to log(phi)

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.spp

thismaximum number of species groups (KS)

ngroup.loc

maximum number of location groups (KL)

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 S containing w


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