pal.treesearch
Class FixedBSRDTGlobalClockModel

java.lang.Object
  extended bypal.treesearch.FixedBSRDTGlobalClockModel
All Implemented Interfaces:
ConstraintModel, ConstraintModel.GroupManager, MolecularClockLikelihoodModel.HeightConverter, NeoParameterized

public class FixedBSRDTGlobalClockModel
extends java.lang.Object
implements ConstraintModel, ConstraintModel.GroupManager, NeoParameterized, MolecularClockLikelihoodModel.HeightConverter


Nested Class Summary
 
Nested classes inherited from class pal.treesearch.ConstraintModel
ConstraintModel.GroupManager
 
Constructor Summary
FixedBSRDTGlobalClockModel(SampleInformation sampleInformation, MolecularClockLikelihoodModel.Instance likelihoodModel, double rate)
           
 
Method Summary
 ConditionalProbabilityStore createAppropriateConditionalProbabilityStore(boolean isForLeaf)
           
 MolecularClockLikelihoodModel.External createNewClockExternal()
           
 MolecularClockLikelihoodModel.Internal createNewClockInternal()
           
 MolecularClockLikelihoodModel.Leaf createNewClockLeaf(PatternInfo pattern, int[] patternStateMatchup)
           
 UnconstrainedLikelihoodModel.External createNewFreeExternal()
           
 UnconstrainedLikelihoodModel.Internal createNewFreeInternal()
           
 UnconstrainedLikelihoodModel.Leaf createNewFreeLeaf(int[] patternStateMatchup, int numberOfPatterns)
           
 NeoParameterized getAllGroupRelatedParameterAccess()
           
 double getBaseHeight(double originalExpectSubstitutionHeight)
           
 int getBaseHeightUnits()
           
 java.lang.String[][] getCladeConstraints(java.lang.String[] allLabelSet)
          Obtain the permanent clade sets.
 void getDefaultValues(double[] store, int startIndex)
          get default value parameter values
 double getExpectedSubstitutionDistance(double lowerBaseHeight, double upperBaseHeight)
           
 double getExpectedSubstitutionHeight(double baseHeight)
           
 ConstraintModel.GroupManager getGlobalClockConstraintGrouping(java.lang.String[] leafLabelSet)
          Enquire about the clock constraint grouping of the leaf
 NeoParameterized getGlobalParameterAccess()
           
 double getLeafBaseHeight(java.lang.String leafLabel)
           
 double getLowerLimit(int n)
          get lower parameter limit
 int getNumberOfParameters()
          get number of parameters
 void getParameters(double[] store, int startIndex)
          get model parameter
 NeoParameterized getPrimaryGroupRelatedParameterAccess()
           
 java.lang.String getRateModelSummary()
           
 NeoParameterized getSecondaryGroupRelatedParameterAccess()
           
 double getSubstitutionRate()
           
 double getUpperLimit(int n)
          get upper parameter limit
 void initialiseParameters(java.lang.String[] leafNames, double[] leafHeights)
           
 void setParameters(double[] parameters, int startIndex)
          set model parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FixedBSRDTGlobalClockModel

public FixedBSRDTGlobalClockModel(SampleInformation sampleInformation,
                                  MolecularClockLikelihoodModel.Instance likelihoodModel,
                                  double rate)
Method Detail

getRateModelSummary

public java.lang.String getRateModelSummary()
Specified by:
getRateModelSummary in interface ConstraintModel

getGlobalClockConstraintGrouping

public ConstraintModel.GroupManager getGlobalClockConstraintGrouping(java.lang.String[] leafLabelSet)
Description copied from interface: ConstraintModel
Enquire about the clock constraint grouping of the leaf

Specified by:
getGlobalClockConstraintGrouping in interface ConstraintModel
Returns:
the grouping of the leaf, or null if outside the leaf is unconstrained (free)

getCladeConstraints

public java.lang.String[][] getCladeConstraints(java.lang.String[] allLabelSet)
Description copied from interface: ConstraintModel
Obtain the permanent clade sets. That is, when randomly building the tree, and when tree searching, what labels must always form a clade.

Specified by:
getCladeConstraints in interface ConstraintModel
Parameters:
allLabelSet - The set of all leaf labels in the tree
Returns:
An array of string arrays dividing up the label set

createNewFreeLeaf

public UnconstrainedLikelihoodModel.Leaf createNewFreeLeaf(int[] patternStateMatchup,
                                                           int numberOfPatterns)
Specified by:
createNewFreeLeaf in interface ConstraintModel

createNewFreeExternal

