Logistic Regression Mixture Model

I think you have a typo in the line

roblog_model = robust_logreg(log_x_train, log_x_train)

you are passing in log_x_train twice which means your observed data are actually your covariates and that means if you try to evaluate the logdensity of the Bernoulli you will get -Inf. If I modify that line it runs without problems for me.

Also unless you are using HMC for a specific reason maybe consider potentially using NUTS(0.65) instead of HMC(0.05, 10) as your inference algorithm because as far as I know PyMC3 uses NUTS as a default algorithm.

1 Like