
R version 4.6.1 (2026-06-24) -- "Happy Hop"
Copyright (C) 2026 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> 
> options(digits = 3)
> 
> library("mboost")
Loading required package: parallel
Loading required package: stabs
> 
> set.seed(290875)
> x <- rnorm(100)
> y <- rnorm(100)
> w <- drop(rmultinom(1, 100, rep(1 / 100, 100)))
> 
> G <- Gaussian()
> fm <- Family(ngradient = G@ngradient, risk = G@risk)
> 
> glmboost(y ~ x, family = G)

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x, family = G)


	 Squared Error (Regression) 

Loss function: (y - f)^2 
 

Number of boosting iterations: mstop = 100 
Step size:  0.1 
Offset:  0.0474 

Coefficients: 
(Intercept)           x 
   -0.00258     0.01857 
attr(,"offset")
[1] 0.0474

> 
> glmboost(y ~ x, family = fm)

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x, family = fm)


	 user-specified 

Loss function:  

Number of boosting iterations: mstop = 100 
Step size:  0.1 
Offset:  0.0474 

Coefficients: 
(Intercept)           x 
   -0.00258     0.01857 
attr(,"offset")
[1] 0.0474

> 
> mG <- glmboost(y ~ x, family = Gaussian())
> mH <- glmboost(y ~ x, family = Huber(10))
> all.equal(coef(mG), coef(mH))
[1] TRUE
> 
> 
> x <- rnorm(100)
> y <- rnbinom(length(x), size = 2, mu = exp(x * 2))
> mod <- glmboost(y ~ x, family = NBinomial(), center = FALSE)
> mod[1000]

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x, family = NBinomial(), center = FALSE)


	 Negative Negative-Binomial Likelihood 

Loss function:  

Number of boosting iterations: mstop = 1000 
Step size:  0.1 
Offset:  1.63 

Coefficients: 
(Intercept)           x 
      -1.48        1.91 
attr(,"offset")
[1] 1.63

> coef(mod)
(Intercept)           x 
      -1.48        1.91 
attr(,"offset")
[1] 1.63
> nuisance(mod)
[1] 1.33
> 
> ### QuantReg and ExpectReg
> gamboost(y ~ x, family = QuantReg())

	 Model-based Boosting

Call:
gamboost(formula = y ~ x, family = QuantReg())


	 Quantile Regression 

Loss function: tau * (y - f) * ((y - f) >= 0) - (1 - tau) * (y - f) * ((y -  
     f) < 0) 
 

Number of boosting iterations: mstop = 100 
Step size:  0.1 
Offset:  1 
Number of baselearners:  1 

> gamboost(y ~ x, family = ExpectReg())

	 Model-based Boosting

Call:
gamboost(formula = y ~ x, family = ExpectReg())


	 Expectile Regression 

Loss function: tau * (y - f)^2 * ((y - f) >= 0) + (1 - tau) * (y - f)^2 * ((y -  
     f) < 0) 
 

Number of boosting iterations: mstop = 100 
Step size:  0.1 
Offset:  5.12 
Number of baselearners:  1 

> 
> if (require("MASS")) {
+ 
+ summary(glm.nb(y ~ x))
+ 
+ y <- cut(x, breaks = c(-Inf, quantile(x, prob = c(0.25, 0.5, 0.75)), Inf), ordered = TRUE)
+ x <- rnorm(100)
+ polr(y ~ x)
+ mod <- glmboost(y ~ x, family = PropOdds(), center = FALSE)
+ nuisance(mod) - attr(coef(mod), "offset")
+ coef(mod)
+ 
+ }
Loading required package: MASS
     x 
