Running 'Distributions.R' [2s]
  Comparing 'Distributions.Rout' to 'Distributions.Rout.save' ... OK
  Running 'LinearStatistic-regtest.R' [169s]
  Running 'Predict-regtest.R' [3s]
  Comparing 'Predict-regtest.Rout' to 'Predict-regtest.Rout.save' ... OK
  Running 'RandomForest-regtest.R' [4s]
  Comparing 'RandomForest-regtest.Rout' to 'RandomForest-regtest.Rout.save' ... OK
  Running 'TestStatistic-regtest.R' [2s]
  Comparing 'TestStatistic-regtest.Rout' to 'TestStatistic-regtest.Rout.save' ... OK
  Running 'TreeGrow-regtest.R' [155s]
  Running 'Utils-regtest.R' [2s]
  Comparing 'Utils-regtest.Rout' to 'Utils-regtest.Rout.save' ... OK
  Running 'bugfixes.R' [167s]
  Running 'mob.R' [159s]
Running the tests in 'tests/LinearStatistic-regtest.R' failed.
Complete output:
  > 
  > set.seed(290875)
  > library("party")
  Loading required package: grid
  Loading required package: mvtnorm
  Loading required package: modeltools
  Loading required package: stats4
  Loading required package: strucchange
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  Loading required package: sandwich
  > 
  > ### get rid of the NAMESPACE
  > attach(list2env(as.list(asNamespace("party"))))
  The following objects are masked from package:party:
  
      cforest, cforest_classical, cforest_control, cforest_unbiased,
      conditionalTree, ctree, ctree_control, edge_simple,
      initVariableFrame, mob, mob_control, node_barplot, node_bivplot,
      node_boxplot, node_density, node_hist, node_inner,
      node_scatterplot, node_surv, node_terminal, nodes, party_intern,
      prettytree, proximity, ptrafo, response, reweight, sctest.mob,
      treeresponse, varimp, varimpAUC, where
  
  > 
  > ### 
  > ###
  > ###    Regression tests for linear statistics, expectations and covariances
  > ###    
  > ###    functions defined in file `./src/LinearStatistics.c'    
  > 
  > ### tests for function C_LinearStatistic
  > ### Linear Statistics
  > x = matrix(c(rep.int(1,4), rep.int(0,6)), ncol = 1)
  > y = matrix(1:10, ncol = 1)
  > weights = rep(1, 10)
  > linstat = LinearStatistic(x, y, weights)
  > stopifnot(isequal(linstat, sum(1:4)))
  > 
  > weights[1] = 0
  > linstat = LinearStatistic(x, y, weights) 
  > stopifnot(isequal(linstat, sum(2:4)))
  > 
  > xf <- gl(3, 10)
  > yf <- gl(3, 10)[sample(1:30)]
  > x <- sapply(levels(xf), function(l) as.numeric(xf == l))
  > colnames(x) <- NULL
  > y <- sapply(levels(yf), function(l) as.numeric(yf == l))
  > colnames(y) <- NULL
  > weights <- sample(1:30)
  > linstat <- LinearStatistic(x, y, weights) 
  > stopifnot(isequal(linstat, as.vector(t(x) %*% diag(weights) %*% y)))
  > 
  > xf <- factor(cut(rnorm(6000), breaks = c(-Inf, -2, 0.5, Inf)))
  > x <- sapply(levels(xf), function(l) as.numeric(xf == l))
  > yf <- factor(cut(rnorm(6000), breaks = c(-Inf, -0.5, 1.5, Inf)))
  > y <- sapply(levels(yf), function(l) as.numeric(yf == l))
  > weights <- rep(1, nrow(x))
  > colnames(x) <- NULL
  > colnames(y) <- NULL
  > weights <- rep(1, 6000)
  > linstat <- LinearStatistic(x, y, weights)
  > stopifnot(isequal(as.vector(table(xf, yf)), linstat))
  > stopifnot(isequal(as.vector(t(x)%*%y), linstat))
  > 
  > 
  > ### tests for function C_ExpectCovarInfluence
  > eci <- ExpectCovarInfluence(y, weights)
  > isequal(eci@sumweights, sum(weights))
  [1] TRUE
  > isequal(eci@expectation, drop(weights %*% y / sum(weights)))
  [1] TRUE
  > ys <- t(t(y) - eci@expectation)
  > stopifnot(isequal(eci@covariance, (t(ys) %*% (weights * ys)) /
  +                   sum(weights)))
  > 
  > ### tests for function C_ExpectCovarLinearStatistic
  > ### Conditional Expectation and Variance (via Kruskal-Wallis statistic)
  > 
  > ### case 1: p > 1, q = 1
  > group <- gl(3, 5)
  > x <- sapply(levels(group), function(l) as.numeric(group == l))
  > y <- matrix(1:15, ncol = 1)
  > weights <- rep(1, 15)
  > 
  > linstat <- LinearStatistic(x, y, weights)
  > expcov <- ExpectCovarLinearStatistic(x, y, weights)
  > KW <- quadformTestStatistic(linstat, expcov@expectation, expcov@covariance)
  > kts <- kruskal.test(y ~ group)$statistic
  > stopifnot(isequal(KW, kts))
  > 
  > ### case 2: p = 1, q > 1
  > linstat <- LinearStatistic(y, x, weights)
  > expcov <- ExpectCovarLinearStatistic(y, x, weights)
  > KW <- quadformTestStatistic(linstat, expcov@expectation, expcov@covariance)
  > kts <- kruskal.test(y ~ group)$statistic
  > stopifnot(isequal(KW, kts))
  > 
  > ### case 3: p = 1, q = 1
  > x <- x[,1,drop = FALSE]
  > linstat <- LinearStatistic(x, y, weights)
  > expcov <- ExpectCovarLinearStatistic(x, y, weights)
  > KW <- quadformTestStatistic(linstat, expcov@expectation, expcov@covariance)
  > kts <- kruskal.test(y ~ as.factor(x))$statistic
  > stopifnot(isequal(KW, kts))
  > 
  > ### case 4: p > 1, q > 1 via chisq.test
  > n <- 900
  > xf <- gl(3, n / 3)
  > yf <- gl(3, n / 3)[sample(1:n)]
  > x <- sapply(levels(xf), function(l) as.numeric(xf == l))
  > colnames(x) <- NULL
  > y <- sapply(levels(yf), function(l) as.numeric(yf == l))
  > colnames(y) <- NULL
  > weights <- rep(1, n)
  > linstat <- LinearStatistic(x, y, weights)
  > expcov <- ExpectCovarLinearStatistic(x, y, weights)
  > chi <- quadformTestStatistic(linstat, expcov@expectation, expcov@covariance)
  > chis <- chisq.test(table(xf, yf))$statistic
  > stopifnot(isequal(round(chi, 1), round(chis, 1)))
  > 
  > ### tests for function C_PermutedLinearStatistic
  > ### Linear Statistics with permuted indices
  > x <- matrix(rnorm(100), ncol = 2)
  > y <- matrix(rnorm(100), ncol = 2)
  > weights <- rep(1, 50)
  > indx <- 1:50
  > perm <- 1:50
  > stopifnot(isequal(LinearStatistic(x, y, weights), 
  +                   PermutedLinearStatistic(x, y, indx, perm)))
  > x <- matrix(1:10000, ncol = 2)
  > y <- matrix(1:10000, ncol = 2)
  > 
  > for (i in 1:100) {
  +   indx <- sample(1:ncol(y), replace = TRUE)
  +   perm <- sample(1:ncol(y), replace = TRUE)
  + 
  +   stopifnot(isequal(as.vector(t(x[indx,]) %*% y[perm, ]),
  +                     PermutedLinearStatistic(x, y, indx, perm)))
  + }
  > 
  > proc.time()
     user  system elapsed 
     1.71    0.25    1.96 
