Package jebl.evolution.coalescent
Class ConstantPopulation
java.lang.Object
jebl.evolution.coalescent.ConstantPopulation
- All Implemented Interfaces:
DemographicFunction
- Direct Known Subclasses:
ExponentialGrowth
This class models coalescent intervals for a constant population
(parameter: N0=present-day population size).
If time units are set to Units.EXPECTED_SUBSTITUTIONS then the N0 parameter will be interpreted as N0 * mu.
Also note that if you are dealing with a diploid population N0 will be out by a factor of 2.
If time units are set to Units.EXPECTED_SUBSTITUTIONS then the N0 parameter will be interpreted as N0 * mu.
Also note that if you are dealing with a diploid population N0 will be out by a factor of 2.
- Version:
- $Id: ConstantPopulation.java 390 2006-07-20 14:33:51Z rambaut $
- Author:
- Andrew Rambaut, Alexei Drummond
-
Nested Class Summary
Nested classes/interfaces inherited from interface jebl.evolution.coalescent.DemographicFunction
DemographicFunction.Utils -
Constructor Summary
ConstructorsConstructorDescriptionConstruct demographic model with default settingsConstantPopulation(double N0) Construct demographic model with given settings -
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 finish.doublegetIntensity(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.doublegetN0()returns initial population size.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.voidsetN0(double N0) sets initial population size.
-
Constructor Details
-
ConstantPopulation
public ConstantPopulation()Construct demographic model with default settings -
ConstantPopulation
public ConstantPopulation(double N0) Construct demographic model with given settings
-
-
Method Details
-
getN0
public double getN0()returns initial population size. -
setN0
public void setN0(double N0) sets initial population size. -
getDemographic
public double getDemographic(double t) Description copied from interface:DemographicFunctionGets the value of the demographic function N(t) at time t.- Specified by:
getDemographicin interfaceDemographicFunction
-
getIntensity
public double getIntensity(double t) Description copied from interface:DemographicFunctionReturns 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) Description copied from interface:DemographicFunctionReturns 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) Calculates the integral 1/N(x) dx between start and finish. The inherited function in DemographicFunction.Abstract calls a numerical integrater which is unecessary.- Specified by:
getIntegralin interfaceDemographicFunction
-
getArgumentCount
public int getArgumentCount()Description copied from interface:DemographicFunctionReturns the number of arguments for this function.- Specified by:
getArgumentCountin interfaceDemographicFunction
-
getArgumentName
Description copied from interface:DemographicFunctionReturns the name of the nth argument of this function.- Specified by:
getArgumentNamein interfaceDemographicFunction
-
getArgument
public double getArgument(int n) Description copied from interface:DemographicFunctionReturns the value of the nth argument of this function.- Specified by:
getArgumentin interfaceDemographicFunction
-
setArgument
public void setArgument(int n, double value) Description copied from interface:DemographicFunctionSets the value of the nth argument of this function.- Specified by:
setArgumentin interfaceDemographicFunction
-
getLowerBound
public double getLowerBound(int n) Description copied from interface:DemographicFunctionReturns the lower bound of the nth argument of this function.- Specified by:
getLowerBoundin interfaceDemographicFunction
-
getUpperBound
public double getUpperBound(int n) Description copied from interface:DemographicFunctionReturns the upper bound of the nth argument of this function.- Specified by:
getUpperBoundin interfaceDemographicFunction
-