5#ifndef BPP_PHYL_MAPPING_STOCHASTICMAPPING_H
6#define BPP_PHYL_MAPPING_STOCHASTICMAPPING_H
9#include "../Likelihood/DataFlow/DataFlowCWise.h"
10#include "../Likelihood/DataFlow/LikelihoodCalculationSingleProcess.h"
11#include "../Simulation/MutationProcess.h"
12#include "../Simulation/SubstitutionProcessSequenceSimulator.h"
49 std::shared_ptr<LikelihoodCalculationSingleProcess>
likelihood_;
51 std::shared_ptr<PhyloTree>
tree_;
77 explicit StochasticMapping(std::shared_ptr<LikelihoodCalculationSingleProcess> drl,
size_t numOfMappings = 10000);
126 std::shared_ptr<PhyloTree>
generateExpectedMapping(std::vector<std::shared_ptr<PhyloTree>>& mappings,
size_t divMethod = 0);
vector< vector< vector< double > > > VVVDouble
vector< vector< double > > VVDouble
This class is used by MutationProcess to store detailed results of simulations.
void giveNamesToInternalNodes(PhyloTree &tree)
void updateBranchMapping(PhyloNode *son, const MutationPath &branchMapping)
void setExpectedAncestrals(shared_ptr< PhyloTree > expectedMapping, VVDouble &posteriorProbabilities)
void setNodeState(PhyloNode *node, size_t state)
void sampleAncestrals(shared_ptr< PhyloTree > mapping)
void sampleMutationsGivenAncestralsPerBranch(PhyloNode *son, size_t maxIterNum=10000)
size_t sampleState(const VDouble &distibution)
std::shared_ptr< LikelihoodCalculationSingleProcess > likelihood_
int getNodeState(const PhyloNode *node) const
void computeFractionals()
void ComputeConditionals()
std::shared_ptr< PhyloTree > generateAnalyticExpectedMapping(size_t divMethod=0)
Creates a single expected (i.e, average) history based the rewards provided by the algorithm of Minin...
void updateBranchByDwellingTimes(PhyloNode *node, VDouble &dwellingTimes, VVDouble &posteriorProbabilities, size_t divMethod=0)
StochasticMapping * clone() const
cloning function used by the copy constructor of ./Likelihood/JointLikelihoodFunction/h
VVDouble fractionalProbabilities_
StochasticMapping(std::shared_ptr< LikelihoodCalculationSingleProcess > drl, size_t numOfMappings=10000)
void setLeafsStates(std::shared_ptr< PhyloTree > mapping)
void computeStatesFrequencies(VVDouble &ancestralStatesFreuquencies, vector< shared_ptr< PhyloTree > > &mappings)
std::shared_ptr< PhyloTree > generateExpectedMapping(std::vector< std::shared_ptr< PhyloTree > > &mappings, size_t divMethod=0)
Creates a single expected (i.e, average) history based on a given set of mappings steps....
VVVDouble ConditionalProbabilities_
StochasticMapping(const StochasticMapping &sm)
std::shared_ptr< PhyloTree > tree_
void sampleMutationsGivenAncestrals(shared_ptr< PhyloTree > mapping)
void generateStochasticMapping(std::vector< std::shared_ptr< PhyloTree > > &mappings)
Defines the basic types of data flow nodes.