# Detecting separation and infinite estimates in log binomial regression In detectseparation: Detect and Check for Separation and Infinite Maximum Likelihood Estimates

## Simple approach

If an intercept is present in the estimation (-1, 0, ..., 0) will always provide valid starting values.

find_start_simple <- function(formula, data) {
c(-1, double(ncol(model.matrix(formula, data = data)) - 1L))
}

find_start_simple(formula, data)
max(model.matrix(formula, data = data) %*% find_start_simple(formula, data))


## Hot start via Poisson model

@andrade+andrade2018 suggest a hot start method, by using the modified estimation result of a Poisson model with log link as starting values. Again this method only works if an intercept is used.

find_start_poisson <- function(formula, data, delta = 1) {
b0 <- coef(glm(formula, data, family = poisson(link = "log")))
mX <- -model.matrix(formula, data = data)[, -1L, drop = FALSE]
b0 <- min(mX %*% b0[-1]) - delta
b0
}

find_start_poisson(formula, data)
max(model.matrix(formula, data = data) %*% find_start_poisson(formula, data))


## Recommendation

One can also solve an LP to find valid start values or think of other strategies. However, for the benchmark examples reported in @schwendinger+gruen+hornik:2021 we found no conclusive evidence that one of these initialization methods outperforms the others. Therefore, my personal favorite is the simple approach (-1, 0, ..., 0).

# References

## Try the detectseparation package in your browser

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

detectseparation documentation built on Aug. 27, 2022, 1:08 a.m.