update_alpha_subid_doubletree: Update alpha's variational distribution.

View source: R/RcppExports.R

update_alpha_subid_doubletreeR Documentation

Update alpha's variational distribution.

Description

Update alpha's variational distribution.

Usage

update_alpha_subid_doubletree(
  u,
  v1,
  g_phi,
  tau_2_t_u,
  E_eta,
  E_xi_u,
  X,
  rmat,
  emat,
  h_pau,
  levels,
  subject_ids,
  v2_lookup
)

Arguments

u

node id; internal or leaf node in tree1

v1

leaf node id in tree1.

g_phi

g of local variational parameters

tau_2_t_u

variational Gaussian variances for gamma

E_eta, E_xi_u

moment updates produced by get_moments_cpp; E_xi_u is directly calculated

X

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 obsered leaf nodes in tree1, we just have an one-hot representation. of that cause.

h_pau

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

levels

a vector of possibly repeating integers from 1 to Fg2

subject_ids

integer ids for subjects nested under node u

v2_lookup

a vector of length equal to the total number of rows in X; each element is an integer, indicating which leaf does the observation belong to in tree2.

Value

a list

resC

actually 1/C in the paper, this is variance

resD
logresDsq_o_C

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