public class SteppedMutationRate extends MutationRateModel implements Report, Summarizable, Parameterized, java.io.Serializable
Drummond, Forsberg and Rodrigo (2001). The inference of step-wise changes in substitution rates using serial sequence samples. accepted in MBE.
MutationRateModel.Factory
Parameterized.Null, Parameterized.ParameterizedBase, Parameterized.ParameterizedUser, Parameterized.Utils
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
INVALID_INTERVALS_TEXT |
static java.lang.String |
MAX_TIME_IS_TEXT |
static java.lang.String |
NEGATIVE_VALUES_TEXT |
static java.lang.String |
REPEATED_TIMES_TEXT |
static java.lang.String |
ZERO_TIME_TEXT |
fo
DAYS, EXPECTED_SUBSTITUTIONS, GENERATIONS, MONTHS, SAMPLE, SHORT_UNIT_NAMES, UNIT_NAMES, UNKNOWN, YEARS
Constructor and Description |
---|
SteppedMutationRate(double[] rates,
double[] muChanges,
int units,
boolean fixed,
double maximumMutationRate)
Construct mutation rate model of a give rate in given units.
|
SteppedMutationRate(double[] rates,
double[] muChanges,
int units,
double maximumMutationRate)
Construct mutation rate model of a give rate in given units.
|
SteppedMutationRate(double[] muChanges,
int units,
double maximumMutationRate)
Construct demographic model with default settings
|
SteppedMutationRate(double[] rates,
TimeOrderCharacterData timeInfo)
Construct mutation rate model of a give rate in given units.
|
SteppedMutationRate(double[] rates,
TimeOrderCharacterData timeInfo,
boolean fixed)
Construct mutation rate model of a give rate in given units.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
checkMuChanges(boolean allowEstimationOutsideSamplingTimes,
double[] muChanges,
boolean sortMuChanges,
double[] sampleTimes,
boolean sortSampleTimes)
Checks if mu changes are valid for a particular set of sample times.
|
java.lang.Object |
clone() |
MutationRateModel.Factory |
generateFactory() |
MutationRateModel |
getCopy() |
double |
getDefaultValue(int k)
get default value of parameter
|
double[] |
getDeltas(double[] times) |
double |
getEndTime(double expectedSubs,
double startTime)
Return the end time at which expected substitutions has occurred, given we start at start time
|
double |
getExpectedSubstitutions(double time)
Returns integral of mutation rate function
(= integral mu(x) dx from 0 to t).
|
static MutationRateModel.Factory |
getFactory(double[] rates,
double[] muChanges,
int units,
double maximumMutationRate)
Generate a MutationRateModel.Factory class for a SteppedMutationRate
|
static MutationRateModel.Factory |
getFactory(double[] muChanges,
int units,
double maximumMutationRate)
Generate a MutationRateModel.Factory class for a SteppedMutationRate
|
static MutationRateModel.Factory |
getFactory(double[] muChanges,
TimeOrderCharacterData tocd)
Generate a MutationRateModel.Factory class for a SteppedMutationRate
|
double |
getLowerLimit(int k)
get lower parameter limit
|
double |
getMu()
returns current day mutation rate.
|
double[] |
getMuChanges() |
double[] |
getMus() |
void |
getMus(double[] muStore) |
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) |
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() |
getExpectedSubstitutions, getMaximumMutationRate, getOrthogonalHints, getTime, getUnits, scale, setUnits
public static final java.lang.String REPEATED_TIMES_TEXT
public static final java.lang.String NEGATIVE_VALUES_TEXT
public static final java.lang.String MAX_TIME_IS_TEXT
public static final java.lang.String ZERO_TIME_TEXT
public static final java.lang.String INVALID_INTERVALS_TEXT
public SteppedMutationRate(double[] muChanges, int units, double maximumMutationRate)
public SteppedMutationRate(double[] rates, double[] muChanges, int units, double maximumMutationRate)
rates
- The initial values of the rates (this array is used for storing the rates)muChanges
- The times for when the mutation rate can changemaximumMutationRate
- The maximum mutation rate (1 is a good value...)public SteppedMutationRate(double[] rates, double[] muChanges, int units, boolean fixed, double maximumMutationRate)
fixed
- if true the mutation rates are set and are not parametersrates
- The initial values of the rates (this array is used for storing the rates)muChanges
- The times for when the mutation rate can changemaximumMutationRate
- The maximum mutation rate (related to how much difference there is between samples, max mu*time diff ~= 1 is a good estimate...)public SteppedMutationRate(double[] rates, TimeOrderCharacterData timeInfo)
rates
- The initial values of the rates (this array is used for storing the rates)timeInfo
- the sample information object that relates times to sequences. Will extract the mu change information from this input, such that the mutation rate changes at each sample pointpublic SteppedMutationRate(double[] rates, TimeOrderCharacterData timeInfo, boolean fixed)
fixed
- if true the mutation rates are set and are not parametersrates
- The initial values of the rates (this array is used for storing the rates)timeInfo
- the sample information object that relates times to sequences. Will extract the mu change information from this input, such that the mutation rate changes at each sample pointpublic java.lang.Object clone()
clone
in class MutationRateModel
public MutationRateModel getCopy()
getCopy
in class MutationRateModel
public java.lang.String[] getSummaryTypes()
getSummaryTypes
in interface Summarizable
public double getSummaryValue(int summaryType)
getSummaryValue
in interface Summarizable
public double getMu()
public void setMu(double m)
public void getMus(double[] muStore)
public final double getMutationRate(double t)
MutationRateModel
getMutationRate
in class MutationRateModel
public final double getExpectedSubstitutions(double time)
MutationRateModel
getExpectedSubstitutions
in class MutationRateModel
public final double getEndTime(double expectedSubs, double startTime)
MutationRateModel
getEndTime
in class MutationRateModel
public final void scale(double scale)
scale
in class MutationRateModel
scale
- getExpectedSubstitutions should return scale instead of 1.0 at time t.public static double[] getTimeIntervals(double[] muChanges, double smallTime, double bigTime)
public double[] getDeltas(double[] times)
public int getNumParameters()
Parameterized
getNumParameters
in interface Parameterized
public double getParameter(int k)
Parameterized
getParameter
in interface Parameterized
k
- parameter numberpublic double getUpperLimit(int k)
Parameterized
getUpperLimit
in interface Parameterized
k
- parameter numberpublic double getLowerLimit(int k)
Parameterized
getLowerLimit
in interface Parameterized
k
- parameter numberpublic double getDefaultValue(int k)
Parameterized
getDefaultValue
in interface Parameterized
k
- parameter numberpublic void setParameter(double value, int k)
Parameterized
setParameter
in interface Parameterized
value
- parameter valuek
- parameter numberpublic void setParameterSE(double value, int k)
Parameterized
setParameterSE
in interface Parameterized
value
- standard error of parameter valuek
- parameter numberpublic java.lang.String toString()
toString
in class java.lang.Object
public void report(java.io.PrintWriter out)
Report
public double[] getMus()
public final double[] getMuChanges()
public java.lang.String toSingleLine()
toSingleLine
in class MutationRateModel
public MutationRateModel.Factory generateFactory()
generateFactory
in class MutationRateModel
public static final MutationRateModel.Factory getFactory(double[] muChanges, int units, double maximumMutationRate)
public static final MutationRateModel.Factory getFactory(double[] rates, double[] muChanges, int units, double maximumMutationRate)
public static final MutationRateModel.Factory getFactory(double[] muChanges, TimeOrderCharacterData tocd)
public static final java.lang.String checkMuChanges(boolean allowEstimationOutsideSamplingTimes, double[] muChanges, boolean sortMuChanges, double[] sampleTimes, boolean sortSampleTimes)