
mLL = function(x,y,beta) {
   py1 = 1/(1+exp(-(beta[1] + beta[2]*x)))
   return(-sum(ifelse(y==1,log(py1),log(1-py1))))
}

x = 1:5
y = c(0,0,0,1,1)
beta = c(-3,.5)

temp = mLL(x,y,beta)
cat("temp: ",temp,"\n")
