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))
}

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.