boost-R / gamboostLSS

Boosting models for fitting generalized additive models for location, shape and scale (GAMLSS) to potentially high dimensional data. The current relase version can be found on CRAN (https://cran.r-project.org/package=gamboostLSS).
26 stars 11 forks source link

Problem fitting a blackboost(LSS) model to toy data #58

Closed BerriJ closed 4 years ago

BerriJ commented 4 years ago

I'm currently playing around with a toy example to get the blackboostLSS function working. That is, I set up a blackboost model (without LSS) which works fast and produces the expected results. However, when I use blackboostLSS the results are vastly different although I tried to keep all parameters equal.

Here is my code:

library(gamboostLSS)
library(partykit)

# Init boost control params
boost_ctrl <- boost_control(trace = TRUE)

# Init tree control params
tree_ctrl <- ctree_control()

# Fit blackboost model
bb <- blackboost(dist ~ speed, 
                      data = cars,
                      control = boost_ctrl,
                      tree_controls = tree_ctrl)

### plot fit
plot(dist ~ speed, data = cars, main = "Blackboost Fit")
lines(cars$speed, predict(bb), col = "red")

# Fit blackboostLSS model
bb_lss <- blackboostLSS(formula = list(mu = dist ~ speed,
                                           sigma = dist ~ speed),
                            data = cars,
                            method = "cyclic",
                            control = boost_ctrl,
                            tree_controls = tree_ctrl)

# plot fit
plot(dist ~ speed, data = cars, main = "BlackboostLSS fit")
lines(cars$speed, predict(bb_lss)$mu, col = "red")

Blackboost Fit

Blackboost LSS Fit

Essentially I would expect the first and second plot to look very similar which clearly isn't the case.

Any hint or advice would be highly appreciated.