I am running a hierarchical regression model and due to bad input variables it sometimes fail at the starting point. Following is an example of such error:
SamplingError: Initial evaluation of model at starting point failed!
Starting values:
{'ctrl': array([[ 0.27 , -0.138, 0.108, 0.439]]), 'pos_truncnormal_audit_interval__': array([[ 0., 0., 0., 0., nan, 0., 0., 0., 0.]])
Now from this message I know the troublesome variable is the 5th element of the RV pos_truncnormal_audit_interval__ and in the next iteration would like to exclude it from my model. But I’m not being able to return this information as any object.
When I’m trying to get the information by running
for RV in model.basic_RVs:
print(RV.name, pm.logp(RV, model.test_point))
I’m receiving the following error:
NotImplementedError: Cannot convert {'ctrl': array([[0.00605671, 0.05232037, 0.07515219]]), 'pos_truncnormal_audit_interval__': array([[0., 0., 0., 0., 0., 0., 0., 0.]])} to a tensor variable.
Is there any way to extract this information as an object so that it can be used for further diagnosis.
Many thanks in advance.