jebl.evolution.coalescent
Class Coalescent

java.lang.Object
  extended by jebl.evolution.coalescent.Coalescent
All Implemented Interfaces:
MultivariateFunction

public class Coalescent
extends Object
implements MultivariateFunction

A likelihood function for the coalescent. Takes a tree and a demographic model. Parts of this class were derived from C++ code provided by Oliver Pybus.

Author:
Andrew Rambaut, Alexei Drummond

Constructor Summary
Coalescent(IntervalList intervals, DemographicFunction demographicFunction)
           
Coalescent(RootedTree tree, DemographicFunction demographicFunction)
           
 
Method Summary
static double calculateAnalyticalLogLikelihood(IntervalList intervals)
          Calculates the log likelihood of this set of coalescent intervals, using an analytical integration over theta.
 double calculateLogLikelihood()
          Calculates the log likelihood of this set of coalescent intervals, given a demographic model.
static double calculateLogLikelihood(IntervalList intervals, DemographicFunction demographicFunction)
          Calculates the log likelihood of this set of coalescent intervals, given a demographic model.
 double evaluate(double[] argument)
          compute function value
 double getLowerBound(int n)
          get lower bound of argument n
 int getNumArguments()
          get number of arguments
 OrthogonalHints getOrthogonalHints()
           
 double getUpperBound(int n)
          get upper bound of argument n
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Coalescent

public Coalescent(RootedTree tree,
                  DemographicFunction demographicFunction)

Coalescent

public Coalescent(IntervalList intervals,
                  DemographicFunction demographicFunction)
Method Detail

calculateLogLikelihood

public double calculateLogLikelihood()
Calculates the log likelihood of this set of coalescent intervals, given a demographic model.


calculateLogLikelihood

public static final double calculateLogLikelihood(IntervalList intervals,
                                                  DemographicFunction demographicFunction)
Calculates the log likelihood of this set of coalescent intervals, given a demographic model.


calculateAnalyticalLogLikelihood

public static final double calculateAnalyticalLogLikelihood(IntervalList intervals)
Calculates the log likelihood of this set of coalescent intervals, using an analytical integration over theta.


evaluate

public double evaluate(double[] argument)
Description copied from interface: MultivariateFunction
compute function value

Specified by:
evaluate in interface MultivariateFunction
Parameters:
argument - function argument (vector)
Returns:
function value

getNumArguments

public int getNumArguments()
Description copied from interface: MultivariateFunction
get number of arguments

Specified by:
getNumArguments in interface MultivariateFunction
Returns:
number of arguments

getLowerBound

public double getLowerBound(int n)
Description copied from interface: MultivariateFunction
get lower bound of argument n

Specified by:
getLowerBound in interface MultivariateFunction
Parameters:
n - argument number
Returns:
lower bound

getUpperBound

public double getUpperBound(int n)
Description copied from interface: MultivariateFunction
get upper bound of argument n

Specified by:
getUpperBound in interface MultivariateFunction
Parameters:
n - argument number
Returns:
upper bound

getOrthogonalHints

public OrthogonalHints getOrthogonalHints()
Specified by:
getOrthogonalHints in interface MultivariateFunction
Returns:
an Orthogonal Hints object that can be used by Orthogonal based optimisers to get information about the function