[Mboost-commits] r813 - in pkg: mboostDevel mboostDevel/R mboostDevel/inst mboostDevel/man mboostDevel/vignettes mboostPatch/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Nov 26 18:57:45 CET 2014


Author: hofner
Date: 2014-11-26 18:57:45 +0100 (Wed, 26 Nov 2014)
New Revision: 813

Removed:
   pkg/mboostDevel/inst/AML_Bullinger.Rda
Modified:
   pkg/mboostDevel/DESCRIPTION
   pkg/mboostDevel/NAMESPACE
   pkg/mboostDevel/R/crossvalidation.R
   pkg/mboostDevel/R/methods.R
   pkg/mboostDevel/R/stabsel.R
   pkg/mboostDevel/inst/CITATION
   pkg/mboostDevel/inst/NEWS.Rd
   pkg/mboostDevel/man/baselearners.Rd
   pkg/mboostDevel/man/confint.Rd
   pkg/mboostDevel/man/cvrisk.Rd
   pkg/mboostDevel/man/methods.Rd
   pkg/mboostDevel/man/stabsel.Rd
   pkg/mboostDevel/vignettes/SurvivalEnsembles.Rnw
   pkg/mboostPatch/R/stabsel.R
Log:
- merged changes from mboost to mboostDevel

Modified: pkg/mboostDevel/DESCRIPTION
===================================================================
--- pkg/mboostDevel/DESCRIPTION	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/DESCRIPTION	2014-11-26 17:57:45 UTC (rev 813)
@@ -21,4 +21,4 @@
         RColorBrewer, rpart (>= 4.0-3)
 LazyData: yes
 License: GPL-2
-URL: http://r-forge.r-project.org/projects/mboost/
+URL: http://mboost.r-forge.r-project.org/

Modified: pkg/mboostDevel/NAMESPACE
===================================================================
--- pkg/mboostDevel/NAMESPACE	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/NAMESPACE	2014-11-26 17:57:45 UTC (rev 813)
@@ -21,7 +21,7 @@
        ExpectReg, NBinomial, PropOdds, Weibull, Loglog, Lognormal, AUC, mboost_fit,
        Huber, AdaExp, Gehan, CoxPH, Hurdle, Multinomial, FP, IPCweights,
        cvrisk, cv, bbs,
-       bols, bspatial, brandom, btree, bss, bns, brad, bmono, bmrf, buser, survFit, selected,
+       bols, bspatial, brandom, btree, bss, bns, brad, bmono, bmrf, buser, survFit, selected.mboost,
        nuisance, "%+%", "%X%", "%O%", extract, risk, "mstop<-",
        stabsel.mboost, stabsel_parameters.mboost, confint.mboost, confint.glmboost)
        ###, basesel, fitsel)

Modified: pkg/mboostDevel/R/crossvalidation.R
===================================================================
--- pkg/mboostDevel/R/crossvalidation.R	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/R/crossvalidation.R	2014-11-26 17:57:45 UTC (rev 813)
@@ -7,8 +7,10 @@
 cvrisk <- function(object, ...)
     UseMethod("cvrisk")
 
