heritable_amplitude_objective: Objective function for heritable amplitude

View source: R/cavi_updates.R

heritable_amplitude_objectiveR Documentation

Objective function for heritable amplitude

Description

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

Usage

heritable_amplitude_objective(
  par,
  i,
  heritable_amplitude,
  length_scale,
  taxon_specific_latent_trait_expectation,
  taxon_specific_latent_trait_outer_product_expectation,
  taxon_specific_latent_trait_covariance,
  phy,
  phylogenetic_gp,
  perform_checks = TRUE
)

Arguments

par

A real value on the unit interval. The heritable amplitude.

i

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

heritable_amplitude

An L-dimensional vector of values on the unit interval. The current amplitude of the phylogenetic OU process. Note that this is the square root of the variance and so should be thought of as a standard deviation parameter.

length_scale

A positive real-valued scalar. The amplitude of the phylogenetic OU process. Note that this is the square root of the variance and so should be thought of as a standard deviation parameter.

taxon_specific_latent_trait_expectation

A (2S - 1)xL matrix of real values. The expected value of the taxon specific latent traits.

taxon_specific_latent_trait_outer_product_expectation

A LxLx(2S - 1) array of real values. The expected outer product of taxon specific latent traits under the approximate posterior.

taxon_specific_latent_trait_covariance

A LxLx(2S - 1) array of real values. The covariance of taxon specific latent traits under the approximate posterior.

phy

An object of class "phylo".

phylogenetic_gp

A (2S - 1)x2xL array of real values. Hyperparameters for the Gaussian process over phy.

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 heritable amplitude.


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