+ acc_z0 <- plogis(0.7*scale(yz0) + qlogis(accuracy_z0))
+ acc_z1 <- plogis(1.3*scale(yz1) + qlogis(accuracy_z1))
+
+ w0z0 <- (1-yz0)**2 + (-1)**(1-yz0) * acc_z0
+ w0z1 <- (1-yz1)**2 + (-1)**(1-yz1) * acc_z1
+
+ w0z0.noisy.odds <- rlogis(nz0,qlogis(w0z0))
+ w0z1.noisy.odds <- rlogis(nz1,qlogis(w0z1))
+ df[z==0,w:=plogis(w0z0.noisy.odds)]
+ df[z==1,w:=plogis(w0z1.noisy.odds)]