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

Class Dream

source code

object --+    
         |    
  _Sampler --+
             |
            Dream

DiffeRential Evolution Adaptive Markov chain sampler
Instance Methods [hide private]
 
__init__(self, meldobj, samples, sampmax, data, t, parpriors, parnames, parlimits, likfun, likvariance, burnin, thin=5, convergenceCriteria=1.1, nCR=3, DEpairs=1, adaptationRate=.65, eps=5e-6, mConvergence=False, mAccept=False, **kwargs)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
_det_outlier_chains(self, step)
Determine which chains are outliers
source code
 
delayed_rejection(self, xi, zi, pxi, zprob)
Generates a second proposal based on rejected proposal xi
source code
 
_alpha1(self, p1, p2)
Returns the Metropolis acceptance probability: alpha1(p1,p1) = min(1,p1/p2) if p2 >-np.inf else 1
source code
 
update_CR_dist(self) source code
 
_prop_initial_theta(self, step)
Generate Theta proposals from priors
source code
 
_prop_phi(self, thetalist, po=None)
Returns proposed Phi derived from theta
source code
 
_chain_evolution(self, proptheta, propphi, pps, liks)
Chain evolution as describe in ter Braak's Dream algorithm.
source code
 
_get_post_prob(self, theta, prop, po=None)
Calculates the posterior probability for the proposal of each chain
source code
 
step(self)
Does the actual sampling loop.
source code

Inherited from _Sampler: DIC, best_prop_index, check_constraints, dimensions, gr_R, gr_convergence, po, setup_xmlrpc_plotserver, shut_down, shutdown_xmlrpc_plotserver, term_pool

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

Class Variables [hide private]

Inherited from _Sampler: e, liklist, seqhist, trace_acceptance, trace_convergence

Inherited from _Sampler (private): _R, _dimensions, _j, _po

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, meldobj, samples, sampmax, data, t, parpriors, parnames, parlimits, likfun, likvariance, burnin, thin=5, convergenceCriteria=1.1, nCR=3, DEpairs=1, adaptationRate=.65, eps=5e-6, mConvergence=False, mAccept=False, **kwargs)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

_alpha1(self, p1, p2)

source code 
Returns the Metropolis acceptance probability: alpha1(p1,p1) = min(1,p1/p2) if p2 >-np.inf else 1
Parameters:
  • p1 - : log probability
  • p2 - : log probability
Decorators:
  • @np.vectorize

_get_post_prob(self, theta, prop, po=None)

source code 
Calculates the posterior probability for the proposal of each chain
Parameters:
  • theta - : list of nchains thetas
  • prop - : list of nchains phis
  • po - : Pool of processes
Returns:
  • posts: list of log posterior probabilities of length self.nchains
  • listoliks: list of log-likelihoods of length self.nchains