BayesicFitting

Model Fitting and Evidence Calculation

View project on GitHub



class ChordEngine( Engine )Source

Move a a walker in a random direction.

The ChordEngine draws a random line through the walker parameters in unit space, from unitMin (lowpoint) with lengths unitRange (highpoint).

A random point on the line is selected. If the corresponding parameter set has a likelihood < LowLhood, it is accepted. Otherwise either the highpoint is reset to the random point (if randompoint > walkerpoint) or the lowpoint is replaced by the randompoint (if walker < random). Then a new random point on the line is selected, until the point is accepted.

When the point is accepted, another random line is constructed through the new point and orthogonal to (all) previous ones. (The orthogonality is not implemented now. TBC).

This is an independent implementation inspired by the polychord engine described in "POLYCHORD: next-generation nested sampling", WJ Handley, MP Hobson and AN Lasenby. MNRAS (2015) Volume 453, Issue 4, p 4384–4398

Attributes

  • debug : bool
         perform the step-out action too

Attributes from Engine

walkers, errdis, slow, maxtrials, nstep, rng, verbose, report, unitRange, unitMin

Author Do Kester.

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

Constructor.

Parameters

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

copy( )

Return copy of this.

execute( kw, lowLhood, append=False, iteration=0 )
Execute the engine by diffusing 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

stepOut( problem, ptry, usav, vel, t, tmax, lowLhood, fitIndex )
Check if endpoints are indeed outside the lowLhood domain.
Methods inherited from Engine