Description Usage Arguments Details Value

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. Given two graphs, and samples from their posteriors, we can estimate the Bayes factor between them.

1 | ```
model_bayes_factor_n(logL1, logL2, no_samples = 100)
``` |

`logL1` |
Samples of log likelihoods from the posterior distribution of the first graph. |

`logL2` |
Samples of log likelihoods from the posterior distribution of the second graph. |

`no_samples` |
Number of permutations to sample when computing the result. |

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 Bayes factors over different permutations of the input and estimates the standard deviation.

The Bayes factor between the two graphs given as the mean and standard
deviation over `no_samples`

different permutations of the input.

mailund/admixture_graph documentation built on April 3, 2018, 9:28 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.