@michaelosthege, yes, it looks like my guess was correct. I had such problem because I used previously obtained solution for testval
s. This means that if I would get an upper bound in my previous solution, I potentially encounter the inf
problem.
If desirably, I may try to write a reproducible example, but the excerpt looks like that:
Rmn = .5
Rmx = 2.8
with pm.Model() as model:
Rmin = pm.Uniform('Rmin', Rmn, Rmx, testval=inits['Rmin'][-nprefects:], shape=nprefects)
ĪR = pm.Uniform('ĪR', 0, Rmx, testval=inits['ĪR'][-nprefects:], shape=nprefects)
Īµ = pm.Uniform('Īµ', 0, .5, testval=inits['Īµ'][-nprefects:], shape=nprefects)
Ļ = pm.Uniform('Ļ', 0, 1, testval=inits['Ļ'][-nprefects:], shape=nprefects)
logĻ = pm.Uniform('logĻ', 4, 9, testval=inits['logĻ'][-nprefects:], shape=nprefects)
popSize = tt.as_tensor_variable(np.array(popSizes,dtype=np.float64))
Infected0 = pm.Uniform('Infected0', 0, 500,
testval=inits['Infected0'][-nprefects:], shape=nprefects)
Immune_fraction0 = tt.as_tensor_variable(np.dtype('float64').type(0.2))
# Solving ODEs
initial = tt.stack([Rmin, ĪR, Īµ, popSize, Infected0,
tt.repeat(Immune_fraction0, nprefects)], axis=1)
forward = forward_model(initial, theano.shared(Ī£))
Ī¼ = Ļ*forward
Ī± = popSize/tt.exp(logĻ)
pm.TruncatedNormal('Y_obs', Ī¼, Ī± + 1e-6, lower=0, observed=Y)
solMLE_raw = pm.find_MAP(return_raw = True, include_transformed = False, progressbar = True, maxeval=1000000)
solMLE = solMLE_raw[0]
solMLE
To note that inf
arises when I have also a problematic fit (trying to fit something that looks not so good).