Description Usage Arguments Details Value Author(s) References Examples

View source: R/logLik_phybreak.R

The likelihood of a `phybreak`

-object is calculated, with the option to include or exclude parts of the
likelihood for genetic data, phylogenetic tree (within-host model), sampling times and generation times.

1 2 3 |

`object` |
An object of class |

`genetic` |
Whether to include the likelihood of the mutation model. |

`withinhost` |
Whether to include the likelihood of within-host (coalescent) model. |

`sampling` |
Whether to include the likelihood of the sampling model (sampling intervals). |

`generation` |
Whether to include the likelihood of the transmission model (generation intervals). |

`...` |
Some methods for this generic require additional arguments. None are used in this method. |

The sequence likelihood is calculated by Felsenstein's pruning algorithm, assuming a prior probability of 0.25 for each nucleotide. The within-host likelihood is the likelihood of coalescence times given the within-host model and slope. The generation interval and sampling interval likelihood are log-densities of the gamma distributions for these variables.

The log-likelihood as an object of class logLik.

Don Klinkenberg [email protected]

Klinkenberg et al. (2017) Simultaneous
inference of phylogenetic and transmission trees in infectious disease outbreaks.
*PLoS Comput Biol*, **13**(5): e1005495.

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
#First build a phybreak-object containing samples.
simulation <- sim_phybreak(obsize = 5)
MCMCstate <- phybreak(dataset = simulation)
logLik(MCMCstate)
MCMCstate <- burnin_phybreak(MCMCstate, ncycles = 20)
logLik(MCMCstate)
tree0 <- get_phylo(MCMCstate)
seqdata <- get_data(MCMCstate)$sequences
phangorn::pml(tree0, seqdata, rate = 0.75*get_parameters(MCMCstate, "mu")
logLik(MCMCstate, genetic = TRUE, withinhost = FALSE,
sampling = FALSE, generation = FALSE) #should give the same result as 'pml'
``` |

donkeyshot/phybreak documentation built on Aug. 16, 2018, noon

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.