pal.coalescent
Class ConstExpConst

java.lang.Object
  extended by pal.coalescent.DemographicModel
      extended by pal.coalescent.ConstantPopulation
          extended by pal.coalescent.ExponentialGrowth
              extended by pal.coalescent.ConstExpGrowth
                  extended by pal.coalescent.ConstExpConst
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Parameterized, Report, Summarizable, Units

public class ConstExpConst
extends ConstExpGrowth
implements Report, Parameterized, java.io.Serializable

This class models a population that grows exponentially from an initial population size alpha N0 at time y to a size N0 at time x until the present-day. (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 and tx -> 0).

Version:
$Id: ConstExpConst.java,v 1.2 2002/02/16 00:51:43 alexi Exp $
Author:
Alexei Drummond, Andrew Rambaut
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface pal.misc.Parameterized
Parameterized.Null, Parameterized.ParameterizedBase, Parameterized.ParameterizedUser, Parameterized.Utils
 
Field Summary
 double tx
          time of end of exponential growth
 double txSE
          standard error of time of growth
 
Fields inherited from class pal.coalescent.ConstExpGrowth
alpha, ALPHA_PARAMETERIZATION, alphaSE, LX_PARAMETERIZATION, N1, N1_PARAMETERIZATION, N1SE, parameterization
 
Fields inherited from class pal.coalescent.ExponentialGrowth
r, rSE
 
Fields inherited from class pal.coalescent.ConstantPopulation
N0, N0SE
 
Fields inherited from class pal.coalescent.DemographicModel
fo
 
Fields inherited from interface pal.misc.Units
DAYS, EXPECTED_SUBSTITUTIONS, GENERATIONS, MONTHS, SAMPLE, SHORT_UNIT_NAMES, UNIT_NAMES, UNKNOWN, YEARS
 
Constructor Summary
ConstExpConst(double size, double growth, double ancestral, double timeX, int units, int parameterization)
          Construct demographic model of constexpconst population.
ConstExpConst(int units, int parameterization)
          Construct demographic model with default settings.
 
Method Summary
 java.lang.Object clone()
          Makes a copy of this demographic model.
 double getDefaultValue(int k)
          get default value of parameter
 double getDemographic(double t)
          Gets the value of the demographic function N(t) at time t.
 double getGrowthPhaseDuration()
           
 double getIntensity(double t)
          Returns value of demographic intensity function at time t (= integral 1/N(x) dx from 0 to t).
 double getInverseIntensity(double x)
          Returns value of inverse demographic intensity function (returns time, needed for simulation of coalescent intervals).
 double getLowerLimit(int k)
          get lower parameter limit
 int getNumParameters()
          get number of parameters
 double getParameter(int k)
          get model parameter
 double getTimeX()
           
 double getTransitionTime()
          Gets the time of transition from initial constant phase to exponential phase.
 double getUpperLimit(int k)
          get upper parameter limit
static void main(java.lang.String[] args)
           
 void report(java.io.PrintWriter out)
          print human readable report (e.g., on parameters and associated model)
 void setParameter(double value, int k)
          set model parameter
 void setParameterSE(double value, int k)
          set standard errors for model parameter
 void setTimeX(double timeX)
           
 java.lang.String toString()
           
 
Methods inherited from class pal.coalescent.ConstExpGrowth
calculateRFromLx, getAncestral, getAncestralN0, getGrowthParam, getGrowthRate, getParameterization, isLxParameterized, isN1Parameterized, setAncestral, setGrowthParam, setGrowthPhaseDuration, setParameterization
 
Methods inherited from class pal.coalescent.ExponentialGrowth
getSummaryTypes, getSummaryValue
 
Methods inherited from class pal.coalescent.ConstantPopulation
getN0
 
Methods inherited from class pal.coalescent.DemographicModel
computeLogLikelihood, computeLogLikelihood, getIntegral, getLogL, getSimulatedInterval, getUnits, setLogL, setUnits, testConsistency
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tx

public double tx
time of end of exponential growth


txSE

public double txSE
standard error of time of growth