0.0911 
attr(,"offset")
[1] -0.062
> 
> ## Count models as before but with highly skewed data 
> ## (used to lead to an error as offset was not properly computed)
> x <- rnorm(100)
> y <- rnbinom(length(x), size = 2, mu = exp(x * 5))
> mod <- glmboost(y ~ x, family = NBinomial())
> ## check same for Hurdle model
> x <- x[y > 0]
> y <- y[y > 0]
> mod <- glmboost(y ~ x, family = Hurdle())
> 
> ### Weibull model
> 
> if (require("survival")) {
+ 
+ rextrval <- function(x) log( -log(1-x) )
+ sigma <- 0.5
+ u <- runif(100)
+ u.1 <- runif(100)
+ w <- rextrval(u)
+ w.1 <- rextrval(u.1)
+ 
+ x1 <- rnorm(100,sd=1)
+ x2 <- x1 + rnorm(100,sd=1)
+ x1.1 <- rnorm(100,sd=1)
+ x2.1 <- x1.1 + rnorm(100,sd=1)
+ X <- cbind(x1,x2)
+ X.1 <- cbind(x1.1,x2.1)
+ beta <- c(1,0.5)
+ survtime <- exp(X%*%beta + sigma*w)
+ censtime <- exp(X.1%*%beta + sigma*w.1)
+ event <- survtime < censtime
+ stime <- pmin(survtime,censtime)
+ 
+ model1 <- glmboost(Surv(stime,event)~x1+x2, family=Weibull(),
+     control = boost_control(mstop=100), center = FALSE)
+ coef(model1)
+ nuisance(model1)
+ model2 <- survreg(Surv(stime,event)~x1+x2)
+ coef(model2)
+ model2$scale
+ 
+ }
Loading required package: survival
[1] 0.439
> 
> 
> ### Log logistic model
> 
> if (require("survival")) {
+ 
+ sigma <- 0.5
+ w <- rlogis(100)
+ w.1 <- rlogis(100)
+ 
+ x1 <- rnorm(100,sd=1)
+ x2 <- x1 + rnorm(100,sd=1)
+ x1.1 <- rnorm(100,sd=1)
+ x2.1 <- x1.1 + rnorm(100,sd=1)
+ X <- cbind(x1,x2)
+ X.1 <- cbind(x1.1,x2.1)
+ beta <- c(1,0.5)
+ survtime <- exp(X%*%beta + sigma*w)
+ censtime <- exp(X.1%*%beta + sigma*w.1)
+ event <- survtime < censtime
+ stime <- pmin(survtime,censtime)
+ 
+ model1 <- glmboost(Surv(stime,event)~x1+x2, family=Loglog(),
+     control = boost_control(mstop=200), center = FALSE)
+ coef(model1)
+ nuisance(model1)
+ model2 <- survreg(Surv(stime,event)~x1+x2, dist="loglogistic")
+ coef(model2)
+ model2$scale
+ 
+ }
[1] 0.518
> 
> 
> ### Log normal model
> 
> if (require("survival")) {
+ 
+ sigma <- 0.5
+ w <- rnorm(100)
+ w.1 <- rnorm(100)
+ 
+ x1 <- rnorm(100,sd=1)
+ x2 <- x1 + rnorm(100,sd=1)
+ x1.1 <- rnorm(100,sd=1)
+ x2.1 <- x1.1 + rnorm(100,sd=1)
+ X <- cbind(x1,x2)
+ X.1 <- cbind(x1.1,x2.1)
+ beta <- c(1,0.5)
+ survtime <- exp(X%*%beta + sigma*w)
+ censtime <- exp(X.1%*%beta + sigma*w.1)
+ event <- survtime < censtime
+ stime <- pmin(survtime,censtime)
+ 
+ model1 <- glmboost(Surv(stime,event)~x1+x2, family=Lognormal(),
+     control = boost_control(mstop=200), center = FALSE)
+ coef(model1)
+ nuisance(model1)
+ model2 <- survreg(Surv(stime,event)~x1+x2, dist="lognormal")
+ coef(model2)
+ model2$scale
+ 
+ }
[1] 0.402
> 
> 
> ### AUC
> data("wpbc", package = "TH.data")
> wpbc[,colnames(wpbc) != "status"] <- scale(wpbc[,colnames(wpbc) != "status"])
> wpbc <- wpbc[complete.cases(wpbc), colnames(wpbc) != "time"]
> mAUC <- gamboost(status ~ ., data = wpbc, family = AUC())
> 1 - mAUC$risk()
  [1] 0.000 0.578 0.703 0.715 0.730 0.743 0.749 0.757 0.764 0.766 0.772 0.779
 [13] 0.781 0.784 0.790 0.792 0.793 0.797 0.799 0.802 0.805 0.808 0.810 0.813
 [25] 0.818 0.820 0.824 0.830 0.833 0.834 0.840 0.842 0.845 0.848 0.848 0.852
 [37] 0.853 0.861 0.863 0.866 0.869 0.874 0.878 0.885 0.889 0.894 0.898 0.906
 [49] 0.908 0.910 0.913 0.920 0.925 0.924 0.925 0.930 0.935 0.941 0.942 0.947
 [61] 0.945 0.948 0.951 0.954 0.951 0.954 0.958 0.957 0.960 0.960 0.961 0.962
 [73] 0.962 0.962 0.964 0.965 0.965 0.968 0.968 0.968 0.968 0.971 0.973 0.972
 [85] 0.973 0.973 0.975 0.976 0.977 0.976 0.977 0.978 0.978 0.979 0.979 0.979
 [97] 0.979 0.979 0.979 0.979 0.980
