sample.cs: Sample cs

Description Usage Arguments Value

View source: R/SAM_gibbs_functions.R

Description

This function generates samples of the group assignment variable cs

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
sample.cs(
  ngroups,
  omega,
  xmat,
  alpha,
  betas,
  theta,
  nspp,
  nloc,
  InvSigma.precalc,
  Sigma.precalc,
  lds,
  cs,
  nparam
)

Arguments

ngroups

maximum number of species groups (KS)

omega

a matrix L x S containing the underlying latent variables omega

xmat

the design matrix of dimension L x P

alpha

vector of size S with intercept for each species

betas

P x KS matrix containing slope parameters for each covariate (row) and each group (column)

theta

vector of size KS with the probability of each species group

nspp

overall number of species (S)

nloc

overall number of locations (L)

Sigma.precalc

covariance matrix for new group

lds

log of determinant of covariance matrix for new group

cs

vector of size S with group assignment for each species

nparam

overall number of covariates (P)

invSigma.precalc

precision matrix for new group

Value

a vector of size S with the group assignment variable cs


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