calc_relative_lik_matrix: Calculate matrix of relative likelihoods.

calc_relative_lik_matrixR Documentation

Calculate matrix of relative likelihoods.

Description

Computes matrix of relative likelihoods for each of J rows of Bhat for each of P prior covariances.

This is an internal (non-exported) function. This help page provides additional documentation mainly intended for developers and expert users.

Usage

calc_relative_lik_matrix(data, Ulist, algorithm.version = c("Rcpp", "R"))

Arguments

data

A mash data object; e.g., created by mash_set_data.

Ulist

List containing the prior covariance matrices.

algorithm.version

indicates R or Rcpp

Value

The return value is a list containing the following components:

lik_matrix

J x P matrix containing likelihoods p(bhat[j] + Ulist[p], V), but normalized so that the largest entry in each row is 1.

lfactors

Vector which will recover the original likelihoods; for example, lfactors[i] + log(lik_matrix[i,]) yields the log-likelihoods corresponding to row i of the Bhat data matrix.


mashr documentation built on Oct. 18, 2023, 5:08 p.m.