Class TwoStateModel

All Implemented Interfaces:
Serializable, Cloneable, ExternalParameterListener, NamedParameterized, Parameterized, Report, RateMatrix, XMLConstants

public class TwoStateModel extends AbstractRateMatrix implements RateMatrix, XMLConstants
implements the most general reversible rate matrix for two-state data
Version:
$Id: TwoStateModel.java,v 1.7 2003/11/13 04:05:39 matt Exp $
Author:
Korbinian Strimmer, Alexei Drummond
See Also:
  • Constructor Details

    • TwoStateModel

      public TwoStateModel(double[] f)
      constructor
      Parameters:
      f - frequencies
  • Method Details

    • getModelID

      public int getModelID()
      get numerical code describing the model type
      Specified by:
      getModelID in interface RateMatrix
      Specified by:
      getModelID in class AbstractRateMatrix
      Returns:
      0 (there is only one model)
    • getInstance

      public static TwoStateModel getInstance(double[] freq)
      create object using an instance method
      Parameters:
      freq - model frequencies
      Returns:
      rate matrix
    • report

      public void report(PrintWriter out)
      Description copied from interface: Report
      print human readable report (e.g., on parameters and associated model)
      Specified by:
      report in interface Report
      Parameters:
      out - output stream
    • getNumParameters

      public int getNumParameters()
      Description copied from interface: Parameterized
      get number of parameters
      Specified by:
      getNumParameters in interface Parameterized
      Returns:
      number of parameters
    • 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
    • getLowerLimit

      public double getLowerLimit(int n)
      Description copied from interface: Parameterized
      get lower parameter limit
      Specified by:
      getLowerLimit in interface Parameterized
      Parameters:
      n - parameter number
      Returns:
      lower bound
    • 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
    • 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
    • getParameterName

      public String getParameterName(int i)
      Specified by:
      getParameterName in interface NamedParameterized
      Returns:
      a short identifier for this parameter type. Should be the same for all instances of a given class!
    • getUniqueName

      public String getUniqueName()
      Specified by:
      getUniqueName in interface RateMatrix
      Returns:
      a short unique human-readable identifier for this rate matrix.
    • rebuildRateMatrix

      protected final void rebuildRateMatrix(double[][] rate, double[] parameters)
      Specified by:
      rebuildRateMatrix in class AbstractRateMatrix