-cvrisk.mboost <- function (object, folds = cv(model.weights(object)), grid = 1:mstop(object),
-                    papply = mclapply, fun = NULL, ...){
+cvrisk.mboost <- function (object, folds = cv(model.weights(object)),
+                           grid = 1:mstop(object), papply = mclapply,
+                           fun = NULL, corrected = TRUE, ...) {
+
     weights <- model.weights(object)
     if (any(weights == 0))
         warning("zero weights")
@@ -24,21 +26,48 @@
     fam_name <- object$family at name
     call <- deparse(object$call)
     if (is.null(fun)) {
-        dummyfct <- function(weights, oobweights) {
-            mod <- fitfct(weights = weights, oobweights = oobweights)
-            mod[max(grid)]
-            mod$risk()[grid]
+        if (fam_name != "Cox Partial Likelihood" || !corrected) {
+            dummyfct <- function(weights, oobweights) {
+                mod <- fitfct(weights = weights, oobweights = oobweights)
+                mod[max(grid)]
+                mod$risk()[grid]
+            }
+        } else {
+            ## If family = CoxPH(), cross-validation needs to be computed as in
+            ## Verweij, van Houwelingen (1993), Cross-validation in survival
+            ## analysis, Statistics in Medicine, 12:2305-2314.
+            plloss <- environment(object$family at risk)[["plloss"]]
+
+            if (is.null(fun)) {
+                dummyfct <- function(weights, oobweights) {
+                    ## <FIXME> Should the risk be computed on the inbag
+                    ## (currently done) or on the oobag observations?
+                    mod <- fitfct(weights = weights, oobweights = oobweights,
+                                  risk = "inbag")
+                    mod[max(grid)]
+
+                    pr <- predict(mod, aggregate = "cumsum")
+                    ## <FIXME> are the weights w really equal to 1? Shouldn't it
+                    ## be equal to the original fitting weights? Is this
+                    ## computed on ALL observations (currently done) or only on
+                    ## the OOBAG observations?
+                    lplk <- apply(pr[, grid], 2, function(f)
+                        sum(plloss(y = object$response, f = f, w = 1)))
+                    ## return negative "cvl"
+                    - mod$risk()[grid] - lplk
+                }
+            }
         }
-    }
-    else {
+    } else { ## !is.null(fun)
         dummyfct <- function(weights, oobweights) {
             mod <- fitfct(weights = weights, oobweights = oobweights)
             mod[max(grid)]
-            ### make sure dispatch works correctly
+            ## make sure dispatch works correctly
             class(mod) <- class(object)
             fun(mod)
         }
     }
+
     ## use case weights as out-of-bag weights (but set inbag to 0)
     OOBweights <- matrix(rep(weights, ncol(folds)), ncol = ncol(folds))
     OOBweights[folds > 0] <- 0

Modified: pkg/mboostDevel/R/methods.R
===================================================================
--- pkg/mboostDevel/R/methods.R	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/R/methods.R	2014-11-26 17:57:45 UTC (rev 813)
@@ -444,10 +444,6 @@
     ret[which]
 }
 
-
-selected <- function(object, ...)
-    UseMethod("selected", object)
-
 selected.mboost <- function(object, ...)
     object$xselect()
 

Modified: pkg/mboostDevel/R/stabsel.R
===================================================================
--- pkg/mboostDevel/R/stabsel.R	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/R/stabsel.R	2014-11-26 17:57:45 UTC (rev 813)
@@ -74,11 +74,11 @@
     if (extends(class(x), "glmboost"))
         rownames(phat) <- variable.names(x)
     ret <- list(phat = phat, selected = which((mm <- apply(phat, 1, max)) >= cutoff),
-                max = mm, cutoff = cutoff, q = q, PFER = PFER,
+                max = mm, cutoff = cutoff, q = q, PFER = PFER, p = p, B = B, 
                 sampling.type = sampling.type, assumption = assumption,
                 call = cll)
     ret$call[[1]] <- as.name("stabsel")
-    class(ret) <- c("stabsel", "stabsel_mboost")
+    class(ret) <- c("stabsel_mboost", "stabsel")
     ret
 }
 

Deleted: pkg/mboostDevel/inst/AML_Bullinger.Rda
===================================================================
(Binary files differ)

Modified: pkg/mboostDevel/inst/CITATION
===================================================================
--- pkg/mboostDevel/inst/CITATION	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/inst/CITATION	2014-11-26 17:57:45 UTC (rev 813)
@@ -6,7 +6,7 @@
      vers <- paste("R package version", desc$Version)
 
      citEntry(entry="Manual",
-              title = "Model-Based Boosting",
+              title = "{mboost}: Model-Based Boosting",
               author = personList(as.person("Torsten Hothorn"),
                                   as.person("Peter Buehlmann"),
                                   as.person("Thomas Kneib"),
@@ -14,12 +14,12 @@
                                   as.person("Benjamin Hofner")),
               year = year,
               note = vers,
-              url = "http://CRAN.R-project.org/package=mboostDevel",
+              url = "http://CRAN.R-project.org/package=mboost",
               textVersion =
               paste("T. Hothorn, P. Buehlmann, T. Kneib, M. Schmid, and B. Hofner (",
                     year,
-                    "). mboostDevel: Model-Based Boosting, ",
-                    vers, ", http://CRAN.R-project.org/package=mboostDevel", ".",
+                    "). mboost: Model-Based Boosting, ",
+                    vers, ", http://CRAN.R-project.org/package=mboost", ".",
                     sep=""))
 
     citEntry(entry="Article",

Modified: pkg/mboostDevel/inst/NEWS.Rd
===================================================================
--- pkg/mboostDevel/inst/NEWS.Rd	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/inst/NEWS.Rd	2014-11-26 17:57:45 UTC (rev 813)
@@ -18,8 +18,24 @@
     }
   }
 }
