Package jebl.evolution.coalescent
Class EmpiricalDemographicFunction
java.lang.Object
jebl.evolution.coalescent.EmpiricalDemographicFunction
- All Implemented Interfaces:
DemographicFunction
- Version:
- $Id$
- Author:
- Oliver Pybus, Andrew Rambaut
-
Nested Class Summary
Nested classes/interfaces inherited from interface jebl.evolution.coalescent.DemographicFunction
DemographicFunction.Utils -
Constructor Summary
ConstructorsConstructorDescriptionEmpiricalDemographicFunction(double[] populationSizes, double[] times, boolean stepwise) -
Method Summary
Modifier and TypeMethodDescriptiondoublegetArgument(int n) Returns the value of the nth argument of this function.intReturns the number of arguments for this function.getArgumentName(int n) Returns the name of the nth argument of this function.doublegetDemographic(double t) Gets the value of the demographic function N(t) at time t.doublegetIntegral(double start, double finish) Calculates the integral 1/N(x) dx between start and finishdoublegetIntensity(double t) Returns value of demographic intensity function at time t (= integral 1/N(x) dx from 0 to t).doublegetInverseIntensity(double x) Returns value of inverse demographic intensity function (returns time, needed for simulation of coalescent intervals).doublegetLowerBound(int n) Returns the lower bound of the nth argument of this function.doublegetUpperBound(int n) Returns the upper bound of the nth argument of this function.booleanreturns whether an analytical expression for the integral is implementedvoidsetArgument(int n, double value) Sets the value of the nth argument of this function.
-
Constructor Details
-
EmpiricalDemographicFunction
public EmpiricalDemographicFunction(double[] populationSizes, double[] times, boolean stepwise)
-
-
Method Details
-
getDemographic
public double getDemographic(double t) Gets the value of the demographic function N(t) at time t.- Specified by:
getDemographicin interfaceDemographicFunction
-
getIntensity
public double getIntensity(double t) Returns value of demographic intensity function at time t (= integral 1/N(x) dx from 0 to t).- Specified by:
getIntensityin interfaceDemographicFunction
-
getInverseIntensity
public double getInverseIntensity(double x) Returns value of inverse demographic intensity function (returns time, needed for simulation of coalescent intervals).- Specified by:
getInverseIntensityin interfaceDemographicFunction
-
hasIntegral
public boolean hasIntegral()Description copied from interface:DemographicFunctionreturns whether an analytical expression for the integral is implemented- Specified by:
hasIntegralin interfaceDemographicFunction- Returns:
- a boolean
-
getIntegral
public double getIntegral(double start, double finish) Description copied from interface:DemographicFunctionCalculates the integral 1/N(x) dx between start and finish- Specified by:
getIntegralin interfaceDemographicFunction
-
getArgumentCount
public int getArgumentCount()Returns the number of arguments for this function.- Specified by:
getArgumentCountin interfaceDemographicFunction
-
getArgumentName
Returns the name of the nth argument of this function.- Specified by:
getArgumentNamein interfaceDemographicFunction
-
getArgument
public double getArgument(int n) Returns the value of the nth argument of this function.- Specified by:
getArgumentin interfaceDemographicFunction
-
setArgument
public void setArgument(int n, double value) Sets the value of the nth argument of this function.- Specified by:
setArgumentin interfaceDemographicFunction
-
getLowerBound
public double getLowerBound(int n) Returns the lower bound of the nth argument of this function.- Specified by:
getLowerBoundin interfaceDemographicFunction
-
getUpperBound
public double getUpperBound(int n) Returns the upper bound of the nth argument of this function.- Specified by:
getUpperBoundin interfaceDemographicFunction
-