Running the tests in 'tests/TreeGrow-regtest.R' failed.
Complete output:
  > 
  > set.seed(290875)
  > library("party")
  Loading required package: grid
  Loading required package: mvtnorm
  Loading required package: modeltools
  Loading required package: stats4
  Loading required package: strucchange
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  Loading required package: sandwich
  > if (!require("TH.data"))
  +     stop("cannot load package TH.data")
  Loading required package: TH.data
  Loading required package: survival
  Loading required package: MASS
  
  Attaching package: 'TH.data'
  
  The following object is masked from 'package:MASS':
  
      geyser
  
  > if (!require("coin"))
  +     stop("cannot load package coin")
  Loading required package: coin
  > 
  > ### get rid of the NAMESPACE
  > attach(list2env(as.list(asNamespace("party"))))
  The following objects are masked from package:party:
  
      cforest, cforest_classical, cforest_control, cforest_unbiased,
      conditionalTree, ctree, ctree_control, edge_simple,
      initVariableFrame, mob, mob_control, node_barplot, node_bivplot,
      node_boxplot, node_density, node_hist, node_inner,
      node_scatterplot, node_surv, node_terminal, nodes, party_intern,
      prettytree, proximity, ptrafo, response, reweight, sctest.mob,
      treeresponse, varimp, varimpAUC, where
  
  > 
  > gtctrl <- new("GlobalTestControl")
  > tlev <- levels(gtctrl@testtype)
  > 
  > data(GlaucomaM, package = "TH.data")
  > gtree <- ctree(Class ~ ., data = GlaucomaM)
  > tree <- gtree@tree
  > stopifnot(isequal(tree[[5]][[3]], 0.059))
  > predict(gtree)
    [1] normal   normal   normal   normal   normal   normal   normal   normal  
    [9] normal   normal   normal   glaucoma normal   normal   normal   normal  
   [17] normal   normal   normal   normal   normal   normal   normal   normal  
   [25] normal   normal   normal   normal   normal   normal   normal   normal  
   [33] normal   normal   glaucoma normal   normal   normal   normal   normal  
   [41] normal   normal   glaucoma normal   normal   normal   normal   normal  
   [49] normal   normal   normal   normal   normal   normal   normal   normal  
   [57] normal   normal   normal   normal   normal   normal   normal   normal  
   [65] normal   normal   normal   normal   normal   glaucoma normal   normal  
   [73] normal   normal   normal   normal   normal   normal   normal   normal  
   [81] glaucoma normal   normal   normal   normal   normal   normal   normal  
   [89] normal   normal   normal   normal   normal   normal   normal   normal  
   [97] normal   normal   glaucoma glaucoma glaucoma glaucoma normal   normal  
  [105] normal   normal   normal   glaucoma glaucoma normal   glaucoma glaucoma
  [113] glaucoma glaucoma glaucoma glaucoma glaucoma normal   normal   glaucoma
  [121] glaucoma glaucoma glaucoma glaucoma glaucoma glaucoma normal   glaucoma
  [129] normal   glaucoma normal   glaucoma glaucoma glaucoma glaucoma glaucoma
  [137] glaucoma glaucoma glaucoma glaucoma glaucoma glaucoma glaucoma glaucoma
  [145] glaucoma glaucoma normal   glaucoma glaucoma glaucoma glaucoma normal  
  [153] glaucoma glaucoma glaucoma glaucoma normal   glaucoma glaucoma glaucoma
  [161] glaucoma glaucoma normal   normal   glaucoma glaucoma normal   glaucoma
  [169] glaucoma glaucoma glaucoma glaucoma normal   glaucoma glaucoma glaucoma
  [177] normal   glaucoma normal   glaucoma glaucoma glaucoma normal   glaucoma
  [185] glaucoma glaucoma normal   glaucoma glaucoma normal   glaucoma normal  
  [193] glaucoma glaucoma glaucoma glaucoma
  Levels: glaucoma normal
  > 
  > # print(tree)
  > 
  > stump <- ctree(Class ~ ., data = GlaucomaM, 
  +                control = ctree_control(stump = TRUE))
  > print(stump)
  
  	 Conditional inference tree with 2 terminal nodes
  
  Response:  Class 
  Inputs:  ag, at, as, an, ai, eag, eat, eas, ean, eai, abrg, abrt, abrs, abrn, abri, hic, mhcg, mhct, mhcs, mhcn, mhci, phcg, phct, phcs, phcn, phci, hvc, vbsg, vbst, vbss, vbsn, vbsi, vasg, vast, vass, vasn, vasi, vbrg, vbrt, vbrs, vbrn, vbri, varg, vart, vars, varn, vari, mdg, mdt, mds, mdn, mdi, tmg, tmt, tms, tmn, tmi, mr, rnf, mdic, emd, mv 
  Number of observations:  196 
  
  1) vari <= 0.059; criterion = 1, statistic = 71.475
    2)*  weights = 87 
  1) vari > 0.059
    3)*  weights = 109 
  > 
  > data(treepipit, package = "coin")
  > 
  > tr <- ctree(counts ~ ., data = treepipit)
  > tr
  
  	 Conditional inference tree with 2 terminal nodes
  
  Response:  counts 
  Inputs:  age, coverstorey, coverregen, meanregen, coniferous, deadtree, cbpiles, ivytree, fdist 
  Number of observations:  86 
  
  1) coverstorey <= 40; criterion = 0.998, statistic = 13.678
    2)*  weights = 24 
  1) coverstorey > 40
    3)*  weights = 62 
  > plot(tr)
  > 
  > 
  > data(GlaucomaM, package = "TH.data")
  > 
  > tr <- ctree(Class ~ ., data = GlaucomaM)
  > tr
  
  	 Conditional inference tree with 4 terminal nodes
  
  Response:  Class 
  Inputs:  ag, at, as, an, ai, eag, eat, eas, ean, eai, abrg, abrt, abrs, abrn, abri, hic, mhcg, mhct, mhcs, mhcn, mhci, phcg, phct, phcs, phcn, phci, hvc, vbsg, vbst, vbss, vbsn, vbsi, vasg, vast, vass, vasn, vasi, vbrg, vbrt, vbrs, vbrn, vbri, varg, vart, vars, varn, vari, mdg, mdt, mds, mdn, mdi, tmg, tmt, tms, tmn, tmi, mr, rnf, mdic, emd, mv 
  Number of observations:  196 
  
  1) vari <= 0.059; criterion = 1, statistic = 71.475
    2) vasg <= 0.066; criterion = 1, statistic = 29.265
      3)*  weights = 79 
    2) vasg > 0.066
      4)*  weights = 8 
  1) vari > 0.059
    5) tms <= -0.066; criterion = 0.951, statistic = 11.221
      6)*  weights = 65 
    5) tms > -0.066
      7)*  weights = 44 
  > plot(tr)
  > 
  > data(GBSG2, package = "TH.data")  
  > 
  > GBSG2tree <- ctree(Surv(time, cens) ~ ., data = GBSG2)
  > GBSG2tree
  
  	 Conditional inference tree with 4 terminal nodes
  
  Response:  Surv(time, cens) 
  Inputs:  horTh, age, menostat, tsize, tgrade, pnodes, progrec, estrec 
  Number of observations:  686 
  
  1) pnodes <= 3; criterion = 1, statistic = 56.156
    2) horTh == {yes}; criterion = 0.965, statistic = 8.113
      3)*  weights = 128 
    2) horTh == {no}
      4)*  weights = 248 
  1) pnodes > 3
    5) progrec <= 20; criterion = 0.999, statistic = 14.941
      6)*  weights = 144 
    5) progrec > 20
      7)*  weights = 166 
  > plot(GBSG2tree)
  > plot(GBSG2tree, terminal_panel = node_surv(GBSG2tree))
  > survfit(Surv(time, cens) ~ as.factor(GBSG2tree@where), data = GBSG2)
  Call: survfit(formula = Surv(time, cens) ~ as.factor(GBSG2tree@where), 
      data = GBSG2)
  
                                 n events median 0.95LCL 0.95UCL
  as.factor(GBSG2tree@where)=3 128     31     NA    2372      NA
  as.factor(GBSG2tree@where)=4 248     88   2093    1814      NA
  as.factor(GBSG2tree@where)=6 144    103    624     525     797
  as.factor(GBSG2tree@where)=7 166     77   1701    1174    2018
  > names(GBSG2)
   [1] "horTh"    "age"      "menostat" "tsize"    "tgrade"   "pnodes"  
   [7] "progrec"  "estrec"   "time"     "cens"    
  > 
  > tr <- ctree(Surv(time, cens) ~ ., data = GBSG2, 
  +             control = ctree_control(teststat = "max", 
  +                                     testtype = "Univariate"))
  There were 18 warnings (use warnings() to see them)
  > tr
  
  	 Conditional inference tree with 10 terminal nodes
  
  Response:  Surv(time, cens) 
  Inputs:  horTh, age, menostat, tsize, tgrade, pnodes, progrec, estrec 
  Number of observations:  686 
  
  1) pnodes <= 3; criterion = 1, statistic = 7.494
    2) horTh == {yes}; criterion = 0.996, statistic = 2.848
      3) progrec <= 74; criterion = 0.975, statistic = 2.241
        4)*  weights = 73 
      3) progrec > 74
        5)*  weights = 55 
    2) horTh == {no}
      6) menostat == {Pre}; criterion = 0.978, statistic = 2.286
        7) age <= 37; criterion = 1, statistic = 3.858
          8)*  weights = 21 
        7) age > 37
          9)*  weights = 115 
      6) menostat == {Post}
        10)*  weights = 112 
  1) pnodes > 3
    11) progrec <= 20; criterion = 1, statistic = 3.865
      12) pnodes <= 9; criterion = 0.991, statistic = 2.612
        13)*  weights = 87 
      12) pnodes > 9
        14)*  weights = 57 
    11) progrec > 20
      15) horTh == {yes}; criterion = 0.976, statistic = 2.251
        16) menostat == {Pre}; criterion = 0.965, statistic = 2.105
          17)*  weights = 20 
        16) menostat == {Post}
          18)*  weights = 45 
      15) horTh == {no}
        19)*  weights = 101 
  > plot(tr)
  > 
  > data("mammoexp", package = "TH.data")
  > attr(mammoexp$ME, "scores") <- 1:3   
  > attr(mammoexp$SYMPT, "scores") <- 1:4
  > attr(mammoexp$DECT, "scores") <- 1:3 
  > names(mammoexp)[names(mammoexp) == "SYMPT"] <- "symptoms"
  > names(mammoexp)[names(mammoexp) == "PB"] <- "benefit"
  > 
  > names(mammoexp)
  [1] "ME"       "symptoms" "benefit"  "HIST"     "BSE"      "DECT"    
  > tr <- ctree(ME ~ ., data = mammoexp)
  > tr
  
  	 Conditional inference tree with 3 terminal nodes
  
  Response:  ME 
  Inputs:  symptoms, benefit, HIST, BSE, DECT 
  Number of observations:  412 
  
  1) symptoms <= Agree; criterion = 1, statistic = 29.933
    2)*  weights = 113 
  1) symptoms > Agree
    3) benefit <= 8; criterion = 0.988, statistic = 9.17
      4)*  weights = 208 
    3) benefit > 8
      5)*  weights = 91 
  > plot(tr)
  > 
  > treeresponse(tr, newdata = mammoexp[1:5,])
  [[1]]
  [1] 0.3990385 0.3798077 0.2211538
  
  [[2]]
  [1] 0.84070796 0.05309735 0.10619469
  
  [[3]]
  [1] 0.3990385 0.3798077 0.2211538
  
  [[4]]
  [1] 0.6153846 0.2087912 0.1758242
  
  [[5]]
  [1] 0.3990385 0.3798077 0.2211538
  
  > 
  > ### check different user interfaces
  > data("iris")
  > x <- as.matrix(iris[,colnames(iris) != "Species"])
  > y <- iris[,"Species"]
  > newx <- x
  > 
  > ls <- LearningSample(x, y)
  > p1 <- unlist(treeresponse(ctree(Species ~ ., data = iris), newdata = as.data.frame(newx)))
  > p2 <- unlist(treeresponse(ctreefit(ls, control = ctree_control()), newdata = as.matrix(newx)))
  > stopifnot(identical(max(abs(p1 - p2)), 0))
  > 
  > set.seed(29)
  > p1 <- unlist(treeresponse(cforestfit(ls, control = cforest_unbiased(mtry = 1)), newdata = as.matrix(newx)))
  > set.seed(29)
  > p2 <- unlist(treeresponse(cforest(Species ~ ., data = iris, control = cforest_unbiased(mtry = 1)), 
  +              newdata = as.data.frame(newx)))
  > stopifnot(identical(max(abs(p1 - p2)), 0))
  > 
  > proc.time()
     user  system elapsed 
     3.35    0.29    3.64 
