get_moments_cpp_eco_alpha_doubletree: Calculate variational moments during the updates

View source: R/RcppExports.R

get_moments_cpp_eco_alpha_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_alpha_doubletree(
  prob2,
  mu_alpha,
  sigma_alpha,
  E_eta,
  E_eta_sq,
  anc2,
  leaf_desc
)

Arguments

prob2

prob2 is for s_cu - a matrix pL1 by p2; in R, a list of pL1 length - each element being of length p2.

mu_alpha

variational Gaussian mean vectors (for s_cu=1 component) - this is a pL1 by K-1 by p2 array; in R, we used a list of p2 matrices (each of dimension pL1 by K-1)

sigma_alpha

variational Gaussian variances (for s_cu=1 component)

  • this is an array of dimension (pL1, K-1, p2); in R, we used a list of p2 matrices, each of dimension pL1 by K-1.

E_eta, E_eta_sq

the intermediate moments to be updated.

anc2

anc2 is a list of pL1 vectors, each vector has the node ids of the ancestors in tree2;

leaf_desc

leaf descendants under consideration

Value

a List

return List::create(Named("E_eta")=E_eta, Named("E_eta_sq")=E_eta_sq);


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