restricted_gibbs: Restricted Gibbs scan to update assignment indicators in S.

Description Usage Arguments Value

View source: R/split_merge.R

Description

Function to perform Gibbs scan only for the observations associated with either i or j (randomly chosen), but not including the cluster indicator for i or j. This function does not change the cluster observation i or j currently is in, because the restricted Gibbs scan only updates other observations in S by randomly assigning them to the cluster with i or j.

Usage

1
2
restricted_gibbs(Y, zsa, zsb, cia, cib, cja, cjb, ni, nj, i, j, S, ns, b,
  active, Q, p, theta, psi)

Arguments

Y

multivariate binary data (row for subjects, column for dimensions)

zsa

cluster assignment indicators prior to updating (transition from in MH)

zsb

cluster assignment indicators after updating (transition to in MH; same below.) both zsa and zsb will be set to zs when active is true, because we want the zs to be modified/updated.

cia, cja

cluster indicator for subject i,j prior to updating

cib, cjb

cluster indicator for subject i,j after updating

ni, nj

the number of subjects clustered with i (j) - including i (j).

i, j

two distinct subjects' indices

S

the set of indices clustered with either i or j (including i and j)

ns

size of S

b

gamma in the Dirichlet distribution in MFM.

active

TRUE for performing a split update (both updating cluster indicators and computing the transition probabilities), FALSE otherwise (only for calculating proposal density; used in q(Z|Z_merge) = q(Z|Z_launch)).

Q

a Q matrix of dimension M by L

p

a vector of machine (factor) prevalences of length M

theta

a vector of true positive rates of length L

psi

a vector of false positive rates of length L

Value


oslerinhealth-releases/rewind documentation built on Nov. 4, 2019, 11:13 p.m.