-	
 
+\section{Changes in mboost version 2.4-1 (2014-xx-yy)}{
+  \subsection{Miscellaneous}{
+    \itemize{
+      \item load AML dataset from package TH.data
+    }
+  }
+  \subsection{Bug-fixes}{
+    \itemize{
+      \item Cross-validation was potentially wrong for \code{CoxPH()}
+      models. Users can now choose if they want the naive
+      cross-validation or the improved version by Verweij and van
+      Houwelingen (1993); (spotted by Holger Reulen <hreulen _ at _
+      uni-goettingen.de>)
+    }
+  }
+}
+
 \section{Changes in mboost version 2.4-0 (2014-10-02)}{
   \subsection{User-visible changes}{
     \itemize{

Modified: pkg/mboostDevel/man/baselearners.Rd
===================================================================
--- pkg/mboostDevel/man/baselearners.Rd	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/man/baselearners.Rd	2014-11-26 17:57:45 UTC (rev 813)
@@ -490,9 +490,9 @@
   Monotonicity-Constrained Species Distribution Models,
   \emph{Ecology}, \bold{92}, 1895--1901.
 
-  Benjamin Hofner, Thomas Kneib and Torsten Hothorn (2014),
-  A Unified Framework of Constrained Regression. Accepted for publication
-  in \emph{Statistics & Computing}.\cr
+  Benjamin Hofner, Thomas Kneib and Torsten Hothorn (2014), A Unified
+  Framework of Constrained Regression. \emph{Statistics & Computing}.
+  Online first. DOI:10.1007/s11222-014-9520-y.\cr
   Preliminary version: \url{http://arxiv.org/abs/1403.7118}
 
   Thomas Kneib, Torsten Hothorn and Gerhard Tutz (2009), Variable

Modified: pkg/mboostDevel/man/confint.Rd
===================================================================
--- pkg/mboostDevel/man/confint.Rd	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/man/confint.Rd	2014-11-26 17:57:45 UTC (rev 813)
@@ -118,8 +118,8 @@
 }
 \references{
   Benjamin Hofner, Thomas Kneib and Torsten Hothorn (2014),
-  A Unified Framework of Constrained Regression. Accepted for publication
-  in \emph{Statistics & Computing}.
+  A Unified Framework of Constrained Regression. \emph{Statistics &
+    Computing}. Online first. DOI:10.1007/s11222-014-9520-y.
 
   Preliminary version: \url{http://arxiv.org/abs/1403.7118}
 }

Modified: pkg/mboostDevel/man/cvrisk.Rd
===================================================================
--- pkg/mboostDevel/man/cvrisk.Rd	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/man/cvrisk.Rd	2014-11-26 17:57:45 UTC (rev 813)
@@ -10,7 +10,7 @@
 \method{cvrisk}{mboost}(object, folds = cv(model.weights(object)),
        grid = 1:mstop(object),
        papply = mclapply,
-       fun = NULL, ...)
+       fun = NULL, corrected = TRUE, ...)
 cv(weights, type = c("bootstrap", "kfold", "subsampling"),
    B = ifelse(type == "kfold", 10, 25), prob = 0.5, strata = NULL)
 }
@@ -32,6 +32,10 @@
   \item{fun}{ if \code{fun} is NULL, the out-of-sample risk is returned. \code{fun},
               as a function of \code{object}, may extract any other characteristic
               of the cross-validated models. These are returned as is.}
+  \item{corrected}{ if \code{TRUE}, the corrected cross-validation
+    scheme of Verweij and van Houwelingen (1993) is used in case of Cox
+    models. Otherwise, the naive standard cross-validation scheme is
+    used.}
   \item{weights}{ a numeric vector of weights for the model to be cross-validated.}
   \item{type}{ character argument for specifying the cross-validation
                method. Currently (stratified) bootstrap, k-fold cross-validation
@@ -85,6 +89,10 @@
   component-wise gradient boosting. \emph{Methods of Information in
     Medicine}, \bold{51}, 178--186. \cr
   DOI: \url{http://dx.doi.org/10.3414/ME11-02-0030}
+
+  Verweij and van Houwelingen (1993). Cross-validation in survival
+  analysis. \emph{Statistics in Medicine}, \bold{12}:2305--2314.
+
 }
 \seealso{\code{\link{AIC.mboost}} for
   \code{AIC} based selection of the stopping iteration. Use \code{mstop}

Modified: pkg/mboostDevel/man/methods.Rd
===================================================================
--- pkg/mboostDevel/man/methods.Rd	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/man/methods.Rd	2014-11-26 17:57:45 UTC (rev 813)
@@ -45,7 +45,6 @@
 \alias{hatvalues.gamboost}
 \alias{hatvalues.glmboost}
 
-\alias{selected}
 \alias{selected.mboost}
 
 \alias{nuisance}

Modified: pkg/mboostDevel/man/stabsel.Rd
===================================================================
--- pkg/mboostDevel/man/stabsel.Rd	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/man/stabsel.Rd	2014-11-26 17:57:45 UTC (rev 813)
@@ -66,7 +66,8 @@
 }
 \details{
 
-  For details see \code{\link[stabs]{stabsel}} in package \pkg{stabs}.
+  For details see \code{\link[stabs]{stabsel}} in package \pkg{stabs}
+  and Hofner et al. (2014).
 
 }
 \value{
@@ -86,6 +87,11 @@
 }
 \references{
 
+  B. Hofner, L. Boccuto and M. Goeker (2014),
+  Controlling false discoveries in high-dimensional situations: Boosting
+  with stability selection. \emph{Technical Report}, arXiv:1411.1285.\cr
+  \url{http://arxiv.org/abs/1411.1285}.
+
   N. Meinshausen and P. Buehlmann (2010), Stability selection.
   \emph{Journal of the Royal Statistical Society, Series B},
   \bold{72}, 417--473.

Modified: pkg/mboostDevel/vignettes/SurvivalEnsembles.Rnw
===================================================================
--- pkg/mboostDevel/vignettes/SurvivalEnsembles.Rnw	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostDevel/vignettes/SurvivalEnsembles.Rnw	2014-11-26 17:57:45 UTC (rev 813)
@@ -127,7 +127,7 @@
 <<loaddata, echo = FALSE, results = tex>>=
 ### load data. See `mboost/inst/readAML_Bullinger.R' for
 ### how the data were generated from the raw data.
-load(system.file("AML_Bullinger.Rda", package = "mboostDevel"))
+load(file.path(path.package(package = "TH.data"), "rda", "AML_Bullinger.rda"))
 @
 
 \paragraph{Data preprocessing}

Modified: pkg/mboostPatch/R/stabsel.R
===================================================================
--- pkg/mboostPatch/R/stabsel.R	2014-11-26 17:57:41 UTC (rev 812)
+++ pkg/mboostPatch/R/stabsel.R	2014-11-26 17:57:45 UTC (rev 813)
@@ -74,7 +74,7 @@
     if (extends(class(x), "glmboost"))
         rownames(phat) <- variable.names(x)
     ret <- list(phat = phat, selected = which((mm <- apply(phat, 1, max)) >= cutoff),
-                max = mm, cutoff = cutoff, q = q, PFER = PFER, p = p,
+                max = mm, cutoff = cutoff, q = q, PFER = PFER, p = p, B = B, 
                 sampling.type = sampling.type, assumption = assumption,
                 call = cll)
     ret$call[[1]] <- as.name("stabsel")



More information about the Mboost-commits mailing list