Closed pmcdonal closed 1 year ago
Thanks for the report; I guess I should catch clik errors then... (do not know why they just do not return -inf if unhappy). First point is indeed sampled from the reference distributions --- I'll clarify that. ref_scale can be used to rescale all reference distributions, so setting this to a very small value will achieve what you want. ZeusSampler doesn't need input proposal matrix (others do, e.g. MCMCSampler).
Well, -inf is an implicit prior that you might not want... I'd do it, but, strictly, I can see why you might not hard code. But ok, I figured out how to see ref and prior numbers (after painfully much floundering) and there's no way this point is drawn from ref, and generally it should be ruled out by data, i.e., no way a chain will walk there from the ref starting point... so how/why does it go there? (i.e., whatever it is, it seems like it must be a flaw somewhere in the system)
The parameter vector which is thrown out is compatible with priors, right? Then it's up to Zeus
(I have just edited the Planck likelihoods to catch errors by default)
Well, then if there is no way to fix through Zeus options I'd say the flaw in the system is Zeus... I.e., it isn't the priors' fault, since the problem is being so crazy-far from reasonably consistent with data, in spite of ref... (ok, this is somewhat a matter of judgement, but, in my opinion, a sampler that cannot be stopped from doing this is not one I'd want to use...)
Upon further thought, this is why I'd say the likelihood crash is really the correct response, if it can't return a legit number. I.e., I'd rather know if "something that shouldn't happen" happens, rather than quietly going on...
well, up to you but I'd give it a try again, maybe that was very very bad luck :) (and, if I thought something should not happen, then I would prevent it with priors --- especially as Zeus is just given a likelihood callable, without information on the typical parameter ranges)
It should be possible to give it an idea of starting parameter range and have it use it... It's just about efficiency - whether the Planck likelihood crashed or not there, the call was a waste of time (or would have been if actually evaluated)... if it hadn't crashed we just wouldn't know... You shouldn't need to tailor priors to keep sampler from wasting time in areas ruled out by data. I'm not asking you to solve it though... just thinking out loud... (although I do plan to turn the crashing back on if I can). This sampling is unbearable... no wonder people get so little done... of course, I am doing it because I was also having trouble finding stable Hessians (I don't understand the reason though, for parameter space where chain results look Gaussian... basically nothing is making sense to me right now)
I have this code:
and it does the following... I guess as I write this I realize I don't know what it uses for initial sampling choices, and if it is drawing from prior instead of ref this could happen for that reason... Is it possible to specify a starting point and covariance matrix for sampling? (e.g., with cobaya I would give it the max like point and Hessian covariance to start with)
[001886.50] [0/1] 02-03 11:24 ZeusSampler INFO Varied parameters: ['h', 'omega_cdm', 'omega_b', 'logA', 'n_s', 'tau_reio', 'A_planck']. [001894.60] [0/1] 02-03 11:24 root INFO Initialising ensemble of 18 walkers... zeus: Exception while calling your likelihood function: params: [[0.71845617 0.11316231 0.02500884 3.25690416 0.97226037 0.17722994 0.9907607 ]] args: [] kwargs: {} exception:
Traceback (most recent call last): File "/Users/pmcdonal/github/cosmodesi/desilike/desilike/base.py", line 710, in calculate self.calculator.calculate(**self.param_values) File "/Users/pmcdonal/github/cosmodesi/desilike/desilike/likelihoods/cmb/planck2018_clik.py", line 99, in calculate self.loglikelihood = self.clik(self.vector)[0] File "lkl.pyx", line 90, in clik.lkl.clik.call clik.lkl.CError: clik_compute(../src/clik.c:391)::ForwardError distribution_lkl(../src/minipmc/distribution.c:219)::ForwardError lklbs_lkl(../src/lklbs.c:219)::ForwardError simall_lkl(../src/simall/clik_simall.c:48)::Error -1233 (multipole EE 4 too large (got 0.352342 expected <0.3))