R/logRegDeriv.r

Defines functions logRegDeriv

Documented in logRegDeriv

logRegDeriv <- function(beta, Y, Z){

n <- dim(Z)[1]
p <- dim(Z)[2]

pro <- Z %*% beta
p <- exp(pro) / (1 + exp(pro))

G <- t(Z) %*% (p - Y)

return(list("dL" = -G))
}

Try the OrdFacReg package in your browser

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

OrdFacReg documentation built on May 1, 2019, 10:06 p.m.