Package jebl.evolution.substmodel
Class AbstractRateMatrix
- java.lang.Object
-
- jebl.evolution.substmodel.AbstractRateMatrix
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,RateMatrix
- Direct Known Subclasses:
AminoAcidModel
public abstract class AbstractRateMatrix extends java.lang.Object implements RateMatrix
abstract base class for all rate matrices- Version:
- $Id: AbstractRateMatrix.java 185 2006-01-23 23:03:18Z rambaut $
- Author:
- Korbinian Strimmer, Alexei Drummond
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDimension()
double[]
getEquilibriumFrequencies()
double
getEquilibriumFrequency(int i)
double[][]
getRelativeRates()
SequenceType
getSequenceType()
Get the data type of this rate matrixvoid
getTransitionProbabilities(double[][] probabilityStore)
A utility method for speed, transfers trans prob information quickly into storedouble
getTransitionProbability(int fromState, int toState)
void
rebuild()
void
scale(double scale)
void
setDistance(double distance)
Sets the distance (such as time/branch length) used when calculating the probabilities.void
setDistanceTranspose(double distance)
Sets the distance (such as time/branch length) used when calculating the probabilities.double
setParametersNoScale(double[] parameters)
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface jebl.evolution.substmodel.RateMatrix
getUniqueName
-
-
-
-
Method Detail
-
getDimension
public int getDimension()
- Specified by:
getDimension
in interfaceRateMatrix
- Returns:
- the dimension of this rate matrix.
-
getEquilibriumFrequencies
public double[] getEquilibriumFrequencies()
- Specified by:
getEquilibriumFrequencies
in interfaceRateMatrix
- Returns:
- stationary frequencies (sum = 1.0)
-
getEquilibriumFrequency
public double getEquilibriumFrequency(int i)
- Specified by:
getEquilibriumFrequency
in interfaceRateMatrix
- Returns:
- stationary frequencie (sum = 1.0) for ith state
-
getSequenceType
public SequenceType getSequenceType()
Description copied from interface:RateMatrix
Get the data type of this rate matrix- Specified by:
getSequenceType
in interfaceRateMatrix
-
getRelativeRates
public double[][] getRelativeRates()
- Specified by:
getRelativeRates
in interfaceRateMatrix
- Returns:
- rate matrix (transition: from 1st index to 2nd index)
-
getTransitionProbability
public double getTransitionProbability(int fromState, int toState)
- Specified by:
getTransitionProbability
in interfaceRateMatrix
- Parameters:
fromState
- The state from which we are startingtoState
- The resulting state- Returns:
- the probability of going from one state to another given the current distance
-
rebuild
public final void rebuild()
-
setDistance
public final void setDistance(double distance)
Sets the distance (such as time/branch length) used when calculating the probabilities.- Specified by:
setDistance
in interfaceRateMatrix
-
setDistanceTranspose
public final void setDistanceTranspose(double distance)
Sets the distance (such as time/branch length) used when calculating the probabilities. The resulting transition probabilities will be in reverse (that is in the matrix instead of [from][to] it's [to][from])
-
getTransitionProbabilities
public final void getTransitionProbabilities(double[][] probabilityStore)
A utility method for speed, transfers trans prob information quickly into store- Specified by:
getTransitionProbabilities
in interfaceRateMatrix
-
scale
public void scale(double scale)
-
setParametersNoScale
public double setParametersNoScale(double[] parameters)
-
-