question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot compute a bounding ellipsoid to a single point if `pointvol` is not specified

See original GitHub issue

https://github.com/joshspeagle/dynesty/blob/243025cbfc5f1941e9dc1b00348c54f8b877bd6c/py/dynesty/bounding.py#L1316

Hi, I encountered this error when using DynamicNestedSampler with hslice and my own function of grad_u. This error shows up immediately when the sampler reaches the dlog_z_init, which is 50.0 in my setting. I think hslice works as my grad_u function was called without errors. ndim of the problem is around 90.

Error message:

create run dir: /home/chad/codebase/project/example/xx/_/res/res_100_/seed0/case0/dyn28
  using dynamic nested sampling
iter: 2681 | batch: 0 | bound: 1 | nc: 1 | ncall: 865688 | eff(%):  0.310 | loglstar:   -inf < -26.582 <    inf | logz: -36.999 +/-  0.914 | dlogz:  0.617 > 50.000                                   Traceback (most recent call last):
  File "/home/chad/codebase/project/example/xx/_/dynamic_ns_incremental.py", line 15, in <module>
    dynesty_run_batch(500, case_dir, data_file, data_format, parallel_config = {'queue_size': 64},
  File "/home/chad/codebase/project/src/xx/RunBatch.py", line 289, in dynesty_run_batch
    sample_arr = solver.sample(live_points=live_points, pool=pool, queue_size=parallel_config['queue_size'],
  File "/home/chad/codebase/project/src/sampler/NestedSampling.py", line 97, in sample
    sampler.run_nested(dlogz_init=dlogz, nlive_init=seed_num,
  File "/home/chad/codebase/project/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/dynamicsampler.py", line 1647, in run_nested
  File "/home/chad/codebase/project/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/dynamicsampler.py", line 1767, in add_batch
  File "/home/chad/codebase/project/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/dynamicsampler.py", line 1128, in sample_batch
  File "/home/chad/codebase/project/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/nestedsamplers.py", line 684, in update
  File "/home/chad/codebase/project/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/bounding.py", line 584, in update
  File "/home/chad/codebase/project/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/bounding.py", line 1316, in bounding_ellipsoid
ValueError: Cannot compute a bounding ellipsoid to a single point if `pointvol` is not specified.

I am using the current development version of dynesty with my own loglikelihood and prior_transform functions. I extracted useful parts in my code so a snippet of my code looks like this:

dns_params={'wt_kwargs': {'pfrac': 1.0},
                                      'stop_kwargs': {'post_thresh': .5},
                                      'nlive_batch': 300,
                                      'maxiter_init': 10000,
                                      'maxiter_batch': 1000,
                                      'maxbatch': 10}
sampler = DynamicNestedSampler(
    loglikelihood=loglike,
    prior_transform=ptform,
    periodic=periodic,
    gradient=grad_u,
    ndim=90, **kwargs)
sampler.run_nested(dlogz_init=50, nlive_init=500,
                       **dns_params)

I really want to see the sampling results ASAP. Is there a hacky way to get around this error?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:25 (4 by maintainers)

github_iconTop GitHub Comments

5reactions
joshspeaglecommented, Aug 24, 2021

Fantastic! So glad we could resolve this 😄.

0reactions
doublestrongcommented, Aug 24, 2021

This is a part of the result for that problem with dim=126 using dynamic nested sampling and rslice.

STDOUT:

saving config of sampling
 Dim of problem: 126
 Number of seeds: 500
 maxcall: 5000000
 maxiter: 50000
sampler kwargs:
{'pool': <multiprocessing.pool.Pool state=RUN pool_size=51>, 'queue_size': 64, 'sample': 'rslice'}
  using dynamic nested sampling
{'wt_kwargs': {'pfrac': 1.0}, 'stop_kwargs': {'post_thresh': 0.5}, 'nlive_batch': 300, 'maxiter_init': 500000, 'maxiter_batch': 1000, 'maxbatch': 10, 'maxiter': 10000000, 'use_stop': False, 'dlogz_init': 50.0}
iter: 5243 | batch: 1 | bound: 29 | nc: 780 | ncall: 2415632 | eff(%):  0.198 | loglstar: -51.749 < -62.137 < -49.139 | logz: -62.942 +/-  0.657 | stop:    nan                                       /home/xx/codebase/xx/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/dynamicsampler.py:1325: UserWarning: Warning. The maximum likelihood not reached in the batch. You may not have enough livepoints
iter: 6243 | batch: 2 | bound: 43 | nc: 1511 | ncall: 3221757 | eff(%):  0.181 | loglstar: -44.970 < -51.384 < -43.332 | logz: -59.231 +/-  2.740 | stop:    nan                                      /home/xx/codebase/xx/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/dynamicsampler.py:1325: UserWarning: Warning. The maximum likelihood not reached in the batch. You may not have enough livepoints
iter: 7243 | batch: 3 | bound: 55 | nc: 733 | ncall: 4029046 | eff(%):  0.170 | loglstar: -43.332 < -46.826 < -42.909 | logz: -59.107 +/-  1.811 | stop:    nan                                       /home/xx/codebase/xx/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/dynamicsampler.py:1325: UserWarning: Warning. The maximum likelihood not reached in the batch. You may not have enough livepoints
iter: 8243 | batch: 4 | bound: 67 | nc: 662 | ncall: 4842905 | eff(%):  0.162 | loglstar: -42.461 < -43.858 < -41.704 | logz: -58.874 +/-  1.246 | stop:    nan                                       /home/xx/codebase/xx/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/dynamicsampler.py:1325: UserWarning: Warning. The maximum likelihood not reached in the batch. You may not have enough livepoints
iter: 9243 | batch: 5 | bound: 79 | nc: 758 | ncall: 5675938 | eff(%):  0.156 | loglstar: -40.564 < -42.019 < -40.086 | logz: -58.500 +/-  0.924 | stop:    nan                                       /home/xx/codebase/xx/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/dynamicsampler.py:1325: UserWarning: Warning. The maximum likelihood not reached in the batch. You may not have enough livepoints
iter: 10243 | batch: 6 | bound: 91 | nc: 1635 | ncall: 6531469 | eff(%):  0.151 | loglstar: -39.539 < -40.759 < -39.169 | logz: -58.403 +/-  0.609 | stop:    nan                                     /home/xx/codebase/xx/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/dynamicsampler.py:1325: UserWarning: Warning. The maximum likelihood not reached in the batch. You may not have enough livepoints
iter: 11243 | batch: 7 | bound: 102 | nc: 681 | ncall: 7325910 | eff(%):  0.149 | loglstar: -38.825 < -39.838 < -38.312 | logz: -58.405 +/-  0.364 | stop:    nan                                     /home/xx/codebase/xx/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/dynamicsampler.py:1325: UserWarning: Warning. The maximum likelihood not reached in the batch. You may not have enough livepoints
iter: 12243 | batch: 8 | bound: 114 | nc: 756 | ncall: 8138721 | eff(%):  0.146 | loglstar: -38.149 < -39.161 < -37.136 | logz: -58.397 +/-  0.257 | stop:    nan                                     /home/xx/codebase/xx/venv/lib/python3.8/site-packages/dynesty-1.1-py3.8.egg/dynesty/dynamicsampler.py:1325: UserWarning: Warning. The maximum likelihood not reached in the batch. You may not have enough livepoints
iter: 13819 | batch: 10 | bound: 128 | nc: 783 | ncall: 9374294 | eff(%):  0.147 | loglstar: -45.133 < -38.965 < -44.645 | logz: -58.389 +/-  0.182 | stop:    nan                                    
Sampling time: 14694.23705124855 sec

Saved summary:

{"niter": 13819, "ncall": 9374294, "eff": 0.14741376790614846, "logz": -58.284771541599156, "logzerr": 0.1786152156353317}

I have plotted the resulting samples and they look reasonable to me. Thanks for tracing down bugs to resolve the issue and all discussions!!! Thank you very much!!! @segasai @joshspeagle

Read more comments on GitHub >

github_iconTop Results From Across the Web

[R] Bounding ellipse for any set of points
Plots the points and ellipse. Default TRUE. ## max.iter The maximum number of iterations. If the script tries this ## number of iterations ......
Read more >
Bounding Ellipsoids — nestle 0.2.0 documentation
Illustration of determining bounding ellipsoids in 3 dimensions. For complex iso-likelihood surfaces (ones not well-approximated by a single ellipsoid), Nestle ...
Read more >
UltraNest 3.5.7 documentation
Calculate bounding ellipsoid containing a set of points x. Parameters. x ((npoints, ndim) ndarray) – Coordinates of uniformly sampled points. pointvol ...
Read more >
Bounding ellipse - java - Stack Overflow
Here's the result of the MATLAB code on a set of 10 random 2D points (blue). results. Other methods like PCA does not...
Read more >
A new approach for Robot selection in manufacturing ... - Gale
Thus, interval type-2 fuzzy sets were proposed according to certain simplification assumptions ... If the point is feasible, then the algorithm terminates.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found