Running the tests in 'tests/bugfixes.R' failed.
Complete output:
  > 
  > RNGversion("3.5.2")
  Warning message:
  In RNGkind("Mersenne-Twister", "Inversion", "Rounding") :
    non-uniform 'Rounding' sampler used
  > set.seed(290875)
  > library("party")
  Loading required package: grid
  Loading required package: mvtnorm
  Loading required package: modeltools
  Loading required package: stats4
  Loading required package: strucchange
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  Loading required package: sandwich
  > library("survival")
  > 
  > ### get rid of the NAMESPACE
  > attach(list2env(as.list(asNamespace("party"))))
  The following objects are masked from package:party:
  
      cforest, cforest_classical, cforest_control, cforest_unbiased,
      conditionalTree, ctree, ctree_control, edge_simple,
      initVariableFrame, mob, mob_control, node_barplot, node_bivplot,
      node_boxplot, node_density, node_hist, node_inner,
      node_scatterplot, node_surv, node_terminal, nodes, party_intern,
      prettytree, proximity, ptrafo, response, reweight, sctest.mob,
      treeresponse, varimp, varimpAUC, where
  
  > 
  > ### check nominal level printing
  > set.seed(290875)
  > x <- gl(5, 50)
  > df <- data.frame(y = c(rnorm(50, 0), rnorm(50, 1), rnorm(50, 2), rnorm(50, 3), rnorm(50, 4)), 
  +                  x = x, z = rnorm(250))
  > ctree(y ~ x, data = df)
  
  	 Conditional inference tree with 5 terminal nodes
  
  Response:  y 
  Input:  x 
  Number of observations:  250 
  
  1) x == {3, 4, 5}; criterion = 1, statistic = 159.215
    2) x == {4, 5}; criterion = 1, statistic = 54.696
      3) x == {5}; criterion = 1, statistic = 16.711
        4)*  weights = 50 
      3) x == {4}
        5)*  weights = 50 
    2) x == {3}
      6)*  weights = 50 
  1) x == {1, 2}
    7) x == {2}; criterion = 1, statistic = 21.738
      8)*  weights = 50 
    7) x == {1}
      9)*  weights = 50 
  > 
  > ### check asymptotic vs. MonteCarlo, especially categorical splits after
  > ### MonteCarlo resampling
  > a <- ctree(y ~ x + z, data = df, control = ctree_control(stump = TRUE))
  > b <- ctree(y ~ x + z, data = df,
  +            control =  ctree_control(testtype = "Monte", stump = TRUE))
  > stopifnot(isequal(a@tree$psplit, b@tree$psplit))  
  > stopifnot(isequal(a@tree$criterion$statistic, b@tree$criterion$statistic))
  > 
  > ### we did not check the hyper parameters
  > try(cforest_control(minsplit = -1))
  Error in validObject(object@splitctrl) : 
    invalid class "SplitControl" object: FALSE
  In addition: Warning message:
  In validityMethod(object) :
    no negative values allowed in objects of class 'SplitControl'
  > try(cforest_control(ntree = -1))
  Error in validObject(RET) : invalid class "ForestControl" object: FALSE
  In addition: Warning message:
  In validityMethod(object) : 'ntree' must be equal or greater 1
  > try(cforest_control(maxdepth = -1))
  Error in validObject(object@tgctrl) : 
    invalid class "TreeGrowControl" object: FALSE
  In addition: Warning message:
  In validityMethod(object) : 'maxdepth' must be positive
  > try(cforest_control(nresample = 10))
  Error in validObject(object@gtctrl) : 
    invalid class "GlobalTestControl" object: FALSE
  In addition: Warning message:
  In validityMethod(object) : 'nresample' must be larger than 100
  > 
  > ### NA handling for factors and in random forest
  > ### more than one (ordinal) response variable
  > xo <- ordered(x)
  > x[sample(1:length(x), 10)] <- NA
  > cforest(y + xo ~ x + z, data = df, 
  +         control = cforest_unbiased(ntree = 50))
  
  	 Random Forest using Conditional Inference Trees
  
  Number of trees:  50 
  
  Responses: y, xo 
  Inputs:  x, z 
  Number of observations:  250 
  
  There were 50 or more warnings (use warnings() to see the first 50)
  > 
  > ### make sure minsplit is OK in the presence of missing values
  > ### spotted by Han Lee <Han.Lee@GeodeCapital.com>
  > load("t1.RData")
  > tr <- try(ctree(p ~., data = t1))
  > stopifnot(!inherits(tr, "try-error"))
  > 
  > ### make sure number of surrogate splits exceeds number of inputs by 1
  > ### spotted by Henric Nilsson <henric.nilsson@phadia.com>
  > airq <- subset(airquality, !is.na(Ozone))
  > tr <- try(ctree(Ozone ~ Wind, data = airq,
  +           controls = ctree_control(maxsurrogate = 3)))
  Error in model@fit(data, ...) : 
    cannot set up 3 surrogate splits with only 0 ordered input variable(s)
  > stopifnot(inherits(tr, "try-error"))
  > 
  > ### ctree() used only the first of a multivariate response
  > ### spotted by Henric Nilsson <henric.nilsson@phadia.com>
  > airq <- subset(airquality, complete.cases(Ozone, Solar.R))
  > airOzoSol1 <- ctree(Ozone + Solar.R ~ Wind + Temp + Month + Day,
  +                     data = airq)
  > airOzoSol2 <- ctree(Solar.R + Ozone ~ Wind + Temp + Month + Day,
  +                     data = airq)
  > stopifnot(isequal(airOzoSol1@where, airOzoSol2@where))
  > 
  > ### one variable with all values missing
  > dat <- data.frame(y = rnorm(100), x1 = runif(100), x2 = rep(NA, 100))
  > ctree(y ~ x1 + x2, data = dat)
  
  	 Conditional inference tree with 1 terminal nodes
  
  Response:  y 
  Inputs:  x1, x2 
  Number of observations:  100 
  
  1)*  weights = 100 
  > 
  > ### one factor with only one level
  > dat$x2 <- factor(rep(0, 100))
  > try(ctree(y ~ x1 + x2, data = dat))
  
  	 Conditional inference tree with 1 terminal nodes
  
  Response:  y 
  Inputs:  x1, x2 
  Number of observations:  100 
  
  1)*  weights = 100 
  > 
  > ### weights for sampling without replacement for cforest
  > ### spotted by Carolin Strobl <carolin.strol@stat.uni-muenchen.de>
  > airq <- subset(airquality, !is.na(Ozone))
  > cctrl <- cforest_control(replace = FALSE, fraction = 0.5)
  > n <- nrow(airq)
  > w <- double(n)
  > 
  > 
  > if (FALSE) {
  + ### forest objects have weights remove in 0.9-13
  + 
  + ### case weights
  + x <- runif(w)
  + w[x > 0.5] <- 1
  + w[x > 0.9] <- 2
  + 
  + rf <- cforest(Ozone ~ .,data = airq, weights = w, control = cctrl)
  + rfw <- sapply(rf@ensemble, function(x) x[[2]])
  + stopifnot(all(colSums(rfw) == ceiling(sum(w) / 2)))
  + stopifnot(max(abs(rfw[w == 0,])) == 0)
  + 
  + ### real weights
  + w <- runif(n)
  + w[1:10] <- 0
  + rf <- cforest(Ozone ~ .,data = airq, weights = w, control = cctrl)
  + rfw <- sapply(rf@ensemble, function(x) x[[2]])
  + stopifnot(all(colSums(rfw) == ceiling(sum(w > 0) / 2)))
  + stopifnot(max(abs(rfw[w == 0,])) == 0)
  + }
  > 
  > ### cforest with multivariate response
  > df <- data.frame(y1 = rnorm(100), y2 = rnorm(100), x1 = runif(100), x2 = runif(100))
  > df$y1[df$x1 < 0.5] <- df$y1[df$x1 < 0.5] + 1
  > cf <- cforest(y1 + y2 ~ x1 + x2, data = df)
  There were 50 or more warnings (use warnings() to see the first 50)
  > pr <- predict(cf)
  > stopifnot(length(pr) == nrow(df) || lengthl(pr[[1]]) != 2)
  > 
  > ### varimp with ordered response
  > ### spotted by Max Kuhn <Max.Kuhn@pfizer.com>
  > data("mammoexp", package = "TH.data")
  > test <- cforest(ME ~ ., data = mammoexp, control = cforest_unbiased(ntree = 50))
  > stopifnot(sum(abs(varimp(test))) > 0)
  > 
  > ### missing values in factors lead to segfaults on 64 bit systems
  > ### spotted by Carolin Strobl <carolin.strobl@lme.de>
  > y <- rnorm(100)
  > x <- gl(2, 50)
  > z <- gl(2, 50)[sample(1:100)]
  > y <- y + (x == "1") * 3
  > xNA <- x
  > xNA[1:2] <- NA
  > ctree(y ~ xNA )
  
  	 Conditional inference tree with 2 terminal nodes
  
  Response:  y 
  Input:  xNA 
  Number of observations:  100 
  
  1) xNA == {1}; criterion = 1, statistic = 72.566
    2)*  weights = 48 
  1) xNA == {2}
    3)*  weights = 52 
  > 
  > 
  > y <- rnorm(100)
  > x <- y + rnorm(100, sd = 0.1)
  > 
  > tmp <- data.frame(x, y)
  > 
  > x[sample(1:100)[1:10]] <- NA
  > 
  > ct1 <- ctree(y ~ x, data = tmp)
  > ct2 <- ctree(y ~ x, data = tmp[complete.cases(tmp),])
  > w <- as.double(complete.cases(tmp))
  > ct3 <- ctree(y ~ x, data = tmp, weights = w)
  > 
  > xx <- data.frame(x = rnorm(100))
  > t1 <- max(abs(predict(ct2, newdata = xx) - predict(ct3, newdata = xx))) == 0
  > t2 <- nterminal(ct1@tree) == nterminal(ct2@tree)
  > t3 <- nterminal(ct3@tree) == nterminal(ct1@tree)
  > t4 <- all.equal(ct2@tree$psplit, ct1@tree$psplit)
  > stopifnot(t1 && t2 && t3 && t4)
  > 
  > y <- rnorm(100)
  > x <- cut(y, c(-Inf, -1, 0, 1, Inf))
  > 
  > tmp <- data.frame(x, y)
  > 
  > x[sample(1:100)[1:10]] <- NA
  > 
  > ct1 <- ctree(y ~ x, data = tmp)
  > ct2 <- ctree(y ~ x, data = tmp[complete.cases(tmp),])
  > w <- as.double(complete.cases(tmp))
  > ct3 <- ctree(y ~ x, data = tmp, weights = w)
  > 
  > stopifnot(all.equal(ct2@tree$psplit, ct1@tree$psplit))
  > stopifnot(all.equal(ct2@tree$psplit, ct3@tree$psplit))
  > 
  > ### predictions for obs with zero weights
  > ### spotted by Mark Difford <mark_difford@yahoo.co.uk>
  > airq <- subset(airquality, !is.na(Ozone))
  > w <- rep(1, nrow(airq))
  > w[1:5] <- 0
  > 
  > ctw <- ctree(Ozone ~ ., data = airq, weights = w)
  > stopifnot(all.equal(predict(ctw)[1:5], predict(ctw, newdata = airq)[1:5]))
  > rfw <- cforest(Ozone ~ ., data = airq, weights = w)
  > stopifnot(all.equal(predict(rfw)[1:5], predict(rfw, newdata = airq)[1:5]))
  > 
  > ### more surrogate splits than available requested
  > ### spotted by Henric Nilsson <henric.nilsson@sorch.se>
  > airq <- data.frame(airq,
  +                     x1 = factor(ifelse(runif(nrow(airq)) < 0.5, 0, 1)),
  +                     x2 = factor(ifelse(runif(nrow(airq)) < 0.5, 0, 1)),
  +                     x3 = factor(ifelse(runif(nrow(airq)) < 0.5, 0, 1)))
  > 
  > foo <- function(nm) 
  +     ctree(Ozone ~ ., data = airq,
  +           controls = ctree_control(maxsurrogate = nm))
  > foo(4)
  
  	 Conditional inference tree with 6 terminal nodes
  
  Response:  Ozone 
  Inputs:  Solar.R, Wind, Temp, Month, Day, x1, x2, x3 
  Number of observations:  116 
  
  1) Temp <= 82; criterion = 1, statistic = 56.086
    2) Wind <= 6.9; criterion = 0.997, statistic = 12.969
      3)*  weights = 10 
    2) Wind > 6.9
      4) Temp <= 77; criterion = 0.995, statistic = 11.599
        5)*  weights = 48 
      4) Temp > 77
        6)*  weights = 21 
  1) Temp > 82
    7) Wind <= 10.3; criterion = 0.995, statistic = 11.712
      8) x1 == {1}; criterion = 0.961, statistic = 7.877
        9)*  weights = 15 
      8) x1 == {0}
        10)*  weights = 15 
    7) Wind > 10.3
      11)*  weights = 7 
  > try(foo(5))
  Error in model@fit(data, ...) : 
    cannot set up 5 surrogate splits with only 4 ordered input variable(s)
  > try(foo(6))
  Error in model@fit(data, ...) : 
    cannot set up 6 surrogate splits with only 4 ordered input variable(s)
  > 
  > ### variance = 0 due to constant variables
  > ### spotted by Sebastian Wietzke <Sebastian.Wietzke@axa.de>
  > v <- rep(0,20)
  > w <- rep(0,20)
  > x <- 1:20
  > y <- rep(1,20)
  > z <- c(4,5,8,2,6,1,3,6,8,2,5,8,9,3,5,8,9,4,6,8)
  > tmp <- ctree(z ~ v+w+x+y,controls = ctree_control(mincriterion = 0.80,
  +              minsplit = 2, minbucket = 1, testtype = "Univariate", teststat = "quad"))
  > stopifnot(all(tmp@tree$criterion$criterion[c(1,2,4)] == 0))
  > 
  > ### optimal split in last observation lead to selection of suboptimal split
  > data("GlaucomaM", package = "TH.data")
  > tmp <- subset(GlaucomaM, vari <= 0.059)
  > weights <- rep(1.0, nrow(tmp))
  > stopifnot(all.equal(Split(tmp$vasg, tmp$Class, weights, 
  +                     ctree_control()@splitctrl)[[1]], 0.066))
  > 
  > ### model.matrix.survReg was missing from modeltools
  > data("GBSG2", package = "TH.data")
  > nloglik <- function(x) -logLik(x)
  > GBSG2$time <- GBSG2$time/365
  > mobGBSG2 <- mob(Surv(time, cens) ~ horTh + pnodes | progrec + menostat +
  +   estrec + menostat + age + tsize + tgrade, data = GBSG2, model = survReg,
  +   control = mob_control(objfun = nloglik, minsplit = 40))
  > plot(mobGBSG2, terminal = node_scatterplot, tp_args = list(yscale = c(-0.1, 11)))
  > 
  > ### factors were evaluated for surrogate splits
  > data("Ozone", package = "mlbench")
  > Ozone$V2 <- ordered(Ozone$V2)
  > Ozone <- subset(Ozone, !is.na(V4))
  > rf <- cforest(V4 ~ ., data = Ozone, control = cforest_unbiased(maxsurrogate = 7))
  > 
  > ### scores for response
  > ### spotted and fixed by Silke Janitza <janitza@ibe.med.uni-muenchen.de>
  > tmp <- data.frame(y = gl(3, 10, ordered = TRUE), x = gl(3, 10, ordered = TRUE))
  > ct <- ctree(y ~ x, data = tmp, scores = list(y = c(0, 10, 11), x = c(1, 2, 5)))
  > stopifnot(isTRUE(all.equal(ct@responses@scores, list(y = c(0, 10, 11)))))
  > 
  > ### deal with empty levels for teststat = "quad" by
  > ### removing elements of the teststatistic with zero variance  
  > ### reported by Wei-Yin Loh <loh@stat.wisc.edu>
  > tdata <-
  + structure(list(ytrain = structure(c(3L, 7L, 3L, 2L, 1L, 6L, 2L, 
  + 1L, 1L, 2L, 1L, 2L, 3L, 3L, 2L, 1L, 2L, 6L, 2L, 4L, 6L, 1L, 2L, 
  + 3L, 7L, 6L, 4L, 6L, 2L, 2L, 1L, 2L, 6L, 1L, 7L, 1L, 3L, 6L, 2L, 
  + 1L, 7L, 2L, 7L, 2L, 3L, 2L, 1L, 1L, 3L, 1L, 6L, 2L, 2L, 2L, 2L, 
  + 2L, 1L, 1L, 6L, 6L, 7L, 2L, 2L, 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 7690L, 84L, 19L, 1L, 
  + 143L, 0L, 31L, 23L, 113L, 0L, 47L, 600L, 8512L, 0L, 6L, 111L, 
  + 274L, 678L, 28L, 474L, 9976L, 4L, 0L, 623L, 757L, 9561L, 1139L, 
  + 2L, 342L, 0L, 51L, 115L, 9L, 128L, 43L, 22L, 0L, 49L, 284L, 1001L, 
  + 21L, 28L, 1222L, 1L, 12L, 18L, 337L, 547L, 91L, 268L, 10L, 108L, 
  + 249L, 0L, 132L, 0L, 0L, 109L, 246L, 36L, 215L, 28L, 112L, 1L, 
  + 93L, 103L, 1904L, 1648L, 435L, 70L, 21L, 301L, 323L, 11L, 372L, 
  + 98L, 181L, 583L, 0L, 236L, 10L, 30L, 111L, 0L, 3L, 587L, 118L, 
  + 333L, 0L, 0L, 0L, 1031L, 1973L, 1L, 1566L, 0L, 447L, 783L, 0L, 
  + 140L, 41L, 0L, 268L, 128L, 1267L, 925L, 121L, 195L, 324L, 212L, 
  + 804L, 76L, 463L, 407L, 1285L, 300L, 313L, 9L, 11L, 237L, 26L, 
  + 0L, 2150L, 196L, 72L, 1L, 30L, 637L, 1221L, 99L, 288L, 66L, 0L, 
  + 0L, 0L, 2506L, 63L, 450L, 41L, 185L, 36L, 945L, 514L, 57L, 1L, 
  + 5L, 164L, 781L, 0L, 84L, 236L, 245L, 178L, 0L, 9363L, 22402L, 
  + 15L, 0L, 912L, 333L, 3L, 256L, 905L, 753L, 391L), population = c(16L, 
  + 3L, 20L, 0L, 0L, 7L, 0L, 28L, 28L, 15L, 8L, 0L, 0L, 90L, 0L, 
  + 10L, 0L, 3L, 0L, 1L, 1L, 119L, 0L, 0L, 9L, 7L, 35L, 4L, 8L, 24L, 
  + 0L, 0L, 2L, 11L, 1008L, 28L, 0L, 2L, 0L, 2L, 10L, 1L, 15L, 5L, 
  + 0L, 0L, 6L, 8L, 47L, 5L, 0L, 31L, 0L, 0L, 1L, 5L, 54L, 0L, 1L, 
  + 1L, 17L, 61L, 0L, 10L, 0L, 0L, 8L, 6L, 1L, 1L, 6L, 4L, 5L, 11L, 
  + 0L, 157L, 39L, 14L, 3L, 4L, 57L, 7L, 2L, 118L, 2L, 6L, 17L, 0L, 
  + 3L, 3L, 1L, 1L, 0L, 0L, 9L, 6L, 13L, 0L, 0L, 0L, 2L, 77L, 0L, 
  + 2L, 0L, 20L, 12L, 0L, 16L, 14L, 0L, 2L, 3L, 5L, 56L, 18L, 9L, 
  + 4L, 1L, 84L, 2L, 3L, 3L, 14L, 48L, 36L, 3L, 0L, 22L, 5L, 0L, 
  + 9L, 6L, 3L, 3L, 0L, 5L, 29L, 39L, 2L, 15L, 0L, 0L, 0L, 20L, 0L, 
  + 8L, 6L, 10L, 18L, 18L, 49L, 2L, 0L, 1L, 7L, 45L, 0L, 1L, 13L, 
  + 56L, 3L, 0L, 231L, 274L, 0L, 0L, 15L, 60L, 0L, 22L, 28L, 6L, 
  + 8L), language = structure(c(10L, 6L, 8L, 1L, 6L, 10L, 1L, 2L, 
  + 2L, 1L, 4L, 1L, 8L, 6L, 1L, 6L, 1L, 3L, 1L, 10L, 10L, 6L, 1L, 
  + 10L, 5L, 3L, 10L, 10L, 3L, 1L, 6L, 1L, 10L, 2L, 7L, 2L, 3L, 10L, 
  + 1L, 2L, 2L, 6L, 5L, 6L, 3L, 1L, 2L, 2L, 8L, 2L, 10L, 10L, 6L, 
  + 1L, 1L, 9L, 3L, 3L, 10L, 1L, 4L, 4L, 1L, 6L, 1L, 1L, 2L, 3L, 
  + 6L, 1L, 3L, 2L, 7L, 9L, 6L, 10L, 6L, 8L, 1L, 10L, 6L, 3L, 1L, 
  + 9L, 8L, 10L, 10L, 1L, 10L, 8L, 10L, 10L, 4L, 4L, 10L, 10L, 10L, 
  + 10L, 10L, 10L, 8L, 2L, 10L, 10L, 1L, 8L, 10L, 10L, 10L, 6L, 6L, 
  + 1L, 2L, 3L, 10L, 10L, 8L, 6L, 8L, 6L, 2L, 1L, 2L, 2L, 10L, 5L, 
  + 2L, 8L, 6L, 10L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L, 7L, 1L, 7L, 7L, 2L, 8L, 7L, 3L, 7L, 
  + 7L, 5L, 5L, 5L, 5L, 8L, 5L, 2L, 6L, 8L, 7L, 4L, 5L, 2L, 5L, 7L, 
  + 7L, 2L, 7L, 7L, 7L, 5L, 7L, 5L, 7L, 7L, 7L, 7L, 2L, 5L, 4L, 7L, 
  + 8L, 8L, 8L, 7L, 7L, 4L, 7L, 7L, 7L, 7L, 5L, 5L, 5L), .Label = c("black", 
  + "blue", "brown", "gold", "green", "orange", "red", "white"), class = "factor"), 
  +     circles = c(0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
  +     0L, 1L, 0L, 0L, 1L, 0L, 1L, 4L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 
  +     1L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 
  +     0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 
  +     0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
  +     1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 1L, 
  +     0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
  +     0L, 2L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 1L, 0L, 
  +     0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
  +     0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 
  +     0L, 0L, 1L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L, 0L, 1L, 0L, 0L, 
  +     0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 0L, 1L, 0L, 0L),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L, 4L, 4L, 2L, 6L, 7L, 6L, 4L, 2L, 2L, 
  +     6L, 7L, 7L, 2L, 5L, 4L, 2L, 6L, 6L, 6L, 7L, 7L, 6L, 6L, 6L, 
  +     2L, 7L, 6L, 7L, 2L, 6L, 4L, 4L, 4L, 4L, 6L, 2L, 2L, 5L, 7L, 
  +     6L, 3L, 4L, 2L, 2L, 6L, 4L, 2L, 6L, 6L, 2L, 4L, 6L, 6L, 7L, 
  +     7L, 6L, 6L, 7L, 6L, 1L, 7L, 7L, 7L, 2L, 6L, 1L, 3L, 3L, 6L, 
  +     2L, 2L, 4L, 4L, 4L), .Label = c("black", "blue", "gold", 
  +     "green", "orange", "red", "white"), class = "factor"), botright = structure(c(5L, 
  +     7L, 8L, 7L, 7L, 1L, 2L, 2L, 2L, 2L, 7L, 2L, 7L, 5L, 2L, 7L, 
  +     7L, 5L, 7L, 7L, 2L, 5L, 2L, 4L, 7L, 5L, 7L, 8L, 4L, 7L, 5L, 
  +     2L, 4L, 7L, 7L, 7L, 5L, 7L, 2L, 2L, 2L, 8L, 7L, 7L, 5L, 5L, 
  +     2L, 7L, 1L, 2L, 7L, 7L, 8L, 2L, 2L, 8L, 7L, 7L, 2L, 5L, 4L, 
  +     4L, 7L, 2L, 7L, 7L, 2L, 5L, 5L, 5L, 7L, 2L, 2L, 5L, 2L, 8L, 
  +     7L, 1L, 6L, 2L, 7L, 5L, 4L, 8L, 5L, 7L, 5L, 2L, 7L, 7L, 2L, 
  +     7L, 7L, 2L, 5L, 5L, 8L, 7L, 7L, 2L, 5L, 7L, 2L, 7L, 2L, 7L, 
  +     4L, 2L, 2L, 2L, 8L, 2L, 2L, 5L, 5L, 2L, 1L, 7L, 5L, 5L, 8L, 
  +     1L, 2L, 7L, 7L, 7L, 7L, 3L, 7L, 5L, 5L, 5L, 7L, 2L, 8L, 5L, 
  +     2L, 2L, 8L, 1L, 4L, 7L, 2L, 5L, 1L, 5L, 2L, 7L, 1L, 7L, 2L, 
  +     7L, 5L, 7L, 8L, 7L, 7L, 2L, 1L, 7L, 7L, 8L, 8L, 7L, 7L, 5L, 
  +     8L, 7L, 7L, 7L, 7L, 5L, 3L, 5L), .Label = c("black", "blue", 
  +     "brown", "gold", "green", "orange", "red", "white"), class = "factor")), .Names = c("ytrain", 
  + "landmass", "zone", "area", "population", "language", "bars", 
  + "stripes", "colours", "red", "green", "blue", "gold", "white", 
  + "black", "orange", "mainhue", "circles", "crosses", "saltires", 
  + "quarters", "sunstars", "crescent", "triangle", "icon", "animate", 
  + "text", "topleft", "botright"), row.names = c(NA, -174L), class = "data.frame")
  > tdata$language <-  factor(tdata$language)
  > tdata$ytrain <- factor(tdata$ytrain)
  > 
  > library("coin")
  > 
  > m <- ctree(ytrain ~ language, data = subset(tdata, language != "8"), 
  +     control = ctree_control(testtype = "Univariate", maxdepth = 1L))
  > it <- independence_test(ytrain ~ language, data = subset(tdata, language != "8"), 
  +                         teststat = "quad")
  > stopifnot(isTRUE(all.equal(m@tree$criterion$statistic, 
  +                            statistic(it), check.attributes = FALSE)))
  > 
  > ### easier example
  > levels(tdata$language) <- c(1, 1, 1, 1, 1, 1, 2, 8, 1, 1)
  > levels(tdata$ytrain) <- c(1, 1, 2, 2, 3, 3, 4, 4, 5, 6)
  > m <- ctree(ytrain ~ language, data = subset(tdata, language != "8"),
  +     control = ctree_control(testtype = "Univariate", maxdepth = 1L))
  > it <- independence_test(ytrain ~ language, data = subset(tdata, language != "8"), 
  +                         teststat = "quad")
  > stopifnot(isTRUE(all.equal(m@tree$criterion$statistic, 
  +                            statistic(it), check.attributes = FALSE)))
  > 
  > ## the whole exercise manually
  > Y <- model.matrix(~ language - 1, data = subset(tdata, language != "8"))
  > X <- model.matrix(~ ytrain -1, data = subset(tdata, language != "8"))
  > w <- rep(1, nrow(X))
  > 
  > ### coin:::LinearStatistic and coin:::ExpectCovarLinearStatistic
  > ### have been removed from coin as of 2.0-0
  > ### use libcoin to compare with
  > if (FALSE) { ### (require("libcoin")) {
  +     lstec <- LinStatExpCov(X = X, Y = Y, weights = as.integer(w))
  + 
  +     tmp <- new("LinStatExpectCovar", ncol(Y), ncol(X))
  +     tmp@linearstatistic <-  lstec$LinearStatistic
  +     tmp@expectation <- lstec$Expectation
  +     tmp@covariance <- matrix(0, nrow = length(lstec$LinearStatistic), 
  +                              ncol = length(lstec$LinearStatistic))
  +     tmp@covariance[lower.tri(tmp@covariance, diag = TRUE)] <- lstec$Covariance
  +     tmp@covariance <- tmp@covariance + t(tmp@covariance)
  +     diag(tmp@covariance) <- diag(tmp@covariance) / 2
  + 
  +    a <- .Call(R_linexpcovReduce, tmp)
  + 
  +     u <- matrix(tmp@linearstatistic - tmp@expectation, nc = 1)
  +     d <- tmp@dimension
  +     u <- matrix(tmp@linearstatistic - tmp@expectation, nc = 1)[1:d,,drop = FALSE]
  +     S <- coin:::MPinv(matrix(as.vector(tmp@covariance[1:d^2]), ncol = d))
  +     
  +     stat <- t(u) %*% S$MPinv %*% u
  +     stopifnot(isTRUE(all.equal(stat[1,1], statistic(it), 
  +                                check.attributes = FALSE)))
  + 
  +     x <- matrix(as.vector(tmp@covariance[1:d^2]), ncol = d)
  +     s <- svd(x)
  + 
  +     m <- new("svd_mem", 18L)
  +     m@p <- as.integer(d)
  + 
  +     s2 <- .Call(R_svd, x, m)
  + 
  +     stopifnot(max(abs(s$d - m@s[1:d])) < sqrt(.Machine$double.eps))
  +     stopifnot(max(abs(s$v - t(matrix(m@v[1:d^2], nrow = d)))) < sqrt(.Machine$double.eps))
  +     stopifnot(max(abs(s$u - matrix(m@u[1:d^2], nrow = d))) < sqrt(.Machine$double.eps))
  + 
  +     s2 <- .Call(R_svd, tmp@covariance, m)
  + 
  +     stopifnot(max(abs(s$d - m@s[1:d])) < sqrt(.Machine$double.eps))
  +     stopifnot(max(abs(s$v - t(matrix(m@v[1:d^2], nrow = d)))) < sqrt(.Machine$double.eps))
  +     stopifnot(max(abs(s$u - matrix(m@u[1:d^2], nrow = d))) < sqrt(.Machine$double.eps))
  + 
  +     a <- .Call(R_MPinv, tmp@covariance, sqrt(.Machine$double.eps), m)
  + 
  +     stat <- t(u) %*% matrix(a@MPinv[1:d^2], ncol = d) %*% u  
  +     stopifnot(isTRUE(all.equal(stat[1,1], statistic(it), 
  +                                check.attributes = FALSE)))
  + }
  > 
  > proc.time()
     user  system elapsed 
     8.59    0.43    9.01 
