pal.coalescent
Class ConstantPopulation

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

public class ConstantPopulation
extends DemographicModel
implements Report, Summarizable, Parameterized, java.io.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.

Version:
$Id: ConstantPopulation.java,v 1.14 2003/09/14 05:14:15 matt Exp $
Author:
Alexei Drummond + @author Korbinian Strimmer
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 N0
          population size
 double N0SE
          standard error of population size
 
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
ConstantPopulation(double size, int units)
          Construct demographic model of a constant population size.
ConstantPopulation(int units)
          Construct demographic model with default settings
 
Method Summary
 java.lang.Object clone()
           
 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 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
 double getN0()
          returns initial population size.
 int getNumParameters()
          get number of parameters
 double getParameter(int k)
          get model parameter
 java.lang.String[] getSummaryTypes()
           
 double getSummaryValue(int summaryType)
           
 double getUpperLimit(int k)
          get upper parameter limit
 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
 java.lang.String toString()
           
 
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

N0

public double N0
population size


N0SE

public double N0SE
standard error of population size

Constructor Detail

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 Detail

clone

public java.lang.Object clone()
Specified by:
clone in class DemographicModel

getSummaryTypes

public java.lang.String[] getSummaryTypes()
Specified by:
getSummaryTypes in interface Summarizable

getSummaryValue

public double getSummaryValue(int summaryType)
Specified by:
getSummaryValue in interface Summarizable

getN0

public double getN0()
returns initial population size.


getDemographic

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

Specified by:
getDemographic in class DemographicModel

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).

Specified by:
getIntensity in class DemographicModel

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).

Specified by:
getInverseIntensity in class DemographicModel

getNumParameters

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

Specified by:
getNumParameters in interface Parameterized
Returns:
number of parameters

getParameter

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

Specified by:
getParameter in interface Parameterized
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
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
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
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
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
Parameters:
value - standard error of parameter value
k - parameter number

toString

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

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
Parameters:
out - output stream