pal.mep
Class WindowedMutationRate

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

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

This class models a windowed mutation rate (parameter: mu = mutation rate).

See Also:
Serialized Form

Field Summary
 boolean backgroundFixed
           
 double muBackground
          mutation rates
 double muBackgroundSE
          mutation rate SEs
 double muWindow
           
 double muWindowSE
           
 double windowCenter
          mutation rate change times
 double windowWidth
           
 
Fields inherited from class pal.mep.MutationRateModel
fo
 
Fields inherited from interface pal.misc.Units
DAYS, EXPECTED_SUBSTITUTIONS, GENERATIONS, MONTHS, YEARS
 
Constructor Summary
WindowedMutationRate(double muWindow, double muBackground, double windowCenter, double windowWidth, int units)
          Construct mutation rate model of a give rate in given units.
WindowedMutationRate(double muWindow, double muBackground, double windowCenter, double windowWidth, int units, boolean fixedb)
          Construct mutation rate model of a give rate in given units.
WindowedMutationRate(double muBackground, double windowCenter, double windowWidth, int units)
          Construct mutation rate model of a give rate in given units.
WindowedMutationRate(double windowCenter, double windowWidth, int units)
          Construct demographic model with default settings
 
Method Summary
 java.lang.Object clone()
           
 double getDefaultValue(int k)
          get default value of parameter
 double getExpectedSubstitutions(double time)
          Window must not span zero!
 double getLowerLimit(int k)
          get lower parameter limit
 double getMu()
          returns current day mutation rate.
 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 expected)
          Window must not span zero!
 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 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

muBackground

public double muBackground
mutation rates

muWindow

public double muWindow

muBackgroundSE

public double muBackgroundSE
mutation rate SEs

muWindowSE

public double muWindowSE

windowCenter

public double windowCenter
mutation rate change times

windowWidth

public double windowWidth

backgroundFixed

public boolean backgroundFixed
Constructor Detail

WindowedMutationRate

public WindowedMutationRate(double windowCenter,
                            double windowWidth,
                            int units)
Construct demographic model with default settings

WindowedMutationRate

public WindowedMutationRate(double muBackground,
                            double windowCenter,
                            double windowWidth,
                            int units)
Construct mutation rate model of a give rate in given units.

WindowedMutationRate

public WindowedMutationRate(double muWindow,
                            double muBackground,
                            double windowCenter,
                            double windowWidth,
                            int units,
                            boolean fixedb)
Construct mutation rate model of a give rate in given units.

WindowedMutationRate

public WindowedMutationRate(double muWindow,
                            double muBackground,
                            double windowCenter,
                            double windowWidth,
                            int units)
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.

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)
Window must not span zero!
Overrides:
getExpectedSubstitutions in class MutationRateModel

getTime

public final double getTime(double expected)
Window must not span zero!
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.

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

toSingleLine

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