pal.distance
Class SequencePairLikelihood

java.lang.Object
  |
  +--pal.distance.SequencePairLikelihood
All Implemented Interfaces:
UnivariateFunction

public class SequencePairLikelihood
extends java.lang.Object
implements UnivariateFunction

computation of the (negative) log-likelihood for a pair of sequences


Constructor Summary
SequencePairLikelihood(SitePattern sp, SubstitutionModel m)
          initialisation
 
Method Summary
 double evaluate(double arc)
          compute (negative) log-likelihood for a given distance between the two sequences
 double getLowerBound()
          get lower bound of argument
 double getUpperBound()
          get upper bound of argument
 void setSequences(byte[] s1, byte[] s2)
          specification of two sequences (not necessarily in the given alignment but with the same weights in the site pattern)
 void setSequences(int s1, int s2)
          specification of two sequences in the given alignment
 void updateModel(SubstitutionModel m)
          update model of substitution
 void updateSitePattern(SitePattern sp)
          update site pattern
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SequencePairLikelihood

public SequencePairLikelihood(SitePattern sp,
                              SubstitutionModel m)
initialisation
Parameters:
sp - site pattern
m - model of substitution
Method Detail

updateModel

public void updateModel(SubstitutionModel m)
update model of substitution
Parameters:
model - of substitution

updateSitePattern

public void updateSitePattern(SitePattern sp)
update site pattern
Parameters:
site - pattern

setSequences

public void setSequences(int s1,
                         int s2)
specification of two sequences in the given alignment
Parameters:
s1 - number of first sequence
s2 - number of second sequence

setSequences

public void setSequences(byte[] s1,
                         byte[] s2)
specification of two sequences (not necessarily in the given alignment but with the same weights in the site pattern)
Parameters:
s1 - site pattern of first sequence
s2 - site pattern of second sequence

evaluate

public double evaluate(double arc)
compute (negative) log-likelihood for a given distance between the two sequences
Specified by:
evaluate in interface UnivariateFunction
Parameters:
arc - expected distance
Returns:
negative log-likelihood

getLowerBound

public double getLowerBound()
Description copied from interface: UnivariateFunction
get lower bound of argument
Specified by:
getLowerBound in interface UnivariateFunction
Following copied from interface: pal.math.UnivariateFunction
Returns:
lower bound

getUpperBound

public double getUpperBound()
Description copied from interface: UnivariateFunction
get upper bound of argument
Specified by:
getUpperBound in interface UnivariateFunction
Following copied from interface: pal.math.UnivariateFunction
Returns:
upper bound