Implements the Differential Evolution (DE) algorithm following the manuscript of Cajo J.
|
Global variables |
| enum | Control { parallel,
serial
} |
| | Parallelization type. More...
|
| enum | Distrib { uniform,
gaussian,
cauchy
} |
| | Symmetric distribution. More...
|
|
static Control | cntrl |
| | Current control.
|
|
static int | minmc |
| | Minimum number of chains.
|
|
static int | state_iter |
| | Number of iterations allowed for finding a good initial state.
|
|
static double | tiny |
| | Small pos double "machine" constant (default: double=1.0e-12).
|
|
static unsigned | jfreq |
| | Frequency in steps for setting (default: 10).
|
|
static bool | linear |
| | Use linear or logit mapping for variables (default: false).
|
|
static unsigned | nfifo |
| | Number of states for acceptance rate queue.
|
Public Member Functions |
| | DifferentialEvolution (int max, int ndim, int number, string deinit, BaseDataTree *d, Model *m, Integration *i, Converge *c, MixturePrior *mp, LikelihoodComputation *l, MCAlgorithm *mca, Simulation *last=0) |
| | Constructor for top level invocation.
|
|
virtual | ~DifferentialEvolution () |
| | Destructor.
|
|
virtual void | Initialize () |
| | Initialize all the chains.
|
|
virtual void | Reinitialize (MHWidth *width, MixturePrior *mp) |
| | Reinitialize with new class instances.
|
|
void | PrintState () |
| | Print current state (override).
|
|
virtual void | PrintStepDiagnostic () |
| | override of Simulation method to provide diagnostics specific to DifferentialEvolution
|
| virtual void | PrintStateDiagnostic () |
| | override of Simulation method to provide state specific diagnostics.
|
|
vector< double > | GetStat (void) |
| | Return vector with fraction of acceptances for each chain.
|
|
void | NewNumber (int) |
| | Specify the number of desired chains.
|
|
void | NewGamma (double p) |
| | Change the shift length from the default.
|
|
void | EnableLogging () |
| | Enable caching per chain.
|
|
void | SetLinearMapping (bool b) |
| | Change mapping from logit to linear (or vice versa).
|
|
void | SetJumpFreq (int n) |
| | Change jump frequency for multimodel mixing (default: 10).
|
|
void | AdditionalInfo () |
| | Print out simulation specific diagnostics.
|
|
| void | NewState (int Mcur, vector< double > &w, vector< vector< double > > &p) |
| | Initialize new state (override from Simulation).
|
|
void | NewState (Chain &ch) |
| | Compute the state from the Chain value.
|
|
void | NewState (State &s) |
| | Compute the state from the State value.
|
|
| void | SetControl (int) |
| | Set global parameters.
|
|
|
double | GetValue () |
| | Return current posterior probability value (override).
|
|
double | GetPrior () |
| | Return current prior value (override).
|
|
double | GetLikelihood () |
| | Return current likelihood probability value.
|
|
State | GetState () |
| | Return current state (override).
|
|
virtual void | ReportState () |
| | Print passed state in ascii with labels (override).
|
|
virtual void | LogState (string &logfile) |
| | Add state to log file.
|
|
virtual void | LogState (int level, int iterno, string &outfile) |
Protected Member Functions |
|
virtual void | MCMethod () |
| | The Markov Chain implementation.
|
|
void | CreateChains () |
| | Create the chain structures.
|
|
void | SampleNewState (int k) |
| | Attempt to find a good state from the prior distribution for chain k.
|
|
void | SampleNewStateParallel (int k) |
| | Use the parallel version (called by SampleNewState()).
|
|
void | NewStateSerialInit () |
| | Serial sampling init.
|
|
void | SampleNewStateSerial (int k) |
| | Use the serial version (called by SampleNewState()).
|
|
void | NewStateSerialStatus () |
| | Check the status of the initialization.
|
|
void | TrialState (int zero, int one, int two) |
| | Compute the trial state from the selected particles.
|
| void | InitializeSampler (string epsfile) |
| | Initialize the random part of the sampler from the input file.
|
|
double | Logit (double x) |
| | Logit distribution.
|
|
double | InverseLogit (double q) |
| | The inverse Logit distribution.
|
|
double | Map (double x, double a, double b) |
| | Map from finite to infinite interval.
|
|
double | InverseMap (double q, double a, double b) |
| | Map from infinite back to the finite interval.
|
|
|
void | ResetChainStats () |
| | For gathering diagnostic data.
|
Protected Attributes |
|
MHWidth * | width |
| | The Metropolis-Hastings width instance.
|
|
double | gamma0 |
| | The default (not mode-swapping) value for the proposal direction magntiude.
|
|
double | gamma |
| | The current value of gamma.
|
|
unsigned | ncount |
| | Internal counter for mode swapping.
|
|
bool | caching |
| | Used to flag logging of each chain state.
|
|
vector< Random * > | distrib |
| | Random distribution for parameters when generating trial states.
|
|
vector< unsigned short > | fail |
| | Status vector for sampling new states.
|
|
Chain | chainT |
| | Trial Chain instance.
|
|
Uniform * | unit |
| | Unit interval variates.
|
|
bool | chains_initialized |
| | True if state values have been computed for at least the first time.
|
|
vector< double > | _lower |
| | Lower limit on values imposed by prior.
|
|
vector< double > | _upper |
| | Upper limit on values imposed by prior.
|
|
double | _minw |
| | Lower limit on weights imposed by prior.
|
|
double | _maxw |
| | Upper limit on weights imposed by prior.
|
|
| unsigned int | R0 |
| | State variables.
|
|
vector< unsigned char > | update_flag |
| | Does the chain need to be updated?
|
|
vector< unsigned char > | update_flag1 |
| | For MPI, chains that need to be updated on each node.
|
|
vector< unsigned long > | nstat0 |
| | Tally of proposals for each chain.
|
|
vector< unsigned long > | nstat1 |
| | Tally of accepted proposals for each chain.
|
|
deque< vector< unsigned char > > | arate |
| | Used to compute chain acceptence rates.
|
|
int | Ntot |
| | Maximum dimension of the state vector.
|
|
vector< double > | philower |
| | Minimum allowed value for the parameter vector.
|
|
vector< double > | phiupper |
| | Maximum allowed value for the parameter vector.
|
|
|
int | totalnum |
| | Convergence check.
|
|
int | totaltry |
Friends |
|
class | boost::serialization::access |
Implements the Differential Evolution (DE) algorithm following the manuscript of Cajo J.
F. Ter Braak (Stat Comput 2006, 16:239-249)