Package pal.coalescent
Class ConstExpGrowth
java.lang.Object
pal.coalescent.DemographicModel
pal.coalescent.ConstantPopulation
pal.coalescent.ExponentialGrowth
pal.coalescent.ConstExpGrowth
- All Implemented Interfaces:
Serializable,Cloneable,Parameterized,Report,Summarizable,Units
- Direct Known Subclasses:
ConstExpConst
public class ConstExpGrowth
extends ExponentialGrowth
implements Report, Parameterized, Serializable
This class models a population that grows
exponentially from an inital population size alpha N0 to a present-day size N0.
(Parameters: N0=present-day population size; r=growth rate; alpha: ratio of
population sizes).
or
(Parameters: N0=present-day population size; r=growth rate; N1: pre-growth
ancestral population size).
This model is nested with the exponential-growth model (alpha -> 0 or N1 = N0).
It is similar but not identical to the model used in ExpandingPopulation.
- Version:
- $Id: ConstExpGrowth.java,v 1.10 2002/02/16 00:51:43 alexi Exp $
- Author:
- Alexei Drummond, Andrew Rambaut, 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 TypeFieldDescriptiondoubleratio of pop.static final intuse alpha instead of N1 parameterizationdoublestandard error of time alphastatic final intuse lx instead of growth parameterizationdoubleancestral pop.static final intuse N1 instead of alpha parameterizationdoublestandard error of ancestral pop.intparameterization bit string:
first bit: 0 = ALPHA, 1 = N1
second bit: 0 = GROWTH RATE, 1 = LXFields inherited from class pal.coalescent.ExponentialGrowth
r, rSEFields inherited from class pal.coalescent.ConstantPopulation
N0, N0SEFields 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
ConstructorsConstructorDescriptionConstExpGrowth(double size, double growthParam, double ancestral, int units, int parameterization) Construct demographic model of an expanding population.ConstExpGrowth(int units, int parameterization) Construct demographic model with default settings. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclone()doublereturns ancestral parameter.doublereturns ancestral population sizedoublegetDefaultValue(int k) get default value of parameterdoublegetDemographic(double t) Gets the value of the demographic function N(t) at time t.doubledoubledoubleThis method overrides superclass to check parameterization.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 limitintget number of parametersdoublegetParameter(int k) get model parameterintdoubleGets the time of transition from ancestral constant phase to exponential phase.doublegetUpperLimit(int k) get upper parameter limitbooleanbooleanvoidreport(PrintWriter out) print human readable report (e.g., on parameters and associated model)voidsetAncestral(double ancestral) Sets the ancestral parameter.voidsetGrowthParam(double g) Sets the growth parameter.voidsetGrowthPhaseDuration(double lx) Sets the length of the growth phase.voidsetParameter(double value, int k) set model parametervoidsetParameterization(int p) Sets the parameterization.voidsetParameterSE(double value, int k) set standard errors for model parametertoString()Methods inherited from class pal.coalescent.ExponentialGrowth
getSummaryTypes, getSummaryValueMethods inherited from class pal.coalescent.ConstantPopulation
getN0Methods inherited from class pal.coalescent.DemographicModel
computeLogLikelihood, computeLogLikelihood, getIntegral, getLogL, getSimulatedInterval, getUnits, setLogL, setUnits, testConsistency
-
Field Details
-
ALPHA_PARAMETERIZATION
public static final int ALPHA_PARAMETERIZATIONuse alpha instead of N1 parameterization- See Also:
-
N1_PARAMETERIZATION
public static final int N1_PARAMETERIZATIONuse N1 instead of alpha parameterization- See Also:
-
LX_PARAMETERIZATION
public static final int LX_PARAMETERIZATIONuse lx instead of growth parameterization- See Also:
-
parameterization
public int parameterizationparameterization bit string:
first bit: 0 = ALPHA, 1 = N1
second bit: 0 = GROWTH RATE, 1 = LX -
alpha
public double alpharatio of pop. sizes -
alphaSE
public double alphaSEstandard error of time alpha -
N1
public double N1ancestral pop. size -
N1SE
public double N1SEstandard error of ancestral pop. size
-
-
Constructor Details
-
ConstExpGrowth
public ConstExpGrowth(int units, int parameterization) Construct demographic model with default settings.- Parameters:
parameterization- is a combination of bits representing the parameterization. Valid values are:
ALPHA_PARAMETERIZATION
N1_PARAMETERIZATION
ALPHA_PARAMETERIZATION | LX_PARAMETERIZATION
N1_PARAMETERIZATION | LX_PARAMETERIZATION
-
ConstExpGrowth
public ConstExpGrowth(double size, double growthParam, double ancestral, int units, int parameterization) Construct demographic model of an expanding population.
-
-
Method Details
-
clone
- Overrides:
clonein classExponentialGrowth
-
getTransitionTime
public double getTransitionTime()Gets the time of transition from ancestral constant phase to exponential phase. -
getAncestral
public double getAncestral()returns ancestral parameter. This may be either N1 or alpha depending on the parameterization. -
getGrowthParam
public double getGrowthParam()- Returns:
- the growth parameter. This may be either growth rate or growth phase duration depending on the parameterization.
-
getGrowthRate
public double getGrowthRate()This method overrides superclass to check parameterization.- Overrides:
getGrowthRatein classExponentialGrowth
-
setAncestral
public void setAncestral(double ancestral) Sets the ancestral parameter. This may be either N1 or alpha depending on the parameterization. -
setGrowthParam
public void setGrowthParam(double g) Sets the growth parameter. This may be either growth rate (r) or growth pahse duration (lx) depending on the parameterization. -
getAncestralN0
public double getAncestralN0()returns ancestral population size -
getGrowthPhaseDuration
public double getGrowthPhaseDuration()- Returns:
- the duration of the growth phase
-
setGrowthPhaseDuration
public void setGrowthPhaseDuration(double lx) Sets the length of the growth phase. This method is only valid if ALPHA_LX_PARAMETERIZATION is used. -
getParameterization
public int getParameterization()- Returns:
- parameterization
-
isLxParameterized
public boolean isLxParameterized()- Returns:
- true if using lx instead of growth rate.
-
isN1Parameterized
public boolean isN1Parameterized()- Returns:
- true if using N1 instead of alpha.
-
setParameterization
public void setParameterization(int p) Sets the parameterization.- Parameters:
parameterization- is a combination of bits representing the parameterization. Valid values are:
ALPHA_PARAMETERIZATION
N1_PARAMETERIZATION
ALPHA_PARAMETERIZATION | LX_PARAMETERIZATION
N1_PARAMETERIZATION | LX_PARAMETERIZATION
-
calculateRFromLx
protected void calculateRFromLx() -
getDemographic
public double getDemographic(double t) Description copied from class:DemographicModelGets the value of the demographic function N(t) at time t.- Overrides:
getDemographicin classExponentialGrowth
-
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).- Overrides:
getIntensityin classExponentialGrowth
-
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).- Overrides:
getInverseIntensityin classExponentialGrowth
-
getNumParameters
public int getNumParameters()Description copied from interface:Parameterizedget number of parameters- Specified by:
getNumParametersin interfaceParameterized- Overrides:
getNumParametersin classExponentialGrowth- Returns:
- number of parameters
-
getParameter
public double getParameter(int k) Description copied from interface:Parameterizedget model parameter- Specified by:
getParameterin interfaceParameterized- Overrides:
getParameterin classExponentialGrowth- 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- Overrides:
getUpperLimitin classExponentialGrowth- 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- Overrides:
getLowerLimitin classExponentialGrowth- 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- Overrides:
getDefaultValuein classExponentialGrowth- 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- Overrides:
setParameterin classExponentialGrowth- 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- Overrides:
setParameterSEin classExponentialGrowth- Parameters:
value- standard error of parameter valuek- parameter number
-
toString
- Overrides:
toStringin classExponentialGrowth
-
report
Description copied from interface:Reportprint human readable report (e.g., on parameters and associated model)- Specified by:
reportin interfaceReport- Overrides:
reportin classExponentialGrowth- Parameters:
out- output stream
-