-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Description
When attempting to run a glm, any missing values in the response variable results in an exception, which is appropriate, but the error message is not clear:
TypeError: reduce() of empty sequence with no initial value
For example, in the following model, you get this error when oxygen
has one or more missing values.
glm = pm3.glm.glm
with pm3.Model() as oxygen_no_hx:
formula = 'oxygen ~ ' + '+'.join(no_hx_vars)
glm(formula, rsv_no_hx, family=pm3.glm.families.Binomial())
oxygen_trace = pm3.sample(2000, pm3.NUTS())
Might be worth checking for that further up the chain and returning a more informative error.
kevinmickey