pal.tree
Class MutationRateModelTree

java.lang.Object
  extended by pal.tree.ParameterizedTree.ParameterizedTreeBase
      extended by pal.tree.MutationRateModelTree
All Implemented Interfaces:
java.io.Serializable, OrthogonalHints, IdGroup, Parameterized, Units, UnitsProvider, ParameterizedTree, Tree

public class MutationRateModelTree
extends ParameterizedTree.ParameterizedTreeBase
implements OrthogonalHints, ParameterizedTree

Provides parameter interface to any clock-like tree with serially sampled tips (parameters are the minimal node height differences at each internal node). Any mutation rate model can be used.

Version:
$Id: MutationRateModelTree.java,v 1.19 2003/06/04 03:17:52 matt Exp $
Author:
Alexei Drummond
See Also:
MutationRateModel, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface pal.math.OrthogonalHints
OrthogonalHints.Utils
 
Nested classes/interfaces inherited from interface pal.tree.ParameterizedTree
ParameterizedTree.Factory, ParameterizedTree.ParameterizedTreeBase
 
Nested classes/interfaces inherited from interface pal.misc.Parameterized
Parameterized.Null, Parameterized.ParameterizedBase, Parameterized.ParameterizedUser
 
Nested classes/interfaces inherited from interface pal.tree.Tree
Tree.TreeBase
 
Field Summary
 
Fields inherited from interface pal.misc.Units
DAYS, EXPECTED_SUBSTITUTIONS, GENERATIONS, MONTHS, SAMPLE, SHORT_UNIT_NAMES, UNIT_NAMES, UNKNOWN, YEARS
 
Constructor Summary
protected MutationRateModelTree(MutationRateModelTree toCopy)
          Cloning constructor
  MutationRateModelTree(Tree t, TimeOrderCharacterData tocd, MutationRateModel model)
          take any tree and afford it with an interface suitable for a clock-like tree (parameters are the minimal node height differences at each internal node).
  MutationRateModelTree(Tree t, TimeOrderCharacterData tocd, MutationRateModel model, boolean includeModelParameters)
          take any tree and afford it with an interface suitable for a clock-like tree (parameters are the minimal node height differences at each internal node).
 
Method Summary
 java.lang.Object clone()
           
 Tree getCopy()
          The cheapy copy that just creates a SimpleTree
 double getDefaultValue(int n)
          get default value of parameter
 int getInternalParameterBoundaries(int parameter, double[] storage)
          A boundary is a value of a parameter for which values lower than the boundary and values higher than the boundary are better treated as two separate functions (IE, they are only piecewise connected), and minimisation should be performed over both ranges individually (and then the true minimum taken as the minimuma of the ranges)
 double getLnL()
           
 double getLowerLimit(int n)
          Returns lower limit of parameter estimate.
 MutationRateModel getMutationRateModel()
          returns mu
 int getNumParameters()
          get number of parameters
 OrthogonalHints getOrthogonalHints()
           
 double getParameter(int n)
          get model parameter
 java.lang.String getParameterizationInfo()
           
static ParameterizedTree.Factory getParameterizedTreeFactory(MutationRateModel.Factory rateModel, TimeOrderCharacterData tocd)
          Obtain a ParameterizedTree.Factory for generating Unconstrained trees
 OrderEnumerator getSuggestedOrdering(OrderEnumerator defaultOrdering)
          If there is a "best" ordering to use it can be specified here, if not should return null
 double getUpperLimit(int n)
          get upper parameter limit
protected  void heights2parameters()
           
protected  void parameters2Heights()
           
 void setLnL(double lnL)
           
 void setMaxRelativeHeight(double value)
          Sets the maximum distance between ancestor and latest descendant.
 void setParameter(double param, int n)
          set model parameter
 void setParameterSE(double paramSE, int n)
          set standard errors for model parameter
 
Methods inherited from class pal.tree.ParameterizedTree.ParameterizedTreeBase
createNodeList, getAttribute, getBaseTree, getExternalNode, getExternalNodeCount, getIdCount, getIdentifier, getInternalNode, getInternalNodeCount, getNodeCount, getRoot, getUnits, setAttribute, setBaseTree, setIdentifier, setRoot, toString, whichIdNumber
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface pal.tree.Tree
createNodeList, getAttribute, getExternalNode, getExternalNodeCount, getInternalNode, getInternalNodeCount, getRoot, getUnits, setAttribute, setRoot
 
Methods inherited from interface pal.misc.IdGroup
getIdCount, getIdentifier, setIdentifier, whichIdNumber
 

Constructor Detail

