get_moments_cpp_eco_gamma_doubletree: Calculate variational moments during the updates

View source: R/RcppExports.R

get_moments_cpp_eco_gamma_doubletreeR Documentation

Calculate variational moments during the updates

Description

Get all moments that need updating when iterating over internal and leaf nodes; for both trees. When updating a node u, all the moments of the descendant nodes will be changed. A recalculation of the moments are necessary when moving on to another node.

Usage

get_moments_cpp_eco_gamma_doubletree(
  prob1,
  mu_gamma,
  sigma_gamma,
  E_beta,
  E_beta_sq,
  anc1,
  leaf_desc
)

Arguments

prob1

variational probabilities; prob1 is for s*_u - length p1.

mu_gamma

variational Gaussian means (for s*_u=1 component) for J*K logit(class-specific response probabilities); (J,K,p1) array; In R, we used a list of p1 (J,K) matrices

sigma_gamma

variational Gaussian variances (for s*_u=1 component) for J*K logit(class-specific response probabilities); (J,K,p1) array; in R, we used a list o f p1 (J,K) matrices

E_beta, E_beta_sq

J by K by pL1 each of dimension pL1 by K-1.

anc1

anc1 is a list of pL1 vectors, each vector has the node ids of the ancestors in tree1; lengths may differ. The ancestors include the node concerned; similarly for anc2

leaf_desc

an integer vector of leaf descendant ids under consideration

Value

a List

return List::create(Named("E_beta")=E_beta, Named("E_beta_sq")=E_beta_sq);


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