compute_individual_specific_latent_trait_elbo: Individual Specific Latent Trait Trait ELBO

View source: R/cavi_latent_traits.R

compute_individual_specific_latent_trait_elboR Documentation

Individual Specific Latent Trait Trait ELBO

Description

Compute the contribution of individual specific latent traits to the Evidence Lower Bound (ELBO) of a PLVM given the approximate posterior distribution for loadings and latent traits

Usage

compute_individual_specific_latent_trait_elbo(
  individual_specific_latent_trait_expectation,
  taxon_id,
  phy,
  terminal_taxon_specific_latent_trait_expectation,
  individual_specific_latent_trait_covariance,
  individual_specific_latent_trait_outer_product_expectation,
  terminal_taxon_latent_trait_outer_product_expectation,
  within_taxon_amplitude,
  perform_checks = TRUE
)

Arguments

individual_specific_latent_trait_expectation

A NxL matrix of real values. The expected value of the individual specific latent traits.

taxon_id

A N-dimensional vector of labels. Matches each individual specific latent trait to a terminal node in phy. Each element must correspond to one of phy$tip.labels.

phy

An object of class "phylo".

terminal_taxon_specific_latent_trait_expectation

A SxL matrix of real values. The expected taxon-specific latent trait for terminal nodes in phy. Rows must be ordered by phy$tip.labels.

individual_specific_latent_trait_covariance

A LxL covariance matrix. The covariance of individual specific latent traits under the approximate posterior.

individual_specific_latent_trait_outer_product_expectation

A LxLxN array of real values. The expected outer product of individual specific latent traits under the approximate posterior.

terminal_taxon_latent_trait_outer_product_expectation

A LxLxS array of real values. The expected outer product of taxon specific latent traits at terminal nodes under the approximate posterior.

within_taxon_amplitude

An L-dimensional vector of real values on the interval [0, 1]. The within-taxon variation parameters for each of the L latent traits.

perform_checks

Logical. Check if function inputs are specified correctly.

Value

A real valued scalar. The contribution of individual specific latent traits to the ELBO.


jpmeagher/vbar documentation built on Nov. 22, 2022, 5:48 a.m.