> 
> 
> # rank-based boosting
> 
> if (require("survival")) {
+ 
+ set.seed(1907)
+ n <- 100
+ beta <- c(3, 1.5, 0, 0, 2, 0, 0, 0)
+ p <- length(beta)
+ x <- matrix(rnorm(n*p), n, p)
+ yt <- x %*% beta + rnorm(n)
+ x <- cbind(1, x)
+ colnames(x) <- c("intercept", paste("x", 1:8, sep=""))
+ cens <- runif(n, 0, 6)
+ y <- exp(pmin(yt, cens))
+ del <- yt <= cens
+ ## check fitting and cvrisk
+ mod <- glmboost(x = x, y = Surv(y, del),
+                 control = boost_control(mstop = 500, nu = 0.1),
+                 center = TRUE,
+                 family = Gehan())
+ coef(mod)
+ plot(mod$risk())
+ cvr <- cvrisk(mod, folds = cv(model.weights(mod), "kfold"), papply=lapply)
+ plot(cvr)
+ ## check weighting:
+ wMat <- cv(rep(1, n), type = "kfold",B = 2)
+ modWeighted <- glmboost(x = x, y = Surv(y, del), weights = wMat[, 1],
+                         control = boost_control(mstop = 300, nu = 0.20),
+                         family = Gehan())
+ # same model with data set subseted:
+ modSubset <- glmboost(x = x[as.logical(wMat[, 1]),],
+                       y = Surv(y, del)[as.logical(wMat[, 1]),],
+                       control = boost_control(mstop = 300, nu = 0.20),
+                       family = Gehan())
+ ## <FIXME> there are still some minor discrepancies. Perhaps this is due to
+ ## different pre-processing? </FIXME>
+ round(coef(modWeighted, which = "") - coef(modSubset, which = ""), 3)
+ }
intercept        x1        x2        x3        x4        x5        x6        x7 
   -0.609     0.000    -0.004     0.001    -0.001    -0.003     0.000     0.000 
       x8 
   -0.004 
attr(,"offset")
[1] 5.87
> 
> 
> ## Binomial
> y <- as.factor(sample(0:1, 100, replace = TRUE))
> x1 <- rnorm(100)
> x2 <- rnorm(100)
> 
> mod <- glmboost(y ~ x1 + x2, family = Binomial())
> mod[500]

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x1 + x2, family = Binomial())


	 Negative Binomial Likelihood (logit link) 

Loss function: { 
     f <- pmin(abs(f), 36) * sign(f) 
     p <- exp(f)/(exp(f) + exp(-f)) 
     y <- (y + 1)/2 
     -y * log(p) - (1 - y) * log(1 - p) 
 } 
 

Number of boosting iterations: mstop = 500 
Step size:  0.1 
Offset:  -0.0601 

Coefficients: 

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

(Intercept)          x1          x2 
   -0.00793    -0.01005     0.08619 
attr(,"offset")
[1] -0.0601

> 2 * coef(mod, off2int = TRUE)

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

(Intercept)          x1          x2 
    -0.1360     -0.0201      0.1724 
> 
> glmMod <- glm(y ~ x1 + x2, family = 'binomial')
> coef(glmMod)
(Intercept)          x1          x2 
    -0.1360     -0.0201      0.1724 
> print(all(abs((coef(glmMod) - coef(mod, off2int = TRUE) * 2)) < sqrt(.Machine$double.eps)))

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

