compute_loading_expectation: Compute Loading Expectation

View source: R/cavi_loading.R

compute_loading_expectationR Documentation

Compute Loading Expectation

Description

Compute the expectation of the PLVM loading under the approximate posterior.

Usage

compute_loading_expectation(
  current_loading_expectation,
  loading_row_precision,
  auxiliary_traits,
  latent_trait_expectation,
  precision_vector,
  ard_precision,
  scaled_conditional_row_variance_vector,
  loading_row_conditional_mean_weight,
  perform_checks = TRUE
)

Arguments

current_loading_expectation

A D'xL matrix of real values. The Loading Expectation under the previous approximate posterior.

loading_row_precision

A LxLxD' array. The precision of each row of the loading matrix under the approximate posterior distribution.

auxiliary_traits

An NxD' matrix of real numbers. The auxiliary traits.

latent_trait_expectation

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

precision_vector

A D'-dimensional vector of positive real values. The precision associated with each auxiliary trait,

ard_precision

An L-dimensional vector of real numbers. The initial ARD precision hyper-parameters on the loadings.

scaled_conditional_row_variance_vector

A D'-dimensional vector of positive real values. The variance of the loading in each row conditioned on the loading at every other row before allowing for the ARD precision hyper-parameter.

loading_row_conditional_mean_weight

A D'x(D'-1) matrix of positive real numbers. The weight of the remaining loading matrix in the conditional mean of each row in the loading matrix.

perform_checks

Logical. Check if function inputs are specified correctly.

Value

A D'xL matrix of real values. The Loading expectation under the approximate posterior distribution.


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