model_likelihood_n: Computes the likelihood of a model from samples from its...

Description Usage Arguments Details Value

Description

The likelihood of a graph can be computed by integrating over all the graph parameters (with appropriate priors). Doing this by sampling from priors is very inefficient, so we use samples from the posteriors to importance sample the likelihood.

Usage

1
model_likelihood_n(log_likelihoods, no_samples = 100)

Arguments

log_likelihoods

Samples of log likelihoods from the posterior distribution of the graph.

no_samples

Number of permutations to sample when computing the result.

Details

The numerical issues with adding a lot of numbers in log space is unstable so we get a better estimate by doing it several times on different permutations of the data.This function calculates the mean of the likelihoods over different permutations of the input and estimates the standard devition.

Value

The likelihood of a graph where graph parameters are integrated out given as the mean and standard deviation over no_samples different permutations of the input.


admixturegraph documentation built on May 2, 2019, 6:02 a.m.