R/ProbitUpdate.R

Defines functions ProbitUpdate

Documented in ProbitUpdate

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

  linear.pred <- as.vector(X%*%beta.hat)
  ZZ <- linear.pred + y*InvMillsRatio(linear.pred, lt=FALSE) - (1 - y)*InvMillsRatio(linear.pred, lt=TRUE)

  newbeta.hat <- solve(crossprod(X, X), crossprod(X, ZZ))
  return(c(newbeta.hat))
}
nchenderson/daarem documentation built on April 1, 2022, 7:37 p.m.