public UnconstrainedLikelihoodModel.External createNewFreeExternal()
Specified by:
createNewFreeExternal in interface ConstraintModel

createNewFreeInternal

public UnconstrainedLikelihoodModel.Internal createNewFreeInternal()
Specified by:
createNewFreeInternal in interface ConstraintModel

createAppropriateConditionalProbabilityStore

public ConditionalProbabilityStore createAppropriateConditionalProbabilityStore(boolean isForLeaf)
Specified by:
createAppropriateConditionalProbabilityStore in interface ConstraintModel

getSubstitutionRate

public double getSubstitutionRate()

getGlobalParameterAccess

public NeoParameterized getGlobalParameterAccess()
Specified by:
getGlobalParameterAccess in interface ConstraintModel

getLeafBaseHeight

public double getLeafBaseHeight(java.lang.String leafLabel)
Specified by:
getLeafBaseHeight in interface ConstraintModel.GroupManager

getBaseHeight

public double getBaseHeight(double originalExpectSubstitutionHeight)
Specified by:
getBaseHeight in interface ConstraintModel.GroupManager

getBaseHeightUnits

public int getBaseHeightUnits()
Specified by:
getBaseHeightUnits in interface ConstraintModel.GroupManager

initialiseParameters

public void initialiseParameters(java.lang.String[] leafNames,
                                 double[] leafHeights)
Specified by:
initialiseParameters in interface ConstraintModel.GroupManager

getAllGroupRelatedParameterAccess

public NeoParameterized getAllGroupRelatedParameterAccess()
Specified by:
getAllGroupRelatedParameterAccess in interface ConstraintModel.GroupManager

getPrimaryGroupRelatedParameterAccess

public NeoParameterized getPrimaryGroupRelatedParameterAccess()
Specified by:
getPrimaryGroupRelatedParameterAccess in interface ConstraintModel.GroupManager

getSecondaryGroupRelatedParameterAccess

public NeoParameterized getSecondaryGroupRelatedParameterAccess()
Specified by:
getSecondaryGroupRelatedParameterAccess in interface ConstraintModel.GroupManager

createNewClockLeaf

public MolecularClockLikelihoodModel.Leaf createNewClockLeaf(PatternInfo pattern,
                                                             int[] patternStateMatchup)
Specified by:
createNewClockLeaf in interface ConstraintModel.GroupManager

createNewClockExternal

public MolecularClockLikelihoodModel.External createNewClockExternal()
Specified by:
createNewClockExternal in interface ConstraintModel.GroupManager

createNewClockInternal

public MolecularClockLikelihoodModel.Internal createNewClockInternal()
Specified by:
createNewClockInternal in interface ConstraintModel.GroupManager

getExpectedSubstitutionHeight

public double getExpectedSubstitutionHeight(double baseHeight)
Specified by:
getExpectedSubstitutionHeight in interface ConstraintModel.GroupManager

getExpectedSubstitutionDistance

public double getExpectedSubstitutionDistance(double lowerBaseHeight,
                                              double upperBaseHeight)
Specified by:
getExpectedSubstitutionDistance in interface MolecularClockLikelihoodModel.HeightConverter

getNumberOfParameters

public int getNumberOfParameters()
Description copied from interface: NeoParameterized
get number of parameters

Specified by:
getNumberOfParameters in interface NeoParameterized
Returns:
number of parameters

setParameters

public void setParameters(double[] parameters,
                          int startIndex)
Description copied from interface: NeoParameterized
set model parameter

Specified by:
setParameters in interface NeoParameterized
Parameters:
parameters - the array holding the parameters
startIndex - the index into the array that the related parameters start at

getParameters

public void getParameters(double[] store,
                          int startIndex)
Description copied from interface: NeoParameterized
get model parameter

Specified by:
getParameters in interface NeoParameterized
Parameters:
startIndex - the index into the array that the related parameters start at

getLowerLimit

public double getLowerLimit(int n)
Description copied from interface: NeoParameterized
get lower parameter limit

Specified by:
getLowerLimit in interface NeoParameterized
Parameters:
n - parameter number
Returns:
lower bound

getUpperLimit

public double getUpperLimit(int n)
Description copied from interface: NeoParameterized
get upper parameter limit

Specified by:
getUpperLimit in interface NeoParameterized
Parameters:
n - parameter number
Returns:
upper bound

getDefaultValues

public void getDefaultValues(double[] store,
                             int startIndex)
Description copied from interface: NeoParameterized
get default value parameter values

Specified by:
getDefaultValues in interface NeoParameterized
Returns:
default value