Package pal.coalescent
Class ConstantPopulation
java.lang.Object
pal.coalescent.DemographicModel
pal.coalescent.ConstantPopulation
- All Implemented Interfaces:
Serializable,Cloneable,Parameterized,Report,Summarizable,Units
- Direct Known Subclasses:
ExponentialGrowth
public class ConstantPopulation
extends DemographicModel
implements Report, Summarizable, Parameterized, Serializable
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,v 1.14 2003/09/14 05:14:15 matt Exp $
- Author:
- Alexei Drummond + @author Korbinian Strimmer
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface pal.misc.Parameterized
Parameterized.Null, Parameterized.ParameterizedBase, Parameterized.ParameterizedUser, Parameterized.Utils -
Field Summary
FieldsModifier and TypeFieldDescriptiondoublepopulation sizedoublestandard error of population sizeFields inherited from class pal.coalescent.DemographicModel
foFields inherited from interface pal.misc.Units
DAYS, EXPECTED_SUBSTITUTIONS, GENERATIONS, MONTHS, SAMPLE, SHORT_UNIT_NAMES, UNIT_NAMES, UNKNOWN, YEARS -
Constructor Summary
ConstructorsConstructorDescriptionConstantPopulation(double size, int units) Construct demographic model of a constant population size.ConstantPopulation(int units) Construct demographic model with default settings -
Method Summary
Modifier and TypeMethodDescriptionclone()doublegetDefaultValue(int k) get default value of parameterdoublegetDemographic(double t) Gets the value of the demographic function N(t) at time t.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).doublegetLowerLimit(int k) get lower parameter limitdoublegetN0()returns initial population size.intget number of parametersdoublegetParameter(int k) get model parameterString[]doublegetSummaryValue(int summaryType) doublegetUpperLimit(int k) get upper parameter limitvoidreport(PrintWriter out) print human readable report (e.g., on parameters and associated model)voidsetParameter(double value, int k) set model parametervoidsetParameterSE(double value, int k) set standard errors for model parametertoString()Methods inherited from class pal.coalescent.DemographicModel
computeLogLikelihood, computeLogLikelihood, getIntegral, getLogL, getSimulatedInterval, getUnits, setLogL, setUnits, testConsistency
-
Field Details
-
N0
public double N0population size -
N0SE
public double N0SEstandard error of population size
-
-
Constructor Details
-
ConstantPopulation
public ConstantPopulation(int units) Construct demographic model with default settings -
ConstantPopulation
public ConstantPopulation(double size, int units) Construct demographic model of a constant population size.
-
-
Method Details
-
clone
- Specified by:
clonein classDemographicModel
-
getSummaryTypes
- Specified by:
getSummaryTypesin interfaceSummarizable
-
getSummaryValue
public double getSummaryValue(int summaryType) - Specified by:
getSummaryValuein interfaceSummarizable
-
getN0
public double getN0()returns initial population size. -
getDemographic
public double getDemographic(double t) Description copied from class:DemographicModelGets the value of the demographic function N(t) at time t.- Specified by:
getDemographicin classDemographicModel
-
getIntensity
public double getIntensity(double t) Description copied from class:DemographicModelReturns value of demographic intensity function at time t (= integral 1/N(x) dx from 0 to t).- Specified by:
getIntensityin classDemographicModel
-
getInverseIntensity
public double getInverseIntensity(double x) Description copied from class:DemographicModelReturns value of inverse demographic intensity function (returns time, needed for simulation of coalescent intervals).- Specified by:
getInverseIntensityin classDemographicModel
-
getNumParameters
public int getNumParameters()Description copied from interface:Parameterizedget number of parameters- Specified by:
getNumParametersin interfaceParameterized- Returns:
- number of parameters
-
getParameter
public double getParameter(int k) Description copied from interface:Parameterizedget model parameter- Specified by:
getParameterin interfaceParameterized- Parameters:
k- parameter number- Returns:
- parameter value
-
getUpperLimit
public double getUpperLimit(int k) Description copied from interface:Parameterizedget upper parameter limit- Specified by:
getUpperLimitin interfaceParameterized- Parameters:
k- parameter number- Returns:
- upper bound
-
getLowerLimit
public double getLowerLimit(int k) Description copied from interface:Parameterizedget lower parameter limit- Specified by:
getLowerLimitin interfaceParameterized- Parameters:
k- parameter number- Returns:
- lower bound
-
getDefaultValue
public double getDefaultValue(int k) Description copied from interface:Parameterizedget default value of parameter- Specified by:
getDefaultValuein interfaceParameterized- Parameters:
k- parameter number- Returns:
- default value
-
setParameter
public void setParameter(double value, int k) Description copied from interface:Parameterizedset model parameter- Specified by:
setParameterin interfaceParameterized- Parameters:
value- parameter valuek- parameter number
-
setParameterSE
public void setParameterSE(double value, int k) Description copied from interface:Parameterizedset standard errors for model parameter- Specified by:
setParameterSEin interfaceParameterized- Parameters:
value- standard error of parameter valuek- parameter number
-
toString
-
report
Description copied from interface:Reportprint human readable report (e.g., on parameters and associated model)
-