[1] TRUE
> 
> ## C-index boosting
> if (require("survival")) {
+   
+   sigma <- 0.5
+   w <- rnorm(100)
+   w.1 <- rnorm(100)
+   
+   x1 <- rnorm(100,sd=1)
+   x2 <- x1 + rnorm(100,sd=1)
+   x1.1 <- rnorm(100,sd=1)
+   x2.1 <- x1.1 + rnorm(100,sd=1)
+   X <- cbind(x1,x2)
+   X.1 <- cbind(x1.1,x2.1)
+   beta <- c(1,0.5)
+   survtime <- exp(X%*%beta + sigma*w)
+   censtime <- exp(X.1%*%beta + sigma*w.1)
+   event <- survtime < censtime
+   stime <- pmin(survtime,censtime)
+   dat <- data.frame(time = stime, event = event, x1 = x1, x2 = x2)
+   
+   # compute ipcweights outside the family
+   ipcw <- IPCweights(x = Surv(dat$time, dat$event))
+   model1 <- glmboost(Surv(time,event)~x1+x2, family=Cindex(ipcw = ipcw),
+                      control = boost_control(mstop=50), data = dat)
+   
+   
+   # compute ipcweights inside
+   model2 <- glmboost(Surv(time,event)~x1+x2, family=Cindex(ipcw = 1),
+                      control = boost_control(mstop=50), data = dat)
+   rbind(coef(model1, off2int = TRUE, which = ""), 
+         coef(model2, off2int = TRUE, which = ""))
+   
+   print(identical(coef(model1), coef(model2)))
+   
+   # change sigma
+   model1 <- glmboost(Surv(time,event)~x1+x2, family=Cindex(sigma = 0.01),
+                      control = boost_control(mstop=20), data = dat)
+   model2 <- glmboost(Surv(time,event)~x1+x2, family=Cindex(sigma = 0.2),
+                      control = boost_control(mstop=20), data = dat)
+   rbind(coef(model1, off2int = TRUE, which = ""), 
+         coef(model2, off2int = TRUE, which = ""))
+   print(!identical(coef(model1), coef(model2)))
+   
+ }
[1] TRUE
[1] TRUE
> 
> ## check Binomial(type = "glm")
> glmModboost <- glmboost(y ~ x1 + x2, family = Binomial(type = "glm"))
> glmModboost[1000] 

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x1 + x2, family = Binomial(type = "glm"))


	 Binomial Distribution (similar to glm) 

Loss function: { 
     ntrials <- rowSums(y) 
     y <- y[, 1] 
     p <- link$linkinv(f) 
     -dbinom(x = y, size = ntrials, prob = p, log = log) 
 } 
 

Number of boosting iterations: mstop = 1000 
Step size:  0.1 
Offset:  -0.06 

Coefficients: 
(Intercept)          x1          x2 
    -0.0956     -0.2996      0.2183 
attr(,"offset")
[1] -0.06

> round(rbind(coef(glmMod), coef(glmModboost, off2int =TRUE), 2*coef(mod, off2int = TRUE)),3)

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

     (Intercept)    x1    x2
[1,]      -0.136 -0.02 0.172
[2,]      -0.156 -0.30 0.218
[3,]      -0.136 -0.02 0.172
> ## use different link
> glmMod <- glm(y ~ x1 + x2, family = binomial(link = "probit"))
> coef(glmMod)
(Intercept)          x1          x2 
     -0.102      -0.201       0.145 
> glmModboost <- glmboost(y ~ x1 + x2, family = Binomial(type = "glm", link = "probit"))
> glmModboost[500]

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x1 + x2, family = Binomial(type = "glm",     link = "probit"))


	 Binomial Distribution (similar to glm) 

Loss function: { 
     ntrials <- rowSums(y) 
     y <- y[, 1] 
     p <- link$linkinv(f) 
     -dbinom(x = y, size = ntrials, prob = p, log = log) 
 } 
 

Number of boosting iterations: mstop = 500 
Step size:  0.1 
Offset:  -0.0376 

Coefficients: 
(Intercept)          x1          x2 
    -0.0625     -0.1960      0.1415 
attr(,"offset")
[1] -0.0376

> round(rbind(coef(glmMod), coef(glmModboost, off2int =TRUE)),3)
     (Intercept)     x1    x2
[1,]      -0.102 -0.201 0.145
[2,]      -0.100 -0.196 0.141
> ## use matrix of successes and failures
> y <- matrix(ncol = 2, nrow = length(x1), data = rpois(lambda = 30, n =2*length(x1)) )
> glmMod <- glm(y ~ x1 + x2, family = binomial())
> coef(glmMod)
(Intercept)          x1          x2 
    0.01106     0.00994    -0.03607 
