update_S: Update allocation variables in NPB

Description Usage Arguments Value

View source: R/update_S.R

Description

Function to update the allocations of regression coefficients to clusters in NPB model

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
update_S(
  S,
  p,
  alpha.pi,
  beta.pi,
  beta,
  theta,
  zeta,
  Y,
  W,
  gamma,
  X,
  Z,
  sig2inv,
  phi2inv,
  mu,
  alpha,
  iter
)

Arguments

S

allocation variable to update

p

number of parameters

alpha.pi

shape1 parameter for beta prior on pi0

beta.pi

shape2 parameter for beta prior on pi0

beta

regression coefficients corresponding to S

theta

clusters corresponding to S

zeta

other regression coefficients

Y

response

W

covariates

gamma

covariate regression coefficients

X

data for regression coefficients being updated

Z

data for regression coefficients NOT being updated

sig2inv

error precision

phi2inv

precision for theta

mu

mean for theta

alpha

DP parameter for theta

iter

MCMC iteration for debugging purposes

Value

vector of updated allocation variables that assign each regression coefficient (beta) to a specific cluster (theta)


lvhoskovec/mmpack documentation built on Aug. 21, 2021, 4:05 p.m.