Running ‘bugfixes.R’ [6s/8s]
  Comparing ‘bugfixes.Rout’ to ‘bugfixes.Rout.save’ ... OK
  Running ‘regtest-MIA.R’ [2s/3s]
  Comparing ‘regtest-MIA.Rout’ to ‘regtest-MIA.Rout.save’ ... OK
  Running ‘regtest-cforest.R’ [11s/14s]
  Comparing ‘regtest-cforest.Rout’ to ‘regtest-cforest.Rout.save’ ... OK
  Running ‘regtest-ctree.R’ [2s/3s]
  Comparing ‘regtest-ctree.Rout’ to ‘regtest-ctree.Rout.save’ ... OK
  Running ‘regtest-glmtree.R’ [12s/15s]
Running the tests in ‘tests/regtest-glmtree.R’ failed.
Complete output:
  > 
  > library("partykit")
  Loading required package: grid
  Loading required package: libcoin
  Loading required package: mvtnorm
  Loading required package: rpart
  > library("sandwich")
  > 
  > set.seed(29)
  > n <- 1000
  > x <- runif(n)
  > z <- runif(n)
  > y <- rnorm(n, mean = x * c(-1, 1)[(z > 0.7) + 1], sd = 3)
  > z_noise <- factor(sample(1:3, size = n, replace = TRUE))
  > d <- data.frame(y = y, x = x, z = z, z_noise = z_noise)
  > 
  > 
  > fmla <- as.formula("y ~ x | z + z_noise")
  > fmly <- gaussian()
  > fit <- partykit:::glmfit
  > 
  > # versions of the data
  > d1 <- d
  > d1$z <- signif(d1$z, digits = 1)
  > 
  > k <- 20
  > zs_noise <- matrix(rnorm(n*k), nrow = n)
  > colnames(zs_noise) <- paste0("z_noise_", 1:k)
  > d2 <- cbind(d, zs_noise)
  > fmla2 <- as.formula(paste("y ~ x | z + z_noise +",
  +                           paste0("z_noise_", 1:k, collapse = " + ")))
  > 
  > 
  > d3 <- d2
  > d3$z <- factor(sample(1:3, size = n, replace = TRUE, prob = c(0.1, 0.5, 0.4)))
  > d3$y <- rnorm(n, mean = x * c(-1, 1)[(d3$z == 2) + 1], sd = 3)
  > 
  > ## check weights
  > w <- rep(1, n)
  > w[1:10] <- 2
  > (mw1 <- glmtree(formula = fmla, data = d, weights = w))
  Generalized linear model tree (family: gaussian)
  
  Model formula:
  y ~ x | z + z_noise
  
  Fitted party:
  [1] root
  |   [2] z <= 0.70311: n = 706
  |       (Intercept)           x 
  |        -0.1447422  -0.8138701 
  |   [3] z > 0.70311: n = 304
  |       (Intercept)           x 
  |        0.07006626  0.73278593 
  
  Number of inner nodes:    1
  Number of terminal nodes: 2
  Number of parameters per node: 2
  Objective function (negative log-likelihood): 2551.48
  > (mw2 <- glmtree(formula = fmla, data = d, weights = w, caseweights = FALSE))
  Generalized linear model tree (family: gaussian)
  
  Model formula:
  y ~ x | z + z_noise
  
  Fitted party:
  [1] root
  |   [2] z <= 0.70311: n = 704
  |       (Intercept)           x 
  |        -0.1447422  -0.8138701 
  |   [3] z > 0.70311: n = 296
  |       (Intercept)           x 
  |        0.07006626  0.73278593 
  
  Number of inner nodes:    1
  Number of terminal nodes: 2
  Number of parameters per node: 2
  Objective function (negative log-likelihood): 2551.48
  > 
  > 
  > 
  > ## check dfsplit
  > (mmfluc2 <- mob(formula = fmla, data = d, fit = partykit:::glmfit))
  Model-based recursive partitioning (partykit:::glmfit)
  
  Model formula:
  y ~ x | z + z_noise
  
  Fitted party:
  [1] root
  |   [2] z <= 0.70311: n = 704
  |       (Intercept)           x 
  |        -0.1619978  -0.7896293 
  |   [3] z > 0.70311: n = 296
  |       (Intercept)           x 
  |        0.08683535  0.65598287 
  
  Number of inner nodes:    1
  Number of terminal nodes: 2
  Number of parameters per node: 2
  Objective function: 2551.673
  > (mmfluc3 <- glmtree(formula = fmla, data = d))
  Generalized linear model tree (family: gaussian)
  
  Model formula:
  y ~ x | z + z_noise
  
  Fitted party:
  [1] root
  |   [2] z <= 0.70311: n = 704
  |       (Intercept)           x 
  |        -0.1619978  -0.7896293 
  |   [3] z > 0.70311: n = 296
  |       (Intercept)           x 
  |        0.08683535  0.65598287 
  
  Number of inner nodes:    1
  Number of terminal nodes: 2
  Number of parameters per node: 2
  Objective function (negative log-likelihood): 2551.673
  > (mmfluc3_dfsplit <- glmtree(formula = fmla, data = d, dfsplit = 10))
  Generalized linear model tree (family: gaussian)
  
  Model formula:
  y ~ x | z + z_noise
  
  Fitted party:
  [1] root
  |   [2] z <= 0.70311: n = 704
  |       (Intercept)           x 
  |        -0.1619978  -0.7896293 
  |   [3] z > 0.70311: n = 296
  |       (Intercept)           x 
  |        0.08683535  0.65598287 
  
  Number of inner nodes:    1
  Number of terminal nodes: 2
  Number of parameters per node: 2
  Objective function (negative log-likelihood): 2551.673
  > 
  > 
  > ## check tests
  > library("strucchange")
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  > sctest(mmfluc3, node = 1) # does not yet work
  Error in UseMethod("estfun") : 
    no applicable method for 'estfun' applied to an object of class "c('glmtree', 'modelparty', 'party')"
  Calls: sctest -> sctest.default -> gefp -> scores
  Execution halted