You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using fit_sgs() with intercept=TRUE and type="logistic" yields incorrect estimates for the intercept, despite correct parameter estimates. Reproducible example, comparing it with the built-in glm() function:
set.seed(3)
n=200
p=10
X <- as.matrix(rnorm_multi(n=n,vars=p,mu=0,sd=1,r=0))
y <- 1/(1+exp(-(X %*%rnorm(p,mean=0,sd=sqrt(10)) + rnorm(n,mean=0,sd=4))))
y <- ifelse(y>0.5,1,0)
groups = 1:p
glm_fit <- glm(y ~ as.matrix(X),family="binomial")
sgs = fit_sgs(X=X,y=y, groups=groups, type="logistic", lambda=0, alpha=1, vFDR=0.1, gFDR=0.1,intercept=TRUE,standardise="none")
cbind(glm_fit$coefficients,sgs$beta)
expect_equivalent(coef(glm_fit)[-1],
as.matrix(sgs$beta)[-1],
tol = 1e-3
)
Compared to glmnet(), the intercept is closer but still slightly off (although the parameter estimates are again correct):
Currently, the intercept is fitted alongside the other parameters but has no penalisation applied to it. In contrast to the Gaussian case, where the fitting process takes place without the intercept and it is calculated at the end.
Additionally, slower convergence is observed when using an intercept for logistic regression.
The text was updated successfully, but these errors were encountered:
Using
fit_sgs()
withintercept=TRUE
andtype="logistic"
yields incorrect estimates for the intercept, despite correct parameter estimates. Reproducible example, comparing it with the built-inglm()
function:Compared to
glmnet()
, the intercept is closer but still slightly off (although the parameter estimates are again correct):Currently, the intercept is fitted alongside the other parameters but has no penalisation applied to it. In contrast to the Gaussian case, where the fitting process takes place without the intercept and it is calculated at the end.
Additionally, slower convergence is observed when using an intercept for logistic regression.
The text was updated successfully, but these errors were encountered: