joshspeagle / dynesty

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

Issues with evaluating high-dimensional models #317

Closed akashgpt closed 3 years ago

akashgpt commented 3 years ago

I am currently using dynesty for a 29-D problem (with pretty simple likelihoods and priors) but have been running into the following two issues (I have previously used dynesty successfully on a different problem but that had less than 10 dimensions) -

1) I get the "RuntimeError: Slice sampling appears to be stuck!" error with sample='auto'. I saw that someone else too pointed this out. Based on the discussion there I have been intentionally using more than enough 'live points' (or so I guess; =20k or 500k) but it is not helping, unfortunately. Here's how I call dynesty and the error I eventually get (similar error when running with 500k live points):

dsampler = dynesty.DynamicNestedSampler(loglike, prior_transform, ndim, nlive=20000, bound='multi')#, pool=pool, queue_size=10)
dsampler.run_nested(wt_kwargs={'pfrac': 1.0})
dres = dsampler.results
56419it [4:08:09,  3.79it/s, batch: 0 | bound: 801 | nc: 930 | ncall: 46212728 | eff(%):  0.122 | loglstar:   -inf < -24.392 <    inf | logz: -138.116 +/-  0.670 | dlogz: 23.528 >  0.010]

RuntimeError: Slice sampling appears to be stuck! Some useful output quantities:
u: [1.12309834e-01 1.12368194e-01 1.05820780e-01 6.07346528e-03
 2.10989183e-01 2.96052454e-01 2.67877106e-02 2.23182860e-02
 3.83379706e-02 1.73632583e-02 3.31099842e-02 1.24160804e-01
 1.33841259e-01 4.84234106e-01 2.52800383e-01 5.52957355e-02
 8.94353048e-05 1.95828527e-04 3.60737233e-05 1.19719925e-08
 1.74505920e-01 3.47154738e-02 5.30456050e-01 1.87929011e-01
 7.25736895e-03 2.06562820e-02 1.04155915e-04 5.30632634e-02
 3.62904827e-01]
u_left: [ 1.12309782e-01  1.12368203e-01  1.05820790e-01  6.07350460e-03
  2.10989189e-01  2.96052478e-01  2.67876979e-02  2.23182640e-02
  3.83379845e-02  1.73632558e-02  3.31099837e-02  1.24160792e-01
  1.33841247e-01  4.84234110e-01  2.52800398e-01  5.52956916e-02
  8.94353436e-05  1.95828485e-04  3.60737465e-05 -4.56752209e-09
  1.74505941e-01  3.47155050e-02  5.30456027e-01  1.87929038e-01
  7.25736927e-03  2.06562831e-02  1.04155904e-04  5.30632617e-02
  3.62904852e-01]
u_right: [1.12309899e-01 1.12368182e-01 1.05820768e-01 6.07341584e-03
 2.10989176e-01 2.96052425e-01 2.67877265e-02 2.23183136e-02
 3.83379532e-02 1.73632615e-02 3.31099848e-02 1.24160818e-01
 1.33841275e-01 4.84234102e-01 2.52800364e-01 5.52957907e-02
 8.94352561e-05 1.95828579e-04 3.60736943e-05 3.27697060e-08
 1.74505893e-01 3.47154345e-02 5.30456080e-01 1.87928977e-01
 7.25736854e-03 2.06562805e-02 1.04155929e-04 5.30632656e-02
 3.62904796e-01]
u_hat: [ 1.17224327e-07 -2.17639049e-08 -2.17506104e-08 -8.87592315e-08
 -1.27266857e-08 -5.23568188e-08  2.86650720e-08  4.95490125e-08
 -3.13568993e-08  5.77666200e-09  1.07025320e-09  2.59255610e-08
  2.84575526e-08 -7.07403264e-09 -3.40657333e-08  9.90748246e-08
 -8.74981601e-11  9.40673503e-11 -5.22017106e-11  3.73372281e-08
 -4.73382871e-08 -7.04423580e-08  5.30338459e-08 -6.10766772e-08
 -7.29017659e-10 -2.66338843e-09  2.51441437e-11  3.92350243e-09
 -5.58856050e-08]
loglstar: -24.388820406095416
axes: [[-3.51535212e-10 -7.79285338e-10 -3.82098770e-09 -1.53580705e-09
  -5.58279114e-09 -9.09912029e-10 -2.04370138e-09 -9.54915661e-10
   6.98520467e-10  1.90181718e-08  2.87080741e-08 -7.07460474e-08
  -7.85793478e-08  7.57957634e-09 -3.35247752e-08 -3.33669903e-08
   9.91618177e-06  8.73650979e-06  9.83655750e-06  5.35710695e-09
  -3.12545919e-08 -4.17829303e-08 -1.75497013e-08 -4.07904053e-08
  -9.87707138e-08 -8.89757330e-07  2.07395325e-06 -5.63441430e-07
  -9.59947173e-10]
 [-1.61400680e-09 -3.10966809e-09 -6.14367951e-09 -1.80317987e-09
  -3.65392236e-09 -4.40814514e-09 -5.07291090e-09 -2.47339205e-09
  -1.21523153e-08 -7.80197780e-08  1.06153609e-08 -2.11444432e-07
  -1.62319298e-07 -1.64039821e-07 -9.91880380e-08 -1.09621487e-07
   7.66873644e-07  1.50282242e-06  4.75694278e-07 -1.66894014e-07
  -1.94132230e-07 -9.99436896e-08 -1.13938985e-07 -1.65298808e-07
  -3.06904619e-07 -6.07332786e-06 -1.58411371e-05 -3.47184354e-06
   3.24902875e-09]
 [-3.88904128e-08 -2.20782814e-08 -2.33407463e-08 -5.29321752e-08
  -3.21690430e-08 -7.74352568e-09  1.32063959e-08 -3.83974816e-08
  -2.11043085e-08 -2.19314918e-07 -1.49280925e-08 -1.22330290e-06
  -1.28426695e-06 -2.99322576e-07 -7.37492302e-07 -6.78586011e-07
   5.40567307e-06  1.33398262e-05 -2.55261209e-05 -2.34036693e-07
  -8.28594961e-07 -5.77990787e-07 -1.14668625e-06 -7.32676142e-07
   2.67595776e-06 -3.91200937e-05  1.86543199e-05 -1.31044349e-05
   1.64135026e-09]
 [-2.57880954e-08 -2.34436436e-08  1.41474644e-08  1.48253492e-08
  -2.78195405e-08 -2.28133449e-09 -1.64098543e-08 -8.95971932e-09
  -6.83495625e-08 -1.62599665e-07  1.06086711e-07 -6.06634144e-07
  -1.23261583e-06 -1.93409389e-07 -6.42802421e-07 -6.06059169e-07
  -2.37476191e-05 -2.58016619e-05  4.11530942e-05 -1.24206431e-07
  -6.87796193e-07 -2.92521040e-07 -6.88310121e-07 -7.08833633e-07
   1.43046835e-06 -2.97544557e-05  1.13757873e-05 -1.05022408e-05
  -1.32241072e-08]
 [ 7.51089353e-08  3.74601624e-08  6.09877424e-08 -7.55115793e-09
   1.11394243e-08  5.13043163e-08  7.44490360e-08  7.39259603e-08
   1.16285863e-07  1.14044357e-07  6.13438747e-08  1.64532466e-07
   1.08244374e-07  2.37105991e-07  8.71012321e-08  3.44419961e-09
   5.39512849e-05 -5.37339349e-05 -7.07477138e-06  1.77930852e-07
   8.02434866e-08  4.88458204e-08 -5.37265225e-07  9.83205830e-08
  -4.32337307e-07 -7.50767010e-06 -4.72223517e-07  2.98082082e-06
  -3.72693723e-08]
 [-2.62275961e-07 -3.11319282e-07 -3.19314147e-07 -7.83733280e-08
  -1.91337085e-07 -1.28450666e-07 -2.55395977e-07 -3.81381467e-07
  -8.04419101e-07 -4.49295760e-06  3.71073023e-07 -6.02428366e-06
   8.73006310e-07 -1.01840718e-05  3.84806767e-07  6.03280361e-07
   5.47029952e-06 -8.34339354e-06 -3.04823332e-06 -1.01868650e-05
  -4.62601520e-06 -2.53427733e-06  7.31899592e-06 -4.45329819e-06
   7.34744731e-06  4.83173469e-05  9.32006451e-06 -1.28840189e-04
  -5.73941812e-08]
 [-8.60681741e-07  3.25951185e-07 -8.96549420e-06 -8.73407214e-06
  -1.22142457e-05 -1.85026090e-05 -1.50253682e-05 -2.40925958e-05
  -1.63601628e-05  1.16577820e-04  5.48076509e-05 -2.22391090e-04
   3.55690289e-05  5.96740438e-05 -5.41502381e-05 -8.32783895e-05
  -9.13281961e-06 -2.13888561e-06 -1.16542806e-05  3.05393069e-06
  -4.73918036e-05 -1.35561715e-04 -1.28725488e-05  2.62436788e-05
  -8.76223787e-04 -1.18184697e-05  3.45768078e-05 -4.76543347e-05
   2.36117715e-06]
 [-1.83570787e-05 -1.88526067e-05 -1.88463664e-05 -9.82115775e-06
  -1.61828156e-05 -2.22129854e-05 -3.71926043e-05 -2.60011032e-05
  -2.63051987e-05 -1.20261247e-04  4.07881580e-05 -2.21131863e-04
   5.89073145e-04 -2.92683759e-04  4.27139248e-04  4.16376797e-04
  -4.39509863e-06  2.64866521e-06  6.62857851e-06 -2.57299011e-04
   3.05254736e-04 -1.06615774e-04 -2.23843792e-04  1.57324765e-04
  -1.01198196e-05 -3.57504073e-05  3.43871620e-06  2.45703008e-05
   1.25873442e-05]
 [ 3.05730936e-05  2.86608524e-06  4.11772135e-06  7.29209061e-06
  -3.50806128e-06  1.57211944e-05  9.30239263e-06  1.59871712e-05
  -3.72507342e-06 -1.31869303e-04  2.14325969e-05  8.70366500e-04
   3.24868427e-04 -2.24832093e-04 -2.41884989e-05 -7.45573375e-05
  -1.50194504e-06  5.93239396e-06 -3.98923657e-06 -3.33339253e-04
  -2.17699861e-04  4.39039894e-04  6.12808421e-05 -6.61532744e-06
  -2.87908087e-04 -3.73584810e-05  1.57405219e-05 -1.70196451e-05
   1.98509144e-06]
 [ 5.03625456e-05  3.71709941e-05  4.85527656e-06 -2.82320076e-05
   4.61636406e-05  1.36084729e-05  7.79340724e-05 -4.13686511e-06
   8.57611089e-05  2.32127572e-04 -6.67171292e-05 -2.69334119e-04
   1.18663566e-03  2.78465396e-04 -4.71803245e-04 -6.99655160e-04
   6.02196097e-07 -7.80132813e-07  8.80105442e-06  1.75302685e-04
  -6.83021343e-04 -2.51942788e-04  4.66118595e-05  6.01086234e-04
   3.47432590e-04  3.08174293e-06 -1.16204859e-05  2.18666098e-06
   9.06004192e-06]
 [-1.25860365e-03 -1.12592166e-03 -1.23339897e-03 -1.19071958e-03
  -1.25799709e-03 -1.30279337e-03 -1.20258380e-03 -1.34991217e-03
  -1.37922587e-03 -1.12071272e-03 -6.88988001e-04 -2.71685692e-04
  -9.17602749e-05 -2.52218215e-04 -4.62021284e-04 -4.09310814e-04
   7.88384344e-06 -6.08921082e-06  3.24184469e-06 -1.80728879e-04
  -3.70596012e-04  5.42122332e-05 -9.42268966e-05 -9.39242436e-05
   7.95254156e-05  1.28412787e-05 -5.39982608e-06  1.27046300e-04
   6.82629623e-05]
 [ 2.73786400e-04  2.08221351e-04  1.82749865e-04 -6.11002867e-05
   2.83644163e-04  1.33808669e-04  5.71905999e-04  1.72350342e-04
   6.07518100e-04 -9.28616366e-04 -1.15188914e-04 -2.53008261e-04
  -4.85842394e-04 -4.51338962e-05  2.20162767e-04 -1.21041189e-03
  -3.79953837e-06 -3.54426317e-07  9.31350263e-06 -2.67410743e-03
  -1.50489305e-03 -1.96356961e-03 -2.05480334e-03 -2.01801697e-03
   3.02484154e-04  1.12709847e-04 -1.08716181e-05  3.47195123e-04
  -6.90956597e-05]
 [ 8.80310771e-04  5.05574870e-04  2.23991324e-04  4.61004853e-04
   5.05761324e-04  5.22882756e-04  4.05863597e-04  1.82716093e-04
   6.90603052e-04 -1.13034040e-03 -1.90984950e-03 -1.82386198e-03
  -8.70219901e-04 -3.34415307e-03 -3.72216310e-03  7.62182164e-04
   3.87629459e-06 -3.32762540e-06  1.13946554e-05 -1.52006484e-03
   1.52787688e-04  9.33068831e-04  5.64519595e-04  1.38839595e-03
  -1.11388001e-04 -3.40406524e-05  1.68613626e-06  4.21054632e-04
  -4.61440357e-04]
 [ 7.43192575e-05  1.34096153e-04 -4.77759254e-04 -2.57354794e-04
  -3.35812867e-04 -2.44168987e-04  2.15919315e-05 -3.57768739e-04
   4.30612286e-04 -1.57536921e-03  6.89906136e-03 -6.95289616e-04
  -3.14861776e-04 -2.21225222e-03 -1.19466649e-03 -5.00011132e-04
   7.60079432e-07  2.41869491e-07 -6.57310646e-06  7.65640008e-04
  -5.76532196e-04  8.37944758e-05  1.03040384e-04  4.17820653e-05
   3.82984024e-04  2.28738208e-05 -1.82985128e-05  2.65811930e-04
   1.02301516e-03]
 [-2.18151685e-04 -3.34321618e-04 -7.28581584e-04 -4.17415454e-04
  -9.21308784e-04 -8.29049948e-04 -1.16545559e-03 -6.90613274e-04
  -1.09325510e-03  8.62423175e-03  8.46685096e-04 -6.09669899e-04
  -6.20504179e-04 -3.12156789e-03  2.21785093e-04 -1.05529671e-04
   4.54318406e-06 -4.38188575e-06  7.82286166e-06 -2.76695018e-03
  -1.00300077e-03  7.85199608e-04  2.19056665e-04 -1.03216522e-03
   1.08639478e-03 -7.30481098e-06 -3.90064578e-05  3.33402206e-04
   7.47406927e-04]
 [ 1.87961027e-03  8.72449580e-04 -2.66233337e-04 -5.54333973e-04
  -1.48006778e-03  1.91727661e-03  3.36326032e-04  1.96253173e-03
  -5.58263694e-03 -7.54846887e-04  2.90757161e-03 -1.83146525e-03
  -8.83563870e-04  6.19317328e-03 -6.38027586e-04  2.44735184e-04
   5.43326722e-06  2.24804176e-06  3.02325767e-06 -7.50911739e-03
   1.41914926e-03  1.74670479e-03  3.43312310e-03  2.98068299e-03
   6.30329369e-04 -1.60371812e-04 -2.36179962e-05  2.22966012e-04
  -1.51560583e-03]
 [-1.41975180e-03 -1.98704664e-03 -6.82945562e-04 -4.28605322e-03
   3.85957887e-04 -3.50862682e-03  6.91757587e-04 -3.16761678e-03
   1.12771308e-02  1.82101357e-04  4.04149427e-04 -8.78906909e-04
  -2.46836578e-04  3.49871821e-03  7.83981693e-04  1.65400955e-03
  -7.47582737e-06  2.10250417e-06  7.63533729e-06 -4.24218934e-03
   3.18994049e-04  7.78373780e-04  5.60490268e-03  8.00713190e-04
   6.30680503e-05 -2.76148678e-04 -8.70343642e-07  2.18464783e-04
   1.17747977e-03]
 [ 2.68565669e-03  4.27571133e-04 -3.55302262e-03 -5.94752776e-03
  -7.07031953e-03  1.77228620e-03  3.04953093e-03  1.01220730e-03
   4.62789940e-03  1.91279499e-03  9.81143361e-04 -6.84597423e-04
  -1.37381697e-03  1.68312432e-03 -3.25953346e-04 -9.21261124e-04
  -2.63807102e-05 -1.40162517e-07  3.98010771e-06  1.75140667e-03
   1.10499984e-03  6.73847977e-03 -1.09537033e-02  3.26619319e-03
  -1.66518688e-04  5.36304106e-04 -4.66034303e-07 -1.05437440e-03
  -8.65908989e-03]
 [-6.22923980e-03 -2.16112887e-03 -2.72540104e-03  1.98125929e-03
   8.25795492e-03 -3.21702571e-03 -3.47784515e-03 -2.60557275e-04
   2.91042688e-04  3.67234877e-03  3.35117970e-03  7.19254415e-03
  -2.06228097e-04  5.29734183e-03 -1.11376568e-02  6.89688020e-03
   4.19626180e-06 -1.18797525e-05 -1.04168352e-05 -2.10692216e-03
   5.16496750e-03 -6.82541235e-03 -7.97713216e-03  4.11600667e-03
   3.45984473e-04  3.79303394e-04 -2.12559581e-05 -1.17276861e-03
  -2.68741960e-03]
 [-1.52134375e-03 -6.51774403e-03 -4.10493181e-03  7.69944248e-03
  -1.02030698e-02  4.60225990e-03 -9.98631193e-03  1.07632917e-02
   6.36063160e-03 -3.95312470e-04  3.30821954e-04  2.39112207e-03
   1.98617390e-05 -2.83154443e-03  5.35114516e-04 -3.26811304e-03
   5.48495659e-07  5.33979102e-06 -1.11886346e-05 -8.77762775e-04
   2.39238674e-03 -7.27708973e-03  5.22540240e-03  7.63458075e-04
   1.15978711e-04 -2.44397781e-04 -9.63286107e-07  4.11068267e-04
  -6.37372836e-03]
 [ 1.39460076e-02 -2.58922009e-03 -2.58763847e-03 -1.05595566e-02
  -1.51407528e-03 -6.22881455e-03  3.41024190e-03  5.89477392e-03
  -3.73048469e-03  6.87241072e-04  1.27326466e-04  3.08432627e-03
   3.38555362e-03 -8.41587375e-04 -4.05275072e-03  1.17867877e-02
  -1.04095288e-05  1.11910558e-05 -6.21036155e-06  4.44195569e-03
  -5.63176713e-03 -8.38042483e-03  6.30935948e-03 -7.26620341e-03
  -8.67301700e-05 -3.16859446e-04  2.99136218e-06  4.66773375e-04
  -6.64862911e-03]
 [-4.10184864e-04 -7.03412868e-03 -1.11689241e-03  1.07794087e-02
   6.11470211e-03 -3.58893173e-03 -1.15298626e-03 -2.46568229e-03
   3.76666820e-04 -3.43569659e-04  2.32875871e-03 -7.87049725e-03
   8.72703032e-03  4.03441635e-03 -4.48221685e-03 -9.02968220e-04
   6.57442338e-06  7.81302814e-06 -7.91256956e-06  2.30920355e-04
   3.07508170e-03  1.23418009e-02  1.44280253e-03 -1.76845407e-02
   3.80883738e-04 -6.47078700e-05 -1.41604606e-05  4.48471145e-04
  -1.16840349e-02]
 [ 1.95257660e-02  3.94395669e-03 -1.90979114e-02  7.12363830e-03
  -1.93870312e-03  3.80809466e-03 -7.27059669e-03 -8.26369484e-03
   3.39466480e-03 -1.95974885e-04 -2.40025565e-03  1.42689183e-03
   1.93081337e-03  5.09614534e-03 -3.31042039e-03 -6.94216777e-04
   2.22360264e-06 -1.62869712e-05 -5.20826155e-07  7.77653554e-05
   5.95015682e-03  6.02517339e-04 -3.72533353e-03 -3.07692371e-03
   1.24983363e-04  1.92967910e-04  2.38975967e-06 -7.22042850e-04
   1.51922771e-02]
 [ 1.48999575e-02  2.90289717e-03  1.26437615e-02  3.58804769e-03
   8.21850803e-04 -1.06487988e-02 -6.42129677e-03 -1.81573201e-02
  -8.25983401e-04  1.51671167e-04  1.81153951e-03  5.23642006e-03
  -2.92817697e-03 -3.88168109e-03  3.95664651e-03 -1.15086972e-02
   1.40940623e-05  8.17011686e-06 -8.58457366e-06 -1.20410044e-03
   9.52927099e-03 -7.87583728e-03  2.25217545e-03  6.90932020e-03
   7.71104954e-04 -9.12302010e-05 -2.90694763e-05 -1.77974848e-04
  -1.53516143e-02]
 [-1.50276044e-04  3.14002257e-03 -2.34360436e-02 -1.15120287e-02
   2.58330717e-02 -9.13611562e-03  2.15057817e-03  1.64999139e-02
  -2.30878715e-03 -9.90699337e-04 -1.30147410e-03 -1.09088859e-03
  -2.55819377e-03 -8.53739597e-03  1.01084299e-02 -1.95030345e-02
   3.20115976e-06 -4.07058635e-06  7.40448799e-06 -3.54572387e-04
   1.04124213e-02  1.03157590e-03  4.83692520e-03  4.13324858e-03
  -3.52984776e-04 -2.46588518e-04  2.99966029e-05  3.26406475e-04
  -6.26634196e-03]
 [ 1.48270815e-02 -2.19116134e-02  4.44417783e-03  1.38264297e-02
   1.09349190e-02 -1.89037160e-02 -1.30057762e-02  1.10481278e-02
   9.15116160e-04 -3.17619967e-03  6.83620989e-04 -6.21366998e-03
  -1.10725084e-02  3.47394893e-03  1.19995744e-02  7.73879763e-03
  -8.29812660e-06 -2.97512758e-06  6.25933283e-06 -8.46559359e-04
  -2.40581562e-02  1.18535604e-02 -1.15341558e-02  1.80389049e-02
  -3.53545622e-04  5.58390132e-04  2.87221451e-05 -2.73355906e-04
   5.07569856e-03]
 [-5.16531727e-03  3.47992019e-02  4.37984402e-03  1.43956782e-02
  -2.21246933e-02 -4.75430201e-02  3.50761670e-03  2.27130728e-02
   2.78859087e-03 -1.06587296e-03 -2.12626184e-03 -8.56166277e-04
   3.61383930e-03  4.47282524e-03 -6.83183682e-03 -1.88638717e-03
   5.16503602e-06 -4.41717347e-06 -4.36289606e-06 -1.73474695e-03
   8.34841245e-03  4.30751636e-03 -3.76344008e-03 -4.18168836e-03
   2.64451270e-04  2.00334622e-04  5.11121075e-06 -6.21505895e-04
   9.82479681e-03]
 [-2.24588676e-03 -2.81338442e-02 -2.01075503e-02  2.96896393e-02
  -1.31957263e-02 -1.11524063e-02  5.90951972e-02 -1.08544403e-02
  -6.21470908e-03  3.07988238e-03 -4.96157893e-04  6.55113856e-03
  -5.00430341e-03 -4.53236392e-03  3.41231962e-03 -2.74475565e-03
   4.31787119e-06 -2.27743990e-06 -2.08857290e-06 -1.78530089e-03
   4.44103008e-03 -1.13499425e-02  4.86708762e-03  1.16177653e-02
  -2.30994711e-04 -2.80025633e-04 -2.28562184e-06 -4.28430337e-05
   2.59520071e-04]
 [ 1.93797884e-02 -5.45346036e-02  4.19170517e-02 -2.87668829e-02
  -6.42217398e-03 -5.83662231e-03  6.27637720e-03  2.71679295e-02
  -2.69593400e-03  3.31305963e-03 -2.02194488e-03  2.41848322e-03
   9.59542941e-03  2.36664541e-04 -2.08803081e-02 -2.92965085e-02
  -1.15947107e-06 -4.05182197e-07 -1.00809106e-05 -2.36006182e-03
   4.88814036e-02  5.45444733e-03 -1.46927746e-02 -1.05072562e-02
   3.94091045e-05  8.03506885e-04 -1.13177043e-05 -2.30520144e-03
   4.15674681e-02]]
axlens: [1.6638952470983837e-05, 1.741521776812539e-05, 5.406691426339282e-05, 6.367599731002478e-05, 7.690440353856694e-05, 0.00013982784171547748, 0.0009357131280168681, 0.0010516638932461283, 0.0011743904624291024, 0.0018423788240366104, 0.0040886490185176655, 0.0050464273878060295, 0.006555916952981498, 0.007761426710706949, 0.010165141486018568, 0.013510862638997107, 0.015615436691746544, 0.02019368328188334, 0.024267807037226728, 0.02560109105993761, 0.029276625899822842, 0.0319258803887354, 0.036092864824387, 0.03917558415329468, 0.049801301314093153, 0.057204012111920874, 0.07113022765407233, 0.08035880860786916, 0.11263375507843659].
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-7-a87d0ea00c9f> in <module>
      1 #################################################
      2 dsampler = dynesty.DynamicNestedSampler(loglike, prior_transform, ndim, nlive=20000, bound='multi')#, pool=pool, queue_size=10)
----> 3 dsampler.run_nested(wt_kwargs={'pfrac': 1.0})
      4 dres = dsampler.results
      5 ################################################

~/anaconda3/lib/python3.8/site-packages/dynesty/dynamicsampler.py in run_nested(self, nlive_init, maxiter_init, maxcall_init, dlogz_init, logl_max_init, n_effective_init, nlive_batch, wt_function, wt_kwargs, maxiter_batch, maxcall_batch, maxiter, maxcall, maxbatch, n_effective, stop_function, stop_kwargs, use_stop, save_bounds, print_progress, print_func, live_points)
   1617         try:
   1618             if not self.base:
-> 1619                 for results in self.sample_initial(nlive=nlive_init,
   1620                                                    dlogz=dlogz_init,
   1621                                                    maxcall=maxcall_init,

~/anaconda3/lib/python3.8/site-packages/dynesty/dynamicsampler.py in sample_initial(self, nlive, update_interval, first_update, maxiter, maxcall, logl_max, dlogz, n_effective, live_points, save_samples, resume)
    836         # Run the sampler internally as a generator.
    837         for i in range(1):
--> 838             for it, results in enumerate(self.sampler.sample(maxiter=maxiter,
    839                                          save_samples=save_samples,
    840                                          maxcall=maxcall, dlogz=dlogz,

~/anaconda3/lib/python3.8/site-packages/dynesty/sampler.py in sample(self, maxiter, maxcall, dlogz, logl_max, n_effective, add_live, save_bounds, save_samples)
    786             # `logl > loglstar` using the bounding distribution and sampling
    787             # method from our sampler.
--> 788             u, v, logl, nc = self._new_point(loglstar_new, logvol)
    789             ncall += nc
    790             self.ncall += nc

~/anaconda3/lib/python3.8/site-packages/dynesty/sampler.py in _new_point(self, loglstar, logvol)
    384         while True:
    385             # Get the next point from the queue
--> 386             u, v, logl, nc, blob = self._get_point_value(loglstar)
    387             ncall += nc
    388 

~/anaconda3/lib/python3.8/site-packages/dynesty/sampler.py in _get_point_value(self, loglstar)
    368         # If the queue is empty, refill it.
    369         if self.nqueue <= 0:
--> 370             self._fill_queue(loglstar)
    371 
    372         # Grab the earliest entry.

~/anaconda3/lib/python3.8/site-packages/dynesty/sampler.py in _fill_queue(self, loglstar)
    357         if self.use_pool_evolve:
    358             # Use the pool to propose ("evolve") a new live point.
--> 359             self.queue = list(self.M(evolve_point, args))
    360         else:
    361             # Propose ("evolve") a new live point using the default `map`

~/anaconda3/lib/python3.8/site-packages/dynesty/sampling.py in sample_slice(args)
    558                 # Check if the slice has shrunk to be ridiculously small.
    559                 if window < 1e-5 * window_init:
--> 560                     raise RuntimeError("Slice sampling appears to be "
    561                                        "stuck! Some useful "
    562                                        "output quantities:\n"


2) I also tried using sample="rslice" as you have suggested previously. In this case, I do get results when I assume lower accuracy for log-likelihood but not when I increase accuracy. Basically, I am trying to make 29 functions to go as close to '0' as possible and thus define a Gaussian likelihood for each with \mu=0 (the output likelihood is of course the log of the product of these 29 likelihoods). Then the \sigma of each of these Gaussians ends up defining how accurate the posteriors are/how close to '0' the 29 functions are. Lower the \sigma higher the accuracy (sorry if this is fairly obvious but thought of explicitly mentioning in case not). Here's how I call dynesty and the error I eventually get (similar error when running with 500k live points):

dsampler = dynesty.DynamicNestedSampler(loglike, prior_transform, ndim, nlive=20000, sample='rslice', bound='multi')#, pool=pool, queue_size=10)
dsampler.run_nested(wt_kwargs={'pfrac': 1.0})
dres = dsampler.results

I get multiple instances of the following lines

~/anaconda3/lib/python3.8/site-packages/dynesty/sampler.py:796: RuntimeWarning: overflow encountered in double_scalars
  math.exp(loglstar_new - logz_new) * loglstar_new)
~/anaconda3/lib/python3.8/site-packages/dynesty/sampler.py:800: RuntimeWarning: invalid value encountered in double_scalars
  dh = h_new - h
353358it [54:30, 108.05it/s, batch: 0 | bound: 2413 | nc: 21 | ncall: 9688415 | eff(%):  3.647 | loglstar:   -inf < -58119.249 <    inf | logz: -58828.952 +/-    nan | dlogz: 173.910 >  0.010]

and the following error eventually:

OverflowError: math range error
---------------------------------------------------------------------------
OverflowError                             Traceback (most recent call last)
<ipython-input-7-2df97ef5bd4b> in <module>
      1 #################################################
      2 dsampler = dynesty.DynamicNestedSampler(loglike, prior_transform, ndim, nlive=20000, sample='rslice', bound='multi')#, pool=pool, queue_size=10)
----> 3 dsampler.run_nested(wt_kwargs={'pfrac': 1.0})
      4 dres = dsampler.results
      5 ################################################

~/anaconda3/lib/python3.8/site-packages/dynesty/dynamicsampler.py in run_nested(self, nlive_init, maxiter_init, maxcall_init, dlogz_init, logl_max_init, n_effective_init, nlive_batch, wt_function, wt_kwargs, maxiter_batch, maxcall_batch, maxiter, maxcall, maxbatch, n_effective, stop_function, stop_kwargs, use_stop, save_bounds, print_progress, print_func, live_points)
   1617         try:
   1618             if not self.base:
-> 1619                 for results in self.sample_initial(nlive=nlive_init,
   1620                                                    dlogz=dlogz_init,
   1621                                                    maxcall=maxcall_init,

~/anaconda3/lib/python3.8/site-packages/dynesty/dynamicsampler.py in sample_initial(self, nlive, update_interval, first_update, maxiter, maxcall, logl_max, dlogz, n_effective, live_points, save_samples, resume)
    836         # Run the sampler internally as a generator.
    837         for i in range(1):
--> 838             for it, results in enumerate(self.sampler.sample(maxiter=maxiter,
    839                                          save_samples=save_samples,
    840                                          maxcall=maxcall, dlogz=dlogz,

~/anaconda3/lib/python3.8/site-packages/dynesty/sampler.py in sample(self, maxiter, maxcall, dlogz, logl_max, n_effective, add_live, save_bounds, save_samples)
    794             logz_new = np.logaddexp(logz, logwt)
    795             lzterm = (math.exp(loglstar - logz_new) * loglstar +
--> 796                       math.exp(loglstar_new - logz_new) * loglstar_new)
    797             h_new = (math.exp(logdvol) * lzterm +
    798                      math.exp(logz - logz_new) * (h + logz) -

OverflowError: math range error

Please let me know if you might have any advice or comments on this (perhaps I am doing something really silly!). Thank you so much!

segasai commented 3 years ago

It looks like you are running the 1.1 version, my suggestion is to try the one from github, it has so many various fixes (concerning slice sampling, and in general stability), that I think it should help. Also running 500k live-points is not a good idea. I doubt anything more than 10k is meaningful.

akashgpt commented 3 years ago

Thank you for the suggestion @segasai. I was indeed using dynesty v1.1. I am using the Github version now. Simulations are taking longer and only the 'rslice' simulation has finished so far (run time >15 hrs) but I have not gotten any of the errors I mentioned above, yet. I'll update here if that changes. Thanks again!