Constructor Detail

ConstExpConst

public ConstExpConst(int units,
                     int parameterization)
Construct demographic model with default settings.


ConstExpConst

public ConstExpConst(double size,
                     double growth,
                     double ancestral,
                     double timeX,
                     int units,
                     int parameterization)
Construct demographic model of constexpconst population.

Method Detail

clone

public java.lang.Object clone()
Makes a copy of this demographic model.

Overrides:
clone in class ConstExpGrowth

getTransitionTime

public double getTransitionTime()
Gets the time of transition from initial constant phase to exponential phase.

Overrides:
getTransitionTime in class ConstExpGrowth

getGrowthPhaseDuration

public double getGrowthPhaseDuration()
Overrides:
getGrowthPhaseDuration in class ConstExpGrowth
Returns:
the duration of the growth phase

getTimeX

public double getTimeX()
Returns:
the time at which the modern constant pop size gives way to exponential phase.

setTimeX

public void setTimeX(double timeX)

getDemographic

public double getDemographic(double t)
Description copied from class: DemographicModel
Gets the value of the demographic function N(t) at time t.

Overrides:
getDemographic in class ConstExpGrowth
Returns:
the population size at time t.

getIntensity

public double getIntensity(double t)
Description copied from class: DemographicModel
Returns value of demographic intensity function at time t (= integral 1/N(x) dx from 0 to t).

Overrides:
getIntensity in class ConstExpGrowth
Returns:
the integral of 1 / N(t) from 0 to t.

getInverseIntensity

public double getInverseIntensity(double x)
Description copied from class: DemographicModel
Returns value of inverse demographic intensity function (returns time, needed for simulation of coalescent intervals).

Overrides:
getInverseIntensity in class ConstExpGrowth
Returns:
the time for the given intensity.

getNumParameters

public int getNumParameters()
Description copied from interface: Parameterized
get number of parameters

Specified by:
getNumParameters in interface Parameterized
Overrides:
getNumParameters in class ConstExpGrowth
Returns:
number of parameters

getParameter

public double getParameter(int k)
Description copied from interface: Parameterized
get model parameter

Specified by:
getParameter in interface Parameterized
Overrides:
getParameter in class ConstExpGrowth
Parameters:
k - parameter number
Returns:
parameter value

getUpperLimit

public double getUpperLimit(int k)
Description copied from interface: Parameterized
get upper parameter limit

Specified by:
getUpperLimit in interface Parameterized
Overrides:
getUpperLimit in class ConstExpGrowth
Parameters:
k - parameter number
Returns:
upper bound

getLowerLimit

public double getLowerLimit(int k)
Description copied from interface: Parameterized
get lower parameter limit

Specified by:
getLowerLimit in interface Parameterized
Overrides:
getLowerLimit in class ConstExpGrowth
Parameters:
k - parameter number
Returns:
lower bound

getDefaultValue

public double getDefaultValue(int k)
Description copied from interface: Parameterized
get default value of parameter

Specified by:
getDefaultValue in interface Parameterized
Overrides:
getDefaultValue in class ConstExpGrowth
Parameters:
k - parameter number
Returns:
default value

setParameter

public void setParameter(double value,
                         int k)
Description copied from interface: Parameterized
set model parameter

Specified by:
setParameter in interface Parameterized
Overrides:
setParameter in class ConstExpGrowth
Parameters:
value - parameter value
k - parameter number

setParameterSE

public void setParameterSE(double value,
                           int k)
Description copied from interface: Parameterized
set standard errors for model parameter

Specified by:
setParameterSE in interface Parameterized
Overrides:
setParameterSE in class ConstExpGrowth
Parameters:
value - standard error of parameter value
k - parameter number

toString

public java.lang.String toString()
Overrides:
toString in class ConstExpGrowth

report

public void report(java.io.PrintWriter out)
Description copied from interface: Report
print human readable report (e.g., on parameters and associated model)

Specified by:
report in interface Report
Overrides:
report in class ConstExpGrowth
Parameters:
out - output stream

main

public static void main(java.lang.String[] args)