update_gamma_alpha_subid: Update gamma and alpha together. Update the variational mean...

View source: R/RcppExports.R

update_gamma_alpha_subidR Documentation

Update gamma and alpha together. Update the variational mean and variance for logit of class-specific response probabilities (for the s_u=1 component)

Description

shared tau's

Usage

update_gamma_alpha_subid(
  u,
  g_psi,
  g_phi,
  tau_2_t_u,
  tau_1_t_u,
  E_beta,
  E_zeta_u,
  X,
  E_eta,
  E_xi_u,
  rmat,
  h_pau,
  levels,
  subject_ids,
  v_lookup
)

Arguments

u

node id (internal or leaf node

g_psi, g_phi

g of local variational parameters

tau_2_t_u, tau_1_t_u

variational Gaussian variances for gamma and alpha

E_beta, E_zeta_u

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

X

transformed data: 2Y-1

E_eta

leaves' expected eta

E_xi_u

node u's expected xi

rmat

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

h_pau

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

levels

a vector of possibly repeating integers from 1 to Fg, or L,

subject_ids

the ids of subjects in the leaf descendants of node u

v_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.

Value

a list

resA

actually 1/A in the paper, this is variance

resB
logresBsq_o_A
resC

actually 1/C in the paper, this is variance

resD
logresDsq_o_C

zhenkewu/lotR documentation built on April 24, 2022, 2:36 a.m.