Controls Class#

ControlsClass is all about control. It is necessary in determining the way RAT works. It deals with how the user interacts with the software. From type of parallelization, to whether the users wants to calculate SLD during fit, and even how many iteration an algorithm should do etc.

There are 5 different controlsClass.procedures that can be used with RAT. They are:

  1. Simplex

  2. Differential Evolution (DE) - Optimizes a problem by iteratively improving a candidate solution based on an evolutionary process

  3. Nested Sampler (NS) - Estimates directly how the likelihood function relates to prior mass

  4. DREAM

  5. Calculate

Each of them has their own unique set of options. The fields in class object of controlsClass are automatically updated based on the procedure selected.

RAT uses parallelization to speed up the calculation. This is achieved using Parallel Computing Toolbox. The user can choose to use the parallelisation or not and if yes, what to parallelize on. (Single, Points or Contrasts)

Sample usage of controlsClass.#
    controls = controlsClass();
    controls.procedure = procedures.Dream;
    controls.nSamples = 6000;
    controls.nChains = 10;
    controls.parallel = parallelOptions.Contrasts;
Alternate usage of controlsClass.#
    controls = controlsClass();
    controls = controls.setProcedure('dream',...
                                     {'nSamples', 6000,...
                                      'nChains', 10,...
                                      'parallel', 'contrasts'})

Reference#

class API.controlsClass#
boundHandling#

Boundary handling

calcSldDuringFit#

Indicates if SLD should be calculated (Default: false)

crossoverProbability#

The crossover probability or recombination constant (Default: 0.8)

display#

Display Option (Default: displayOptions.Iter)

fWeight#

Differential weight (Default: 0.5)

getIPCFilePath()#

Returns the path of the IPC file.

USAGE:

path = obj.getIPCFilePath()

initialiseIPC()#

Method setup the inter-process communication file.

USAGE:

obj.initialiseIPC()

jumpProbability#

Jump probabilities (Default: 0.5)

maxFuncEvals#

Maximum number of function evaluations for simplex (Default: 10000)

maxIterations#

Maximum number of iterations for simplex (Default: 1000)

nChains#

Number of MCMC chains (Default: 10)

nLive#

Number of live points for Nested Sampler (Default: 150)

nSamples#

Total number of samples for DREAM (Default: 20000)

nsTolerance#

Target stopping tolerance for Nested Sampler (Default: 0.1)

numGenerations#

Maximum number of generations (Default: 500)

parallel#

Parallelisation Option (Default: parallelOptions.Single)

populationSize#

Differential Evolution population size (Default: 20)

procedure#

Optimization procedure (Default: procedures.Calculate)

propScale#

Used if MCMC is used

resampleMinAngle#

minimum angle for resampling (Default: 0.9)

resampleNPoints#

number of points for resampling (Default: 50)

sendStopEvent()#

Sends the stop event via IPC file.

USAGE:

obj.sendStopEvent()

setProcedure(procedure, varargin)#

Method sets the properties of the class based on the selected procedures.

USAGE:

obj.setProcedure(procedure, varargin)

EXAMPLE:
  • obj.setProcedure(‘simplex’, {‘xTolerance’, 1e-6, ‘funcTolerance’, 1e-6,’maxFuncEvals’, 1000})

  • obj.setProcedure(‘dream’)

  • obj.setProcedure(‘ns’, {‘nLive’, 150,’nMCMC’, 0, ‘propScale’, 0.1, ‘nsTolerance’, 0.1})

strategy#

differential evolution strategy (Default: searchStrategy.RandomWithPerVectorDither)

targetValue#

Target Value (Default: 1)

xTolerance#

optimization tolerance for simplex (Default: 1e-6)