@@ -59,15 +59,19 @@ def __init__(self, vars=None, path_length=2.0, max_steps=1024, **kwargs):
5959
6060 Parameters
6161 ----------
62- vars: list of Aesara variables
62+ vars: list, default=None
63+ List of Aesara variables. If None, all continuous RVs from the
64+ model are included.
6365 path_length: float, default=2
64- total length to travel
66+ Total length to travel
6567 step_rand: function float -> float, default=unif
66- A function which takes the step size and returns an new one used to
67- randomize the step size at each iteration.
68+ A function which takes the step size and returns a new one used to
69+ randomize the step size at each iteration. The default draws a random
70+ new step size from a uniform distribution with +-15% of the given one.
71+ If set to None, no randomization is done.
6872 step_scale: float, default=0.25
69- Initial size of steps to take, automatically scaled down
70- by 1/n**(1/4).
73+ Initial size of steps to take, automatically scaled down by 1/n**(1/4)
74+ where n is the dimensionality of the parameter space
7175 scaling: array_like, ndim = {1,2}
7276 The inverse mass, or precision matrix. One dimensional arrays are
7377 interpreted as diagonal matrices. If `is_cov` is set to True,
@@ -133,7 +137,10 @@ def _hamiltonian_step(self, start, p0, step_size):
133137 energy_change = - np .inf
134138 if np .abs (energy_change ) > self .Emax :
135139 div_info = DivergenceInfo (
136- "Divergence encountered, large integration error." , None , last , state
140+ f"Divergence encountered, energy change larger than { self .Emax } ." ,
141+ None ,
142+ last ,
143+ state ,
137144 )
138145
139146 accept_stat = min (1 , np .exp (energy_change ))
0 commit comments