> glmModboost <- glmboost(y ~ x1 + x2, family = Binomial(type = "glm"))
> glmModboost[500]

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x1 + x2, family = Binomial(type = "glm"))


	 Binomial Distribution (similar to glm) 

Loss function: { 
     ntrials <- rowSums(y) 
     y <- y[, 1] 
     p <- link$linkinv(f) 
     -dbinom(x = y, size = ntrials, prob = p, log = log) 
 } 
 

Number of boosting iterations: mstop = 500 
Step size:  0.1 
Offset:  0.00626 

Coefficients: 
(Intercept)          x1          x2 
    0.00480     0.00994    -0.03607 
attr(,"offset")
[1] 0.00626

> round(rbind(coef(glmMod), coef(glmModboost, off2int =TRUE)),3)
     (Intercept)   x1     x2
[1,]       0.011 0.01 -0.036
[2,]       0.011 0.01 -0.036
> ## use binary vector
> y <- rbinom(prob = plogis(x1 + x2), size = 1, n = length(x1))
> glmMod <- glm(y ~ x1 + x2, family = binomial())
> coef(glmMod)
(Intercept)          x1          x2 
      0.168       1.516       0.743 
> glmModboost <- glmboost(y ~ x1 + x2, family = Binomial(type = "glm"),
+                         control = boost_control(nu = 0.2))
> glmModboost[1000]

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x1 + x2, family = Binomial(type = "glm"),     control = boost_control(nu = 0.2))


	 Binomial Distribution (similar to glm) 

Loss function: { 
     ntrials <- rowSums(y) 
     y <- y[, 1] 
     p <- link$linkinv(f) 
     -dbinom(x = y, size = ntrials, prob = p, log = log) 
 } 
 

Number of boosting iterations: mstop = 1000 
Step size:  0.2 
Offset:  0.1 

Coefficients: 
(Intercept)          x1          x2 
     0.0666      1.5124      0.7406 
attr(,"offset")
[1] 0.1

> round(rbind(coef(glmMod), coef(glmModboost, off2int =TRUE)),2)
     (Intercept)   x1   x2
[1,]        0.17 1.52 0.74
[2,]        0.17 1.51 0.74
> 
> 
> ## 
> ## Binomial with other links
> ## and interface type = "adaboost" or "glm"
> set.seed(123)
> y <- as.factor(sample(0:1, 100, replace = TRUE))
> x1 <- rnorm(100)
> x2 <- rnorm(100)
> 
> mod <- glmboost(y ~ x1 + x2, family = Binomial(type = "adaboost", link = "cauchit"))
> mod[500]

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x1 + x2, family = Binomial(type = "adaboost",     link = "cauchit"))


	 Negative Binomial Likelihood -- cauchit link 

Loss function: { 
     p <- link$linkinv(f) 
     y <- (y + 1)/2 
     -y * log(p) - (1 - y) * log(1 - p) 
 } 
 

Number of boosting iterations: mstop = 500 
Step size:  0.1 
Offset:  -0.224 

Coefficients: 

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

(Intercept)          x1          x2 
   -0.00741    -0.01763    -0.19780 
attr(,"offset")
[1] -0.224

> mod2 <- glmboost(y ~ x1 + x2, family = Binomial(type = "glm", link = "cauchit"))
> mod2[500]

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x1 + x2, family = Binomial(type = "glm",     link = "cauchit"))


	 Binomial Distribution (similar to glm) 

Loss function: { 
     ntrials <- rowSums(y) 
     y <- y[, 1] 
     p <- link$linkinv(f) 
     -dbinom(x = y, size = ntrials, prob = p, log = log) 
 } 
 

Number of boosting iterations: mstop = 500 
Step size:  0.1 
Offset:  -0.11 

Coefficients: 
(Intercept)          x1          x2 
    -0.1202     -0.0173     -0.1974 
attr(,"offset")
[1] -0.11

> glmMod <- glm(y ~ x1 + x2 , family = binomial(link = "cauchit"))
> print(all(round(coef(glmMod),2) == round(coef(mod, off2int =TRUE),2)))

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

[1] TRUE
> rbind(coef(glmMod), coef(mod, off2int = TRUE), coef(mod2, off2int = TRUE))

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

     (Intercept)      x1     x2
