compute_nominal_auxiliary_trait_elbo: Nominal Trait ELBO

View source: R/cavi_auxiliary_traits.R

compute_nominal_auxiliary_trait_elboR Documentation

Nominal Trait ELBO

Description

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

Usage

compute_nominal_auxiliary_trait_elbo(
  y,
  n_samples = 1000,
  random_seed = NULL,
  loading_expectation,
  latent_trait_expectation,
  loading_outer_expectation,
  latent_trait_outer_expectation,
  perform_checks = TRUE
)

Arguments

y

An N-dimensional vector of unordered factors with K levels. A nominal manifest trait.

n_samples

A positive integer. The number of independent samples drawn to obtain the Monte Carlo estimate.

random_seed

A single value, interpreted as an integer, or NULL.

loading_expectation

A KxL matrix of real numbers, The row of the expected loading matrix corresponding to the nominal trait.

latent_trait_expectation

An NxL matrix of real values. The expected individual specific latent traits.

loading_outer_expectation

A LxLxK array. The expected outer products for the row of the expected loading matrix corresponding to the nominal trait.

latent_trait_outer_expectation

A LxLxN array. The expected outer product of individual specific latent traits.

perform_checks

Logical. Check if function inputs are specified correctly.

Value

A real valued scalar. The contribution of the nominal trait to the ELBO.


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