public final class ConditionalProbabilityStore
extends java.lang.Object
implements java.io.Serializable
Title: ConditionalProbabilityStore (was ConditionalLikelihoodStore)
Description: A container class for various bits of data relating to the conditional likelihood. Things stored include the conditional likelihood, an scale factors and whether the current conditional likelihoods were created from cached data.
Modifier and Type | Class and Description |
---|---|
static interface |
ConditionalProbabilityStore.ExtraProcessor |
Constructor and Description |
---|
ConditionalProbabilityStore(int numberOfCategories,
int numberOfStates) |
ConditionalProbabilityStore(int numberOfCategories,
int numberOfStates,
ConditionalProbabilityStore.ExtraProcessor extraProcessor) |
Modifier and Type | Method and Description |
---|---|
double[][] |
calculateCategoryPatternConditionalProbabilities(double[] categoryProbabilities,
double[] equilibriumFrequencies,
int numberOfPatterns)
Calculate the conditional probabilities for each ancestral state at each site pattern, multiplied by related equilibrium frequencies
|
double |
calculateLogLikelihood(double[] categoryProbabilities,
double[] equilibriumFrequencies,
int numberOfPatterns) |
double |
calculateLogLikelihood(double[] categoryProbabilities,
double[] equilibriumFrequencies,
int[] patternWeights,
int numberOfPatterns) |
double[] |
calculatePatternLogLikelihoods(double[] categoryProbabilities,
double[] equilibriumFrequencies,
int numberOfPatterns) |
double[][][] |
getConditionalProbabilityAccess(int numberOfPatterns,
boolean resultsBasedOnCachedData)
Use this when access the internal conditional likelihood store for the purpose
of changing the contents.
|
double[][][] |
getConditionalProbabilityAccessNoChangeData(int numberOfPatterns,
boolean resultsBasedOnCachedData)
Use this when access the internal conditional likelihood store for the purpose
of changing the contents.
|
ConditionalProbabilityStore |
getCopy()
Cloning
|
double[][][] |
getCurrentConditionalProbabilities()
Used for getting access to the internal conditional probability store when
the data is not to be directly changed.
|
double[][] |
getCurrentConditionalProbabilities(int category)
Used for getting access to the internal conditional probability store when
the data is not to be directly changed.
|
ConditionalProbabilityStore.ExtraProcessor |
getExtraProcessor() |
double[][][] |
getIncompleteConditionalProbabilityAccess(int numberOfPatterns,
boolean resultsBasedOnCachedData,
boolean fix)
Use this when access the internal conditional likelihood store for the purpose
of changing the contents.
|
int |
getPatternCapacity() |
boolean |
isBasedOnCachedData() |
boolean |
isHasExtraProcessor() |
void |
setBasedOnCachedData(boolean v) |
java.lang.String |
toString() |
java.lang.String |
toString(int numberOfPatterns) |
public ConditionalProbabilityStore(int numberOfCategories, int numberOfStates)
public ConditionalProbabilityStore(int numberOfCategories, int numberOfStates, ConditionalProbabilityStore.ExtraProcessor extraProcessor)
public final ConditionalProbabilityStore getCopy()
public final boolean isHasExtraProcessor()
public final ConditionalProbabilityStore.ExtraProcessor getExtraProcessor()
public int getPatternCapacity()
public double[][][] getCurrentConditionalProbabilities()
public double[][] getCurrentConditionalProbabilities(int category)
category
- the transition category of interestpublic double[][][] getConditionalProbabilityAccess(int numberOfPatterns, boolean resultsBasedOnCachedData)
numberOfPatterns
- An indication of how much space will be required. The result will always be big enough to accomodate the requested number of patterns.resultsBasedOnCachedData
- An indication of whether the new conditionals about to be stored are based on cached datapublic double[][][] getConditionalProbabilityAccessNoChangeData(int numberOfPatterns, boolean resultsBasedOnCachedData)
numberOfPatterns
- An indication of how much space will be required. An exception is thrown if this number of patterns cannot be accomodated without being resized.resultsBasedOnCachedData
- An indication of whether the new conditionals about to be stored are based on cached datajava.lang.IllegalArgumentException
- if incompatible number of patternspublic double[][][] getIncompleteConditionalProbabilityAccess(int numberOfPatterns, boolean resultsBasedOnCachedData, boolean fix)
numberOfPatterns
- An indication of how much space will be required. The result will always be big enough to accomodate the requested number of patterns.resultsBasedOnCachedData
- An indication of whether the new conditionals about to be stored are based on cached datapublic double calculateLogLikelihood(double[] categoryProbabilities, double[] equilibriumFrequencies, int[] patternWeights, int numberOfPatterns)
public double calculateLogLikelihood(double[] categoryProbabilities, double[] equilibriumFrequencies, int numberOfPatterns)
public double[] calculatePatternLogLikelihoods(double[] categoryProbabilities, double[] equilibriumFrequencies, int numberOfPatterns)
public double[][] calculateCategoryPatternConditionalProbabilities(double[] categoryProbabilities, double[] equilibriumFrequencies, int numberOfPatterns)
categoryProbabilities
- The prior probability of a site belonging to a particular categoryequilibriumFrequencies
- the prior probabibilities of seeing a particular statenumberOfPatterns
- The number of patternspublic boolean isBasedOnCachedData()
public void setBasedOnCachedData(boolean v)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(int numberOfPatterns)