Package trunk :: Package BIP :: Package Bayes :: Package Samplers :: Module MCMC :: Class _Sampler
[hide private]

Class _Sampler

source code

object --+
         |
        _Sampler

Base classe for all samplers Holds common logic and
Instance Methods [hide private]
 
__init__(self, parpriors=[], parnames=[])
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
best_prop_index(self)
Returns the index of the best fitting proposal, i.e., the one which with max Likelihood
source code
 
DIC(self)
Calculates the deviance information criterion
source code
 
dimensions(self) source code
 
po(self)
Pool of processes for parallel execution of tasks Remember to call self.term_pool() when done.
source code
 
shut_down(self, reason='')
Finalizes the sampler, nicely closing the resources allocated
source code
 
term_pool(self) source code
 
gr_R(self, end, start) source code
 
gr_convergence(self, relevantHistoryEnd, relevantHistoryStart)
Gelman-Rubin Convergence
source code
 
_accept(self, last_lik, lik)
Decides whether to accept a proposal
source code
 
setup_xmlrpc_plotserver(self)
Sets up the server for real-time chain watch
source code
 
shutdown_xmlrpc_plotserver(self) source code
 
_every_plot(self)
plotting function for generating a plot at every step
source code
 
_watch_chain(self, j) source code
 
_tune_likvar(self, ar) source code
 
check_constraints(self, theta)
Check if given theta vector complies with all constraints
source code
 
_propose(self, step, po=None)
Generates proposals. returns two lists
source code

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

Class Variables [hide private]
  _po = None
  _dimensions = None
  trace_acceptance = False
  trace_convergence = False
  seqhist = None
  liklist = []
  e = 1e-20
  _j = -1
  _R = np.inf
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, parpriors=[], parnames=[])
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

best_prop_index(self)

source code 
Returns the index of the best fitting proposal, i.e., the one which with max Likelihood
Decorators:
  • @property

DIC(self)

source code 
Calculates the deviance information criterion
Decorators:
  • @property

dimensions(self)

source code 
Decorators:
  • @property

po(self)

source code 
Pool of processes for parallel execution of tasks Remember to call self.term_pool() when done.
Decorators:
  • @property

shut_down(self, reason='')

source code 
Finalizes the sampler, nicely closing the resources allocated
Parameters:
  • reason - : comment stating why the sampling is being shutdown.

_accept(self, last_lik, lik)

source code 
Decides whether to accept a proposal
Decorators:
  • @np.vectorize

check_constraints(self, theta)

source code 
Check if given theta vector complies with all constraints
Parameters:
  • theta - : parameter vector
Returns:
True if theta passes all constraints, False otherwise

_propose(self, step, po=None)

source code 
Generates proposals. returns two lists
Parameters:
  • step - : Position in the markov chain history.
  • po - : Process pool for parallel proposal generation
Returns:
  • theta: List of proposed self.dimensional points in parameter space
  • prop: List of self.nchains proposed phis.