update_gamma_subid_doubletree: Update gamma's variational distribution. Update the...

View source: R/RcppExports.R

update_gamma_subid_doubletreeR Documentation

Update gamma's variational distribution. Update the variational mean and variance for logit of class-specific response probabilities (for the s*_u=1 component in tree1.)

Description

Update gamma's variational distribution. Update the variational mean and variance for logit of class-specific response probabilities (for the s*_u=1 component in tree1.)

Usage

update_gamma_subid_doubletree(
  u,
  g_psi,
  tau_1_t_u,
  E_beta,
  E_zeta_u,
  X_zeropad,
  rmat,
  emat,
  h_pau,
  leaf_desc
)

Arguments

u

node id; internal or leaf node in tree1

g_psi

g of local variational parameters

tau_1_t_u

variational Gaussian variances for gamma

E_beta, E_zeta_u

moment updates produced by get_moments_cpp; E_zeta_u is directly calculated: prob1[u]*sigma_gamma[u,,]

X_zeropad

transformed data: ⁠2Y-1⁠; contains potential missing data.

rmat

a matrix of variational probabilities of all observations belong to K classes; N by K; each row sums to 1

emat

a matrix of variational probability for all observations belonging to pL1 leaf nodes; N by pL1; each row sums to 1. Importantly, for rows with observed leaf nodes in tree1, we just have an one-hot represention of that cause.

h_pau

a numeric vector of length p indicating the branch length between a node and its parent

leaf_desc

a vector of leaf descendants nested under node u

Value

a list

resA

actually 1/A in the paper, this is variance

resB
logresBsq_o_A

zhenkewu/doubletree documentation built on Oct. 21, 2023, 7:04 a.m.