Skip to content

Bug in mstop for non-cyclical fitting #19

@hofnerb

Description

@hofnerb
require("gamboostLSS")

###negbin dist, linear###

set.seed(2611)
x1 <- rnorm(1000)
x2 <- rnorm(1000)
x3 <- rnorm(1000)
x4 <- rnorm(1000)
x5 <- rnorm(1000)
x6 <- rnorm(1000)
mu    <- exp(1.5 + x1^2 +0.5 * x2 - 3 * sin(x3) -1 * x4)
sigma <- exp(-0.2 * x4 +0.2 * x5 +0.4 * x6)
y <- numeric(1000)
for (i in 1:1000)
  y[i] <- rnbinom(1, size = sigma[i], mu = mu[i])
dat <- data.frame(x1, x2, x3, x4, x5, x6, y)

model <- glmboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
                     control = boost_control(mstop = 3), method = "inner")
cvr2 <- cvrisk(model, grid = 1:100)

mstop(cvr2)  #  a scalar
mstop(model) <- mstop(cvr2) #works
## but
mstop(model) # a vector
## and
mstop(model) <- c(mu = 10, sigma = 20) # breaks
mstop(model) ## now mstop = 10...

Does the current behavior makes sense? I don't think so.

I do see why it is interesting to know how many iterations were fitted for mu and sigma but at the same time, we cannot reuse this information. We only care about the total number of steps.

  • So it would preferable to primarily show the single mstop value.
  • Furthermore, we need to check all documentation where we state that mstop can be assigned as a named vector etc. That must be consistent and correct.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions