So about 30% of the way through it failed. The error message was:
Auto-assigning NUTS sampler...
Initializing NUTS using jitter+adapt_diag...
Multiprocess sampling (4 chains in 4 jobs)
NUTS: [theta_interval__, chol_cov_cholesky_cov_packed__]
35%|███▌ | 709/2000 [5:00:17<9:06:48, 25.41s/it]
---------------------------------------------------------------------------
RemoteTraceback Traceback (most recent call last)
RemoteTraceback:
"""
...
File "~/anaconda3/lib/python3.6/site-packages/pymc3/step_methods/hmc/base_hmc.py", line 115, in astep
self.potential.raise_ok()
File "~/anaconda3/lib/python3.6/site-packages/pymc3/step_methods/hmc/quadpotential.py", line 190, in raise_ok
raise ValueError('Mass matrix contains zeros on the diagonal. '
ValueError: Mass matrix contains zeros on the diagonal. Some derivatives might always be zero.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "~/anaconda3/lib/python3.6/multiprocessing/pool.py", line 119, in worker
result = (True, func(*args, **kwds))
File "~/anaconda3/lib/python3.6/site-packages/joblib/_parallel_backends.py", line 359, in __call__
raise TransportableException(text, e_type)
joblib.my_exceptions.TransportableException: TransportableException
___________________________________________________________________________
ValueError Wed Jun 13 16:39:41 2018
PID: 99318 Python 3.6.3: ~/anaconda3/bin/python
...........................................................................
~/anaconda3/lib/python3.6/site-packages/joblib/parallel.py in __call__(self=<joblib.parallel.BatchedCalls object>)
126 def __init__(self, iterator_slice):
127 self.items = list(iterator_slice)
128 self._size = len(self.items)
129
130 def __call__(self):
--> 131 return [func(*args, **kwargs) for func, args, kwargs in self.items]
self.items = [(<function _sample>, (0, True, 496596156, {'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])}), {'draws': 2000, 'live_plot': False, 'live_plot_kwargs': None, 'model': <pymc3.model.Model object>, 'step': <pymc3.step_methods.hmc.nuts.NUTS object>, 'trace': None, 'tune': 1000})]
132
133 def __len__(self):
134 return self._size
135
...........................................................................
~/anaconda3/lib/python3.6/site-packages/joblib/parallel.py in <listcomp>(.0=<list_iterator object>)
126 def __init__(self, iterator_slice):
127 self.items = list(iterator_slice)
128 self._size = len(self.items)
129
130 def __call__(self):
--> 131 return [func(*args, **kwargs) for func, args, kwargs in self.items]
func = <function _sample>
args = (0, True, 496596156, {'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])})
kwargs = {'draws': 2000, 'live_plot': False, 'live_plot_kwargs': None, 'model': <pymc3.model.Model object>, 'step': <pymc3.step_methods.hmc.nuts.NUTS object>, 'trace': None, 'tune': 1000}
132
133 def __len__(self):
134 return self._size
135
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/sampling.py in _sample(chain=0, progressbar=True, random_seed=496596156, start={'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])}, draws=2000, step=<pymc3.step_methods.hmc.nuts.NUTS object>, trace=None, tune=1000, model=<pymc3.model.Model object>, live_plot=False, live_plot_kwargs=None, **kwargs={})
549 tune, model, random_seed)
550 if progressbar:
551 sampling = tqdm(sampling, total=draws)
552 try:
553 strace = None
--> 554 for it, strace in enumerate(sampling):
it = 708
strace = <pymc3.backends.ndarray.NDArray object>
sampling = 35%|███▌ | 709/2000 [5:00:17<9:06:48, 25.41s/it]
555 if live_plot:
556 if live_plot_kwargs is None:
557 live_plot_kwargs = {}
558 if it >= skip_first:
...........................................................................
~/anaconda3/lib/python3.6/site-packages/tqdm/_tqdm.py in __iter__(self= 35%|███▌ | 709/2000 [5:00:17<9:06:48, 25.41s/it])
925 except AttributeError:
926 raise TqdmDeprecationWarning("""\
927 Please use `tqdm_gui(...)` instead of `tqdm(..., gui=True)`
928 """, fp_write=getattr(self.fp, 'write', sys.stderr.write))
929
--> 930 for obj in iterable:
obj = <pymc3.backends.ndarray.NDArray object>
iterable = <generator object _iter_sample>
931 yield obj
932 # Update and possibly print the progressbar.
933 # Note: does not call self.update(1) for speed optimisation.
934 n += 1
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/sampling.py in _iter_sample(draws=2000, step=<pymc3.step_methods.hmc.nuts.NUTS object>, start={'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])}, trace=None, chain=0, tune=1000, model=<pymc3.model.Model object>, random_seed=496596156)
647 step.tune = bool(tune)
648 for i in range(draws):
649 if i == tune:
650 step = stop_tuning(step)
651 if step.generates_stats:
--> 652 point, states = step.step(point)
point = {'chol_cov_cholesky_cov_packed__': array([ -2.08944751, 0.12375549, -18.61648659]), 'theta_interval__': array([-0.15800638, -0.1441874 , -0.19114327, -0...6, -0.12067608, -0.07600247,
-0.05434058])}
states = [{'depth': 10, 'diverging': False, 'energy': -3479.6746766908395, 'energy_error': -0.09381699821506118, 'max_energy_error': 3.0620532972125147, 'mean_tree_accept': 0.8530624568360251, 'step_size': 1.4004626207707957e-06, 'step_size_bar': 5.23527895218224e-07, 'tree_size': 1023, 'tune': True}]
step.step = <bound method GradientSharedStep.step of <pymc3.step_methods.hmc.nuts.NUTS object>>
653 if strace.supports_sampler_stats:
654 strace.record(point, states)
655 else:
656 strace.record(point)
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/step_methods/arraystep.py in step(self=<pymc3.step_methods.hmc.nuts.NUTS object>, point={'chol_cov_cholesky_cov_packed__': array([ -2.08944751, 0.12375549, -18.61648659]), 'theta_interval__': array([-0.15800638, -0.1441874 , -0.19114327, -0...6, -0.12067608, -0.07600247,
-0.05434058])})
217 def step(self, point):
218 self._logp_dlogp_func.set_extra_values(point)
219 array = self._logp_dlogp_func.dict_to_array(point)
220
221 if self.generates_stats:
--> 222 apoint, stats = self.astep(array)
apoint = undefined
stats = undefined
self.astep = <bound method BaseHMC.astep of <pymc3.step_methods.hmc.nuts.NUTS object>>
array = array([-1.58006383e-01, -1.44187398e-01, -1.9114...51e+00,
1.23755491e-01, -1.86164866e+01])
223 point = self._logp_dlogp_func.array_to_full_dict(apoint)
224 return point, stats
225 else:
226 apoint = self.astep(array)
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/step_methods/hmc/base_hmc.py in astep(self=<pymc3.step_methods.hmc.nuts.NUTS object>, q0=array([-1.58006383e-01, -1.44187398e-01, -1.9114...51e+00,
1.23755491e-01, -1.86164866e+01]))
110 """Perform a single HMC iteration."""
111 p0 = self.potential.random()
112 start = self.integrator.compute_state(q0, p0)
113
114 if not np.isfinite(start.energy):
--> 115 self.potential.raise_ok()
self.potential.raise_ok = <bound method QuadPotentialDiagAdapt.raise_ok of...hmc.quadpotential.QuadPotentialDiagAdapt object>>
116 raise ValueError('Bad initial energy: %s. The model '
117 'might be misspecified.' % start.energy)
118
119 adapt_step = self.tune and self.adapt_step_size
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/step_methods/hmc/quadpotential.py in raise_ok(self=<pymc3.step_methods.hmc.quadpotential.QuadPotentialDiagAdapt object>)
185
186 self._n_samples += 1
187
188 def raise_ok(self):
189 if np.any(self._stds == 0):
--> 190 raise ValueError('Mass matrix contains zeros on the diagonal. '
191 'Some derivatives might always be zero.')
192 if np.any(self._stds < 0):
193 raise ValueError('Mass matrix contains negative values on the '
194 'diagonal.')
ValueError: Mass matrix contains zeros on the diagonal. Some derivatives might always be zero.
___________________________________________________________________________
"""
The above exception was the direct cause of the following exception:
TransportableException Traceback (most recent call last)
~/anaconda3/lib/python3.6/site-packages/joblib/parallel.py in retrieve(self)
698 if getattr(self._backend, 'supports_timeout', False):
--> 699 self._output.extend(job.get(timeout=self.timeout))
700 else:
~/anaconda3/lib/python3.6/multiprocessing/pool.py in get(self, timeout)
643 else:
--> 644 raise self._value
645
TransportableException: TransportableException
___________________________________________________________________________
ValueError Wed Jun 13 16:39:41 2018
PID: 99318 Python 3.6.3: ~/anaconda3/bin/python
...........................................................................
~/anaconda3/lib/python3.6/site-packages/joblib/parallel.py in __call__(self=<joblib.parallel.BatchedCalls object>)
126 def __init__(self, iterator_slice):
127 self.items = list(iterator_slice)
128 self._size = len(self.items)
129
130 def __call__(self):
--> 131 return [func(*args, **kwargs) for func, args, kwargs in self.items]
self.items = [(<function _sample>, (0, True, 496596156, {'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])}), {'draws': 2000, 'live_plot': False, 'live_plot_kwargs': None, 'model': <pymc3.model.Model object>, 'step': <pymc3.step_methods.hmc.nuts.NUTS object>, 'trace': None, 'tune': 1000})]
132
133 def __len__(self):
134 return self._size
135
...........................................................................
~/anaconda3/lib/python3.6/site-packages/joblib/parallel.py in <listcomp>(.0=<list_iterator object>)
126 def __init__(self, iterator_slice):
127 self.items = list(iterator_slice)
128 self._size = len(self.items)
129
130 def __call__(self):
--> 131 return [func(*args, **kwargs) for func, args, kwargs in self.items]
func = <function _sample>
args = (0, True, 496596156, {'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])})
kwargs = {'draws': 2000, 'live_plot': False, 'live_plot_kwargs': None, 'model': <pymc3.model.Model object>, 'step': <pymc3.step_methods.hmc.nuts.NUTS object>, 'trace': None, 'tune': 1000}
132
133 def __len__(self):
134 return self._size
135
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/sampling.py in _sample(chain=0, progressbar=True, random_seed=496596156, start={'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])}, draws=2000, step=<pymc3.step_methods.hmc.nuts.NUTS object>, trace=None, tune=1000, model=<pymc3.model.Model object>, live_plot=False, live_plot_kwargs=None, **kwargs={})
549 tune, model, random_seed)
550 if progressbar:
551 sampling = tqdm(sampling, total=draws)
552 try:
553 strace = None
--> 554 for it, strace in enumerate(sampling):
it = 708
strace = <pymc3.backends.ndarray.NDArray object>
sampling = 35%|███▌ | 709/2000 [5:00:17<9:06:48, 25.41s/it]
555 if live_plot:
556 if live_plot_kwargs is None:
557 live_plot_kwargs = {}
558 if it >= skip_first:
...........................................................................
~/anaconda3/lib/python3.6/site-packages/tqdm/_tqdm.py in __iter__(self= 35%|███▌ | 709/2000 [5:00:17<9:06:48, 25.41s/it])
925 except AttributeError:
926 raise TqdmDeprecationWarning("""\
927 Please use `tqdm_gui(...)` instead of `tqdm(..., gui=True)`
928 """, fp_write=getattr(self.fp, 'write', sys.stderr.write))
929
--> 930 for obj in iterable:
obj = <pymc3.backends.ndarray.NDArray object>
iterable = <generator object _iter_sample>
931 yield obj
932 # Update and possibly print the progressbar.
933 # Note: does not call self.update(1) for speed optimisation.
934 n += 1
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/sampling.py in _iter_sample(draws=2000, step=<pymc3.step_methods.hmc.nuts.NUTS object>, start={'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])}, trace=None, chain=0, tune=1000, model=<pymc3.model.Model object>, random_seed=496596156)
647 step.tune = bool(tune)
648 for i in range(draws):
649 if i == tune:
650 step = stop_tuning(step)
651 if step.generates_stats:
--> 652 point, states = step.step(point)
point = {'chol_cov_cholesky_cov_packed__': array([ -2.08944751, 0.12375549, -18.61648659]), 'theta_interval__': array([-0.15800638, -0.1441874 , -0.19114327, -0...6, -0.12067608, -0.07600247,
-0.05434058])}
states = [{'depth': 10, 'diverging': False, 'energy': -3479.6746766908395, 'energy_error': -0.09381699821506118, 'max_energy_error': 3.0620532972125147, 'mean_tree_accept': 0.8530624568360251, 'step_size': 1.4004626207707957e-06, 'step_size_bar': 5.23527895218224e-07, 'tree_size': 1023, 'tune': True}]
step.step = <bound method GradientSharedStep.step of <pymc3.step_methods.hmc.nuts.NUTS object>>
653 if strace.supports_sampler_stats:
654 strace.record(point, states)
655 else:
656 strace.record(point)
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/step_methods/arraystep.py in step(self=<pymc3.step_methods.hmc.nuts.NUTS object>, point={'chol_cov_cholesky_cov_packed__': array([ -2.08944751, 0.12375549, -18.61648659]), 'theta_interval__': array([-0.15800638, -0.1441874 , -0.19114327, -0...6, -0.12067608, -0.07600247,
-0.05434058])})
217 def step(self, point):
218 self._logp_dlogp_func.set_extra_values(point)
219 array = self._logp_dlogp_func.dict_to_array(point)
220
221 if self.generates_stats:
--> 222 apoint, stats = self.astep(array)
apoint = undefined
stats = undefined
self.astep = <bound method BaseHMC.astep of <pymc3.step_methods.hmc.nuts.NUTS object>>
array = array([-1.58006383e-01, -1.44187398e-01, -1.9114...51e+00,
1.23755491e-01, -1.86164866e+01])
223 point = self._logp_dlogp_func.array_to_full_dict(apoint)
224 return point, stats
225 else:
226 apoint = self.astep(array)
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/step_methods/hmc/base_hmc.py in astep(self=<pymc3.step_methods.hmc.nuts.NUTS object>, q0=array([-1.58006383e-01, -1.44187398e-01, -1.9114...51e+00,
1.23755491e-01, -1.86164866e+01]))
110 """Perform a single HMC iteration."""
111 p0 = self.potential.random()
112 start = self.integrator.compute_state(q0, p0)
113
114 if not np.isfinite(start.energy):
--> 115 self.potential.raise_ok()
self.potential.raise_ok = <bound method QuadPotentialDiagAdapt.raise_ok of...hmc.quadpotential.QuadPotentialDiagAdapt object>>
116 raise ValueError('Bad initial energy: %s. The model '
117 'might be misspecified.' % start.energy)
118
119 adapt_step = self.tune and self.adapt_step_size
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/step_methods/hmc/quadpotential.py in raise_ok(self=<pymc3.step_methods.hmc.quadpotential.QuadPotentialDiagAdapt object>)
185
186 self._n_samples += 1
187
188 def raise_ok(self):
189 if np.any(self._stds == 0):
--> 190 raise ValueError('Mass matrix contains zeros on the diagonal. '
191 'Some derivatives might always be zero.')
192 if np.any(self._stds < 0):
193 raise ValueError('Mass matrix contains negative values on the '
194 'diagonal.')
ValueError: Mass matrix contains zeros on the diagonal. Some derivatives might always be zero.
___________________________________________________________________________
…
...........................................................................
~/<ipython-input-5-650b8faacecc> in <module>()
14 thetainit=BoundedNorm.dist(mu=theta_bar,sd=P_bar_sd)
15 #Theta Updating Process
16 theta=BoundedGRW('theta', sd=sd, init=thetainit, shape=len(y_obs)) #gives prior on sequence of thetas
17 #Likelihood function
18 like = univautoreg('like', theta0=theta, v=v, observed=y_obs) #specifies model from class
---> 19 tracemodel1 = pm.sample(1000,tune=1000,cores=4) #runs sample on posterior using NUTS
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/sampling.py in sample(draws=2000, step=<pymc3.step_methods.hmc.nuts.NUTS object>, init='auto', n_init=200000, start=[{'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])}, {'chol_cov_cholesky_cov_packed__': array([ 0.82467436, -0.80963915, 0.55627807]), 'theta_interval__': array([ 0.29077273, 0.18677657, -0.23636995, 0...1, 0.82364536, 0.82978351,
-0.22230971])}, {'chol_cov_cholesky_cov_packed__': array([ 0.23220033, -0.8543097 , 0.08794877]), 'theta_interval__': array([ 0.67284462, 0.2879578 , 0.23400036, 0...8, -0.62044113, 0.77093992,
0.81221703])}, {'chol_cov_cholesky_cov_packed__': array([-0.20368703, 0.41536114, 0.06717203]), 'theta_interval__': array([-0.52843847, -0.23372156, 0.03127953, 0...1, -0.76796809, -0.96247491,
-0.92644218])}], trace=None, chain_idx=0, chains=4, cores=4, tune=1000, nuts_kwargs=None, step_kwargs=None, progressbar=True, model=<pymc3.model.Model object>, random_seed=[496596156, 290684706, 677620699, 399237012], live_plot=False, discard_tuned_samples=True, live_plot_kwargs=None, compute_convergence_checks=True, use_mmap=False, **kwargs={})
437 parallel = cores > 1 and chains > 1 and not has_population_samplers
438 if parallel:
439 _log.info('Multiprocess sampling ({} chains in {} jobs)'.format(chains, cores))
440 _print_step_hierarchy(step)
441 try:
--> 442 trace = _mp_sample(**sample_args)
trace = None
sample_args = {'chain': 0, 'chains': 4, 'cores': 4, 'draws': 2000, 'live_plot': False, 'live_plot_kwargs': None, 'model': <pymc3.model.Model object>, 'progressbar': True, 'random_seed': [496596156, 290684706, 677620699, 399237012], 'start': [{'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])}, {'chol_cov_cholesky_cov_packed__': array([ 0.82467436, -0.80963915, 0.55627807]), 'theta_interval__': array([ 0.29077273, 0.18677657, -0.23636995, 0...1, 0.82364536, 0.82978351,
-0.22230971])}, {'chol_cov_cholesky_cov_packed__': array([ 0.23220033, -0.8543097 , 0.08794877]), 'theta_interval__': array([ 0.67284462, 0.2879578 , 0.23400036, 0...8, -0.62044113, 0.77093992,
0.81221703])}, {'chol_cov_cholesky_cov_packed__': array([-0.20368703, 0.41536114, 0.06717203]), 'theta_interval__': array([-0.52843847, -0.23372156, 0.03127953, 0...1, -0.76796809, -0.96247491,
-0.92644218])}], ...}
443 except pickle.PickleError:
444 _log.warning("Could not pickle model, sampling singlethreaded.")
445 _log.debug('Pickling error:', exec_info=True)
446 parallel = False
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/sampling.py in _mp_sample(**kwargs={'draws': 2000, 'live_plot': False, 'live_plot_kwargs': None, 'model': <pymc3.model.Model object>, 'step': <pymc3.step_methods.hmc.nuts.NUTS object>, 'trace': None, 'tune': 1000})
977 for args in zip(chain_nums, pbars, rseed, start))
978
979 if use_mmap:
980 traces = Parallel(n_jobs=cores)(jobs)
981 else:
--> 982 traces = Parallel(n_jobs=cores, mmap_mode=None)(jobs)
traces = undefined
cores = 4
jobs = <generator object _mp_sample.<locals>.<genexpr>>
983
984 return MultiTrace(traces)
985
986
...
---------------------------------------------------------------------------
Sub-process traceback:
---------------------------------------------------------------------------
ValueError Wed Jun 13 16:39:41 2018
PID: 99318 Python 3.6.3: ~/anaconda3/bin/python
...........................................................................
~/anaconda3/lib/python3.6/site-packages/joblib/parallel.py in __call__(self=<joblib.parallel.BatchedCalls object>)
126 def __init__(self, iterator_slice):
127 self.items = list(iterator_slice)
128 self._size = len(self.items)
129
130 def __call__(self):
--> 131 return [func(*args, **kwargs) for func, args, kwargs in self.items]
self.items = [(<function _sample>, (0, True, 496596156, {'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])}), {'draws': 2000, 'live_plot': False, 'live_plot_kwargs': None, 'model': <pymc3.model.Model object>, 'step': <pymc3.step_methods.hmc.nuts.NUTS object>, 'trace': None, 'tune': 1000})]
132
133 def __len__(self):
134 return self._size
135
...........................................................................
~/anaconda3/lib/python3.6/site-packages/joblib/parallel.py in <listcomp>(.0=<list_iterator object>)
126 def __init__(self, iterator_slice):
127 self.items = list(iterator_slice)
128 self._size = len(self.items)
129
130 def __call__(self):
--> 131 return [func(*args, **kwargs) for func, args, kwargs in self.items]
func = <function _sample>
args = (0, True, 496596156, {'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])})
kwargs = {'draws': 2000, 'live_plot': False, 'live_plot_kwargs': None, 'model': <pymc3.model.Model object>, 'step': <pymc3.step_methods.hmc.nuts.NUTS object>, 'trace': None, 'tune': 1000}
132
133 def __len__(self):
134 return self._size
135
...........................................................................
...
...........................................................................
~/anaconda3/lib/python3.6/site-packages/tqdm/_tqdm.py in __iter__(self= 35%|███▌ | 709/2000 [5:00:17<9:06:48, 25.41s/it])
925 except AttributeError:
926 raise TqdmDeprecationWarning("""\
927 Please use `tqdm_gui(...)` instead of `tqdm(..., gui=True)`
928 """, fp_write=getattr(self.fp, 'write', sys.stderr.write))
929
--> 930 for obj in iterable:
obj = <pymc3.backends.ndarray.NDArray object>
iterable = <generator object _iter_sample>
931 yield obj
932 # Update and possibly print the progressbar.
933 # Note: does not call self.update(1) for speed optimisation.
934 n += 1
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/sampling.py in _iter_sample(draws=2000, step=<pymc3.step_methods.hmc.nuts.NUTS object>, start={'chol_cov_cholesky_cov_packed__': array([-0.86697565, 0.06281649, 0.47892356]), 'theta_interval__': array([-0.35244586, -0.86961885, 0.43604781, -0...5, -0.42408685, -0.62923437,
0.10574297])}, trace=None, chain=0, tune=1000, model=<pymc3.model.Model object>, random_seed=496596156)
647 step.tune = bool(tune)
648 for i in range(draws):
649 if i == tune:
650 step = stop_tuning(step)
651 if step.generates_stats:
--> 652 point, states = step.step(point)
point = {'chol_cov_cholesky_cov_packed__': array([ -2.08944751, 0.12375549, -18.61648659]), 'theta_interval__': array([-0.15800638, -0.1441874 , -0.19114327, -0...6, -0.12067608, -0.07600247,
-0.05434058])}
states = [{'depth': 10, 'diverging': False, 'energy': -3479.6746766908395, 'energy_error': -0.09381699821506118, 'max_energy_error': 3.0620532972125147, 'mean_tree_accept': 0.8530624568360251, 'step_size': 1.4004626207707957e-06, 'step_size_bar': 5.23527895218224e-07, 'tree_size': 1023, 'tune': True}]
step.step = <bound method GradientSharedStep.step of <pymc3.step_methods.hmc.nuts.NUTS object>>
653 if strace.supports_sampler_stats:
654 strace.record(point, states)
655 else:
656 strace.record(point)
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/step_methods/arraystep.py in step(self=<pymc3.step_methods.hmc.nuts.NUTS object>, point={'chol_cov_cholesky_cov_packed__': array([ -2.08944751, 0.12375549, -18.61648659]), 'theta_interval__': array([-0.15800638, -0.1441874 , -0.19114327, -0...6, -0.12067608, -0.07600247,
-0.05434058])})
217 def step(self, point):
218 self._logp_dlogp_func.set_extra_values(point)
219 array = self._logp_dlogp_func.dict_to_array(point)
220
221 if self.generates_stats:
--> 222 apoint, stats = self.astep(array)
apoint = undefined
stats = undefined
self.astep = <bound method BaseHMC.astep of <pymc3.step_methods.hmc.nuts.NUTS object>>
array = array([-1.58006383e-01, -1.44187398e-01, -1.9114...51e+00,
1.23755491e-01, -1.86164866e+01])
223 point = self._logp_dlogp_func.array_to_full_dict(apoint)
224 return point, stats
225 else:
226 apoint = self.astep(array)
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/step_methods/hmc/base_hmc.py in astep(self=<pymc3.step_methods.hmc.nuts.NUTS object>, q0=array([-1.58006383e-01, -1.44187398e-01, -1.9114...51e+00,
1.23755491e-01, -1.86164866e+01]))
110 """Perform a single HMC iteration."""
111 p0 = self.potential.random()
112 start = self.integrator.compute_state(q0, p0)
113
114 if not np.isfinite(start.energy):
--> 115 self.potential.raise_ok()
self.potential.raise_ok = <bound method QuadPotentialDiagAdapt.raise_ok of...hmc.quadpotential.QuadPotentialDiagAdapt object>>
116 raise ValueError('Bad initial energy: %s. The model '
117 'might be misspecified.' % start.energy)
118
119 adapt_step = self.tune and self.adapt_step_size
...........................................................................
~/anaconda3/lib/python3.6/site-packages/pymc3/step_methods/hmc/quadpotential.py in raise_ok(self=<pymc3.step_methods.hmc.quadpotential.QuadPotentialDiagAdapt object>)
185
186 self._n_samples += 1
187
188 def raise_ok(self):
189 if np.any(self._stds == 0):
--> 190 raise ValueError('Mass matrix contains zeros on the diagonal. '
191 'Some derivatives might always be zero.')
192 if np.any(self._stds < 0):
193 raise ValueError('Mass matrix contains negative values on the '
194 'diagonal.')
ValueError: Mass matrix contains zeros on the diagonal. Some derivatives might always be zero.
Leading up to this each iteration was going slower and slower. Any ideas what problem might be?