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

risk: Problem when models are decreased and increased afterwards #33

Closed
hofnerb opened this issue Feb 7, 2017 · 2 comments
Closed

risk: Problem when models are decreased and increased afterwards #33

hofnerb opened this issue Feb 7, 2017 · 2 comments
Assignees
Labels

Comments

@hofnerb
Copy link
Member

hofnerb commented Feb 7, 2017

## Generate some data
set.seed(1907)
x1 <- rnorm(1000)
x2 <- rnorm(1000)
x3 <- rnorm(1000)
x4 <- rnorm(1000)
x5 <- rnorm(1000)
x6 <- rnorm(1000)
mu    <- exp(1.5 +1 * x1 +0.5 * x2 -0.5 * x3 -1 * x4)
sigma <- exp(-0.4 * x3 -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)

## Fit model
model <- glmboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
                      control = boost_control(mstop = list(mu = 10, sigma = 20), trace = TRUE),
                      center = TRUE)
risk(model)  ## OK
lapply(risk(model), length)  ## OK

## Increase mstop
mstop(model) <- c(20, 30)
risk(model) ## Missing value introduced
lapply(risk(model), length)  ## in principle OK


## No issue when model does not need to be reduced (above to mstop = c(10, 10))
model <- glmboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
                      control = boost_control(mstop = 10, trace = TRUE),
                      center = TRUE)
mstop(model) <- 20
risk(model)

@ja-thomas The above error exists at least in the current implementation in the master branch. Please also check this in the devel branch (or your new branch). Altogether, we need to check all occurences of "risk" and make sure that it works with the new mboost risk. I think it's best if we only do this in the devel branch as the old master branch most likely will not make it to CRAN another time...

@ja-thomas
Copy link
Member

This is already fixed in my branch and works both with the cylical and the noncyclical version. Can be closed as soon as the branch in merged.

@ja-thomas
Copy link
Member

Fixed

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