Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gamboost base level coefficient #104

Open
RossA24 opened this issue Feb 10, 2020 · 0 comments
Open

Gamboost base level coefficient #104

RossA24 opened this issue Feb 10, 2020 · 0 comments

Comments

@RossA24
Copy link

RossA24 commented Feb 10, 2020

I have recently been working with mboost, especially gamboost, for the first time. For a deeper understanding of how the algorithm works, I calculated the first iterations of a basic example manually using categorical data and only a single linear base learner. There were some differences between the coefficients I calculated and the ones mboost provides. It seems like mboost provides the „bare“ coefficients and replaces the base level coefficient with zero. I was expecting all coefficients to be corrected in perspective to the base level. Here is short example:

`library(mboost)

x<-as.factor(mtcars$carb)
y<-mtcars$mpg*10

GAM<-gamboost(y~bols(x, intercept = FALSE), family = Poisson())

coef(GAM[1])

nu<-0.1
OffsetWert<-log(mean(y), base = exp(1))
negGradient<-y-exp(OffsetWert)
mtcars_neu<-data.frame(mtcars, negGradient)
Koef_mtcars<-aggregate(mtcars_neu$negGradient, list(mtcars_neu$carb), mean)

#The coefficients mboost provides seem to be the following:
Koef_mtcars$x*nu

#I was expecting the standardized coefficients to be as follow:
#I use subtraction instead of division because we're using a loglink function

Umnormierte_Koef<-(Koef_mtcars$x-Koef_mtcars$x[1])*nu
Umnormierte_Koef`

I would be happy about any help or hints to solve the problem!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant