R/ProbitLogLik.R

Defines functions ProbitLogLik

Documented in ProbitLogLik

ProbitLogLik <- function(beta.hat, X, y) {

  fvals1 <- pnorm(X%*%beta.hat, log.p=TRUE)
  fvals2 <- pnorm(X%*%beta.hat, log.p=TRUE, lower.tail=FALSE)
  ans <- sum(y*fvals1) + sum((1 - y)*fvals2)
  return(ans)
}

Try the daarem package in your browser

Any scripts or data that you put into this service are public.

daarem documentation built on March 23, 2022, 9:06 a.m.