BayesicFitting

Model Fitting and Evidence Calculation

View project on GitHub



class LoopEngine( OrderEngine )Source

The LoopEngine tries to unloop a crossing loop.

Only for 2 dimensional TS problems.

  Input order
      0 1 2 3
     15 14 5 4
      7 6 13 12
      8 9 10 11

The loop crosses between (5,6) and (13,14). By switching the positions of 6 and 13, and reversing the loop in between, a better solution is reached (triangle inequality)

  Output order
      0 1 2 3
     15 14 5 4
     12 13 6 7
     11 10 9 8

This is NOT a random engine as it only steps in the uphill direction.

It belongs to the class of generalized travelling salesman problems where the parameters of the problem is an ordered list.

The walker is kept when the logLikelihood > lowLhood

Attributes from Engine

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

Author Do Kester.

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

Constructor.

Parameters

  • walkers : SampleList
         walkers to be diffused
  • errdis : ErrorDistribution
         error distribution to be used
  • copy : LoopEngine
         to be copied
  • kwargs : dict for Engine
         "phantoms", "slow", "seed", "verbose"

copy( )

Return copy of this.

executeOnce( kw, lowLhood, dims=[0,1] )
Execute the LoopEngine one time.

Parameters

  • kw : int
         walker to diffuse
  • lowLhood : float
         lower limit in logLikelihood
  • dims : list of 2 ints
         dimensions to process over
Methods inherited from OrderEngine
Methods inherited from Engine