[Mboost-commits] r802 - in pkg/mboostDevel: man tests tests/Examples

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Oct 2 11:05:37 CEST 2014


Author: hofner
Date: 2014-10-02 11:05:36 +0200 (Thu, 02 Oct 2014)
New Revision: 802

Modified:
   pkg/mboostDevel/man/confint.Rd
   pkg/mboostDevel/tests/Examples/mboostDevel-Ex.Rout.save
   pkg/mboostDevel/tests/birds_Biometrics.Rout.save
   pkg/mboostDevel/tests/bugfixes.Rout.save
   pkg/mboostDevel/tests/regtest-baselearner.Rout.save
   pkg/mboostDevel/tests/regtest-blackboost.Rout.save
   pkg/mboostDevel/tests/regtest-family.Rout.save
   pkg/mboostDevel/tests/regtest-gamboost.Rout.save
   pkg/mboostDevel/tests/regtest-glmboost.Rout.save
   pkg/mboostDevel/tests/regtest-hatmatrix.Rout.save
   pkg/mboostDevel/tests/regtest-inference.Rout.save
Log:
- Examples in confint are not tested as this takes too long
- Updated .Rout.save files


Modified: pkg/mboostDevel/man/confint.Rd
===================================================================
--- pkg/mboostDevel/man/confint.Rd	2014-10-02 07:37:30 UTC (rev 801)
+++ pkg/mboostDevel/man/confint.Rd	2014-10-02 09:05:36 UTC (rev 802)
@@ -131,6 +131,7 @@
   \code{\link{mboost_methods}} for other methods.
 }
 \examples{
+\donttest{
 ### a simple linear example
 set.seed(1907)
 data <- data.frame(x1 = rnorm(100), x2 = rnorm(100),
@@ -151,7 +152,6 @@
 ## or print a subset (with point estimates):
 print(CI, level = 0.8, pe = TRUE, which = "z")
 
-
 ### a simple smooth example
 set.seed(1907)
 data <- data.frame(x1 = rnorm(100), x2 = rnorm(100))
@@ -170,4 +170,5 @@
 ## level in the plot or lines function:
 lines(CI_gam, which = 2, level = 0.8)
 }
+}
 \keyword{methods}

Modified: pkg/mboostDevel/tests/Examples/mboostDevel-Ex.Rout.save
===================================================================
--- pkg/mboostDevel/tests/Examples/mboostDevel-Ex.Rout.save	2014-10-02 07:37:30 UTC (rev 801)
+++ pkg/mboostDevel/tests/Examples/mboostDevel-Ex.Rout.save	2014-10-02 09:05:36 UTC (rev 802)
@@ -34,6 +34,7 @@
 > ### * </HEADER>
 > library('mboostDevel')
 Loading required package: parallel
+Loading required package: stabs
 This is mboostDevel 2.4-0. See ‘package?mboostDevel’ and the NEWS file
 for a complete list of changes.
 
@@ -961,117 +962,9 @@
 > 
 > ### ** Examples
 > 
-> ### a simple linear example
-> set.seed(1907)
-> data <- data.frame(x1 = rnorm(100), x2 = rnorm(100),
-+                    z = factor(sample(1:3, 100, replace = TRUE)))
-> data$y <- rnorm(100, mean = data$x1 - data$x2 - 1 * (data$z == 2) +
-+                             1 * (data$z == 3), sd = 0.1)
-> linmod <- glmboost(y ~ x1 + x2 + z, data = data,
-+                    control = boost_control(mstop = 200))
 > 
-> ## compute confidence interval from 10 samples. Usually one should use
-> ## at least 1000 samples.
-> CI <- confint(linmod, B = 10, level = 0.9)
-Warning in cvrisk.mboost(mod, folds = cv(model.weights(mod), B = B.mstop),  :
-  zero weights
-Warning in cvrisk.mboost(mod, folds = cv(model.weights(mod), B = B.mstop),  :
-  zero weights
-Warning in cvrisk.mboost(mod, folds = cv(model.weights(mod), B = B.mstop),  :
-  zero weights
-Warning in cvrisk.mboost(mod, folds = cv(model.weights(mod), B = B.mstop),  :
-  zero weights
-Warning in cvrisk.mboost(mod, folds = cv(model.weights(mod), B = B.mstop),  :
-  zero weights
-Warning in cvrisk.mboost(mod, folds = cv(model.weights(mod), B = B.mstop),  :
-  zero weights
-Warning in cvrisk.mboost(mod, folds = cv(model.weights(mod), B = B.mstop),  :
-  zero weights
-Warning in cvrisk.mboost(mod, folds = cv(model.weights(mod), B = B.mstop),  :
-  zero weights
-Warning in cvrisk.mboost(mod, folds = cv(model.weights(mod), B = B.mstop),  :
-  zero weights
-Warning in cvrisk.mboost(mod, folds = cv(model.weights(mod), B = B.mstop),  :
-  zero weights
-> CI
-	Bootstrap Confidence Intervals
-                     5%         95%
-(Intercept) -0.01975195  0.02598639
-x1           0.98986917  1.01853830
-x2          -1.00530226 -0.98158388
-z2          -1.04350674 -0.99290512
-z3           0.98234788  1.06652604
 > 
-> ## to compute a confidence interval for another level simply change the
-> ## level in the print function:
-> print(CI, level = 0.8)
-	Bootstrap Confidence Intervals
-                    10%         90%
-(Intercept) -0.01105303  0.01607163
-x1           0.99577904  1.01340240
-x2          -1.00234059 -0.98355672
-z2          -1.03767821 -0.99552711
-z3           0.98851355  1.04334685
-> ## or print a subset (with point estimates):
-> print(CI, level = 0.8, pe = TRUE, which = "z")
-	Bootstrap Confidence Intervals
-        beta        10%        90%
-z2 -1.016220 -1.0376782 -0.9955271
-z3  1.024731  0.9885135  1.0433468
 > 
-> 
-> ### a simple smooth example
-> set.seed(1907)
-> data <- data.frame(x1 = rnorm(100), x2 = rnorm(100))
-> data$y <- rnorm(100, mean = data$x1^2 - sin(data$x2), sd = 0.1)
-> gam <- gamboost(y ~ x1 + x2, data = data,
-+                 control = boost_control(mstop = 200))
-> 
-> ## compute confidence interval from 10 samples. Usually one should use
-> ## at least 1000 samples.
-> CI_gam <- confint(gam, B = 10, level = 0.9)
-Start computing bootstrap confidence intervals... 
-
-B = 1Warning in cvrisk.mboost(object = list(baselearner = list(`bbs(x1, df = dfbase)` = list( :
-  zero weights
-
-B = 2Warning in cvrisk.mboost(object = list(baselearner = list(`bbs(x1, df = dfbase)` = list( :
-  zero weights
-
-B = 3Warning in cvrisk.mboost(object = list(baselearner = list(`bbs(x1, df = dfbase)` = list( :
-  zero weights
-
-B = 4Warning in cvrisk.mboost(object = list(baselearner = list(`bbs(x1, df = dfbase)` = list( :
-  zero weights
-
-B = 5Warning in cvrisk.mboost(object = list(baselearner = list(`bbs(x1, df = dfbase)` = list( :
-  zero weights
-
-B = 6Warning in cvrisk.mboost(object = list(baselearner = list(`bbs(x1, df = dfbase)` = list( :
-  zero weights
-
-B = 7Warning in cvrisk.mboost(object = list(baselearner = list(`bbs(x1, df = dfbase)` = list( :
-  zero weights
-
-B = 8Warning in cvrisk.mboost(object = list(baselearner = list(`bbs(x1, df = dfbase)` = list( :
-  zero weights
-
-B = 9Warning in cvrisk.mboost(object = list(baselearner = list(`bbs(x1, df = dfbase)` = list( :
-  zero weights
-
-B = 10Warning in cvrisk.mboost(object = list(baselearner = list(`bbs(x1, df = dfbase)` = list( :
-  zero weights
-
-> 
-> par(mfrow = c(1, 2))
-> plot(CI_gam, which = 1)
-> plot(CI_gam, which = 2)
-> ## to compute a confidence interval for another level simply change the
-> ## level in the plot or lines function:
-> lines(CI_gam, which = 2, level = 0.8)
-> 
-> 
-> 
 > base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
 > base::cat("confint", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
 > graphics::par(get("par.postscript", pos = 'CheckExEnv'))
@@ -1545,8 +1438,6 @@
 > 
 >   ### use stability selection for base-learner selection
 >   library("stabs")
-Note: the specification for class “boost_family” in package ‘mboost’ seems equivalent to one from package ‘mboostDevel’: not turning on duplicate class definitions for this class.
-Note: the specification for class “boost_family_glm” in package ‘mboost’ seems equivalent to one from package ‘mboostDevel’: not turning on duplicate class definitions for this class.
 >   ## fit a linear model
 >   # (as this is quicker; also possible with non-linear model from above)
 >   mod <- glmboost(DEXfat ~ ., data = bodyfat)
@@ -1578,9 +1469,9 @@
 > graphics::par(get("par.postscript", pos = 'CheckExEnv'))
 > cleanEx()
 
-detaching ‘package:stabs’, ‘package:party’, ‘package:modeltools’,
-  ‘package:stats4’, ‘package:strucchange’, ‘package:sandwich’,
-  ‘package:zoo’, ‘package:grid’
+detaching ‘package:party’, ‘package:modeltools’, ‘package:stats4’,
+  ‘package:strucchange’, ‘package:sandwich’, ‘package:zoo’,
+  ‘package:grid’
 
 > nameEx("mboost_package")
 > ### * mboost_package
@@ -1588,9 +1479,9 @@
 > flush(stderr()); flush(stdout())
 > 
 > base::assign(".ptime", proc.time(), pos = "CheckExEnv")
-> ### Name: mboostDevel-package
-> ### Title: mboostDevel: Model-Based Boosting
-> ### Aliases: mboostDevel-package
+> ### Name: mboost-package
+> ### Title: mboost: Model-Based Boosting
+> ### Aliases: mboost-package mboost_package package_mboost package-mboost
 > ### Keywords: package smooth nonparametric models
 > 
 > ### ** Examples
@@ -3248,6 +3139,67 @@
 > base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
 > base::cat("methods", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
 > cleanEx()
+> nameEx("stabsel")
+> ### * stabsel
+> 
+> flush(stderr()); flush(stdout())
+> 
+> base::assign(".ptime", proc.time(), pos = "CheckExEnv")
+> ### Name: stabsel
+> ### Title: Stability Selection
+> ### Aliases: stabsel stabsel.mboost stabsel_parameters.mboost
+> ### Keywords: nonparametric
+> 
+> ### ** Examples
+> 
+>   ## make data set available
+>   data("bodyfat", package = "TH.data")
+>   ## set seed
+>   set.seed(1234)
+> 
+>   ### low-dimensional example
+>   mod <- glmboost(DEXfat ~ ., data = bodyfat)
+> 
+>   ## compute cutoff ahead of running stabsel to see if it is a sensible
+>   ## parameter choice.
+>   ##   p = ncol(bodyfat) - 1 (= Outcome) + 1 ( = Intercept)
+>   stabsel_parameters(q = 3, PFER = 1, p = ncol(bodyfat) - 1 + 1,
++                      sampling.type = "MB")
+Stability Selection without further assumptions
+Cutoff: 0.95; q: 3; PFER:  1 
+>   ## the same:
+>   stabsel(mod, q = 3, PFER = 1, sampling.type = "MB", eval = FALSE)
+Stability Selection without further assumptions
+Cutoff: 0.95; q: 3; PFER:  1 
+> 
+>   ## now run stability selection
+>   (sbody <- stabsel(mod, q = 3, PFER = 1, sampling.type = "MB"))
+	Stability Selection without further assumptions
+
+Selected base-learners:
+hipcirc 
+      4 
+
+Selection probabilities:
+ (Intercept)          age elbowbreadth  kneebreadth     anthro3b      anthro4 
+        0.00         0.00         0.00         0.01         0.11         0.17 
+    anthro3c     anthro3a    waistcirc      hipcirc 
+        0.18         0.60         0.93         1.00 
+
+Cutoff: 0.95; q: 3; PFER:  1 
+
+>   opar <- par(mai = par("mai") * c(1, 1, 1, 2.7))
+>   plot(sbody)
+>   par(opar)
+> 
+>   plot(sbody, type = "maxsel", ymargin = 6)
+> 
+> 
+> 
+> base::assign(".dptime", (proc.time() - get(".ptime", pos = "CheckExEnv")), pos = "CheckExEnv")
+> base::cat("stabsel", base::get(".format_ptime", pos = 'CheckExEnv')(get(".dptime", pos = "CheckExEnv")), "\n", file=base::get(".ExTimings", pos = 'CheckExEnv'), append=TRUE, sep="\t")
+> graphics::par(get("par.postscript", pos = 'CheckExEnv'))
+> cleanEx()
 > nameEx("survFit")
 > ### * survFit
 > 
@@ -3333,7 +3285,7 @@
 > ###
 > options(digits = 7L)
 > base::cat("Time elapsed: ", proc.time() - base::get("ptime", pos = 'CheckExEnv'),"\n")
-Time elapsed:  17.527 0.998 35.294 26.941 1.832 
+Time elapsed:  14.895 0.337 17.75 1.39 0.079 
 > grDevices::dev.off()
 null device 
           1 

Modified: pkg/mboostDevel/tests/birds_Biometrics.Rout.save
===================================================================
--- pkg/mboostDevel/tests/birds_Biometrics.Rout.save	2014-10-02 07:37:30 UTC (rev 801)
+++ pkg/mboostDevel/tests/birds_Biometrics.Rout.save	2014-10-02 09:05:36 UTC (rev 802)
@@ -18,6 +18,7 @@
 > 
 > library("mboostDevel")
 Loading required package: parallel
+Loading required package: stabs
 This is mboostDevel 2.4-0. See 'package?mboostDevel' and the NEWS file
 for a complete list of changes.
 
@@ -314,4 +315,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 19.303   0.336  20.173 
+ 18.541   0.565  19.760 

Modified: pkg/mboostDevel/tests/bugfixes.Rout.save
===================================================================
--- pkg/mboostDevel/tests/bugfixes.Rout.save	2014-10-02 07:37:30 UTC (rev 801)
+++ pkg/mboostDevel/tests/bugfixes.Rout.save	2014-10-02 09:05:36 UTC (rev 802)
@@ -19,6 +19,7 @@
 > require("mboostDevel")
 Loading required package: mboostDevel
 Loading required package: parallel
+Loading required package: stabs
 This is mboostDevel 2.4-0. See 'package?mboostDevel' and the NEWS file
 for a complete list of changes.
 
@@ -703,7 +704,7 @@
 missing values are excluded per base-learner, i.e., base-learners may depend on different numbers of observations.
 5: In brad(x1, x2, knots = 20) : base-learner contains missing values;
 missing values are excluded per base-learner, i.e., base-learners may depend on different numbers of observations.
-6: In cover.design(R = unique(x), nd = knots) :
+6: In fields::cover.design(R = unique(x), nd = knots) :
   Number of nearst neighbors (nn) reduced to the actual number of candidates
 7: In bmono(x1) : base-learner contains missing values;
 missing values are excluded per base-learner, i.e., base-learners may depend on different numbers of observations.
@@ -735,4 +736,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 27.765   0.389  28.560 
+ 28.060   0.378  28.861 

Modified: pkg/mboostDevel/tests/regtest-baselearner.Rout.save
===================================================================
--- pkg/mboostDevel/tests/regtest-baselearner.Rout.save	2014-10-02 07:37:30 UTC (rev 801)
+++ pkg/mboostDevel/tests/regtest-baselearner.Rout.save	2014-10-02 09:05:36 UTC (rev 802)
@@ -18,6 +18,7 @@
 > 
 > library("mboostDevel")
 Loading required package: parallel
+Loading required package: stabs
 This is mboostDevel 2.4-0. See 'package?mboostDevel' and the NEWS file
 for a complete list of changes.
 
@@ -29,8 +30,9 @@
     IPCweights, Laplace, Loglog, Lognormal, Multinomial, NBinomial,
     Poisson, PropOdds, QuantReg, Weibull, bbs, blackboost, bmono, bmrf,
     bns, bols, boost_control, brad, brandom, bspatial, bss, btree,
-    buser, cv, cvrisk, extract, gamboost, glmboost, mboost, mboost_fit,
-    mstop, mstop<-, nuisance, risk, selected, survFit
+    buser, confint.glmboost, confint.mboost, cv, cvrisk, extract,
+    gamboost, glmboost, mboost, mboost_fit, mstop, mstop<-, nuisance,
+    risk, selected, stabsel.mboost, stabsel_parameters.mboost, survFit
 
 > library("MASS")
 > library("Matrix")
@@ -1200,4 +1202,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 32.798   0.582  33.944 
+ 34.268   1.116  36.222 

Modified: pkg/mboostDevel/tests/regtest-blackboost.Rout.save
===================================================================
--- pkg/mboostDevel/tests/regtest-blackboost.Rout.save	2014-10-02 07:37:30 UTC (rev 801)
+++ pkg/mboostDevel/tests/regtest-blackboost.Rout.save	2014-10-02 09:05:36 UTC (rev 802)
@@ -19,6 +19,7 @@
 > require("mboostDevel")
 Loading required package: mboostDevel
 Loading required package: parallel
+Loading required package: stabs
 This is mboostDevel 2.4-0. See 'package?mboostDevel' and the NEWS file
 for a complete list of changes.
 
@@ -203,4 +204,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  8.561   0.274   9.109 
+  8.559   0.201   9.020 

Modified: pkg/mboostDevel/tests/regtest-family.Rout.save
===================================================================
--- pkg/mboostDevel/tests/regtest-family.Rout.save	2014-10-02 07:37:30 UTC (rev 801)
+++ pkg/mboostDevel/tests/regtest-family.Rout.save	2014-10-02 09:05:36 UTC (rev 802)
@@ -18,6 +18,7 @@
 > 
 > library("mboostDevel")
 Loading required package: parallel
+Loading required package: stabs
 This is mboostDevel 2.4-0. See 'package?mboostDevel' and the NEWS file
 for a complete list of changes.
 
@@ -403,4 +404,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 15.965   0.154  16.312 
+ 16.432   0.143  16.798 

Modified: pkg/mboostDevel/tests/regtest-gamboost.Rout.save
===================================================================
--- pkg/mboostDevel/tests/regtest-gamboost.Rout.save	2014-10-02 07:37:30 UTC (rev 801)
+++ pkg/mboostDevel/tests/regtest-gamboost.Rout.save	2014-10-02 09:05:36 UTC (rev 802)
@@ -19,6 +19,7 @@
 > require("mboostDevel")
 Loading required package: mboostDevel
 Loading required package: parallel
+Loading required package: stabs
 This is mboostDevel 2.4-0. See 'package?mboostDevel' and the NEWS file
 for a complete list of changes.
 
@@ -507,4 +508,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 10.946   0.189  11.354 
+ 11.110   0.250  11.664 

Modified: pkg/mboostDevel/tests/regtest-glmboost.Rout.save
===================================================================
--- pkg/mboostDevel/tests/regtest-glmboost.Rout.save	2014-10-02 07:37:30 UTC (rev 801)
+++ pkg/mboostDevel/tests/regtest-glmboost.Rout.save	2014-10-02 09:05:36 UTC (rev 802)
@@ -19,6 +19,7 @@
 > require("mboostDevel")
 Loading required package: mboostDevel
 Loading required package: parallel
+Loading required package: stabs
 This is mboostDevel 2.4-0. See 'package?mboostDevel' and the NEWS file
 for a complete list of changes.
 
@@ -597,4 +598,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 16.073   0.217  17.211 
+ 16.180   0.229  16.669 

Modified: pkg/mboostDevel/tests/regtest-hatmatrix.Rout.save
===================================================================
--- pkg/mboostDevel/tests/regtest-hatmatrix.Rout.save	2014-10-02 07:37:30 UTC (rev 801)
+++ pkg/mboostDevel/tests/regtest-hatmatrix.Rout.save	2014-10-02 09:05:36 UTC (rev 802)
@@ -18,6 +18,7 @@
 > 
 > library("mboostDevel")
 Loading required package: parallel
+Loading required package: stabs
 This is mboostDevel 2.4-0. See 'package?mboostDevel' and the NEWS file
 for a complete list of changes.
 
@@ -83,4 +84,4 @@
 > 
 > proc.time()
    user  system elapsed 
-  2.209   0.038   2.292 
+  2.130   0.082   2.278 

Modified: pkg/mboostDevel/tests/regtest-inference.Rout.save
===================================================================
--- pkg/mboostDevel/tests/regtest-inference.Rout.save	2014-10-02 07:37:30 UTC (rev 801)
+++ pkg/mboostDevel/tests/regtest-inference.Rout.save	2014-10-02 09:05:36 UTC (rev 802)
@@ -18,6 +18,7 @@
 > require("mboostDevel")
 Loading required package: mboostDevel
 Loading required package: parallel
+Loading required package: stabs
 This is mboostDevel 2.4-0. See 'package?mboostDevel' and the NEWS file
 for a complete list of changes.
 
@@ -29,8 +30,9 @@
     IPCweights, Laplace, Loglog, Lognormal, Multinomial, NBinomial,
     Poisson, PropOdds, QuantReg, Weibull, bbs, blackboost, bmono, bmrf,
     bns, bols, boost_control, brad, brandom, bspatial, bss, btree,
-    buser, cv, cvrisk, extract, gamboost, glmboost, mboost, mboost_fit,
-    mstop, mstop<-, nuisance, risk, selected, survFit
+    buser, confint.glmboost, confint.mboost, cv, cvrisk, extract,
+    gamboost, glmboost, mboost, mboost_fit, mstop, mstop<-, nuisance,
+    risk, selected, stabsel.mboost, stabsel_parameters.mboost, survFit
 
 > 
 > set.seed(1907)
@@ -204,4 +206,4 @@
 > 
 > proc.time()
    user  system elapsed 
- 49.173   5.592  49.202 
+ 49.465   5.646  49.896 



More information about the Mboost-commits mailing list