merliseclyde / BAS

BAS R package https://merliseclyde.github.io/BAS/
https://merliseclyde.github.io/BAS/
GNU General Public License v3.0
41 stars 16 forks source link

Add Firth logistic regression to BAS #63

Open merliseclyde opened 1 year ago

merliseclyde commented 1 year ago

Separation is a current problem with bas.glm in logistic regressions as which uses nested integrated Laplace approximations which depend on MLEs. With quasi or perfect separation, MLEs are not identifiable, which Firth Logistic regression addresses through data augmentation or equivalently a penalty term using Jeffreys invariant prior.

For DA, an augmented data set with $3n$ observations is constructed with stacking the design matrix 3 times and a response vector that is (the original Y, a nx1 vector of 1's, and a nx1 vector of 0's). The augmented response are accompanied by weights: $w_{i} = hi /2$ where $$H = W^{1/2}X(X^TWX)^{-1}X^TW^{1/2}$$ and $W$ is a diagonal matrix with $[W]{ii} = \pi_i ( 1 - \pi_i)$.

Questions in implementation:

of interest for JASP @vandenman ?