From noreply at r-forge.r-project.org Fri Jul 18 13:11:08 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 18 Jul 2014 13:11:08 +0200 (CEST) Subject: [Robast-commits] r754 - branches/robast-1.0/pkg/RobAStBase/R Message-ID: <20140718111108.ED72D184ACD@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-18 13:11:08 +0200 (Fri, 18 Jul 2014) New Revision: 754 Modified: branches/robast-1.0/pkg/RobAStBase/R/plotWrapper.R Log: RobAStBase:: fixed NA-buglet in plotWrapper.R (detected by Dasha Pupashenko) Modified: branches/robast-1.0/pkg/RobAStBase/R/plotWrapper.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/plotWrapper.R 2014-04-16 09:25:01 UTC (rev 753) +++ branches/robast-1.0/pkg/RobAStBase/R/plotWrapper.R 2014-07-18 11:11:08 UTC (rev 754) @@ -142,7 +142,7 @@ ,with.lab = substitute(FALSE) ,lab.pts = substitute(NULL) ,lab.font = substitute(NULL) - ,alpha.trsp = substitute(NA) + ,alpha.trsp = substitute(alpha.trsp) ,which.lbs = substitute(NULL) ,which.Order = substitute(NULL) ,return.Order = substitute(FALSE) @@ -316,7 +316,7 @@ ,with.lab = substitute(FALSE) ,lab.pts = substitute(NULL) ,lab.font = substitute(NULL) - ,alpha.trsp = substitute(NA) + ,alpha.trsp = substitute(alpha.trsp) ,which.lbs = substitute(NULL) ,which.Order = substitute(NULL) ,return.Order = substitute(FALSE) From noreply at r-forge.r-project.org Fri Jul 18 14:52:53 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Fri, 18 Jul 2014 14:52:53 +0200 (CEST) Subject: [Robast-commits] r755 - branches/robast-1.0/pkg/ROptEst/R Message-ID: <20140718125254.0E8A51862EF@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-18 14:52:53 +0200 (Fri, 18 Jul 2014) New Revision: 755 Modified: branches/robast-1.0/pkg/ROptEst/R/plotWrapper.R Log: ROptEst: fixed NA-buglet in plotWrapper for cniperpointPlot (thx to Dasha) Modified: branches/robast-1.0/pkg/ROptEst/R/plotWrapper.R =================================================================== --- branches/robast-1.0/pkg/ROptEst/R/plotWrapper.R 2014-07-18 11:11:08 UTC (rev 754) +++ branches/robast-1.0/pkg/ROptEst/R/plotWrapper.R 2014-07-18 12:52:53 UTC (rev 755) @@ -91,7 +91,7 @@ ,with.lab = substitute(FALSE) ,lab.pts = substitute(NULL) ,lab.font = substitute(NULL) - ,alpha.trsp = substitute(NA) + ,alpha.trsp = substitute(alpha.trsp) ,which.lbs = substitute(NULL) ,which.Order = substitute(NULL) ,return.Order = substitute(FALSE) From noreply at r-forge.r-project.org Tue Jul 22 19:22:07 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 22 Jul 2014 19:22:07 +0200 (CEST) Subject: [Robast-commits] r756 - branches/robast-1.0/pkg/RobAStBase/R Message-ID: <20140722172207.60EE7186187@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-22 19:22:06 +0200 (Tue, 22 Jul 2014) New Revision: 756 Modified: branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R Log: RobAStBase: introduced automatic scaling of points in comparePlot.R and infoPlot.R Modified: branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R 2014-07-18 12:52:53 UTC (rev 755) +++ branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R 2014-07-22 17:22:06 UTC (rev 756) @@ -253,9 +253,14 @@ return(.SelectOrderData(data, fct.aI, which.lbs, which.Order))} sel1 <- def.sel(IC1); sel2 <- def.sel(IC2) + selAlly <- c(sel1$y,sel2$y) - if(is(obj3, "IC")) sel3 <- def.sel(IC3) - if(is(obj4, "IC")) sel4 <- def.sel(IC4) + if(is(obj3, "IC")){ sel3 <- def.sel(IC3) + selAlly <- c(selAlly,sel3$y) + } + if(is(obj4, "IC")){ sel4 <- def.sel(IC4) + selAlly <- c(selAlly,sel4$y) + } dots.points <- .makedotsLowLevel(dots) dots.points$col <- dots.points$cex <- dots.points$pch <- NULL @@ -275,7 +280,7 @@ col.l <- if(is.na(al0[j.l])) col0[j.l] else addAlphTrsp2col(col0[j.l], al0[j.l]) - cex.l <- log(sel.l$y+1)*3*cex0[j.l] + cex.l <- .cexscale(sel.l$y,selAlly,cex=cex0[j.l]) ##.cexscale in infoPlot.R do.call(points, args=c(list(rescd$X, rescd$Y, cex = cex.l, col = col.l, pch = pch.pts.l), dwo0)) if(with.lab0) Modified: branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R 2014-07-18 12:52:53 UTC (rev 755) +++ branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R 2014-07-22 17:22:06 UTC (rev 756) @@ -357,8 +357,8 @@ ICy0cr1 <- jitter(ICy0cr1, factor = jitter.fac0[2]) } - f1 <- log(ICy0+1)*3*cex0[1] - f1c <- log(ICy0c+1)*3*cex0[2] + f1 <- .cexscale(ICy0,ICy0c,cex=cex0[1]) + f1c <- .cexscale(ICy0c,ICy0,cex=cex0[2]) col.pts <- if(!is.na(al0)) sapply(col0, addAlphTrsp2col, alpha=al0) else col0 @@ -398,8 +398,8 @@ scaleX, scaleX.fct, scaleX.inv, FALSE, scaleY.fct, dots$xlim, dots$ylim, dotsP0) - f1 <- resc.rel$scy*0.3*cex0[1] - f1c <- resc.rel.c$scy*0.3*cex0[2] + f1 <- .cexscale(resc.rel$scy,resc.rel.c$scy,cex=cex0[1]) + f1c <- .cexscale(resc.rel.c$scy,resc.rel$scy,cex=cex0[2]) do.pts(resc.rel$X, resc.rel$Y, f1,col.pts[1],pch0[,1]) do.pts(resc.rel.c$X, resc.rel.c$Y, f1c,col.pts[2],pch0[,2]) @@ -535,4 +535,15 @@ invisible() } ) + + .cexscale <- function(y, y1=y, maxcex=4,mincex=0.05,cex, fun=NULL){ + if(is.null(fun)) fun <- function(x) log(1+abs(x)) + ly <- fun(y) + ly1 <- fun(unique(c(y,y1))) + my <- min(ly1,na.rm=TRUE) + My <- max(ly1,na.rm=TRUE) + ly0 <- (ly-my)/My + ly1 <- ly0*(maxcex-mincex)+mincex + return(cex*ly1) + } \ No newline at end of file From noreply at r-forge.r-project.org Thu Jul 24 13:35:32 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 24 Jul 2014 13:35:32 +0200 (CEST) Subject: [Robast-commits] r757 - in branches/robast-1.0/pkg/RobAStBase: R man Message-ID: <20140724113532.F1B64187094@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-24 13:35:32 +0200 (Thu, 24 Jul 2014) New Revision: 757 Modified: branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd Log: [RobAStBase] infoPlot and comparePlot gain an argument cex.pts.fun to enable individual scaling of the point sizes to be plotted onto each of the plotted curves Modified: branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R 2014-07-22 17:22:06 UTC (rev 756) +++ branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R 2014-07-24 11:35:32 UTC (rev 757) @@ -14,7 +14,7 @@ scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm, scaleN = 9, x.ticks = NULL, y.ticks = NULL, mfColRow = TRUE, to.draw.arg = NULL, - cex.pts = 1, col.pts = par("col"), + cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"), pch.pts = 1, jitter.fac = 1, with.lab = FALSE, lab.pts = NULL, lab.font = NULL, alpha.trsp = NA, which.lbs = NULL, which.Order = NULL, return.Order = FALSE){ @@ -82,6 +82,11 @@ dotsP$yaxt <- "n" } + if(!is.null(cex.pts.fun)){ + cex.pts.fun <- .fillList(list(cex.pts.fun), dims0*ncomp) + } + + MBRB <- matrix(rep(t(MBRB), length.out=dims0*2),ncol=2, byrow=T) MBRB <- MBRB * MBR.fac @@ -280,7 +285,10 @@ col.l <- if(is.na(al0[j.l])) col0[j.l] else addAlphTrsp2col(col0[j.l], al0[j.l]) - cex.l <- .cexscale(sel.l$y,selAlly,cex=cex0[j.l]) ##.cexscale in infoPlot.R + + cfun <- if(is.null(cexfun)) NULL else cexfun[[(i-1)*ncomp+j.l]] + + cex.l <- .cexscale(sel.l$y,selAlly,cex=cex0[j.l], fun = cfun) ##.cexscale in infoPlot.R do.call(points, args=c(list(rescd$X, rescd$Y, cex = cex.l, col = col.l, pch = pch.pts.l), dwo0)) if(with.lab0) @@ -293,7 +301,7 @@ pL0 }, list(pL0 = pL, cex0 = cex.pts, pch0 = pch.pts, col0 = col.pts, jitter.fac0 = jitter.fac, dwo0 = dots.points, al0 = alp.v, - with.lab0 = with.lab, lab0 = lab.pts) + with.lab0 = with.lab, lab0 = lab.pts, cexfun=cex.pts.fun) ) } Modified: branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R 2014-07-22 17:22:06 UTC (rev 756) +++ branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R 2014-07-24 11:35:32 UTC (rev 757) @@ -12,7 +12,7 @@ scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm, scaleN = 9, x.ticks = NULL, y.ticks = NULL, mfColRow = TRUE, to.draw.arg = NULL, - cex.pts = 1, col.pts = par("col"), + cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"), pch.pts = 1, jitter.fac = 1, with.lab = FALSE, lab.pts = NULL, lab.font = NULL, alpha.trsp = NA, which.lbs = NULL, which.Order = NULL, return.Order = FALSE, @@ -59,6 +59,11 @@ ncols <- ceiling(dims0/nrows) in1to.draw <- (1%in%to.draw) + if(!is.null(cex.pts.fun)){ + cex.pts.fun <- .fillList(list(cex.pts.fun), (dims0+in1to.draw)*2) + } + + if(!is.null(x.ticks)) dots$xaxt <- "n" if(!is.null(y.ticks)){ y.ticks <- .fillList(list(y.ticks), dims0+in1to.draw) @@ -71,7 +76,7 @@ if (in1to.draw) legend.location[[1]] <- "bottomright" }else{ legend.location <- as.list(legend.location) - legend.location <- .fillList(legend.location, dims0+in1to.draw ) + legend.location <- .fillList(legend.location, dims0+in1to.draw ) } if(is.null(legend)){ legend <- vector("list",dims0+in1to.draw) @@ -357,8 +362,10 @@ ICy0cr1 <- jitter(ICy0cr1, factor = jitter.fac0[2]) } - f1 <- .cexscale(ICy0,ICy0c,cex=cex0[1]) - f1c <- .cexscale(ICy0c,ICy0,cex=cex0[2]) + c1fun <- if(is.null(cexfun)) NULL else cexfun[[1]] + c2fun <- if(is.null(cexfun)) NULL else cexfun[[2]] + f1 <- .cexscale(ICy0,ICy0c,cex=cex0[1], fun = c1fun) + f1c <- .cexscale(ICy0c,ICy0,cex=cex0[2], fun = c2fun) col.pts <- if(!is.na(al0)) sapply(col0, addAlphTrsp2col, alpha=al0) else col0 @@ -377,7 +384,7 @@ pch0 = pch.pts, al0 = alp.v[1], col0 = col.pts, with.lab0 = with.lab, n0 = n, lab.pts0 = lab.pts[i.d], lab.pts0C = lab.pts[i.dC], - jitter.fac0 = jitter.fac) + jitter.fac0 = jitter.fac, cexfun = cex.pts.fun) ) pL.rel <- substitute({ @@ -398,9 +405,12 @@ scaleX, scaleX.fct, scaleX.inv, FALSE, scaleY.fct, dots$xlim, dots$ylim, dotsP0) - f1 <- .cexscale(resc.rel$scy,resc.rel.c$scy,cex=cex0[1]) - f1c <- .cexscale(resc.rel.c$scy,resc.rel$scy,cex=cex0[2]) + c1fun <- if(is.null(cexfun)) NULL else cexfun[[(i1-1)*2+1]] + c2fun <- if(is.null(cexfun)) NULL else cexfun[[(i1-1)*2+2]] + f1 <- .cexscale(resc.rel$scy,resc.rel.c$scy,cex=cex0[1], fun=c1fun) + f1c <- .cexscale(resc.rel.c$scy,resc.rel$scy,cex=cex0[2], fun=c2fun) + do.pts(resc.rel$X, resc.rel$Y, f1,col.pts[1],pch0[,1]) do.pts(resc.rel.c$X, resc.rel.c$Y, f1c,col.pts[2],pch0[,2]) if(with.lab0){ @@ -414,7 +424,7 @@ cex0 = cex.pts, pch0 = pch.pts, al0 = alp.v, col0 = col.pts, with.lab0 = with.lab,n0 = n, lab.pts0 = lab.pts[i.d], lab.pts0C = lab.pts[i.dC], - jitter.fac0 = jitter.fac + jitter.fac0 = jitter.fac, cexfun = cex.pts.fun )) } Modified: branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd =================================================================== --- branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd 2014-07-22 17:22:06 UTC (rev 756) +++ branches/robast-1.0/pkg/RobAStBase/man/comparePlot.Rd 2014-07-24 11:35:32 UTC (rev 757) @@ -25,7 +25,7 @@ scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm, scaleN = 9, x.ticks = NULL, y.ticks = NULL, mfColRow = TRUE, to.draw.arg = NULL, - cex.pts = 1, col.pts = par("col"), + cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"), pch.pts = 1, jitter.fac = 1, with.lab = FALSE, lab.pts = NULL, lab.font = NULL, alpha.trsp = NA, which.lbs = NULL, which.Order = NULL, return.Order = FALSE) @@ -118,6 +118,14 @@ the number of rows of the trafo matrix. } \item{cex.pts}{size of the points of the \code{data} argument plotted} + \item{cex.pts.fun}{rescaling function for the size of the points to be plotted; + either \code{NULL} (default), then \code{log(1+abs(x))} is used for each of + the rescalings, or a function which is then used for each of the + rescalings, or a list of functions; if it is a function or a list of + functions, if necessary it is recylced to length \code{nIC * dim} + where \code{nIC} is the number of pICs and \code{dim} is the number of + dimensions of the pICs to be plotted; in the index of this list, + \code{nIC} is incremented first; then \code{dim}.} \item{col.pts}{color of the points of the \code{data} argument plotted} \item{pch.pts}{symbol of the points of the \code{data} argument plotted} \item{with.lab}{logical; shall labels be plotted to the observations?} Modified: branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd =================================================================== --- branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd 2014-07-22 17:22:06 UTC (rev 756) +++ branches/robast-1.0/pkg/RobAStBase/man/infoPlot.Rd 2014-07-24 11:35:32 UTC (rev 757) @@ -22,7 +22,7 @@ scaleY = FALSE, scaleY.fct = pnorm, scaleY.inv=qnorm, scaleN = 9, x.ticks = NULL, y.ticks = NULL, mfColRow = TRUE, to.draw.arg = NULL, - cex.pts = 1, col.pts = par("col"), + cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"), pch.pts = 1, jitter.fac = 1, with.lab = FALSE, lab.pts = NULL, lab.font = NULL, alpha.trsp = NA, which.lbs = NULL, which.Order = NULL, return.Order = FALSE, @@ -114,6 +114,16 @@ the number of rows of the trafo matrix. } \item{cex.pts}{size of the points of the \code{data} argument plotted} + \item{cex.pts.fun}{rescaling function for the size of the points to be plotted; + either \code{NULL} (default), then \code{log(1+abs(x))} is used for each of + the rescalings, or a function which is then used for each of the + rescalings, or a list of functions; if it is a function or a list of + functions, if necessary it is recylced to length \code{2 * dim} + (where 2 is for the two pICs plotted, i.e., the classically optimal one and + argument \code{IC}, and \code{dim} is the number of + dimensions of the pICs to be plotted; in the index of this list, + the index for classical vs. \code{IC} is incremented first; + then \code{dim}.} \item{col.pts}{color of the points of the \code{data} argument plotted} \item{pch.pts}{symbol of the points of the \code{data} argument plotted} \item{with.lab}{logical; shall labels be plotted to the observations?} From noreply at r-forge.r-project.org Thu Jul 24 13:42:34 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 24 Jul 2014 13:42:34 +0200 (CEST) Subject: [Robast-commits] r758 - branches/robast-1.0/pkg/ROptEst/R Message-ID: <20140724114235.108621845E3@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-24 13:42:34 +0200 (Thu, 24 Jul 2014) New Revision: 758 Modified: branches/robast-1.0/pkg/ROptEst/R/cniperCont.R Log: [ROptEst] cniperPointPlot gains capacity to deal with "interpolRisk" - risks Modified: branches/robast-1.0/pkg/ROptEst/R/cniperCont.R =================================================================== --- branches/robast-1.0/pkg/ROptEst/R/cniperCont.R 2014-07-24 11:35:32 UTC (rev 757) +++ branches/robast-1.0/pkg/ROptEst/R/cniperCont.R 2014-07-24 11:42:34 UTC (rev 758) @@ -228,7 +228,9 @@ robMod <- InfRobModel(center = L2Fam, neighbor = neighbor) mcl$IC1 <- optIC(model = L2Fam, risk = asCov()) - mcl$IC2 <- optIC(model = robMod, risk = risk) + mcl$IC2 <- if(is(risk,"interpolRisk")){ + getStartIC(model=L2Fam, risk = risk) + }else optIC(model = robMod, risk = risk) mcl$L2Fam <- NULL if(is.null(dots$ylab)) mcl$ylab <- gettext("Asymptotic Risk difference (classic - robust)") From noreply at r-forge.r-project.org Thu Jul 24 14:29:21 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 24 Jul 2014 14:29:21 +0200 (CEST) Subject: [Robast-commits] r759 - in branches/robast-1.0/pkg/RobAStBase: R man Message-ID: <20140724122922.1E482187094@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-24 14:29:21 +0200 (Thu, 24 Jul 2014) New Revision: 759 Modified: branches/robast-1.0/pkg/RobAStBase/R/00internal.R branches/robast-1.0/pkg/RobAStBase/R/AllPlot.R branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R branches/robast-1.0/pkg/RobAStBase/man/internal_plots.Rd Log: [RobAStBase] fixed a little bug with the use of .cexscale (with list of functions); .cexscale is now documented, and the argument of .fillList is now automatically cast to list (if necessary). Modified: branches/robast-1.0/pkg/RobAStBase/R/00internal.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/00internal.R 2014-07-24 11:42:34 UTC (rev 758) +++ branches/robast-1.0/pkg/RobAStBase/R/00internal.R 2014-07-24 12:29:21 UTC (rev 759) @@ -17,6 +17,7 @@ {as.character(arg) %in% names(formals(fct))} .fillList <- function(list0, len = length(list0)){ + if(!is.list(list0)) list0 <- list(list0) if(len == length(list0)) return(list0) i <- 0 Modified: branches/robast-1.0/pkg/RobAStBase/R/AllPlot.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/AllPlot.R 2014-07-24 11:42:34 UTC (rev 758) +++ branches/robast-1.0/pkg/RobAStBase/R/AllPlot.R 2014-07-24 12:29:21 UTC (rev 759) @@ -52,7 +52,7 @@ if(!is.null(x.ticks)) dots$xaxt <- "n" if(!is.null(y.ticks)){ - y.ticks <- .fillList(list(y.ticks), dims0) + y.ticks <- .fillList(y.ticks, dims0) dots$yaxt <- "n" } @@ -195,7 +195,7 @@ if(with.legend){ fac.leg <- if(dims0>1) 3/4 else .75/.8 if(missing(legend.location)){ - legend.location <- .fillList(list("bottomright"), dims0) + legend.location <- .fillList("bottomright", dims0) }else{ legend.location <- as.list(legend.location) legend.location <- .fillList(legend.location, dims0) Modified: branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R 2014-07-24 11:42:34 UTC (rev 758) +++ branches/robast-1.0/pkg/RobAStBase/R/comparePlot.R 2014-07-24 12:29:21 UTC (rev 759) @@ -78,12 +78,12 @@ if(!is.null(x.ticks)) dotsP$xaxt <- "n" if(!is.null(y.ticks)){ - y.ticks <- .fillList(list(y.ticks), dims0) + y.ticks <- .fillList(y.ticks, dims0) dotsP$yaxt <- "n" } if(!is.null(cex.pts.fun)){ - cex.pts.fun <- .fillList(list(cex.pts.fun), dims0*ncomp) + cex.pts.fun <- .fillList(cex.pts.fun, dims0*ncomp) } @@ -410,3 +410,4 @@ obj3=sel3$ind1, obj4=sel4$ind1)) invisible() }) + Modified: branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R 2014-07-24 11:42:34 UTC (rev 758) +++ branches/robast-1.0/pkg/RobAStBase/R/infoPlot.R 2014-07-24 12:29:21 UTC (rev 759) @@ -60,19 +60,19 @@ in1to.draw <- (1%in%to.draw) if(!is.null(cex.pts.fun)){ - cex.pts.fun <- .fillList(list(cex.pts.fun), (dims0+in1to.draw)*2) + cex.pts.fun <- .fillList(cex.pts.fun, (dims0+in1to.draw)*2) } if(!is.null(x.ticks)) dots$xaxt <- "n" if(!is.null(y.ticks)){ - y.ticks <- .fillList(list(y.ticks), dims0+in1to.draw) + y.ticks <- .fillList(y.ticks, dims0+in1to.draw) dots$yaxt <- "n" } if(with.legend){ if(missing(legend.location)){ - legend.location <- .fillList(list("topright"), dims0+in1to.draw ) + legend.location <- .fillList("topright", dims0+in1to.draw ) if (in1to.draw) legend.location[[1]] <- "bottomright" }else{ legend.location <- as.list(legend.location) Modified: branches/robast-1.0/pkg/RobAStBase/man/internal_plots.Rd =================================================================== --- branches/robast-1.0/pkg/RobAStBase/man/internal_plots.Rd 2014-07-24 11:42:34 UTC (rev 758) +++ branches/robast-1.0/pkg/RobAStBase/man/internal_plots.Rd 2014-07-24 12:29:21 UTC (rev 759) @@ -6,6 +6,7 @@ \alias{.SelectOrderData} \alias{.makedotsP} \alias{.makedotsLowLevel} +\alias{.cexscale} \title{Internal / Helper functions of package RobAStBase for plot functions} @@ -24,6 +25,7 @@ .SelectOrderData(data, fct, which.lbs, which.Order) .makedotsP(dots) .makedotsLowLevel(dots) +.cexscale(y, y1=y, maxcex=4,mincex=0.05,cex, fun=NULL) } \arguments{ \item{scaleX}{logical; shall X-axis be rescaled (by default according to the cdf of @@ -75,6 +77,12 @@ \code{y.ticks} are both \code{NULL}, a respective box is drawn around the panel; otherwise no box is drawn in this case. } \item{dots}{a list; intended to be the \code{\dots} argument of \code{plot}. } + \item{y}{} + \item{y1}{} + \item{maxcex}{} + \item{mincex}{} + \item{cex}{} + \item{fun}{} } \details{ \code{.rescalefct} rescales, if necessary, x and y axis for use in plot @@ -118,7 +126,19 @@ \code{.makedotsP} and \code{.makedotsLowLevel} manipulate the \code{\dots} argument, deleting certain items and selecting items which can be digested by \code{plot}, returning the manipulated list. + +\code{.cexscale}{rescales the point sizes of the points to be plotted; + the unscaled sizes are given in argument \code{y}, \code{y1} in + case of several lines of points to be plotted may contain the + vector of the sizes of all points to be plotted in (e.g., including + those of the other lines of points). \code{maxcex} and \code{mincex} + are maximum and minimum of the raw rescaled sizes; \code{cex} is + a factor drawn from argument \code{cex.pts} by which the raw sizes + are rescaled before being returned. \code{fun} is the function + by which the rescaling is done; by default this argument is \code{NULL} + and in this case the function \code{log(1+abs(x))} is used. } +} \keyword{internal} From noreply at r-forge.r-project.org Thu Jul 24 14:58:41 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 24 Jul 2014 14:58:41 +0200 (CEST) Subject: [Robast-commits] r760 - in branches/robast-1.0/pkg/RobAStBase: R man Message-ID: <20140724125841.EB9A0186ADC@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-24 14:58:41 +0200 (Thu, 24 Jul 2014) New Revision: 760 Added: branches/robast-1.0/pkg/RobAStBase/man/biastype-methods.Rd branches/robast-1.0/pkg/RobAStBase/man/normtype-methods.Rd Modified: branches/robast-1.0/pkg/RobAStBase/R/interpolRisks.R Log: [RobAStBase] interpolRisks gain biastype and normtype methods Modified: branches/robast-1.0/pkg/RobAStBase/R/interpolRisks.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/interpolRisks.R 2014-07-24 12:29:21 UTC (rev 759) +++ branches/robast-1.0/pkg/RobAStBase/R/interpolRisks.R 2014-07-24 12:58:41 UTC (rev 760) @@ -4,4 +4,6 @@ RMXRRisk <- function(samplesize = 100) new("RMXRRisk",type=".RMXE", samplesize = samplesize) setMethod("samplesize","interpolRisk", function(object)object at samplesize) setReplaceMethod("samplesize","interpolRisk", function(object, value){ - object at samplesize <- value; object}) \ No newline at end of file + object at samplesize <- value; object}) +setMethod("biastype","interpolRisk", function(object) NormType()) +setMethod("normtype","interpolRisk", function(object) symmetricBias()) \ No newline at end of file Added: branches/robast-1.0/pkg/RobAStBase/man/biastype-methods.Rd =================================================================== --- branches/robast-1.0/pkg/RobAStBase/man/biastype-methods.Rd (rev 0) +++ branches/robast-1.0/pkg/RobAStBase/man/biastype-methods.Rd 2014-07-24 12:58:41 UTC (rev 760) @@ -0,0 +1,18 @@ +\name{biastype-methods} +\docType{methods} +\alias{biastype,interpolRisk-method} +\alias{biastype} +\title{Methods for Function biastype in Package `RobAStBase'} +\description{biastype-methods} + +\section{Methods}{\describe{ + +\item{biastype}{\code{signature(object = "interpolrisk")}: + returns the slot \code{biastype} of an object of class \code{"interpolrisk"}. } +}} +\examples{ +myrisk <- MBRRisk(biastype=100) +biastype(myrisk) +} +\concept{risk} +\keyword{classes} Added: branches/robast-1.0/pkg/RobAStBase/man/normtype-methods.Rd =================================================================== --- branches/robast-1.0/pkg/RobAStBase/man/normtype-methods.Rd (rev 0) +++ branches/robast-1.0/pkg/RobAStBase/man/normtype-methods.Rd 2014-07-24 12:58:41 UTC (rev 760) @@ -0,0 +1,18 @@ +\name{normtype-methods} +\docType{methods} +\alias{normtype,interpolRisk-method} +\alias{normtype} +\title{Methods for Function normtype in Package `RobAStBase'} +\description{normtype-methods} + +\section{Methods}{\describe{ + +\item{normtype}{\code{signature(object = "interpolrisk")}: + returns the slot \code{normtype} of an object of class \code{"interpolrisk"}. } +}} +\examples{ +myrisk <- MBRRisk(normtype=100) +normtype(myrisk) +} +\concept{risk} +\keyword{classes} From noreply at r-forge.r-project.org Thu Jul 24 15:02:46 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 24 Jul 2014 15:02:46 +0200 (CEST) Subject: [Robast-commits] r761 - branches/robast-1.0/pkg/RobAStBase/R Message-ID: <20140724130246.77CC01872B2@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-24 15:02:46 +0200 (Thu, 24 Jul 2014) New Revision: 761 Modified: branches/robast-1.0/pkg/RobAStBase/R/interpolRisks.R Log: [RobAStBase] argh a typo with biastype and normtype methods of interpolRisks.R Modified: branches/robast-1.0/pkg/RobAStBase/R/interpolRisks.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/interpolRisks.R 2014-07-24 12:58:41 UTC (rev 760) +++ branches/robast-1.0/pkg/RobAStBase/R/interpolRisks.R 2014-07-24 13:02:46 UTC (rev 761) @@ -5,5 +5,5 @@ setMethod("samplesize","interpolRisk", function(object)object at samplesize) setReplaceMethod("samplesize","interpolRisk", function(object, value){ object at samplesize <- value; object}) -setMethod("biastype","interpolRisk", function(object) NormType()) -setMethod("normtype","interpolRisk", function(object) symmetricBias()) \ No newline at end of file +setMethod("biastype","interpolRisk", function(object) symmetricBias()) +setMethod("normtype","interpolRisk", function(object) NormType()) \ No newline at end of file From noreply at r-forge.r-project.org Thu Jul 24 17:32:09 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 24 Jul 2014 17:32:09 +0200 (CEST) Subject: [Robast-commits] r762 - in branches/robast-1.0/pkg: ROptEst/R RobAStBase/R RobAStBase/man Message-ID: <20140724153210.1AA09187129@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-24 17:32:09 +0200 (Thu, 24 Jul 2014) New Revision: 762 Modified: branches/robast-1.0/pkg/ROptEst/R/cniperCont.R branches/robast-1.0/pkg/RobAStBase/R/getRiskBV.R branches/robast-1.0/pkg/RobAStBase/man/getRiskFctBV-methods.Rd Log: [RobAStBase/ROptEst] new methods for normtype and biastype for interpolRisk, as well as getRiskFctBV; now cniperPointPlot should work for GPD-type data Modified: branches/robast-1.0/pkg/ROptEst/R/cniperCont.R =================================================================== --- branches/robast-1.0/pkg/ROptEst/R/cniperCont.R 2014-07-24 13:02:46 UTC (rev 761) +++ branches/robast-1.0/pkg/ROptEst/R/cniperCont.R 2014-07-24 15:32:09 UTC (rev 762) @@ -67,29 +67,35 @@ .getFunCnip <- function(IC1,IC2, risk, L2Fam, r, b20=NULL){ - riskfct <- getRiskFctBV(risk, biastype(risk)) + bType <- biastype(risk) + nType <- normtype(risk) + fnorm <- fct(nType) + riskfct <- getRiskFctBV(risk, bType) + .getTrVar <- function(IC){ R <- Risks(IC)[["trAsCov"]] if(is.null(R)) R <- getRiskIC(IC, risk = trAsCov(), L2Fam = L2Fam) + if("trAsCov" %in% names(R)) R <- R[["trAsCov"]] if(length(R) > 1) R <- R$value - return(R) + return(c(R)) } R1 <- .getTrVar (IC1) R2 <- .getTrVar (IC2) - fun <- function(x){ y1 <- sapply(x, function(x1)evalIC(IC1,as.matrix(x1,ncol=1))) - r1 <- riskfct(var=R1,bias=r*fct(normtype(risk))(y1)) + b1 <- r*fnorm(y1) + r1 <- riskfct(var=R1,bias=b1) if(!is.null(b20)){ r2 <- riskfct(var=R2, bias=b20) }else{ y2 <- sapply(x,function(x0) evalIC(IC2,x0)) - r2 <- riskfct(var=R2,bias=r*fct(normtype(risk))(y2)) + b2 <- r*fnorm(y2) + r2 <- riskfct(var=R2,bias=b2) } r1 - r2 + return(r1-r2) } - return(fun) } @@ -116,7 +122,7 @@ b20 <- NULL fCpl <- eval(dots$fromCniperPlot) - if(!is.null(fCpl)) + if(!is.null(fCpl)&&length(Risks(IC2))) if(fCpl) b20 <- neighbor at radius*Risks(IC2)$asBias$value dots$fromCniperPlot <- NULL @@ -127,11 +133,13 @@ scaleX.inv <- q(L2Fam) } - if(!is.null(as.list(mc)$lower)) lower <- p(L2Fam)(lower) - if(!is.null(as.list(mc)$upper)) upper <- p(L2Fam)(upper) + if("lower" %in% names(as.list(mc))) lower <- p(L2Fam)(lower) + if("upper" %in% names(as.list(mc))) upper <- p(L2Fam)(upper) + x <- q(L2Fam)(seq(lower,upper,length=n)) if(is(distribution(L2Fam), "DiscreteDistribution")) x <- seq(q(L2Fam)(lower),q(L2Fam)(upper),length=n) + resc <- .rescalefct(x, fun, scaleX, scaleX.fct, scaleX.inv, scaleY, scaleY.fct, dots$xlim, dots$ylim, dots) dots$x <- resc$X Modified: branches/robast-1.0/pkg/RobAStBase/R/getRiskBV.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/getRiskBV.R 2014-07-24 13:02:46 UTC (rev 761) +++ branches/robast-1.0/pkg/RobAStBase/R/getRiskBV.R 2014-07-24 15:32:09 UTC (rev 762) @@ -1,3 +1,6 @@ +setMethod("getRiskFctBV", signature(risk = "interpolRisk", biastype = "ANY"), + function(risk) function(bias, var) return(bias^2+var)) + setMethod("getRiskFctBV", signature(risk = "asGRisk", biastype = "ANY"), function(risk) function(bias, var)stop("not yet implemented")) @@ -2,3 +5,3 @@ setMethod("getRiskFctBV", signature(risk = "asMSE", biastype = "ANY"), - function(risk) function(bias, var) bias^2+var) + function(risk) function(bias, var) return(bias^2+var)) Modified: branches/robast-1.0/pkg/RobAStBase/man/getRiskFctBV-methods.Rd =================================================================== --- branches/robast-1.0/pkg/RobAStBase/man/getRiskFctBV-methods.Rd 2014-07-24 13:02:46 UTC (rev 761) +++ branches/robast-1.0/pkg/RobAStBase/man/getRiskFctBV-methods.Rd 2014-07-24 15:32:09 UTC (rev 762) @@ -2,6 +2,7 @@ \docType{methods} \alias{getRiskFctBV} \alias{getRiskFctBV-methods} +\alias{getRiskFctBV,interpolRisk,ANY-method} \alias{getRiskFctBV,asGRisk,ANY-method} \alias{getRiskFctBV,asMSE,ANY-method} \alias{getRiskFctBV,asSemivar,onesidedBias-method} @@ -15,6 +16,10 @@ \item{getRiskFctBV}{\code{signature(risk = "asGRisk", biastype = "ANY")}: returns an error that the respective method is not yet implemented. } +\item{getRiskFctBV}{\code{signature(risk = "interpolRisk", biastype = "ANY")}: + returns a function with arguments \code{bias} and \code{variance} + to compute the asymptotic MSE for a given ALE at a situation where it has bias \code{bias} + (including the radius!) and variance \code{variance}. } \item{getRiskFctBV}{\code{signature(risk = "asMSE", biastype = "ANY")}: returns a function with arguments \code{bias} and \code{variance} to compute the asymptotic MSE for a given ALE at a situation where it has bias \code{bias} From noreply at r-forge.r-project.org Sun Jul 27 10:45:45 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 27 Jul 2014 10:45:45 +0200 (CEST) Subject: [Robast-commits] r763 - branches/robast-1.0/pkg/RobAStBase/man Message-ID: <20140727084545.7E3AE183C4E@r-forge.r-project.org> Author: stamats Date: 2014-07-27 10:45:45 +0200 (Sun, 27 Jul 2014) New Revision: 763 Modified: branches/robast-1.0/pkg/RobAStBase/man/biastype-methods.Rd branches/robast-1.0/pkg/RobAStBase/man/normtype-methods.Rd Log: corrected to small errors in examples section Modified: branches/robast-1.0/pkg/RobAStBase/man/biastype-methods.Rd =================================================================== --- branches/robast-1.0/pkg/RobAStBase/man/biastype-methods.Rd 2014-07-24 15:32:09 UTC (rev 762) +++ branches/robast-1.0/pkg/RobAStBase/man/biastype-methods.Rd 2014-07-27 08:45:45 UTC (rev 763) @@ -1,18 +1,18 @@ -\name{biastype-methods} -\docType{methods} -\alias{biastype,interpolRisk-method} -\alias{biastype} -\title{Methods for Function biastype in Package `RobAStBase'} -\description{biastype-methods} - -\section{Methods}{\describe{ - -\item{biastype}{\code{signature(object = "interpolrisk")}: - returns the slot \code{biastype} of an object of class \code{"interpolrisk"}. } -}} -\examples{ -myrisk <- MBRRisk(biastype=100) -biastype(myrisk) -} -\concept{risk} -\keyword{classes} +\name{biastype-methods} +\docType{methods} +\alias{biastype,interpolRisk-method} +\alias{biastype} +\title{Methods for Function biastype in Package `RobAStBase'} +\description{biastype-methods} + +\section{Methods}{\describe{ + +\item{biastype}{\code{signature(object = "interpolrisk")}: + returns the slot \code{biastype} of an object of class \code{"interpolrisk"}. } +}} +\examples{ +myrisk <- MBRRisk(samplesize=100) +biastype(myrisk) +} +\concept{risk} +\keyword{classes} Modified: branches/robast-1.0/pkg/RobAStBase/man/normtype-methods.Rd =================================================================== --- branches/robast-1.0/pkg/RobAStBase/man/normtype-methods.Rd 2014-07-24 15:32:09 UTC (rev 762) +++ branches/robast-1.0/pkg/RobAStBase/man/normtype-methods.Rd 2014-07-27 08:45:45 UTC (rev 763) @@ -1,18 +1,18 @@ -\name{normtype-methods} -\docType{methods} -\alias{normtype,interpolRisk-method} -\alias{normtype} -\title{Methods for Function normtype in Package `RobAStBase'} -\description{normtype-methods} - -\section{Methods}{\describe{ - -\item{normtype}{\code{signature(object = "interpolrisk")}: - returns the slot \code{normtype} of an object of class \code{"interpolrisk"}. } -}} -\examples{ -myrisk <- MBRRisk(normtype=100) -normtype(myrisk) -} -\concept{risk} -\keyword{classes} +\name{normtype-methods} +\docType{methods} +\alias{normtype,interpolRisk-method} +\alias{normtype} +\title{Methods for Function normtype in Package `RobAStBase'} +\description{normtype-methods} + +\section{Methods}{\describe{ + +\item{normtype}{\code{signature(object = "interpolrisk")}: + returns the slot \code{normtype} of an object of class \code{"interpolrisk"}. } +}} +\examples{ +myrisk <- MBRRisk(samplesize=100) +normtype(myrisk) +} +\concept{risk} +\keyword{classes} From noreply at r-forge.r-project.org Sun Jul 27 11:03:03 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 27 Jul 2014 11:03:03 +0200 (CEST) Subject: [Robast-commits] r764 - branches/robast-1.0/pkg/RobRex Message-ID: <20140727090303.290831874EB@r-forge.r-project.org> Author: stamats Date: 2014-07-27 11:03:02 +0200 (Sun, 27 Jul 2014) New Revision: 764 Modified: branches/robast-1.0/pkg/RobRex/NAMESPACE Log: added RoptRegTS to namespace Modified: branches/robast-1.0/pkg/RobRex/NAMESPACE =================================================================== --- branches/robast-1.0/pkg/RobRex/NAMESPACE 2014-07-27 08:45:45 UTC (rev 763) +++ branches/robast-1.0/pkg/RobRex/NAMESPACE 2014-07-27 09:03:02 UTC (rev 764) @@ -1,3 +1,4 @@ +import(ROptRegTS) export(rgsOptIC.AL, rgsOptIC.M, rgsOptIC.MK, From noreply at r-forge.r-project.org Sun Jul 27 11:53:18 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 27 Jul 2014 11:53:18 +0200 (CEST) Subject: [Robast-commits] r765 - branches/robast-1.0/pkg/RobExtremes Message-ID: <20140727095318.28F471845AB@r-forge.r-project.org> Author: stamats Date: 2014-07-27 11:53:17 +0200 (Sun, 27 Jul 2014) New Revision: 765 Modified: branches/robast-1.0/pkg/RobExtremes/DESCRIPTION Log: moved some packages to Imports to avoid note on many packages in Depends, added Encoding due to warning about character 2292 in my locale Modified: branches/robast-1.0/pkg/RobExtremes/DESCRIPTION =================================================================== --- branches/robast-1.0/pkg/RobExtremes/DESCRIPTION 2014-07-27 09:03:02 UTC (rev 764) +++ branches/robast-1.0/pkg/RobExtremes/DESCRIPTION 2014-07-27 09:53:17 UTC (rev 765) @@ -4,15 +4,15 @@ Title: Optimally robust estimation for extreme value distributions Description: Optimally robust estimation for extreme value distributions using S4 classes and methods (based on packages distr, distrEx, distrMod, RobAStBase, and ROptEst) -Depends: R (>= 2.14.0), methods, distr(>= 2.5.2), distrEx(>= 2.5), RandVar(>= 0.9.2), distrMod(>= 2.5.2), - RobAStBase(>= 0.9), ROptEst(>= 0.9), robustbase(>= 0.8-0), evd, actuar +Depends: R (>= 2.14.0), methods, distrMod(>= 2.5.2), ROptEst(>= 0.9), robustbase(>= 0.8-0), evd, actuar Suggests: RUnit (>= 0.4.26) -Imports: RobAStRDA +Imports: RobAStRDA, distr, distrEx, RandVar, RobAStBase Author: Peter Ruckdeschel, Matthias Kohl, Nataliya Horbenko Maintainer: Peter Ruckdeschel LazyLoad: yes ByteCompile: yes License: LGPL-3 +Encoding: latin1 URL: http://robast.r-forge.r-project.org/ LastChangedDate: {$LastChangedDate: 2011-09-30 11:10:33 +0200 (Fr, 30 Sep 2011) $} LastChangedRevision: {$LastChangedRevision: 453 $} From noreply at r-forge.r-project.org Sun Jul 27 11:53:38 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 27 Jul 2014 11:53:38 +0200 (CEST) Subject: [Robast-commits] r766 - branches/robast-1.0/pkg/RobExtremes/man Message-ID: <20140727095338.6A7101845AB@r-forge.r-project.org> Author: stamats Date: 2014-07-27 11:53:38 +0200 (Sun, 27 Jul 2014) New Revision: 766 Modified: branches/robast-1.0/pkg/RobExtremes/man/Var.Rd Log: corrected link Modified: branches/robast-1.0/pkg/RobExtremes/man/Var.Rd =================================================================== --- branches/robast-1.0/pkg/RobExtremes/man/Var.Rd 2014-07-27 09:53:17 UTC (rev 765) +++ branches/robast-1.0/pkg/RobExtremes/man/Var.Rd 2014-07-27 09:53:38 UTC (rev 766) @@ -1,243 +1,243 @@ -\name{var} -\alias{var} -\alias{var-methods} -\alias{var,Gumbel-method} -\alias{var,GPareto-method} -\alias{var,GEV-method} -\alias{var,Pareto-method} -\alias{median} -\alias{median-methods} -\alias{median,Gumbel-method} -\alias{median,GEV-method} -\alias{median,GPareto-method} -\alias{median,Pareto-method} -\alias{IQR} -\alias{IQR-methods} -\alias{IQR,Gumbel-method} -\alias{IQR,GPareto-method} -\alias{IQR,GEV-method} -\alias{IQR,Pareto-method} -\alias{skewness} -\alias{skewness-methods} -\alias{skewness,Gumbel-method} -\alias{skewness,GEV-method} -\alias{skewness,GPareto-method} -\alias{skewness,Pareto-method} -\alias{kurtosis} -\alias{kurtosis-methods} -\alias{kurtosis,Gumbel-method} -\alias{kurtosis,GEV-method} -\alias{kurtosis,GPareto-method} -\alias{kurtosis,Pareto-method} -\alias{Sn} -\alias{Sn-methods} -\alias{Sn,ANY-method} -\alias{Sn,UnivariateDistribution-method} -\alias{Sn,Norm-method} -\alias{Sn,AffLinDistribution-method} -\alias{Sn,GPareto-method} -\alias{Sn,Gammad-method} -\alias{Sn,Weibull-method} -\alias{Sn,GEV-method} -\alias{Sn,DiscreteDistribution-method} -\alias{Qn} -\alias{Qn-methods} -\alias{Qn,ANY-method} -\alias{Qn,UnivariateDistribution-method} -\alias{Qn,Norm-method} -\alias{Qn,DiscreteDistribution-method} -\alias{Qn,AffLinDistribution-method} - -\title{Generic Functions for the Computation of Functionals} -\description{ - Generic functions for the computation of functionals on distributions. -} -\usage{ -IQR(x, ...) - -\S4method{IQR}{Gumbel}(x) -\S4method{IQR}{GEV}(x) -\S4method{IQR}{GPareto}(x) -\S4method{IQR}{Pareto}(x) - -median(x, ...) - -\S4method{median}{Gumbel}(x) -\S4method{median}{GEV}(x) -\S4method{median}{GPareto}(x) -\S4method{median}{Pareto}(x) - -var(x, ...) - -\S4method{var}{Gumbel}(x, ...) -\S4method{var}{GEV}(x, ...) -\S4method{var}{GPareto}(x, ...) -\S4method{var}{Pareto}(x, ...) - -skewness(x, ...) -\S4method{skewness}{Gumbel}(x, ...) -\S4method{skewness}{GEV}(x, ...) -\S4method{skewness}{GPareto}(x, ...) -\S4method{skewness}{Pareto}(x, ...) - -kurtosis(x, ...) -\S4method{kurtosis}{Gumbel}(x, ...) -\S4method{kurtosis}{GEV}(x, ...) -\S4method{kurtosis}{GPareto}(x, ...) -\S4method{kurtosis}{Pareto}(x, ...) - -Sn(x, ...) -\S4method{Sn}{ANY}(x, ...) -\S4method{Sn}{UnivariateDistribution}(x, low = 0, upp = 1.01, accuracy = 1000, ...) -\S4method{Sn}{DiscreteDistribution}(x, ...) -\S4method{Sn}{AffLinDistribution}(x, ...) -\S4method{Sn}{Norm}(x, ...) -\S4method{Sn}{GPareto}(x, ...) -\S4method{Sn}{GEV}(x, ...) -\S4method{Sn}{Gammad}(x, ...) -\S4method{Sn}{Weibull}(x, ...) - -Qn(x, ...) -\S4method{Qn}{ANY}(x, ...) -\S4method{Qn}{UnivariateDistribution}(x, q00 = NULL, ...) -\S4method{Qn}{AffLinDistribution}(x, ...) -\S4method{Qn}{DiscreteDistribution}(x, ...) -\S4method{Qn}{Norm}(x, ...) -} - -\arguments{ - \item{x}{ object of class \code{"UnivariateDistribution"}} - \item{\dots}{ additional arguments to \code{fun} or \code{E}} - \item{q00}{numeric or NULL: determines search interval (from \code{-q00} to \code{q00}) - for \code{Qn}; if \code{NULL} (default) \code{q00} - is set to \code{10*q(x)(3/4)} internally. } - \item{low}{numeric; lower bound for search interval for median(abs(x-Y)) where - Y (a real constant) runs over the range of x; defaults to \code{0}. } - \item{upp}{numeric; upper bound for search interval for median(abs(x-Y)) where - Y (a real constant) runs over the range of x; defaults to \code{1.01}. - Is used internally as \code{upp*(mad(x)+abs(median(x)-Y))}. } - \item{accuracy}{numeric; number of grid points for \code{Sn}; defaults to \code{1000}. } - } -\value{ - The value of the corresponding functional at the distribution in the argument is computed. -} -\section{Methods}{ -\describe{ - - \item{\code{Qn}, \code{signature(x = "Any")}:}{ - interface to the \pkg{robustbase}-function \code{Qn} --- see \code{\link[robustbase]{Qn}}.} - \item{\code{Qn}, \code{signature(x = "UnivariateDistribution")}:}{ - Qn of univariate distributions.} - \item{\code{Qn}, \code{signature(x = "DiscreteDistribution")}:}{ - Qn of discrete distributions.} - \item{\code{Qn}, \code{signature(x = "AffLinDistribution")}:}{\code{abs(x at a) * Qn(x at X0)}} - - \item{\code{Sn}, \code{signature(x = "Any")}:}{ - interface to the \pkg{robustbase}-function \code{Qn} --- see \code{\link[robustbase]{Sn}}.} - \item{\code{Sn}, \code{signature(x = "UnivariateDistribution")}:}{ - Sn of univariate distributions using pseudo-random variables (Thx to N. Horbenko).} - \item{\code{Sn}, \code{signature(x = "DiscreteDistribution")}:}{ - Sn of discrete distributions.} - \item{\code{Sn}, \code{signature(x = "AffLinDistribution")}:}{\code{abs(x at a) * Sn(x at X0)}} - - \item{\code{var}, \code{signature(x = "Gumbel")}:}{ - exact evaluation using explicit expressions.} - \item{\code{var}, \code{signature(x = "GPareto")}:}{ - exact evaluation using explicit expressions.} - \item{\code{var}, \code{signature(x = "GEV")}:}{ - exact evaluation using explicit expressions.} - \item{\code{var}, \code{signature(x = "Pareto")}:}{ - exact evaluation using explicit expressions.} - - \item{\code{IQR}, \code{signature(x = "Gumbel")}:}{ - exact evaluation using explicit expressions.} - \item{\code{IQR}, \code{signature(x = "GPareto")}:}{ - exact evaluation using explicit expressions.} - \item{\code{IQR}, \code{signature(x = "GEV")}:}{ - exact evaluation using explicit expressions.} - \item{\code{IQR}, \code{signature(x = "Pareto")}:}{ - exact evaluation using explicit expressions.} - - \item{\code{median}, \code{signature(x = "Gumbel")}:}{ - exact evaluation using explicit expressions.} - \item{\code{median}, \code{signature(x = "GEV")}:}{ - exact evaluation using explicit expressions.} - \item{\code{median}, \code{signature(x = "GPareto")}:}{ - exact evaluation using explicit expressions.} - \item{\code{median}, \code{signature(x = "Pareto")}:}{ - exact evaluation using explicit expressions.} - - \item{\code{skewness}, \code{signature(x = "Gumbel")}:}{ - exact evaluation using explicit expressions.} - \item{\code{skewness}, \code{signature(x = "GEV")}:}{ - exact evaluation using explicit expressions.} - \item{\code{skewness}, \code{signature(x = "GPareto")}:}{ - exact evaluation using explicit expressions.} - \item{\code{skewness}, \code{signature(x = "Pareto")}:}{ - exact evaluation using explicit expressions.} - - \item{\code{kurtosis}, \code{signature(x = "Gumbel")}:}{ - exact evaluation using explicit expressions.} - \item{\code{kurtosis}, \code{signature(x = "GEV")}:}{ - exact evaluation using explicit expressions.} - \item{\code{kurtosis}, \code{signature(x = "GPareto")}:}{ - exact evaluation using explicit expressions.} - \item{\code{kurtosis}, \code{signature(x = "Pareto")}:}{ - exact evaluation using explicit expressions.} - - \item{\code{Sn}, \code{signature(x = "Norm")}:}{ - exact evaluation using explicit expressions.} - \item{\code{Sn}, \code{signature(x = "GPareto")}:}{ - speeded up using interpolation grid.} - \item{\code{Sn}, \code{signature(x = "GEV")}:}{ - speeded up using interpolation grid.} - \item{\code{Sn}, \code{signature(x = "Gammad")}:}{ - speeded up using interpolation grid.} - \item{\code{Sn}, \code{signature(x = "Weibull")}:}{ - speeded up using interpolation grid.} - - \item{\code{Qn}, \code{signature(x = "Norm")}:}{ - exact evaluation using explicit expressions.} -}} -%\references{ ~put references to the literature/web site here ~ } -\author{Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}} -%\note{ ~~further notes~~ } - -\section{Caveat}{ -If any of the packages \pkg{e1071}, \pkg{moments}, \pkg{fBasics} is to be used together with \pkg{distrEx} -(or \pkg{RobExtremes}) the latter must be attached \emph{after} any of the first mentioned. -Otherwise \code{kurtosis()} and \code{skewness()} -defined as \emph{methods} in \pkg{distrEx} (or \pkg{RobExtremes}) may get masked.\cr -To re-mask, you may use -\code{kurtosis <- distrEx::kurtosis; skewness <- distrEx::skewness}. -See also \code{distrExMASK()}. -} - -\examples{ -# Variance of Exp(1) distribution -G <- GPareto() -var(G) - -#median(Exp()) -IQR(G) - -## note the timing -Sn(GPareto(shape=0.5,scale=2)) -Sn(as(GPareto(shape=0.5,scale=2),"AbscontDistribution")) - -} -\seealso{\code{\link[distrEx]{var}},\cr - \code{\link[stats]{sd}}, \code{\link[stats:cor]{var}}, \code{\link[stats]{IQR}},\cr - \code{\link[stats]{median}}, \code{\link[stats]{mad}}, \code{\link[distr:sd-methods]{sd}},\cr - \code{\link[robustbase]{Sn}}, \code{\link[robustbase]{Qn}}} -\concept{functional} -\concept{var} -\concept{IQR} -\concept{median} -\concept{skewness} -\concept{kurtosis} -\concept{Sn} -\concept{Qn} -\keyword{methods} -\keyword{distribution} -\concept{integration} +\name{var} +\alias{var} +\alias{var-methods} +\alias{var,Gumbel-method} +\alias{var,GPareto-method} +\alias{var,GEV-method} +\alias{var,Pareto-method} +\alias{median} +\alias{median-methods} +\alias{median,Gumbel-method} +\alias{median,GEV-method} +\alias{median,GPareto-method} +\alias{median,Pareto-method} +\alias{IQR} +\alias{IQR-methods} +\alias{IQR,Gumbel-method} +\alias{IQR,GPareto-method} +\alias{IQR,GEV-method} +\alias{IQR,Pareto-method} +\alias{skewness} +\alias{skewness-methods} +\alias{skewness,Gumbel-method} +\alias{skewness,GEV-method} +\alias{skewness,GPareto-method} +\alias{skewness,Pareto-method} +\alias{kurtosis} +\alias{kurtosis-methods} +\alias{kurtosis,Gumbel-method} +\alias{kurtosis,GEV-method} +\alias{kurtosis,GPareto-method} +\alias{kurtosis,Pareto-method} +\alias{Sn} +\alias{Sn-methods} +\alias{Sn,ANY-method} +\alias{Sn,UnivariateDistribution-method} +\alias{Sn,Norm-method} +\alias{Sn,AffLinDistribution-method} +\alias{Sn,GPareto-method} +\alias{Sn,Gammad-method} +\alias{Sn,Weibull-method} +\alias{Sn,GEV-method} +\alias{Sn,DiscreteDistribution-method} +\alias{Qn} +\alias{Qn-methods} +\alias{Qn,ANY-method} +\alias{Qn,UnivariateDistribution-method} +\alias{Qn,Norm-method} +\alias{Qn,DiscreteDistribution-method} +\alias{Qn,AffLinDistribution-method} + +\title{Generic Functions for the Computation of Functionals} +\description{ + Generic functions for the computation of functionals on distributions. +} +\usage{ +IQR(x, ...) + +\S4method{IQR}{Gumbel}(x) +\S4method{IQR}{GEV}(x) +\S4method{IQR}{GPareto}(x) +\S4method{IQR}{Pareto}(x) + +median(x, ...) + +\S4method{median}{Gumbel}(x) +\S4method{median}{GEV}(x) +\S4method{median}{GPareto}(x) +\S4method{median}{Pareto}(x) + +var(x, ...) + +\S4method{var}{Gumbel}(x, ...) +\S4method{var}{GEV}(x, ...) +\S4method{var}{GPareto}(x, ...) +\S4method{var}{Pareto}(x, ...) + +skewness(x, ...) +\S4method{skewness}{Gumbel}(x, ...) +\S4method{skewness}{GEV}(x, ...) +\S4method{skewness}{GPareto}(x, ...) +\S4method{skewness}{Pareto}(x, ...) + +kurtosis(x, ...) +\S4method{kurtosis}{Gumbel}(x, ...) +\S4method{kurtosis}{GEV}(x, ...) +\S4method{kurtosis}{GPareto}(x, ...) +\S4method{kurtosis}{Pareto}(x, ...) + +Sn(x, ...) +\S4method{Sn}{ANY}(x, ...) +\S4method{Sn}{UnivariateDistribution}(x, low = 0, upp = 1.01, accuracy = 1000, ...) +\S4method{Sn}{DiscreteDistribution}(x, ...) +\S4method{Sn}{AffLinDistribution}(x, ...) +\S4method{Sn}{Norm}(x, ...) +\S4method{Sn}{GPareto}(x, ...) +\S4method{Sn}{GEV}(x, ...) +\S4method{Sn}{Gammad}(x, ...) +\S4method{Sn}{Weibull}(x, ...) + +Qn(x, ...) +\S4method{Qn}{ANY}(x, ...) +\S4method{Qn}{UnivariateDistribution}(x, q00 = NULL, ...) +\S4method{Qn}{AffLinDistribution}(x, ...) +\S4method{Qn}{DiscreteDistribution}(x, ...) +\S4method{Qn}{Norm}(x, ...) +} + +\arguments{ + \item{x}{ object of class \code{"UnivariateDistribution"}} + \item{\dots}{ additional arguments to \code{fun} or \code{E}} + \item{q00}{numeric or NULL: determines search interval (from \code{-q00} to \code{q00}) + for \code{Qn}; if \code{NULL} (default) \code{q00} + is set to \code{10*q(x)(3/4)} internally. } + \item{low}{numeric; lower bound for search interval for median(abs(x-Y)) where + Y (a real constant) runs over the range of x; defaults to \code{0}. } + \item{upp}{numeric; upper bound for search interval for median(abs(x-Y)) where + Y (a real constant) runs over the range of x; defaults to \code{1.01}. + Is used internally as \code{upp*(mad(x)+abs(median(x)-Y))}. } + \item{accuracy}{numeric; number of grid points for \code{Sn}; defaults to \code{1000}. } + } +\value{ + The value of the corresponding functional at the distribution in the argument is computed. +} +\section{Methods}{ +\describe{ + + \item{\code{Qn}, \code{signature(x = "Any")}:}{ + interface to the \pkg{robustbase}-function \code{Qn} --- see \code{\link[robustbase]{Qn}}.} + \item{\code{Qn}, \code{signature(x = "UnivariateDistribution")}:}{ + Qn of univariate distributions.} + \item{\code{Qn}, \code{signature(x = "DiscreteDistribution")}:}{ + Qn of discrete distributions.} + \item{\code{Qn}, \code{signature(x = "AffLinDistribution")}:}{\code{abs(x at a) * Qn(x at X0)}} + + \item{\code{Sn}, \code{signature(x = "Any")}:}{ + interface to the \pkg{robustbase}-function \code{Qn} --- see \code{\link[robustbase]{Sn}}.} + \item{\code{Sn}, \code{signature(x = "UnivariateDistribution")}:}{ + Sn of univariate distributions using pseudo-random variables (Thx to N. Horbenko).} + \item{\code{Sn}, \code{signature(x = "DiscreteDistribution")}:}{ + Sn of discrete distributions.} + \item{\code{Sn}, \code{signature(x = "AffLinDistribution")}:}{\code{abs(x at a) * Sn(x at X0)}} + + \item{\code{var}, \code{signature(x = "Gumbel")}:}{ + exact evaluation using explicit expressions.} + \item{\code{var}, \code{signature(x = "GPareto")}:}{ + exact evaluation using explicit expressions.} + \item{\code{var}, \code{signature(x = "GEV")}:}{ + exact evaluation using explicit expressions.} + \item{\code{var}, \code{signature(x = "Pareto")}:}{ + exact evaluation using explicit expressions.} + + \item{\code{IQR}, \code{signature(x = "Gumbel")}:}{ + exact evaluation using explicit expressions.} + \item{\code{IQR}, \code{signature(x = "GPareto")}:}{ + exact evaluation using explicit expressions.} + \item{\code{IQR}, \code{signature(x = "GEV")}:}{ + exact evaluation using explicit expressions.} + \item{\code{IQR}, \code{signature(x = "Pareto")}:}{ + exact evaluation using explicit expressions.} + + \item{\code{median}, \code{signature(x = "Gumbel")}:}{ + exact evaluation using explicit expressions.} + \item{\code{median}, \code{signature(x = "GEV")}:}{ + exact evaluation using explicit expressions.} + \item{\code{median}, \code{signature(x = "GPareto")}:}{ + exact evaluation using explicit expressions.} + \item{\code{median}, \code{signature(x = "Pareto")}:}{ + exact evaluation using explicit expressions.} + + \item{\code{skewness}, \code{signature(x = "Gumbel")}:}{ + exact evaluation using explicit expressions.} + \item{\code{skewness}, \code{signature(x = "GEV")}:}{ + exact evaluation using explicit expressions.} + \item{\code{skewness}, \code{signature(x = "GPareto")}:}{ + exact evaluation using explicit expressions.} + \item{\code{skewness}, \code{signature(x = "Pareto")}:}{ + exact evaluation using explicit expressions.} + + \item{\code{kurtosis}, \code{signature(x = "Gumbel")}:}{ + exact evaluation using explicit expressions.} + \item{\code{kurtosis}, \code{signature(x = "GEV")}:}{ + exact evaluation using explicit expressions.} + \item{\code{kurtosis}, \code{signature(x = "GPareto")}:}{ + exact evaluation using explicit expressions.} + \item{\code{kurtosis}, \code{signature(x = "Pareto")}:}{ + exact evaluation using explicit expressions.} + + \item{\code{Sn}, \code{signature(x = "Norm")}:}{ + exact evaluation using explicit expressions.} + \item{\code{Sn}, \code{signature(x = "GPareto")}:}{ + speeded up using interpolation grid.} + \item{\code{Sn}, \code{signature(x = "GEV")}:}{ + speeded up using interpolation grid.} + \item{\code{Sn}, \code{signature(x = "Gammad")}:}{ + speeded up using interpolation grid.} + \item{\code{Sn}, \code{signature(x = "Weibull")}:}{ + speeded up using interpolation grid.} + + \item{\code{Qn}, \code{signature(x = "Norm")}:}{ + exact evaluation using explicit expressions.} +}} +%\references{ ~put references to the literature/web site here ~ } +\author{Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}} +%\note{ ~~further notes~~ } + +\section{Caveat}{ +If any of the packages \pkg{e1071}, \pkg{moments}, \pkg{fBasics} is to be used together with \pkg{distrEx} +(or \pkg{RobExtremes}) the latter must be attached \emph{after} any of the first mentioned. +Otherwise \code{kurtosis()} and \code{skewness()} +defined as \emph{methods} in \pkg{distrEx} (or \pkg{RobExtremes}) may get masked.\cr +To re-mask, you may use +\code{kurtosis <- distrEx::kurtosis; skewness <- distrEx::skewness}. +See also \code{distrExMASK()}. +} + +\examples{ +# Variance of Exp(1) distribution +G <- GPareto() +var(G) + +#median(Exp()) +IQR(G) + +## note the timing +Sn(GPareto(shape=0.5,scale=2)) +Sn(as(GPareto(shape=0.5,scale=2),"AbscontDistribution")) + +} +\seealso{\code{\link[distrEx]{Var}},\cr + \code{\link[stats]{sd}}, \code{\link[stats:cor]{var}}, \code{\link[stats]{IQR}},\cr + \code{\link[stats]{median}}, \code{\link[stats]{mad}}, \code{\link[distr:sd-methods]{sd}},\cr + \code{\link[robustbase]{Sn}}, \code{\link[robustbase]{Qn}}} +\concept{functional} +\concept{var} +\concept{IQR} +\concept{median} +\concept{skewness} +\concept{kurtosis} +\concept{Sn} +\concept{Qn} +\keyword{methods} +\keyword{distribution} +\concept{integration} From noreply at r-forge.r-project.org Sun Jul 27 11:54:00 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Sun, 27 Jul 2014 11:54:00 +0200 (CEST) Subject: [Robast-commits] r767 - branches/robast-1.0/pkg/RobExtremes/man Message-ID: <20140727095400.11832184D69@r-forge.r-project.org> Author: stamats Date: 2014-07-27 11:53:59 +0200 (Sun, 27 Jul 2014) New Revision: 767 Modified: branches/robast-1.0/pkg/RobExtremes/man/getCVaR.Rd Log: put code in \dontrun to reduce checking time Modified: branches/robast-1.0/pkg/RobExtremes/man/getCVaR.Rd =================================================================== --- branches/robast-1.0/pkg/RobExtremes/man/getCVaR.Rd 2014-07-27 09:53:38 UTC (rev 766) +++ branches/robast-1.0/pkg/RobExtremes/man/getCVaR.Rd 2014-07-27 09:53:59 UTC (rev 767) @@ -1,59 +1,61 @@ -\name{getCVaR} -\alias{getVaR} -\alias{getCVaR} -\alias{getEL} -\alias{print.riskMeasure} - -\title{Risk Measures for Scale-Shape Families} -\description{ - Functions to compute Value-at-Risk (VaR), Conditional Value-at-Risk (CVaR) - and Expected Loss (EL) at data from scale-shape families. -} -\usage{ -getVaR(data, model, level, rob=TRUE) -getCVaR(data, model, level, rob=TRUE) -getEL(data, model, N0, rob=TRUE) -\method{print}{riskMeasure}(x, level=NULL, ...) -} -\arguments{ - \item{data}{data at which to compute the risk measure. } - \item{model}{an object of class \code{"L2ScaleShapeFamily"}. - The parametric family at which to evaluate the risk measure. } - \item{level}{real: probability needed for VaR and CVaR. } - \item{N0}{real: expected frequency for expected loss. } - \item{rob}{logical; if \code{TRUE} (default) the RMXE-parametric estimator is - used; otherwise the MLE. } - \item{x}{an object of (S3-)class \code{"riskmeasure"}. } - \item{...}{further arguments for \code{print}. } - } -\value{The risk measures \code{getVaR}, \code{getCVaR}, \code{getEL} return -an (S3) object of class \code{"riskMeasure"}, i.e., a numeric vector -of length 2 with components \code{"Risk"} and \code{"varofRisk"} -containing the respective risk measure -and a corresponding (asymptotic) standard error for the risk -measure. To the return class \code{"riskMeasure"}, -there is a particular \code{print}-method; if the corresponding argument -\code{level} is \code{NULL} (default) the corresponding standard error -is printed together with the risk measure; otherwise a corresponding -CLT-based confidence interval for the risk meausre is produced.} -\references{ -P. Ruckdeschel, N. Horbenko (2013): Optimally-Robust Estimators in Generalized -Pareto Models. Statistics 47(4), 762--791. -N. Horbenko, P. Ruckdeschel, T. Bae (2011): Robust Estimation of Operational Risk. -Journal of Operational Risk 6(2), 3--30. -} -\author{Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}} -\seealso{\code{\link{GParetoFamily}}, \code{\link{GEVFamily}}, \code{\link{WeibullFamily}}, \code{\link{GammaFamily}}} -\examples{ - set.seed(123) - GPD <- GParetoFamily(loc=20480, scale=7e4, shape=0.3) - data <- r(GPD)(500) - getVaR(data,GPD,0.99) - getVaR(data,GPD,0.99, rob=FALSE) - getCVaR(data,GPD,0.99) - getCVaR(data,GPD,0.99, rob=FALSE) - getEL(data,GPD,5) - getEL(data,GPD,5, rob=FALSE) -} -\concept{estimator} -\keyword{risk measure} +\name{getCVaR} +\alias{getVaR} +\alias{getCVaR} +\alias{getEL} +\alias{print.riskMeasure} + +\title{Risk Measures for Scale-Shape Families} +\description{ + Functions to compute Value-at-Risk (VaR), Conditional Value-at-Risk (CVaR) + and Expected Loss (EL) at data from scale-shape families. +} +\usage{ +getVaR(data, model, level, rob=TRUE) +getCVaR(data, model, level, rob=TRUE) +getEL(data, model, N0, rob=TRUE) +\method{print}{riskMeasure}(x, level=NULL, ...) +} +\arguments{ + \item{data}{data at which to compute the risk measure. } + \item{model}{an object of class \code{"L2ScaleShapeFamily"}. + The parametric family at which to evaluate the risk measure. } + \item{level}{real: probability needed for VaR and CVaR. } + \item{N0}{real: expected frequency for expected loss. } + \item{rob}{logical; if \code{TRUE} (default) the RMXE-parametric estimator is + used; otherwise the MLE. } + \item{x}{an object of (S3-)class \code{"riskmeasure"}. } + \item{...}{further arguments for \code{print}. } + } +\value{The risk measures \code{getVaR}, \code{getCVaR}, \code{getEL} return +an (S3) object of class \code{"riskMeasure"}, i.e., a numeric vector +of length 2 with components \code{"Risk"} and \code{"varofRisk"} +containing the respective risk measure +and a corresponding (asymptotic) standard error for the risk +measure. To the return class \code{"riskMeasure"}, +there is a particular \code{print}-method; if the corresponding argument +\code{level} is \code{NULL} (default) the corresponding standard error +is printed together with the risk measure; otherwise a corresponding +CLT-based confidence interval for the risk meausre is produced.} +\references{ +P. Ruckdeschel, N. Horbenko (2013): Optimally-Robust Estimators in Generalized +Pareto Models. Statistics 47(4), 762--791. +N. Horbenko, P. Ruckdeschel, T. Bae (2011): Robust Estimation of Operational Risk. +Journal of Operational Risk 6(2), 3--30. +} +\author{Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}} +\seealso{\code{\link{GParetoFamily}}, \code{\link{GEVFamily}}, \code{\link{WeibullFamily}}, \code{\link{GammaFamily}}} +\examples{ + set.seed(123) + GPD <- GParetoFamily(loc=20480, scale=7e4, shape=0.3) + data <- r(GPD)(500) + getCVaR(data,GPD,0.99) + \dontrun{ # to reduce checking time + getVaR(data,GPD,0.99) + getEL(data,GPD,5) + getVaR(data,GPD,0.99, rob=FALSE) + getEL(data,GPD,5, rob=FALSE) + getCVaR(data,GPD,0.99, rob=FALSE) + } +} +\concept{estimator} +\keyword{risk measure} From noreply at r-forge.r-project.org Mon Jul 28 13:33:01 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 28 Jul 2014 13:33:01 +0200 (CEST) Subject: [Robast-commits] r768 - branches/robast-1.0/pkg/ROptEstOld/R Message-ID: <20140728113301.ABB04187616@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-28 13:33:01 +0200 (Mon, 28 Jul 2014) New Revision: 768 Added: branches/robast-1.0/pkg/ROptEstOld/R/internalUtilsFromDistr.R Modified: branches/robast-1.0/pkg/ROptEstOld/R/AllClass.R branches/robast-1.0/pkg/ROptEstOld/R/AllInitialize.R Log: [ROptEstOld] removed ::: internal dependencies (within distr&robast-Fam's of pkgs) by copying respective routines Modified: branches/robast-1.0/pkg/ROptEstOld/R/AllClass.R =================================================================== --- branches/robast-1.0/pkg/ROptEstOld/R/AllClass.R 2014-07-27 09:53:59 UTC (rev 767) +++ branches/robast-1.0/pkg/ROptEstOld/R/AllClass.R 2014-07-28 11:33:01 UTC (rev 768) @@ -30,10 +30,10 @@ p1 <- if(log.p) exp(p) else p in01 <- (p1>1 | p1<0) - i01 <- distr:::.isEqual01(p1) + i01 <- .isEqual01(p1) i0 <- (i01 & p1<1) i1 <- (i01 & p1>0) - ii01 <- distr:::.isEqual01(p1) | in01 + ii01 <- .isEqual01(p1) | in01 p0 <- p p0[ii01] <- if(log.p) log(0.5) else 0.5 @@ -391,3 +391,4 @@ "!= dimension of 'stand'")) return(TRUE) }) + Modified: branches/robast-1.0/pkg/ROptEstOld/R/AllInitialize.R =================================================================== --- branches/robast-1.0/pkg/ROptEstOld/R/AllInitialize.R 2014-07-27 09:53:59 UTC (rev 767) +++ branches/robast-1.0/pkg/ROptEstOld/R/AllInitialize.R 2014-07-28 11:33:01 UTC (rev 768) @@ -20,10 +20,10 @@ p1 <- if(log.p) exp(p) else p in01 <- (p1>1 | p1<0) - i01 <- distr:::.isEqual01(p1) + i01 <- .isEqual01(p1) i0 <- (i01 & p1<1) i1 <- (i01 & p1>0) - ii01 <- distr:::.isEqual01(p1) | in01 + ii01 <- .isEqual01(p1) | in01 p0 <- p p0[ii01] <- if(log.p) log(0.5) else 0.5 Added: branches/robast-1.0/pkg/ROptEstOld/R/internalUtilsFromDistr.R =================================================================== --- branches/robast-1.0/pkg/ROptEstOld/R/internalUtilsFromDistr.R (rev 0) +++ branches/robast-1.0/pkg/ROptEstOld/R/internalUtilsFromDistr.R 2014-07-28 11:33:01 UTC (rev 768) @@ -0,0 +1,9 @@ +#------------------------------------ +#### utilities copied from package distr v.2.6 svn-rev 943 +#------------------------------------ + +.isEqual <- function(p0, p1, tol = min( getdistrOption("TruncQuantile")/2, + .Machine$double.eps^.7 + )) + abs(p0-p1)< tol +.isEqual01<- function(x) .isEqual(x,0)|.isEqual(x,1) From noreply at r-forge.r-project.org Mon Jul 28 13:36:47 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 28 Jul 2014 13:36:47 +0200 (CEST) Subject: [Robast-commits] r769 - branches/robast-1.0/pkg/RobAStBase Message-ID: <20140728113647.4F5C618762B@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-28 13:36:46 +0200 (Mon, 28 Jul 2014) New Revision: 769 Modified: branches/robast-1.0/pkg/RobAStBase/DESCRIPTION Log: [RobAstBase] added reference for copied routine stats:::format.perc Modified: branches/robast-1.0/pkg/RobAStBase/DESCRIPTION =================================================================== --- branches/robast-1.0/pkg/RobAStBase/DESCRIPTION 2014-07-28 11:33:01 UTC (rev 768) +++ branches/robast-1.0/pkg/RobAStBase/DESCRIPTION 2014-07-28 11:36:46 UTC (rev 769) @@ -6,8 +6,10 @@ Depends: R(>= 2.14.0), methods, rrcov, distr(>= 2.5.2), distrEx(>= 2.5), distrMod(>= 2.5.2), RandVar(>= 0.9.2) Suggests: ROptEst, RUnit (>= 0.4.26) -Author: Matthias Kohl, Peter Ruckdeschel -Maintainer: Matthias Kohl +Authors at R: c(person("Matthias", "Kohl", role=c("cre", "cph"), email="Matthias.Kohl at stamats.de"), + person("Peter", "Ruckdeschel", role=c("aut", "cph")), + person("R Core Team", role = c("ctb", "cph"), + comment="for source file 'format.perc'")) ByteCompile: yes LazyLoad: yes License: LGPL-3 From noreply at r-forge.r-project.org Mon Jul 28 13:45:11 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 28 Jul 2014 13:45:11 +0200 (CEST) Subject: [Robast-commits] r770 - branches/robast-1.0/pkg/ROptEst/R Message-ID: <20140728114511.17564184BBA@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-28 13:45:10 +0200 (Mon, 28 Jul 2014) New Revision: 770 Added: branches/robast-1.0/pkg/ROptEst/R/internalutilsFromRobAStBase.R Modified: branches/robast-1.0/pkg/ROptEst/R/00internal.R Log: [ROptEst] removed ::: internal dependencies (within distr&robast-Fam's of pkgs) by copying respective routines Modified: branches/robast-1.0/pkg/ROptEst/R/00internal.R =================================================================== --- branches/robast-1.0/pkg/ROptEst/R/00internal.R 2014-07-28 11:36:46 UTC (rev 769) +++ branches/robast-1.0/pkg/ROptEst/R/00internal.R 2014-07-28 11:45:10 UTC (rev 770) @@ -1,12 +1,3 @@ -.rescalefct <- RobAStBase:::.rescalefct -.plotRescaledAxis <- RobAStBase:::.plotRescaledAxis -.makedotsP <- RobAStBase:::.makedotsP -.makedotsLowLevel <- RobAStBase:::.makedotsLowLevel -.SelectOrderData <- RobAStBase:::.SelectOrderData -### helper function to recursively evaluate list -.evalListRec <- RobAStBase:::.evalListRec - - if(packageVersion("distrMod")<"2.5"){ .isUnitMatrix <- function(m){ ### checks whether m is unit matrix Added: branches/robast-1.0/pkg/ROptEst/R/internalutilsFromRobAStBase.R =================================================================== --- branches/robast-1.0/pkg/ROptEst/R/internalutilsFromRobAStBase.R (rev 0) +++ branches/robast-1.0/pkg/ROptEst/R/internalutilsFromRobAStBase.R 2014-07-28 11:45:10 UTC (rev 770) @@ -0,0 +1,230 @@ +#------------------------------------ +#### utilities copied from package RobAStBase v.1.0 svn-rev 767 +#------------------------------------ + +.evalListRec <- function(list0){ ## a list + len <- length(list0) + if(len==0L) return(list0) + for(i in 1:len) { + if(is.list(list0[[i]])){ list0[[i]] <- .evalListRec(list0[[i]]) + }else list0[[i]] <- eval(list0[[i]]) + } + return(list0) +} + + +.makedotsLowLevel <- function(dots){ + dots$sub <- dots$xlab <- dots$ylab <- dots$main <- dots$type <- NULL + dots$xlim <- dots$ylim <- dots$yaxt <- dots$axes <- dots$xaxt <- NULL + dots$panel.last <- dots$panel.first <- dots$frame.plot <- dots$ann <-NULL + dots$log <- dots$asp <- NULL + return(dots) +} + +.deleteDotsABLINE <- function(dots){ + dots$reg <- dots$a <- dots$b <- NULL + dots$untf <- dots$h <- dots$v <- NULL + dots +} + +.deleteDotsTEXT <- function(dots){ + dots$labels <- dots$offset <- dots$vfont <- dots$pos <- dots$font <- NULL + dots +} + +.makedotsP <- function(dots){ + dots <- .makedotsLowLevel(dots) + dots$lwd <- NULL + .deleteDotsABLINE(.deleteDotsTEXT(dots)) +} + +.SelectOrderData <- function(data, fct, which.lbs, which.Order){ + ## for data to be plot in performs two selections: + ## on unordered (original) data (acc. to which.lbs) + ## on data ordered acc. to fct a selection acc. to which.Order is done + ## return value: list with elements + # data, the selected/thinned out data, + # y = fct(data) + # ind the indices of the selected data in the original data + # ind1 the indices of the data selected by which.lbs in the original data + dimL <- !is.null(dim(data)) + d1 <- if(dimL) dim(data) else 1 + n <- if(dimL) nrow(data) else length(data) + ind <- 1:n + + ### selection + if(is.null(which.lbs)) which.lbs <- 1:n + which.lbs0 <- (1:n) %in% which.lbs + n <- sum(which.lbs0) + which.lbx <- rep(which.lbs0, length.out=length(data)) + data <- data[which.lbx] + if(dimL) dim(data) <- c(n,d1[-1]) + ind <- ind[which.lbs0] + ### function evaluation + y <- if(dimL) apply(data, 1, fct) else sapply(data,fct) + ## ordering + oN <- order(y) + ind1 <- rev(ind[oN]) + + ## selection of ordered + if(is.null(which.Order)) + which.Order <- 1:n + oN <- oN[(n+1)-which.Order] + data <- if(dimL) data[oN,] else data[oN] + y <- y[oN] + ind <- ind[oN] + + return(list(data=data, y=y, ind=ind, ind1=ind1)) +} + +.plotRescaledAxis <- function(scaleX,scaleX.fct, scaleX.inv, + scaleY,scaleY.fct, scaleY.inv, + xlim, ylim, X, ypts = 400, n = 11, + x.ticks = NULL, y.ticks = NULL, withbox = TRUE){ +# plots rescaled axes acc. to logicals scaleX, scaleY +# to this end uses trafos scaleX.fct with inverse scale.inv +# resp. scaleY.fct; it respects xlim and ylim (given in orig. scale) +# return value: none + if(scaleX){ + if(is.null(x.ticks)){ + x <- pretty(scaleX.inv(X)) + if(!is.null(xlim)) x <- pmax(x, xlim[1]) + if(!is.null(xlim)) x <- pmin(x, xlim[2]) + X <- .DistrCollapse(scaleX.fct(x),0*x)$supp + x <- scaleX.inv(X) + x <- x[is.finite(x)] + x <- pretty(x,n=n) + X <- .DistrCollapse(scaleX.fct(x),0*x)$supp + x <- scaleX.inv(X) + x <- x[is.finite(x)] + x <- pretty(x,n=length(x)) + x[.isEqual01(x)&x<0.4] <- 0 + X <- scaleX.fct(x) + xf <- prettyNum(x) + i01 <- !.isEqual01(X) + xf <- xf[i01] + Xi <- X + X <- X[i01] + i0 <- any(!i01&Xi<0.5) + i1 <- any(!i01&Xi>0.5) + if(i0){ xf <- c(NA,xf); X <- c(0, X)} + if(i1){ xf <- c(xf,NA); X <- c(X, 1)} + axis(1,at=X,labels=xf) + if(i0) axis(1,at=0,labels=expression(-infinity)) + if(i1) axis(1,at=1,labels=expression(infinity)) + }else{ + if(is.null(xlim)){ xlim <- c(-Inf,Inf)}else{ + if(is.na(xlim[1])) xlim[1] <- -Inf + if(is.na(xlim[2])) xlim[2] <- Inf } + x.ticks <- sort(unique(x.ticks[!is.na(x.ticks)])) + xf <- pmin(pmax(x.ticks[is.finite(x.ticks)],xlim[1]),xlim[2]) + Xf <- scaleX.fct(xf) + axis(1,at=Xf,labels=xf) + if(-Inf %in% x.ticks) axis(1,at=0,labels=expression(-infinity)) + if(Inf %in% x.ticks) axis(1,at=1,labels=expression(infinity)) + } + if(withbox) box() + }else{ + if(!is.null(x.ticks)){ + if(is.null(xlim)){ xlim <- c(-Inf,Inf)}else{ + if(is.na(xlim[1])) xlim[1] <- -Inf + if(is.na(xlim[2])) xlim[2] <- Inf } + x.ticks <- sort(unique(x.ticks[!is.na(x.ticks)])) + xf <- pmin(pmax(x.ticks[is.finite(x.ticks)],xlim[1]),xlim[2]) + axis(1,at=xf,labels=xf) + if(-Inf %in% x.ticks) axis(1,at=0,labels=expression(-infinity)) + if(Inf %in% x.ticks) axis(1,at=1,labels=expression(infinity)) + if(withbox) box() + } + } + if(scaleY){ + if(is.null(y.ticks)){ + Y0 <- if(!is.null(ylim)) max(0, scaleY.fct(ylim[1])) else 0 + Y1 <- if(!is.null(ylim)) min(1, scaleY.fct(ylim[2])) else 1 + Y <- seq(Y0,Y1, length=ypts) + y <- pretty(scaleY.inv(Y),n=n) + Y <- .DistrCollapse(scaleY.fct(y),0*y)$supp + y <- scaleY.inv(Y) + y <- y[is.finite(y)] + y <- pretty(y,n=length(y)) + y[.isEqual01(y)&y<0.4] <- 0 + Y <- scaleX.fct(y) + yf <- prettyNum(y) + Y <- scaleY.fct(y) + i01 <- !.isEqual01(Y) + yf <- yf[i01] + Yi <- Y + Y <- Y[i01] + i0 <- any(!i01&Yi<0.5) + i1 <- any(!i01&Yi>0.5) + if(i0){ yf <- c(NA,yf); Y <- c(0, Y)} + if(i1){ yf <- c(yf,NA); Y <- c(Y, 1)} + axis(2,at=Y,labels=yf) + if(i0) axis(2,at=0,labels=expression(-infinity)) + if(i1) axis(2,at=1,labels=expression(infinity)) + }else{ + if(is.null(ylim)){ ylim <- c(-Inf,Inf)}else{ + if(is.na(ylim[1])) ylim[1] <- -Inf + if(is.na(ylim[2])) ylim[2] <- Inf } + y.ticks <- sort(unique(y.ticks[!is.na(y.ticks)])) + yf <- pmin(pmax(y.ticks[is.finite(y.ticks)],ylim[1]),ylim[2]) + Yf <- scaleY.fct(yf) + axis(2,at=Yf,labels=yf) + if(-Inf %in% y.ticks) axis(2,at=0,labels=expression(-infinity)) + if(Inf %in% y.ticks) axis(2,at=1,labels=expression(infinity)) + } + if(withbox) box() + }else{ + if(!is.null(y.ticks)){ + if(is.null(ylim)){ ylim <- c(-Inf,Inf)}else{ + if(is.na(ylim[1])) ylim[1] <- -Inf + if(is.na(ylim[2])) ylim[2] <- Inf } + y.ticks <- sort(unique(y.ticks[!is.na(y.ticks)])) + yf <- pmin(pmax(y.ticks[is.finite(y.ticks)],ylim[1]),ylim[2]) + axis(2,at=yf,labels=yf) + if(-Inf %in% y.ticks) axis(2,at=0,labels=expression(-infinity)) + if(Inf %in% y.ticks) axis(2,at=1,labels=expression(infinity)) + if(withbox) box() + } + } + return(invisible(NULL)) +} + +.rescalefct <- function(x, fct, + scaleX = FALSE, scaleX.fct, scaleX.inv, + scaleY = FALSE, scaleY.fct = pnorm, + xlim, ylim, dots){ + +# if scaleX rescales x, if scaleY rescales fct(x); +# to this end uses trafos scaleX.fct with inverse scale.inv +# resp. scaleY.fct; it respects xlim and ylim (given in orig. scale) +# thins out the scaled values if necessary and accordingly modifies +# slots xaxt, yaxt, axes of dots to indicate the new axes have to be drawn +# paradigm small letters = orig. scale, capital letters = transformed scale +# return value: list with (thinned out) x and y, X and Y and modified dots + + X <- x + wI <- 1:length(x) + if(scaleX){ + if(!is.null(xlim)){ + dots$xlim <- scaleX.fct(xlim) + x <- x[x>=xlim[1] & x<=xlim[2]] + } + Xo <- X <- scaleX.fct(x) + X <- .DistrCollapse(X, 0*X)$supp + wI <- sapply(X, function(uu){ w<- which(uu==Xo); if(length(w)>0) w[1] else NA}) + wI <- wI[!is.na(wI)] + x <- scaleX.inv(X) + dots$axes <- NULL + dots$xaxt <- "n" + } + Y <- y <- if(is.function(fct)) fct(x) else fct[wI,1] + scy <- if(is.function(fct)) NA else fct[wI,2] + if(scaleY){ + Y <- scaleY.fct(y) + if(!is.null(ylim)) dots$ylim <- scaleY.fct(ylim) + dots$axes <- NULL + dots$yaxt <- "n" + } + return(list(x=x,y=y,X=X,Y=Y,scy=scy,dots=dots)) +} From noreply at r-forge.r-project.org Mon Jul 28 13:56:34 2014 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Mon, 28 Jul 2014 13:56:34 +0200 (CEST) Subject: [Robast-commits] r771 - branches/robast-1.0/pkg/RobExtremes/R Message-ID: <20140728115634.9917518599B@r-forge.r-project.org> Author: ruckdeschel Date: 2014-07-28 13:56:34 +0200 (Mon, 28 Jul 2014) New Revision: 771 Modified: branches/robast-1.0/pkg/RobExtremes/R/00fromRobAStRDA.R Log: [RobExtremes] removed ::: internal dependencies (within distr&robast-Fam's of pkgs) by copying respective routines Modified: branches/robast-1.0/pkg/RobExtremes/R/00fromRobAStRDA.R =================================================================== --- branches/robast-1.0/pkg/RobExtremes/R/00fromRobAStRDA.R 2014-07-28 11:45:10 UTC (rev 770) +++ branches/robast-1.0/pkg/RobExtremes/R/00fromRobAStRDA.R 2014-07-28 11:56:34 UTC (rev 771) @@ -1,3 +1,66 @@ -.versionSuff <- RobAStRDA:::.versionSuff -.MakeSmoothGridList <- RobAStRDA:::.MakeSmoothGridList +#------------------------------------ +#### utilities copied from package RobAStRDA v.1.0 svn-rev 767 +#------------------------------------ +.versionSuff <- function(name){ + paste(sep="", name, if(getRversion()<"2.16") ".O" else ".N") +} +.MakeSmoothGridList <- function(thGrid, Y, df = NULL, + gridRestrForSmooth = NULL){ + if(length(dim(Y))==3) + LMGrid <- Y[,1,,drop=TRUE] + else LMGrid <- Y[,drop=FALSE] + + if(!is.null(df)){ + df0 <- vector("list",ncol(LMGrid)) + if(is.numeric(df)){ + df <- rep(df,length.out=ncol(LMGrid)) + for(i in 1:ncol(LMGrid)) df0[[i]] <- df[i] + df <- df0 + } + }else{ + df0 <- vector("list",ncol(LMGrid)+1) + df0[[ncol(LMGrid)+1]] <- NULL + df <- df0 + } + + iNA <- apply(LMGrid,1, function(u) any(is.na(u))) + LMGrid <- LMGrid[!iNA,,drop=FALSE] + thGrid <- thGrid[!iNA] + oG <- order(thGrid) + thGrid <- thGrid[oG] + LMGrid <- LMGrid[oG,,drop=FALSE] + + if(is.null(gridRestrForSmooth)) + gridRestrForSmooth <- as.data.frame(matrix(TRUE,nrow(LMGrid),ncol(LMGrid))) + if((is.vector(gridRestrForSmooth)&&!is.list(gridRestrForSmooth))|| + is.matrix(gridRestrForSmooth)) + gridRestrForSmooth <- as.data.frame(gridRestrForSmooth) + + if(is.list(gridRestrForSmooth)){ + gm <- vector("list",ncol(LMGrid)) + idx <- rep(1:length(gridRestrForSmooth), length.out=ncol(LMGrid)) + for (i in 1:ncol(LMGrid)){ + if(!is.null(gridRestrForSmooth[[idx[i]]])){ + gm[[i]] <- gridRestrForSmooth[[idx[i]]] + }else{ + gm[[i]] <- rep(TRUE,nrow(LMGrid)) + } + } + gridRestrForSmooth <- gm + } + + for(i in 1:ncol(LMGrid)){ + gmi <- gridRestrForSmooth[[i]] + if(is.null(df[[i]])){ + SmoothSpline <- smooth.spline(thGrid[gmi], LMGrid[gmi, i]) + LMGrid[, i] <- predict(SmoothSpline, thGrid)$y + } else { + SmoothSpline <- smooth.spline(thGrid[gmi], LMGrid[gmi, i], + df = df[[i]]) + LMGrid[, i] <- predict(SmoothSpline, thGrid)$y + } + } + return(cbind(xi=thGrid,LM=LMGrid)) +} +