gaussian_outer_product_expectation: Compute outer product expectation

View source: R/cavi_generic_functions.R

gaussian_outer_product_expectationR Documentation

Compute outer product expectation

Description

Computes the expected value of the outer product of the D-dimensional Gaussian random variable.

Usage

gaussian_outer_product_expectation(
  expected_value,
  covariance_matrix = NULL,
  precision_matrix = NULL,
  perform_checks = TRUE
)

Arguments

expected_value

A real-valued vector length L. The expected value of the Gaussian random variable.

covariance_matrix

Either a L \times L covariance matrix or NULL if the precision matrix is available instead. The covariance matrix for the Gaussian random variable.

precision_matrix

Either a L \times L precision matrix or NULL if the covariance matrix has been provided.. The precision matrix for the Gaussian random variable.

perform_checks

Logical. Check if function inputs are specified correctly.

Value

A symmetric L \times L matrix.

Examples

D <- 5
z <- rnorm(D)
S <- stats::rWishart(1, df = D, Sigma = diag(D)/ D^2)[, , 1]
gaussian_outer_product_expectation(expected_value = z, covariance_matrix = S)

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