BayesicFitting

Model Fitting and Evidence Calculation

View project on GitHub



class RandomEngine( Engine )Source

RandomEngine.

It generates a random trial point from the available unit box. If it is OK (> lowLhood) it is kept. The execute method returns immediately as the new point is random and completely independent of the fiducial point.

If is is not OK, the trial point is shrunk by a random amount toward the fiducial point, until it is accepted. Now the new point is not independent of the fiducial point. We start the execution again starting from the new point.

The restart is repeated a few times after which he new point is deemed sufficiently independent.

Attributes from Engine

walkers, errdis, maxtrials, slow, rng, report, phantoms, verbose

Author Do Kester.

RandomEngine( walkers, errdis, copy=None, **kwargs )

Constructor. Parameters

  • walkers : WalkerList
         walkers to be diffused
  • errdis : ErrorDistribution
         error distribution to be used
  • copy : RandomEngine
         engine to be copied
  • kwargs : for Engine
         "phantoms", "slow", "seed", "verbose"

copy( )

Return copy of this.

execute( kw, lowLhood, append=False, iteration=0 )
Execute the engine by a random selection of the parameters.

Parameters

  • kw : int
         index of Walker to diffuse
  • lowLhood : float
         lower limit in logLikelihood
  • append : bool
         set walker in place or append
  • iteration : int
         iteration number

Returns

  • int : the number of successfull moves
Methods inherited from Engine