statalign.model.subst.plugins
Class NucleotideModelUtils

java.lang.Object
  extended by statalign.model.subst.plugins.NucleotideModelUtils

public class NucleotideModelUtils
extends java.lang.Object

This class implements various utility methods for nucleotide models.

Author:
lyngsoe

Constructor Summary
NucleotideModelUtils()
           
 
Method Summary
static void numericalDiagonalisation(NucleotideModel M, double[][] Q)
          Class method for numerical diagonalisation of rate matrix Q for nucleotide model M.
static double sampleFrequencies(double[] f, double dmax)
          Class method for sampling new equilibrium frequency parameter for one of the frequencies in f, where the maximum allowed change is dmax.
static double sampleRates(double[] r, double dmax)
          Class method for sampling new rate parameter for one of the rates in r, where the maximum allowed change is dmax.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NucleotideModelUtils

public NucleotideModelUtils()
Method Detail

sampleRates

public static double sampleRates(double[] r,
                                 double dmax)
Class method for sampling new rate parameter for one of the rates in r, where the maximum allowed change is dmax. Return value is logarithm of Metropolis-Hastings ratio.


sampleFrequencies

public static double sampleFrequencies(double[] f,
                                       double dmax)
Class method for sampling new equilibrium frequency parameter for one of the frequencies in f, where the maximum allowed change is dmax. Return value is logarithm of Metropolis-Hastings ratio.


numericalDiagonalisation

public static void numericalDiagonalisation(NucleotideModel M,
                                            double[][] Q)
Class method for numerical diagonalisation of rate matrix Q for nucleotide model M. It is assumed that M.e holds the equilibrium frequencies for the model and that the diagonalising matrices should be stored in M.v, M.d and M.w, and that it is safe to modify Q.