Running the tests in 'tests/mob.R' failed.
Complete output:
  > library("party")
  Loading required package: grid
  Loading required package: mvtnorm
  Loading required package: modeltools
  Loading required package: stats4
  Loading required package: strucchange
  Loading required package: zoo
  
  Attaching package: 'zoo'
  
  The following objects are masked from 'package:base':
  
      as.Date, as.Date.numeric
  
  Loading required package: sandwich
  > 
  > data("BostonHousing", package = "mlbench")
  > BostonHousing$lstat <- log(BostonHousing$lstat)
  > BostonHousing$rm <- BostonHousing$rm^2
  > BostonHousing$chas <- factor(BostonHousing$chas, levels = 0:1, labels = c("no", "yes"))
  > BostonHousing$rad <- factor(BostonHousing$rad, ordered = TRUE)
  > fmBH <- mob(medv ~ lstat + rm | zn + indus + chas + nox + age + dis + rad + tax + crim + b + ptratio,
  +   control = mob_control(minsplit = 40, verbose = TRUE),
  +   data = BostonHousing, model = linearModel)
  
  -------------------------------------------
  Fluctuation tests of splitting variables:
                      zn        indus         chas          nox          age
  statistic 3.363356e+01 6.532322e+01 2.275635e+01 8.136281e+01 3.675850e+01
  p.value   1.023987e-04 1.363602e-11 4.993053e-04 3.489797e-15 2.263798e-05
                     dis          rad          tax         crim            b
  statistic 6.848533e+01 1.153641e+02 9.068440e+01 8.655065e+01 3.627629e+01
  p.value   2.693904e-12 7.087680e-13 2.735524e-17 2.356348e-16 2.860686e-05
                 ptratio
  statistic 7.221524e+01
  p.value   3.953623e-13
  
  Best splitting variable: tax
  Perform split? yes
  -------------------------------------------
  
  Node properties:
  tax <= 432; criterion = 1, statistic = 115.364
  
  -------------------------------------------
  Fluctuation tests of splitting variables:
                      zn      indus      chas          nox        age
  statistic 27.785009791 21.3329346 8.0272421 23.774323202 11.9204284
  p.value    0.001494064  0.0285193 0.4005192  0.009518732  0.7666366
                     dis          rad          tax         crim         b
  statistic 24.268011081 50.481593270 3.523250e+01 3.276813e+01 9.0363245
  p.value    0.007601532  0.003437763 4.275527e-05 1.404487e-04 0.9871502
                 ptratio
  statistic 4.510680e+01
  p.value   3.309747e-07
  
  Best splitting variable: ptratio
  Perform split? yes
  -------------------------------------------
  
  Node properties:
  ptratio <= 15.2; criterion = 1, statistic = 50.482
  
  -------------------------------------------
  Fluctuation tests of splitting variables:
                      zn       indus        chas         nox         age
  statistic 3.233350e+01 22.26864036 12.93407112 22.10510234 20.41295354
  p.value   1.229678e-04  0.01504788  0.05259509  0.01622098  0.03499731
                   dis          rad          tax        crim         b
  statistic 17.7204735 5.526565e+01 2.879128e+01 20.28503194 6.5549665
  p.value    0.1091769 7.112214e-04 6.916307e-04  0.03706934 0.9999522
                 ptratio
  statistic 4.789850e+01
  p.value   4.738855e-08
  
  Best splitting variable: ptratio
  Perform split? yes
  -------------------------------------------
  
  Node properties:
  ptratio <= 19.6; criterion = 1, statistic = 55.266
  
  -------------------------------------------
  Fluctuation tests of splitting variables:
                   zn      indus      chas        nox       age        dis
  statistic 14.971474 14.6477733 7.1172962 14.3455158 8.2176363 16.1112185
  p.value    0.280361  0.3134649 0.5405005  0.3467974 0.9906672  0.1847818
                    rad          tax     crim         b    ptratio
  statistic 43.17824350 3.447271e+01 9.340075 8.7773142 10.8469969
  p.value    0.03281124 4.281939e-05 0.952996 0.9772696  0.8202694
  
  Best splitting variable: tax
  Perform split? yes
  -------------------------------------------
  
  Node properties:
  tax <= 265; criterion = 1, statistic = 43.178
  
  -------------------------------------------
  Fluctuation tests of splitting variables:
                   zn     indus     chas       nox        age       dis
  statistic 11.998039 7.3971233 7.227770 9.2936189 14.3023962 8.9239826
  p.value    0.574642 0.9931875 0.522447 0.9119621  0.2886603 0.9389895
                   rad        tax       crim         b    ptratio
  statistic 33.1746444 16.6666129 11.7143758 9.9050903 11.5927528
  p.value    0.3926249  0.1206412  0.6153455 0.8539893  0.6328381
  
  Best splitting variable: tax
  Perform split? no
  -------------------------------------------
  
  -------------------------------------------
  Fluctuation tests of splitting variables:
                    zn     indus         chas         nox       age        dis
  statistic 10.9187926 9.0917078 2.754081e+01 17.39203006 4.6282349 11.9581600
  p.value    0.7091039 0.9172303 4.987667e-05  0.08922543 0.9999992  0.5607267
                  rad        tax     crim        b   ptratio
  statistic 0.2557803 10.9076165 3.711175 3.158329 9.8865054
  p.value   1.0000000  0.7106612 1.000000 1.000000 0.8410064
  
  Best splitting variable: chas
  Perform split? yes
  -------------------------------------------
  
  Splitting factor variable, objective function: 
   no 
  Inf 
  
  No admissable split found in 'chas'
  > fmBH
  1) tax <= 432; criterion = 1, statistic = 115.364
    2) ptratio <= 15.2; criterion = 1, statistic = 50.482
      3)*  weights = 72 
  Terminal node model
  Linear model with coefficients:
  (Intercept)        lstat           rm  
       9.2349      -4.9391       0.6859  
  
    2) ptratio > 15.2
      4) ptratio <= 19.6; criterion = 1, statistic = 55.266
        5) tax <= 265; criterion = 1, statistic = 43.178
          6)*  weights = 63 
  Terminal node model
  Linear model with coefficients:
  (Intercept)        lstat           rm  
       3.9637      -2.7663       0.6881  
  
        5) tax > 265
          7)*  weights = 162 
  Terminal node model
  Linear model with coefficients:
  (Intercept)        lstat           rm  
      -1.7984      -0.2677       0.6539  
  
      4) ptratio > 19.6
        8)*  weights = 56 
  Terminal node model
  Linear model with coefficients:
  (Intercept)        lstat           rm  
      17.5865      -4.6190       0.3387  
  
  1) tax > 432
    9)*  weights = 153 
  Terminal node model
  Linear model with coefficients:
  (Intercept)        lstat           rm  
      68.2971     -16.3540      -0.1478  
  
  > summary(fmBH)
  $`3`
  
  Call:
  NULL
  
  Weighted Residuals:
     Min     1Q Median     3Q    Max 
  -7.910  0.000  0.000  0.000  6.632 
  
  Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
  (Intercept)  9.23488    3.95128   2.337   0.0223 *  
  lstat       -4.93910    0.88285  -5.595 4.14e-07 ***
  rm           0.68591    0.05136  13.354  < 2e-16 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual standard error: 3.413 on 69 degrees of freedom
  Multiple R-squared:  0.922,	Adjusted R-squared:  0.9197 
  F-statistic: 407.8 on 2 and 69 DF,  p-value: < 2.2e-16
  
  
  $`6`
  
  Call:
  NULL
  
  Weighted Residuals:
     Min     1Q Median     3Q    Max 
  -4.614  0.000  0.000  0.000 12.473 
  
  Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
  (Intercept)  3.96372    5.00781   0.792  0.43177    
  lstat       -2.76629    1.00406  -2.755  0.00776 ** 
  rm           0.68813    0.07716   8.918 1.36e-12 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual standard error: 3.2 on 60 degrees of freedom
  Multiple R-squared:  0.8176,	Adjusted R-squared:  0.8115 
  F-statistic: 134.5 on 2 and 60 DF,  p-value: < 2.2e-16
  
  
  $`7`
  
  Call:
  NULL
  
  Weighted Residuals:
     Min     1Q Median     3Q    Max 
  -9.092  0.000  0.000  0.000 10.236 
  
  Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
  (Intercept) -1.79839    2.84702  -0.632    0.529    
  lstat       -0.26771    0.69581  -0.385    0.701    
  rm           0.65389    0.03757  17.404   <2e-16 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual standard error: 2.652 on 159 degrees of freedom
  Multiple R-squared:  0.8173,	Adjusted R-squared:  0.815 
  F-statistic: 355.6 on 2 and 159 DF,  p-value: < 2.2e-16
  
  
  $`8`
  
  Call:
  NULL
  
  Weighted Residuals:
     Min     1Q Median     3Q    Max 
  -8.466  0.000  0.000  0.000  4.947 
  
  Coefficients:
              Estimate Std. Error t value Pr(>|t|)    
  (Intercept) 17.58649    4.21666   4.171 0.000113 ***
  lstat       -4.61897    0.84025  -5.497 1.13e-06 ***
  rm           0.33867    0.07574   4.472 4.13e-05 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual standard error: 2.197 on 53 degrees of freedom
  Multiple R-squared:  0.6446,	Adjusted R-squared:  0.6312 
  F-statistic: 48.07 on 2 and 53 DF,  p-value: 1.238e-12
  
  
  $`9`
  
  Call:
  NULL
  
  Weighted Residuals:
     Min     1Q Median     3Q    Max 
  -10.56   0.00   0.00   0.00  24.28 
  
  Coefficients:
               Estimate Std. Error t value Pr(>|t|)    
  (Intercept)  68.29709    3.83284  17.819  < 2e-16 ***
  lstat       -16.35401    0.96577 -16.934  < 2e-16 ***
  rm           -0.14779    0.05047  -2.928  0.00394 ** 
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  Residual standard error: 4.689 on 150 degrees of freedom
  Multiple R-squared:  0.6649,	Adjusted R-squared:  0.6604 
  F-statistic: 148.8 on 2 and 150 DF,  p-value: < 2.2e-16
  
  
  > 
  > ### check for one-node tree
  > fmBH <- try(mob(medv ~ lstat + rm | zn, control = mob_control(minsplit = 4000, verbose = TRUE),
  +   data = BostonHousing, model = linearModel))
  > stopifnot(class(fmBH) != "try-error")
  > 
  > 
  > data("PimaIndiansDiabetes", package = "mlbench")
  > fmPID <- mob(diabetes ~ glucose | pregnant + pressure + triceps + insulin + mass + pedigree + age,
  +   control = mob_control(verbose = TRUE),
  +   data = PimaIndiansDiabetes, model = glinearModel, family = binomial())
  
  -------------------------------------------
  Fluctuation tests of splitting variables:
                pregnant  pressure     triceps   insulin         mass    pedigree
  statistic 2.988542e+01 7.5024235 15.94095417 6.5969297 4.880982e+01 18.33476114
  p.value   9.778517e-05 0.9104325  0.06660773 0.9701412 8.316815e-09  0.02275017
                     age
  statistic 4.351412e+01
  p.value   1.182811e-07
  
  Best splitting variable: mass
  Perform split? yes
  -------------------------------------------
  
  Node properties:
  mass <= 26.3; criterion = 1, statistic = 48.81
  
  -------------------------------------------
  Fluctuation tests of splitting variables:
              pregnant pressure  triceps   insulin       mass  pedigree       age
  statistic 10.3924070 4.353740 5.911229 3.7855726 10.4748907 3.6263026 6.0978662
  p.value    0.4903221 0.999824 0.986895 0.9999888  0.4785454 0.9999958 0.9817742
  
  Best splitting variable: mass
  Perform split? no
  -------------------------------------------
  
  -------------------------------------------
  Fluctuation tests of splitting variables:
                pregnant  pressure  triceps   insulin      mass    pedigree
  statistic 2.673912e+01 6.1757583 7.346804 7.8963977 9.1545915 17.96438828
  p.value   4.434356e-04 0.9845137 0.922646 0.8700398 0.7033477  0.02677105
                     age
  statistic 3.498466e+01
  p.value   8.098640e-06
  
  Best splitting variable: age
  Perform split? yes
  -------------------------------------------
  
  Node properties:
  age <= 30; criterion = 1, statistic = 34.985
  
  -------------------------------------------
  Fluctuation tests of splitting variables:
             pregnant  pressure  triceps   insulin      mass pedigree       age
  statistic 4.3749991 9.4006532 7.661457 9.0583568 5.4287861 5.640420 6.3088818
  p.value   0.9998989 0.6656073 0.893893 0.7168659 0.9967316 0.994611 0.9804133
  
  Best splitting variable: pressure
  Perform split? no
  -------------------------------------------
  
  -------------------------------------------
  Fluctuation tests of splitting variables:
             pregnant pressure   triceps   insulin      mass   pedigree
  statistic 7.7282903 1.935271 3.6078314 4.9703223 10.136944 11.9004129
  p.value   0.8882324 1.000000 0.9999987 0.9991162  0.555382  0.3205095
                   age
  statistic 10.1330698
  p.value    0.5559631
  
  Best splitting variable: pedigree
  Perform split? no
  -------------------------------------------
  > fmPID
  1) mass <= 26.3; criterion = 1, statistic = 48.81
    2)*  weights = 167 
  Terminal node model
  Binomial GLM with coefficients:
  (Intercept)      glucose  
     -9.95151      0.05871  
  
  1) mass > 26.3
    3) age <= 30; criterion = 1, statistic = 34.985
      4)*  weights = 304 
  Terminal node model
  Binomial GLM with coefficients:
  (Intercept)      glucose  
     -6.70559      0.04684  
  
    3) age > 30
      5)*  weights = 297 
  Terminal node model
  Binomial GLM with coefficients:
  (Intercept)      glucose  
     -2.77095      0.02354  
  
  > summary(fmPID)
  $`2`
  
  Call:
  NULL
  
  Coefficients:
              Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -9.95151    1.74013  -5.719 1.07e-08 ***
  glucose      0.05871    0.01211   4.846 1.26e-06 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 96.202  on 166  degrees of freedom
  Residual deviance: 60.502  on 165  degrees of freedom
  AIC: 64.502
  
  Number of Fisher Scoring iterations: 6
  
  
  $`4`
  
  Call:
  NULL
  
  Coefficients:
               Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -6.705586   0.800193  -8.380  < 2e-16 ***
  glucose      0.046837   0.006208   7.544 4.54e-14 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 364.01  on 303  degrees of freedom
  Residual deviance: 280.98  on 302  degrees of freedom
  AIC: 284.98
  
  Number of Fisher Scoring iterations: 5
  
  
  $`5`
  
  Call:
  NULL
  
  Coefficients:
               Estimate Std. Error z value Pr(>|z|)    
  (Intercept) -2.770954   0.548241  -5.054 4.32e-07 ***
  glucose      0.023536   0.004202   5.601 2.13e-08 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
  
  (Dispersion parameter for binomial family taken to be 1)
  
      Null deviance: 407.11  on 296  degrees of freedom
  Residual deviance: 369.43  on 295  degrees of freedom
  AIC: 373.43
  
  Number of Fisher Scoring iterations: 4
  
  
  > 
  > 
  > proc.time()
     user  system elapsed 
     3.04    0.53    3.54