public class SiteLikelihood
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
SiteLikelihood.LikelihoodException
Exception related to a likelihood calculation
|
static class |
SiteLikelihood.NodeLikelihood
Stores the results of a likelihood calculation for a single node in a tree.
|
static class |
SiteLikelihood.RateLikelihood
Stores the result of the likelihood calculations for a single site and
a single rate class.
|
Constructor and Description |
---|
SiteLikelihood(java.util.Map<RateCategory,SiteLikelihood.RateLikelihood> rateLikelihoods,
Probabilities P)
Default constructor
|
Modifier and Type | Method and Description |
---|---|
Real |
getLikelihood()
Get the likelihood
|
RateCategory |
getMostProbableRateCategory()
Gets the most probable rate category
|
Real |
getRateCategoryProbability(RateCategory rc)
Gets the probability of being in a rate category
|
SiteLikelihood.RateLikelihood |
getRateLikelihood(RateCategory rate)
Get the likelihood for a single rate class
|
static void |
keepNodeLikelihoods(boolean keep)
Sets whether to store the node likelihoods after they've been used.
|
static void |
optKeepNL(boolean keep)
Similar to
keepNodeLikelihoods(boolean) but if set to false
overrides the setting set by that function. |
static void |
realType(RealFactory.RealType type)
Sets the real type to be used during calculations, either
SmallDouble
or StandardDouble . |
java.lang.String |
toString() |
public SiteLikelihood(java.util.Map<RateCategory,SiteLikelihood.RateLikelihood> rateLikelihoods, Probabilities P)
rateLikelihoods
- The likelihood of the individual rates at that siteP
- A Probabilities object from which the frequency of each rate will be fetchedpublic Real getLikelihood()
public SiteLikelihood.RateLikelihood getRateLikelihood(RateCategory rate) throws SiteLikelihood.LikelihoodException
rate
- Rate class to get the likelihood forSiteLikelihood.LikelihoodException
- Thrown if no likelihood
has been calculated for the given ratepublic Real getRateCategoryProbability(RateCategory rc)
rc
- The rate categorypublic RateCategory getMostProbableRateCategory()
public java.lang.String toString()
toString
in class java.lang.Object
public static void keepNodeLikelihoods(boolean keep)
keep
- Whether to keep the node likelihoodspublic static void optKeepNL(boolean keep)
keepNodeLikelihoods(boolean)
but if set to false
overrides the setting set by that function. Intended to only be used
by optimizers so that the node likelihoods calculated while optimizing
aren't kept. I.e. should be set to false before optimizing and back to
true for the final calculation.keep
- Whether to keep the ndoe likelihoodspublic static void realType(RealFactory.RealType type)
SmallDouble
or StandardDouble
.type
- The double type to useAncestralJointDP.realType(Maths.RealFactory.RealType)