|
| ~Geese () |
|
void | init (size_t bar_width=BARRY_PROGRESS_BAR_WIDTH) |
|
void | inherit_support (const Geese &model_, bool delete_support_=false) |
|
void | calc_sequence (Node *n=nullptr) |
|
void | calc_reduced_sequence () |
|
double | likelihood (const std::vector< double > &par, bool as_log=false, bool use_reduced_sequence=true, size_t ncores=1u, bool no_update_pset_probs=false) |
|
double | likelihood_exhaust (const std::vector< double > &par) |
|
std::vector< double > | get_probabilities () const |
|
void | set_seed (const size_t &s) |
|
std::vector< std::vector< size_t > > | simulate (const std::vector< double > &par) |
|
std::vector< std::vector< double > > | observed_counts () |
|
void | print_observed_counts () |
|
void | print () const |
| Prints information about the GEESE. More...
|
|
void | print_nodes () const |
|
void | init_node (Node &n) |
|
void | update_annotations (size_t nodeid, std::vector< size_t > newann) |
|
std::vector< std::vector< bool > > | get_states () const |
| Powerset of a gene's possible states. More...
|
|
std::vector< size_t > | get_annotated_nodes () const |
| Returns the ids of the nodes with at least one annotation. More...
|
|
std::vector< size_t > | get_annotations () const |
| Returns the annotations of the nodes with at least one annotation. More...
|
|
|
The model includes a total of N + 1 nodes, the + 1 beign the root node.
- Parameters
-
annotations | A vector of vectors with annotations. It should be of length k (number of functions). Each vector should be of length N (equal to the number of nodes, including interior). Possible values are 0, 1, and 9. |
geneid | Id of the gene. It should be of length N . |
parent | Id of the parent gene. Also of length N |
duplication | Logical scalar indicating the type of event (true: duplication, false: speciation.) |
The ordering of the entries does not matter. Passing the nodes in post order or not makes no difference to the constructor.
|
| Geese () |
|
| Geese (std::vector< std::vector< size_t > > &annotations, std::vector< size_t > &geneid, std::vector< int > &parent, std::vector< bool > &duplication) |
|
| Geese (const Geese &model_, bool copy_data=true) |
|
| Geese (Geese &&x) noexcept |
|
Geese & | operator= (const Geese &model_)=delete |
|
Geese & | operator= (Geese &&model_) noexcept=delete |
|
|
- Parameters
-
verb | When true it will print out information about the encountered polytomies. |
|
size_t | nfuns () const noexcept |
| Number of functions analyzed. More...
|
|
size_t | nnodes () const noexcept |
| Number of nodes (interior + leaf) More...
|
|
size_t | nleafs () const noexcept |
| Number of leaf. More...
|
|
size_t | nterms () const |
| Number of terms included. More...
|
|
size_t | support_size () const noexcept |
| Number of unique sets of sufficient stats. More...
|
|
std::vector< size_t > | nannotations () const noexcept |
| Number of annotations. More...
|
|
std::vector< std::string > | colnames () const |
| Names of the terms in the model. More...
|
|
size_t | parse_polytomies (bool verb=true, std::vector< size_t > *dist=nullptr) const noexcept |
| Check polytomies and return the largest. More...
|
|
|
Calculate the conditional probability
- Parameters
-
par | Vector of parameters (terms + root). |
res_prob | Vector indicating each nodes' state probability. |
leave_one_out | When true , it will compute the predictions using leave-one-out, thus the prediction will be repeated nleaf times. |
only_annotated | When true , it will make the predictions only on the induced sub-tree with annotated leafs. |
use_reduced_sequence | Passed to the likelihood method. |
preorder | For the tree traversal. |
When res_prob is specified, the function will attach the member vector probabilities from the Node s objects. This contains the probability that the ith node has either of the possible states.
- Returns
- std::vector< double > Returns the posterior probability
|
std::vector< std::vector< double > > | predict (const std::vector< double > &par, std::vector< std::vector< double > > *res_prob=nullptr, bool leave_one_out=false, bool only_annotated=false, bool use_reduced_sequence=true) |
|
std::vector< std::vector< double > > | predict_backend (const std::vector< double > &par, bool use_reduced_sequence, const std::vector< size_t > &preorder) |
|
std::vector< std::vector< double > > | predict_exhaust_backend (const std::vector< double > &par, const std::vector< size_t > &preorder) |
|
std::vector< std::vector< double > > | predict_exhaust (const std::vector< double > &par) |
|
std::vector< std::vector< double > > | predict_sim (const std::vector< double > &par, bool only_annotated=false, size_t nsims=10000u) |
|
|
These functions provide direct access to some member objects that are shared by the nodes within Geese .
- Returns
get_rengine() returns the Pseudo-RNG engine used.
-
get_counters() returns the vector of counters used.
-
get_model() returns the Model object used.
-
get_support_fun() returns the computed support of the model.
|
std::mt19937 * | get_rengine () |
|
PhyloCounters * | get_counters () |
|
PhyloModel * | get_model () |
|
PhyloSupport * | get_support_fun () |
|
Annotated Phylo Model.
A list of available terms for this model can be found in the Phylo counters section.
Class representing a phylogenetic tree model with annotations.
The Geese
class represents a phylogenetic tree model with annotations. It includes a total of N + 1
nodes, the + 1
being the root node. The class provides methods for initializing the model, calculating the likelihood, simulating trees, and making predictions.
The class includes shared objects within a Geese
object, such as rengine
, model
, states
, n_zeros
, n_ones
, n_dupl_events
, and n_spec_events
. It also includes information about the type of event, such as etype_default
, etype_speciation
, etype_duplication
, and etype_either
.
The class provides constructors, a destructor, and methods for initializing the model, inheriting support, calculating the sequence, calculating the reduced sequence, calculating the likelihood, calculating the likelihood exhaustively, getting probabilities, setting the seed, simulating trees, parsing polytomies, getting observed counts, printing observed counts, printing information about the GEESE, and making predictions.
- See also
- Flock
Definition at line 114 of file geese-bones.hpp.