Package gmisclib :: Module mcmc :: Class stepper
[frames] | no frames]

Class stepper

source code


This is your basic stepper class. It's a base class containing common features; it is not used directly.

Instance Methods
 
__init__(self)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
step(self)
In subclasses, this takes a step and returns 0 or 1, depending on whether the step was accepted or not.
source code
numpy.ndarray
prms(self)
Returns: The current parameters
source code
 
status(self)
Provides some printable status information in a=v; format.
source code
 
reset(self)
Called internally to mark when the optimization has found a new minimum.
source code
int
reset_id(self)
Use this to tell if the stepper has been reset since you last looked at it.
source code
 
needs_a_reset(self)
Decides if we we need a reset.
source code
position_base
current(self)
Returns: the current position.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Instance Variables
  acceptable
Acceptable is a function that decides whether or not a step is OK.
  last_failed
It should reflect the success or failure of the most recently completed step.
Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Decorators:
  • @g_implements.make_varargs
Overrides: object.__init__
(inherited documentation)

prms(self)

source code 
Returns: numpy.ndarray
The current parameters

reset(self)

source code 

Called internally to mark when the optimization has found a new minimum.

Note: You might also call it if the function you are minimizing changes.

reset_id(self)

source code 

Use this to tell if the stepper has been reset since you last looked at it.

Returns: int
an integer that's different for each reset.

needs_a_reset(self)

source code 

Decides if we we need a reset. This checks to see if we have a new logP that exceeds the old record. It keeps track of the necessary paperwork.

current(self)

source code 
Returns: position_base
the current position.

Instance Variable Details

acceptable

Acceptable is a function that decides whether or not a step is OK. You can replace it if you want, but the class should be equivalent to T_acceptor.

last_failed

It should reflect the success or failure of the most recently completed step. It is None if the last step succeeded; it is the most recently rejected position_base object if the last step failed. This is intended for debugging mostly. It is not used by code in this module.