within_taxon_amplitude_objective: Objective function for within-taxon amplitude

View source: R/cavi_updates.R

within_taxon_amplitude_objectiveR Documentation

Objective function for within-taxon amplitude

Description

Update the within-taxon amplitude by optimising the ELBO for individual-specific latent traits.

Usage

within_taxon_amplitude_objective(
  par,
  i,
  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

par

A real value on the unit interval. The within-taxon amplitude.

i

An integer value between 1 and L. The index for the within-taxon amplitude to be optimised.

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 scalar. The negative ELBO associated with individual specific latent traits scaled to account for the logit transform of the within-taxon amplitude.


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