Running ‘bugfixes.R’ [3s/6s]
  Running ‘regtest-families.R’ [7s/10s]
  Running ‘regtest-gamboostLSS.R’ [6s/9s]
  Running ‘regtest-glmboostLSS.R’ [5s/8s]
  Running ‘regtest-mstop.R’ [3s/5s]
  Running ‘regtest-noncyclic_fitting.R’ [11s/14s]
  Running ‘regtest-stabilization.R’ [23s/34s]
  Running ‘regtest-stabsel.R’ [8s/9s]
Running the tests in ‘tests/regtest-noncyclic_fitting.R’ failed.
Complete output:
  > require("gamboostLSS")
  Loading required package: gamboostLSS
  Loading required package: mboost
  Loading required package: parallel
  Loading required package: stabs
  This is mboost 2.9-3. See 'package?mboost' and 'news(package  = "mboost")'
  for a complete list of changes.
  
  
  Attaching package: 'gamboostLSS'
  
  The following object is masked from 'package:stats':
  
      model.weights
  
  > 
  > ###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)
  > 
  > #fit models at number of params + 1
  > 
  > #glmboost
  > model <- glmboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
  +                      control = boost_control(mstop = 3), method = "noncyclic")
  > 
  > #linear baselearner with bols
  > model <- gamboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
  +                      control = boost_control(mstop = 3), method = "noncyclic",
  +                      baselearner = "bols")
  > 
  > #nonlinear bbs baselearner
  > 
  > model <- gamboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
  +                      control = boost_control(mstop = 3), method = "noncyclic",
  +                      baselearner = "bbs")
  > 
  > #reducing model and increasing it afterwards should yield the same fit
  > 
  > model <- glmboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
  +                      control = boost_control(mstop = 50), method = "noncyclic")
  > 
  > m_co <- coef(model)
  > 
  > mstop(model) <- 5
  > mstop(model) <- 50
  > 
  > stopifnot(all.equal(m_co, coef(model)))
  > 
  > 
  > model <- gamboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
  +                      control = boost_control(mstop = 50), method = "noncyclic",
  +                      baselearner = "bols")
  > 
  > m_co <- coef(model)
  > 
  > mstop(model) <- 5
  > mstop(model) <- 50
  > 
  > stopifnot(all.equal(m_co, coef(model)))
  > 
  > 
  > model <- gamboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
  +                      control = boost_control(mstop = 50), method = "noncyclic",
  +                      baselearner = "bbs")
  > 
  > m_co <- coef(model)
  > 
  > mstop(model) <- 5
  > mstop(model) <- 50
  > 
  > stopifnot(all.equal(m_co, coef(model)))
  > 
  > 
  > model <- gamboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
  +                      control = boost_control(mstop = 50), method = "noncyclic",
  +                      baselearner = "bbs")
  > 
  > m_co <- coef(model)
  > 
  > mstop(model) <- 5
  > mstop(model) <- 50
  > 
  > stopifnot(all.equal(m_co, coef(model)))
  > 
  > ## check cvrisk for noncyclic models
  > model <- glmboostLSS(y ~ ., families = NBinomialLSS(), data = dat,
  +                      control = boost_control(mstop = 3), method = "noncyclic")
  > cvr1 <- cvrisk(model, grid = 1:50, cv(model.weights(model), B = 5))
  Starting cross-validation...
  [Fold: 2]
  
  [Fold: 1]
  [  1] ....[  1] .................................................... -- risk: 1734.54 
  .[ 41] ................
  Final risk: 1732.471 
  ...
  [Fold: 3]
  .......[  1] .......... -- risk: 1805.447 
  [ 41] .............
  Final risk: 1799.837 
  ....
  [Fold: 4]
  ...............[  1] ................. -- risk: 1836.44 
  .[ 41] ...............
  Final risk: 1830.995 
  ....
  [Fold: 5]
  ......[  1] ..................................................... -- risk: 1644.972 
  .....[ 41] .. -- risk: 1748.201 
  ....[ 41] ............
  Final risk: 1643.654 
  .
  Final risk: 1745.054 
  > cvr1
  
  	 Cross-validated 
  	 glmboostLSS(formula = y ~ ., data = dat, families = NBinomialLSS(),      control = boost_control(mstop = 3), method = "noncyclic") 
  
         1        2        3        4        5        6        7        8 
  4.857889 4.857889 4.854336 4.851760 4.848367 4.845487 4.843456 4.840692 
         9       10       11       12       13       14       15       16 
  4.837335 4.835769 4.833281 4.831312 4.829041 4.827176 4.824955 4.822376 
        17       18       19       20       21       22       23       24 
  4.820667 4.819740 4.817552 4.816011 4.813472 4.812703 4.810620 4.809356 
        25       26       27       28       29       30       31       32 
  4.807388 4.806713 4.804566 4.803307 4.801508 4.800541 4.799011 4.798048 
        33       34       35       36       37       38       39       40 
  4.796181 4.795305 4.793928 4.793380 4.791924 4.790579 4.789696 4.788866 
        41       42       43       44       45       46       47       48 
  4.787808 4.786352 4.785354 4.784043 4.783679 4.782704 4.781571 4.780256 
        49       50 
  4.779861 4.778943 
  
  	 Optimal number of boosting iterations: 50 
  > plot(cvr1)
  > 
  > risk(model, merge = TRUE)
        mu    sigma    sigma    sigma       mu 
  4755.327 4755.327 4752.028 4749.214 4746.600 
  > risk(model, merge = FALSE)
  $mu
  [1] 4755.327 4746.600
  
  $sigma
  [1] 4755.327 4752.028 4749.214
  
  attr(,"class")
  [1] "inbag"
  > 
  > 
  > ## test that mstop = 0 is possible
  > compare_models <- function (m1, m2) {
  +   stopifnot(all.equal(coef(m1), coef(m2)))
  +   stopifnot(all.equal(predict(m1), predict(m2)))
  +   stopifnot(all.equal(fitted(m1), fitted(m2)))
  +   stopifnot(all.equal(selected(m1), selected(m2)))
  +   stopifnot(all.equal(risk(m1), risk(m2)))
  +   ## remove obvious differences from objects
  +   m1$control <- m2$control <- NULL
  +   m1$call <- m2$call <- NULL
  +   if (!all.equal(m1, m2))
  +     stop("Objects of offset model + 1 step and model with 1 step not identical")
  +   invisible(NULL)
  + }
  > 
  > # set up models
  > mod <- glmboostLSS(y ~ ., data = dat, method = "noncyclic", control = boost_control(mstop = 0))
  > mod2 <- glmboostLSS(y ~ ., data = dat, method = "noncyclic",  control = boost_control(mstop = 1))
  > mod3 <- glmboostLSS(y ~ ., data = dat, method = "noncyclic", control = boost_control(mstop = 1))
  > 
  > lapply(coef(mod), function(x) stopifnot(is.null(x)))
  $mu
  NULL
  
  $sigma
  NULL
  
  > 
  > mstop(mod3) <- 0
  > mapply(compare_models, m1 = mod, m2 = mod3)
  Error in !all.equal(m1, m2) : invalid argument type
  Calls: mapply -> <Anonymous>
  Execution halted