[1,]      -0.231 -0.0179 -0.198
[2,]      -0.231 -0.0176 -0.198
[3,]      -0.231 -0.0173 -0.197
> 
> mod <- glmboost(y ~ x1 + x2, family = Binomial(type = "adaboost", link = "probit"))
> mod[500]

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x1 + x2, family = Binomial(type = "adaboost",     link = "probit"))


	 Negative Binomial Likelihood -- probit link 

Loss function: { 
     p <- link$linkinv(f) 
     y <- (y + 1)/2 
     -y * log(p) - (1 - y) * log(1 - p) 
 } 
 

Number of boosting iterations: mstop = 500 
Step size:  0.1 
Offset:  -0.176 

Coefficients: 

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

(Intercept)          x1          x2 
  -6.01e-05   -1.13e-02   -1.40e-01 
attr(,"offset")
[1] -0.176

> glmMod <- glm(y ~ x1 + x2 , family = binomial(link = "probit"))
> print(all(round(coef(glmMod),2) == round(coef(mod, off2int =TRUE),2)))

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

[1] TRUE
> mod2 <- glmboost(y ~ x1 + x2, family = Binomial(type = "glm", link = "probit"))
> mod2[500]

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x1 + x2, family = Binomial(type = "glm",     link = "probit"))


	 Binomial Distribution (similar to glm) 

Loss function: { 
     ntrials <- rowSums(y) 
     y <- y[, 1] 
     p <- link$linkinv(f) 
     -dbinom(x = y, size = ntrials, prob = p, log = log) 
 } 
 

Number of boosting iterations: mstop = 500 
Step size:  0.1 
Offset:  -0.0878 

Coefficients: 
(Intercept)          x1          x2 
    -0.0886     -0.0113     -0.1404 
attr(,"offset")
[1] -0.0878

> rbind(coef(glmMod), coef(mod, off2int = TRUE), coef(mod2, off2int = TRUE))

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

     (Intercept)      x1    x2
[1,]      -0.176 -0.0113 -0.14
[2,]      -0.176 -0.0113 -0.14
[3,]      -0.176 -0.0113 -0.14
> 
> 
> mod <- glmboost(y ~ x1 + x2, family = Binomial(type = "adaboost", link = "log"))
> mod[500]

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x1 + x2, family = Binomial(type = "adaboost",     link = "log"))


	 Negative Binomial Likelihood -- log link 

Loss function: { 
     p <- link$linkinv(f) 
     y <- (y + 1)/2 
     -y * log(p) - (1 - y) * log(1 - p) 
 } 
 

Number of boosting iterations: mstop = 500 
Step size:  0.1 
Offset:  -0.844 

Coefficients: 

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

(Intercept)          x1          x2 
   -0.00587    -0.00376    -0.14114 
attr(,"offset")
[1] -0.844

> glmMod <- glm(y ~ x1 + x2 , family = binomial(link = "log"))
> print(all(round(coef(glmMod),2) == round(coef(mod, off2int =TRUE),2)))

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

[1] TRUE
> mod2 <- glmboost(y ~ x1 + x2, family = Binomial(type = "glm", link = "log"))
> mod2[500]

	 Generalized Linear Models Fitted via Gradient Boosting

Call:
glmboost.formula(formula = y ~ x1 + x2, family = Binomial(type = "glm",     link = "log"))


	 Binomial Distribution (similar to glm) 

Loss function: { 
     ntrials <- rowSums(y) 
     y <- y[, 1] 
     p <- link$linkinv(f) 
     -dbinom(x = y, size = ntrials, prob = p, log = log) 
 } 
 

Number of boosting iterations: mstop = 500 
Step size:  0.1 
Offset:  -0.766 

Coefficients: 
(Intercept)          x1          x2 
   -0.08413    -0.00376    -0.14114 
attr(,"offset")
[1] -0.766

> rbind(coef(glmMod), coef(mod, off2int = TRUE), coef(mod2, off2int = TRUE))

NOTE: Coefficients from a Binomial model are half the size of coefficients
 from a model fitted via glm(... , family = 'binomial').
See Warning section in ?coef.mboost

     (Intercept)       x1     x2
[1,]       -0.85 -0.00376 -0.141
[2,]       -0.85 -0.00376 -0.141
[3,]       -0.85 -0.00376 -0.141
> 
> 
> proc.time()
   user  system elapsed 
   5.14    0.10    5.23 
