pal.substmodel
Interface RateMatrix

All Superinterfaces:
java.lang.Cloneable, NamedParameterized, Parameterized, Report, java.io.Serializable
All Known Implementing Classes:
AbstractRateMatrix, AminoAcidModel, CachedRateMatrix, CodonModel, NucleotideModel, TwoStateModel

public interface RateMatrix
extends NamedParameterized, Report, java.lang.Cloneable, java.io.Serializable

abstract base class for all rate matrices


Nested Class Summary
 
Nested classes inherited from class pal.misc.Parameterized
Parameterized.Null, Parameterized.ParameterizedBase, Parameterized.ParameterizedUser, Parameterized.Utils
 
Method Summary
 void addPalObjectListener(PalObjectListener pol)
          Add a PalObjectListener to be notified of changes to the model.
 java.lang.Object clone()
           
 DataType getDataType()
          Get the data type of this rate matrix
 int getDimension()
           
 double[] getEquilibriumFrequencies()
           
 double getEquilibriumFrequency(int i)
           
 int getModelID()
          get numerical code describing the model type
 OrthogonalHints getOrthogonalHints()
           
 double[][] getRelativeRates()
          Deprecated. try not to use.
 void getTransitionProbabilities(double[][] probabilityStore)
          A utility method for speed, transfers trans prob information quickly into store
 double getTransitionProbability(int fromState, int toState)
           
 int getTypeID()
          get numerical code describing the data type
 java.lang.String getUniqueName()
           
 void removePalObjectListener(PalObjectListener pol)
           
 void scale(double scaleValue)
           
 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 interface pal.misc.NamedParameterized
getParameterName
 
Methods inherited from interface pal.misc.Parameterized
getDefaultValue, getLowerLimit, getNumParameters, getParameter, getUpperLimit, setParameter, setParameterSE
 
Methods inherited from interface pal.misc.Report
report
 

Method Detail

getTypeID

public int getTypeID()
get numerical code describing the data type

Returns:
integer code identifying a data type

getModelID

public int getModelID()
get numerical code describing the model type

Returns:
integer code identifying a substitution model

getUniqueName

public java.lang.String getUniqueName()
Returns:
a short unique human-readable identifier for this rate matrix.

getDimension

public int getDimension()
Returns:
the dimension of this rate matrix.

getEquilibriumFrequencies

public double[] getEquilibriumFrequencies()
Returns:
stationary frequencies (sum = 1.0)

getEquilibriumFrequency

public double getEquilibriumFrequency(int i)
Returns:
stationary frequency (sum = 1.0) for ith state Preferred method for infrequent use.

getDataType

public DataType getDataType()
Get the data type of this rate matrix


getRelativeRates

public double[][] getRelativeRates()
Deprecated. try not to use.

Returns:
rate matrix (transition: from 1st index to 2nd index)

getTransitionProbability

public double getTransitionProbability(int fromState,
                                       int toState)
Parameters:
fromState - The state from which we are starting
toState - The resulting state
Returns:
the probability of going from one state to another given the current distance

getTransitionProbabilities

public void getTransitionProbabilities(double[][] probabilityStore)
A utility method for speed, transfers trans prob information quickly into store


setDistance

public void setDistance(double distance)
Sets the distance (such as time/branch length) used when calculating the probabilities. This method may well take the most time!


setDistanceTranspose

public void setDistanceTranspose(double distance)
Sets the distance (such as time/branch length) used when calculating the probabilities.


addPalObjectListener

public void addPalObjectListener(PalObjectListener pol)
Add a PalObjectListener to be notified of changes to the model. Only the parametersChanged method will generally be called


removePalObjectListener

public void removePalObjectListener(PalObjectListener pol)

getOrthogonalHints

public OrthogonalHints getOrthogonalHints()
Returns:
an orthogonal hints object for orthogonal optimisation (may return null for no hints)

clone

public java.lang.Object clone()

setParametersNoScale

public double setParametersNoScale(double[] parameters)

scale

public void scale(double scaleValue)