MutationRateModelTree

public MutationRateModelTree(Tree t,
                             TimeOrderCharacterData tocd,
                             MutationRateModel model)
take any tree and afford it with an interface suitable for a clock-like tree (parameters are the minimal node height differences at each internal node). Includes model parameters as parameters of tree

This parameterisation of a clock-tree, ensuring that all parameters are independent of each other is due to Andrew Rambaut (personal communication).


MutationRateModelTree

public MutationRateModelTree(Tree t,
                             TimeOrderCharacterData tocd,
                             MutationRateModel model,
                             boolean includeModelParameters)
take any tree and afford it with an interface suitable for a clock-like tree (parameters are the minimal node height differences at each internal node).

This parameterisation of a clock-tree, ensuring that all parameters are independent of each other is due to Andrew Rambaut (personal communication).


MutationRateModelTree

protected MutationRateModelTree(MutationRateModelTree toCopy)
Cloning constructor

Method Detail

setMaxRelativeHeight

public void setMaxRelativeHeight(double value)
Sets the maximum distance between ancestor and latest descendant.


getNumParameters

public int getNumParameters()
Description copied from interface: Parameterized
get number of parameters

Specified by:
getNumParameters in interface Parameterized
Returns:
number of parameters

setParameter

public void setParameter(double param,
                         int n)
Description copied from interface: Parameterized
set model parameter

Specified by:
setParameter in interface Parameterized
Parameters:
param - parameter value
n - parameter number

getParameter

public double getParameter(int n)
Description copied from interface: Parameterized
get model parameter

Specified by:
getParameter in interface Parameterized
Parameters:
n - parameter number
Returns:
parameter value

getLowerLimit

public double getLowerLimit(int n)
Returns lower limit of parameter estimate.

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

getDefaultValue

public double getDefaultValue(int n)
Description copied from interface: Parameterized
get default value of parameter

Specified by:
getDefaultValue in interface Parameterized
Parameters:
n - parameter number
Returns:
default value

setParameterSE

public void setParameterSE(double paramSE,
                           int n)
Description copied from interface: Parameterized
set standard errors for model parameter

Specified by:
setParameterSE in interface Parameterized
Parameters:
paramSE - standard error of parameter value
n - parameter number

getUpperLimit

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

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

getParameterizationInfo

public java.lang.String getParameterizationInfo()
Specified by:
getParameterizationInfo in interface ParameterizedTree

getMutationRateModel

public MutationRateModel getMutationRateModel()
returns mu


parameters2Heights

protected void parameters2Heights()

heights2parameters

protected void heights2parameters()

setLnL

public void setLnL(double lnL)

getLnL

public double getLnL()

getOrthogonalHints

public OrthogonalHints getOrthogonalHints()
Specified by:
getOrthogonalHints in interface ParameterizedTree
Overrides:
getOrthogonalHints in class ParameterizedTree.ParameterizedTreeBase
Returns:
null by default (implying not hint information)

getSuggestedOrdering

public OrderEnumerator getSuggestedOrdering(OrderEnumerator defaultOrdering)
Description copied from interface: OrthogonalHints
If there is a "best" ordering to use it can be specified here, if not should return null

Specified by:
getSuggestedOrdering in interface OrthogonalHints
Parameters:
defaultOrdering - The ordering suggested by the optimiser, may be null!
Returns:
null, or default ordering if no known best ordering

getInternalParameterBoundaries

public int getInternalParameterBoundaries(int parameter,
                                          double[] storage)
Description copied from interface: OrthogonalHints
A boundary is a value of a parameter for which values lower than the boundary and values higher than the boundary are better treated as two separate functions (IE, they are only piecewise connected), and minimisation should be performed over both ranges individually (and then the true minimum taken as the minimuma of the ranges)

Specified by:
getInternalParameterBoundaries in interface OrthogonalHints
Returns:
the number of boundary locations stored in storage, or -1 if not enough room, or 0 if there are no boundaries (other than the normal parameter range)

getCopy

public Tree getCopy()
Description copied from class: ParameterizedTree.ParameterizedTreeBase
The cheapy copy that just creates a SimpleTree

Specified by:
getCopy in interface Tree
Overrides:
getCopy in class ParameterizedTree.ParameterizedTreeBase
Returns:
a clone of this tree

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

getParameterizedTreeFactory

public static final ParameterizedTree.Factory getParameterizedTreeFactory(MutationRateModel.Factory rateModel,
                                                                          TimeOrderCharacterData tocd)
Obtain a ParameterizedTree.Factory for generating Unconstrained trees