calculate_theta_epi: calculate_theta_epi

View source: R/calculate_theta_epi.R

calculate_theta_epiR Documentation

calculate_theta_epi

Description

Internal function to calculate parameters for each dimension of each hidden variable for the epicorex function

Usage

calculate_theta_epi(
  data,
  p_y_given_x_3d,
  marginal_description,
  smooth_marginals,
  dimvis_byvars
)

Arguments

data

Data provided by user

p_y_given_x_3d

A 3D array of numerics in range (0, 1), that represent the probability that each observed x variable belongs to n_hidden latent variables of dimension dim_hidden. p_y_given_x_3d has dimensions (n_hidden, n_samples, dim_hidden).

marginal_description

Character string which determines the marginal distribution of the data. single marginal description applies to all variables in biocorex

smooth_marginals

Boolean (TRUE/FALSE) which indicates whether Bayesian smoothing of marginal estimates should be used.

dimvis_byvars

For each variable the dimension of the data provided - i.e. the number of discrete levels that exist in the data. Must be positive integer.

Details

This function is calls functions estimate_parameters_gaussian or estimate_parameters_discrete depending on the marginal_description.

Value

Returns a list of estimated parameters. The list has length = number of columns in the supplied data. The elements of the returned list depend on the marginal_description as follows:

  • If the marginal description is "gaussian" a list of 2 arrays the first of which represent the estimate means, the second the estimated standard deviations. Each of these lists will have dimensions (n_hidden, dim_hidden).

  • If the marginal description is "discrete", each element contains a list of length...


jpkrooney/rcorex documentation built on July 25, 2022, 1:37 a.m.