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

Bug in mstop for non-cyclical fitting #19

Closed
2 tasks
hofnerb opened this issue Aug 23, 2016 · 3 comments
Closed
2 tasks

Bug in mstop for non-cyclical fitting #19

hofnerb opened this issue Aug 23, 2016 · 3 comments
Assignees
Labels

Comments

@hofnerb
Copy link
Member

hofnerb commented Aug 23, 2016

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.
@ja-thomas
Copy link
Member

I see your point but:

  1. in most cases it is more interesting to see the distribution of the iterations that the overall iterations (which is specified by the user).

  2. this would break a lot of my code since I use the mstop() function a lot in the internal fitting process.

What we could do is if mstop(model) <- c(mu = 10, sigma = 20) is called we use sum(c(mu = 10, sigma = 20)) as new mstop and give a warning to the user?

@hofnerb
Copy link
Member Author

hofnerb commented Aug 23, 2016

I see. Let's discuss this at the phone. That is easier.

@hofnerb
Copy link
Member Author

hofnerb commented Aug 23, 2016

return scalar with one attribute for individual steps per distribution parameter. perhaps add nice print function...

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

No branches or pull requests

2 participants