Modifier and Type | Class and Description |
---|---|
static class |
NelderMead.DebugLevel
Enumeration of the debug level
|
Optimizer.OptimizerException
Constructor and Description |
---|
NelderMead()
Constrcutor that defaults to no debug output
|
NelderMead(NelderMead.DebugLevel debug)
Constructor that allows user defined debug level
|
Modifier and Type | Method and Description |
---|---|
Likelihood |
maximise(Calculator l,
Parameters params)
Maximises the likelihood, logging to screen.
|
Likelihood |
maximise(Calculator l,
Parameters params,
java.io.File log)
Maximises the likelihood, logging to a file.
|
Likelihood |
restart(Calculator l,
java.io.File checkPoint)
Maximises the likelihood starting from a checkpoint file (see
Optimizer.setCheckPointFile(java.io.File) ,
logging to the screen. |
Likelihood |
restart(Calculator l,
java.io.File checkPoint,
java.io.File log)
Maximises the likelihood starting from a checkpoint file (see
Optimizer.setCheckPointFile(java.io.File) ,
logging to a file. |
void |
setCheckPointFile(java.io.File checkPoint)
Sets a checkpoint file.
|
void |
setCheckPointFrequency(int num,
java.util.concurrent.TimeUnit unit)
Sets how often a checkpoint is saved (if a file has been set).
|
public NelderMead()
public NelderMead(NelderMead.DebugLevel debug)
debug
- Debug levelpublic Likelihood maximise(Calculator l, Parameters params) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException, Parameters.ParameterException, OutputException
Optimizer
maximise
in interface Optimizer
l
- The likelihood calculatorparams
- The parameters to maximise. Parameters are modified.RateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a requied parameter is not present)OutputException
- Thrown if unable to write a checkpoint filepublic Likelihood maximise(Calculator l, Parameters params, java.io.File log) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException, Parameters.ParameterException, OutputException
Optimizer
maximise
in interface Optimizer
l
- The likelihood calculatorparams
- The parameters to maximise. Parameters are modified.log
- The log fileRateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a requied parameter is not present)OutputException
- Thrown if unable to write a checkpoint filepublic Likelihood restart(Calculator l, java.io.File checkPoint) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException, Parameters.ParameterException, InputException, OutputException, Optimizer.OptimizerException
Optimizer
Optimizer.setCheckPointFile(java.io.File)
,
logging to the screen. Logging level sould be set in the constructor of implementing classes.restart
in interface Optimizer
l
- The likelihood calculatorcheckPoint
- The checkpoint fileRateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a requied parameter is not present)InputException
- Thrown if there is a problem with the checkpoint fileOutputException
- Thrown if unable to write a checkpoint fileOptimizer.OptimizerException
- Thrown if optomizer is unable
to restart from a checkpoint filepublic Likelihood restart(Calculator l, java.io.File checkPoint, java.io.File log) throws RateCategory.RateException, Model.ModelException, TreeException, Parameters.ParameterException, Parameters.ParameterException, InputException, OutputException, Optimizer.OptimizerException
Optimizer
Optimizer.setCheckPointFile(java.io.File)
,
logging to a file. Logging level sould be set in the constructor of implementing classes.restart
in interface Optimizer
l
- The likelihood calculatorcheckPoint
- The checkpoint filelog
- The log fileRateCategory.RateException
- Thrown if there is an issue with
a rate category in the model (e.g. a badly formatted rate).Model.ModelException
- Thrown if there is a problem with the
model (e.g. the rate categories differ in their states)TreeException
- Thrown if there is a problem with the tree.Parameters.ParameterException
- Thrown if there is a problem
with the parameters (e.g. a requied parameter is not present)InputException
- Thrown if there is a problem with the checkpoint fileOutputException
- Thrown if unable to write a checkpoint fileOptimizer.OptimizerException
- Thrown if optomizer is unable
to restart from a checkpoint filepublic void setCheckPointFile(java.io.File checkPoint) throws Optimizer.OptimizerException
Optimizer
Optimizer.setCheckPointFrequency(int, java.util.concurrent.TimeUnit)
).
This checkpoint file can then be used to restart the optimizer from this
state. Can be useful if optimization is likely to take a long and the
process could be stopped for some reason.setCheckPointFile
in interface Optimizer
checkPoint
- The chekpoint file.Optimizer.OptimizerException
- Thrown if the optomizer
does not implement checkpoints.public void setCheckPointFrequency(int num, java.util.concurrent.TimeUnit unit) throws Optimizer.OptimizerException
Optimizer
setCheckPointFrequency
in interface Optimizer
num
- The number of time units that should pass between checkpoint
writes.unit
- The time unitOptimizer.OptimizerException
- Thrown if the optomizer
does not implement checkpoints.