Library for the Development and Use of Phylogenetic Network Methods
Metropolis-Hastings MCMC and Hill Climbing search algorithms for phylogenetic inference.
This exception is raised when there is an error running the Hill Climbing algorithm.
This exception is raised when there is an error running the Metropolis Hastings algorithm.
Abstract class that defines proposal kernel behavior. In general, simply must have a generate method that spits out a move.
Initialize a proposal kernel
*ABSTRACT METHOD* Generate the next move for a model to apply to the network.
Proposal kernel for the Infer_MP_Allop_2.0 method.
Initialize proposal kernel for the Infer_MP_Allop_2.0 method.
Simply return a new SwitchParentage object.
Class that implements the Hill Climbing search method.
Initialize a Hill Climb search.
| Parameter | Type | Description |
|---|---|---|
| pkernel | ProposalKernel | Some proposal kernel |
| submodel | GTR, optional | A substitution model. Defaults to JC. |
| data | Matrix | None, optional | A data matrix. Defaults to None. |
| model | Model | None, optional | A Model obj. Defaults to None. |
| num_iter | int, optional | Number of iterations. Defaults to 500. |
| stochastic | int, optional | Random seed. Defaults to -1. |
| enhanced_stop | bool, optional | Early stopping flag. Defaults to True. |
Run the hill climbing algorithm.
Runs the hill climbing algorithm 'count' times.
| Parameter | Type | Description |
|---|---|---|
| count | int | the number of times to run. |
A special case of Hill Climbing, in which moves are accepted even if the score is not an improvement, based on the Hastings Ratio.
Initialize a Metropolis Hastings search.
| Parameter | Type | Description |
|---|---|---|
| pkernel | ProposalKernel | A proposal kernel. |
| submodel | GTR, optional | A substitution model. Defaults to JC. |
| data | Matrix | None, optional | The data. Defaults to None. |
| model | Model | None, optional | A phylogenetic model. Defaults to None. |
| num_iter | int, optional | Number of iterations. Defaults to 500. |
Run the Metropolis-Hastings algorithm.
Runs the MH algorithm 'count' times.
| Parameter | Type | Description |
|---|---|---|
| count | int | The number of times to run. |
| format_stats | bool | Flag to print stats. |