joshspeagle / dynesty

Dynamic Nested Sampling package for computing Bayesian posteriors and evidences
https://dynesty.readthedocs.io/
MIT License
357 stars 77 forks source link

Crash course example fails #139

Closed MrBudgens closed 5 years ago

MrBudgens commented 5 years ago

I tried running the crash course example but it throws an exception. I installed dynesty using pip in a fresh Anaconda install.

If it helps, the "samples" variable reports its shape as (27554, 3)

Relevant output below:

File "C:/Users/miste/ ... /Dynesty test/crashCourse.py", line 70, in quantiles = dyfunc.quantile(samples, [0.05, 0.95], weights=weights)

File "C:\Users\miste\Anaconda3\lib\site-packages\dynesty\utils.py", line 197, in quantile quantiles = np.interp(q, cdf, x[idx]).tolist()

File "C:\Users\miste\Anaconda3\lib\site-packages\numpy\lib\function_base.py", line 1412, in interp return interp_func(x, xp, fp, left, right)

ValueError: object too deep for desired array

joshspeagle commented 5 years ago

Ah, this looks like me putting up code without testing it. I agree that you'd need to slice the samples each time I think to get this to work. I'll patch this up in the next update.