I’m building a complex model, that have a convergence problem, when initializing with NUTS I get this error message :
ValueError: Bad initial energy: nan. The model might be misspecified.
How can I have clues about the random variable that produce such ‘nan’ energy ?
So far my work around is to use Metropolis step for a given variable instead of NUTS. But this is not satisfying. I guess that this given variable is not the problem because I still have the problem even if I replace this random variable by a constant (with a reasonable value).
I printed the logp value of the test point for each of my random variables :
original_ctr_logodds__ -1.3862943611198906 ctr_logodds__ -138.62943611198918 ctr_prior_interval__ -794407.2905335968 w_stickbreaking__ -5.963065072586285 ctr_pp 207.9293698687659 original_ctr_pp 2.079293698687664 original_conv -31871.982096691176 conv -3180114.173934952 original_conv_pp -31871.98209669117 conv_pp -3180114.173934952 -7218315.572728861
(last value is the whole model logp)
None of them are Inf or Nan, I’m a bit surprised to see positive logp but I’m not sure that it is a problem (?).
How can I get more information about this ‘nan ernergy’ ?