pal.mep
Class SteppedMutationRate

java.lang.Object
  |
  +--pal.mep.MutationRateModel
        |
        +--pal.mep.SteppedMutationRate
All Implemented Interfaces:
java.lang.Cloneable, Parameterized, Report, java.io.Serializable, Summarizable, Units

public class SteppedMutationRate
extends MutationRateModel
implements Report, Summarizable, Parameterized, java.io.Serializable

This class models a step-wise mutation rate.
parameters:
mus[] = vector of mutation rates
muChanges[] = vector of change times

Drummond, Forsberg and Rodrigo (2001). The inference of step-wise changes in substitution rates using serial sequence samples. accepted in MBE.

See Also:
Serialized Form

Field Summary
 boolean fixedMus
          whether or not the mu values are optimizable
 double[] muChanges
          mutation rate change times
 double[] mus
          mutation rates
 double[] muSEs
          mutation rate SEs
 
Fields inherited from class pal.mep.MutationRateModel
fo
 
Fields inherited from interface pal.misc.Units
DAYS, EXPECTED_SUBSTITUTIONS, GENERATIONS, MONTHS, YEARS
 
Constructor Summary
SteppedMutationRate(double[] rates, double[] muChanges, int units)
          Construct mutation rate model of a give rate in given units.
SteppedMutationRate(double[] rates, double[] muChanges, int units, boolean fixed)
          Construct mutation rate model of a give rate in given units.
SteppedMutationRate(double[] muChanges, int units)
          Construct demographic model with default settings
 
Method Summary
 java.lang.Object clone()
           
 double getDefaultValue(int k)
          get default value of parameter
 double[] getDeltas(double[] times)
           
 double getExpectedSubstitutions(double time)
          Returns integral of mutation rate function (= integral mu(x) dx from 0 to t).
 double getLowerLimit(int k)
          get lower parameter limit
 double getMu()
          returns current day mutation rate.
 double[] getMus()
           
 double getMutationRate(double t)
          Gets the mutation rate, value of mu(t) at time t.
 int getNumParameters()
          get number of parameters
 double getParameter(int k)
          get model parameter
 java.lang.String[] getSummaryTypes()
           
 double getSummaryValue(int summaryType)
           
 double getTime(double expectedSubs)
          Return the time at which expected substitutions has occurred.
static double[] getTimeIntervals(double[] muChanges, double smallTime, double bigTime)
           
 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 scale(double scale)
          Linearly scales this mutation rate model.
 void setMu(double m)
           
 void setParameter(double value, int k)
          set model parameter
 void setParameterSE(double value, int k)
          set standard errors for model parameter
 java.lang.String toSingleLine()
           
 java.lang.String toString()
           
 
Methods inherited from class pal.mep.MutationRateModel
getExpectedSubstitutions, getUnits, setUnits
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mus

public double[] mus
mutation rates

muSEs

public double[] muSEs
mutation rate SEs

muChanges

public double[] muChanges
mutation rate change times

fixedMus

public boolean fixedMus
whether or not the mu values are optimizable
Constructor Detail

SteppedMutationRate

public SteppedMutationRate(double[] muChanges,
                           int units)
Construct demographic model with default settings

SteppedMutationRate

public SteppedMutationRate(double[] rates,
                           double[] muChanges,
                           int units)
Construct mutation rate model of a give rate in given units.

SteppedMutationRate

public SteppedMutationRate(double[] rates,
                           double[] muChanges,
                           int units,
                           boolean fixed)
Construct mutation rate model of a give rate in given units.
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class MutationRateModel

getSummaryTypes

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

getSummaryValue

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

getMu

public double getMu()
returns current day mutation rate.

setMu

public void setMu(double m)

getMutationRate

public final double getMutationRate(double t)
Description copied from class: MutationRateModel
Gets the mutation rate, value of mu(t) at time t.
Overrides:
getMutationRate in class MutationRateModel

getExpectedSubstitutions

public final double getExpectedSubstitutions(double time)
Description copied from class: MutationRateModel
Returns integral of mutation rate function (= integral mu(x) dx from 0 to t).
Overrides:
getExpectedSubstitutions in class MutationRateModel

getTime

public final double getTime(double expectedSubs)
Description copied from class: MutationRateModel
Return the time at which expected substitutions has occurred.
Overrides:
getTime in class MutationRateModel

scale

public final void scale(double scale)
Linearly scales this mutation rate model.
Overrides:
scale in class MutationRateModel
Parameters:
scale - getExpectedSubstitutions should return scale instead of 1.0 at time t.

getTimeIntervals

public static double[] getTimeIntervals(double[] muChanges,
                                        double smallTime,
                                        double bigTime)

getDeltas

public double[] getDeltas(double[] times)

getNumParameters

public int getNumParameters()
Description copied from interface: Parameterized
get number of parameters
Specified by:
getNumParameters in interface Parameterized
Following copied from interface: pal.misc.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
Following copied from interface: pal.misc.Parameterized
Parameters:
n - 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
Following copied from interface: pal.misc.Parameterized
Parameters:
n - 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
Following copied from interface: pal.misc.Parameterized
Parameters:
n - 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
Following copied from interface: pal.misc.Parameterized
Parameters:
n - 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
Following copied from interface: pal.misc.Parameterized
Parameters:
param - parameter value
n - 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
Following copied from interface: pal.misc.Parameterized
Parameters:
paramSE - standard error of parameter value
n - 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
Following copied from interface: pal.misc.Report
Parameters:
out - output stream

getMus

public double[] getMus()

toSingleLine

public java.lang.String toSingleLine()
Overrides:
toSingleLine in class MutationRateModel