Implementing normal CDF for signal detection theory model (includes full sample code)

Update

I tried switching from a Bernoulli likelihood to Binomial likelihood:

with mc.Model() as one_param:
    d = mc.Normal('d', 0, 0.5)
    c = mc.Normal('c', 0, 2)
    theta_hit = mc.Deterministic('hit_rate', 0.5*(1+erf((d/2-c)/np.sqrt(2))))
    theta_fa = mc.Deterministic('fa_rate', 0.5*(1+erf((-d/2-c)/np.sqrt(2))))
    
    #hits = mc.Bernoulli('hit', theta_hit, observed=obs_hit)
    #fa = mc.Bernoulli('fa', theta_fa, observed=obs_fa)
    hits = mc.Binomial('hit', p=theta_hit, n=len(obs_hit), observed=obs_hit.sum())
    fa = mc.Binomial('fa', p=theta_fa, n=len(obs_fa), observed=obs_fa.sum())
    trace = mc.sample()

I still get the Theano errors, but the model now converges even if obs_hit is all ones.