From noreply at r-forge.r-project.org Tue May 29 21:07:52 2018 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 29 May 2018 21:07:52 +0200 (CEST) Subject: [Robast-commits] r939 - in pkg/RobAStBase: . R man Message-ID: <20180529190752.4093F187C42@r-forge.r-project.org> Author: stamats Date: 2018-05-29 21:07:51 +0200 (Tue, 29 May 2018) New Revision: 939 Modified: pkg/RobAStBase/DESCRIPTION pkg/RobAStBase/R/infoPlot.R pkg/RobAStBase/man/0RobAStBase-package.Rd Log: Request by CRAN as we had if-conditions with length > 1. Should work now. Modified: pkg/RobAStBase/DESCRIPTION =================================================================== --- pkg/RobAStBase/DESCRIPTION 2017-09-20 01:17:04 UTC (rev 938) +++ pkg/RobAStBase/DESCRIPTION 2018-05-29 19:07:51 UTC (rev 939) @@ -1,6 +1,6 @@ Package: RobAStBase -Version: 1.0.1 -Date: 2017-04-23 +Version: 1.0.2 +Date: 2018-05-29 Title: Robust Asymptotic Statistics Description: Base S4-classes and functions for robust asymptotic statistics. Depends: R(>= 2.14.0), methods, rrcov, distr(>= 2.5.2), distrEx(>= 2.5), distrMod(>= 2.5.2), RandVar(>= 0.9.2) Modified: pkg/RobAStBase/R/infoPlot.R =================================================================== --- pkg/RobAStBase/R/infoPlot.R 2017-09-20 01:17:04 UTC (rev 938) +++ pkg/RobAStBase/R/infoPlot.R 2018-05-29 19:07:51 UTC (rev 939) @@ -1,630 +1,630 @@ -setMethod("infoPlot", "IC", - function(object, data = NULL, - ..., withSweave = getdistrOption("withSweave"), - col = par("col"), lwd = par("lwd"), lty, - colI = grey(0.5), lwdI = 0.7*par("lwd"), ltyI = "dotted", - main = FALSE, inner = TRUE, sub = FALSE, - col.inner = par("col.main"), cex.inner = 0.8, - bmar = par("mar")[1], tmar = par("mar")[3], - with.automatic.grid = TRUE, - with.legend = TRUE, legend = NULL, legend.bg = "white", - legend.location = "bottomright", legend.cex = 0.8, - x.vec = NULL, scaleX = FALSE, scaleX.fct, scaleX.inv, - 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, 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, - ylab.abs = "absolute information", - ylab.rel= "relative information", - withSubst = TRUE){ - - objectc <- match.call(call = sys.call(sys.parent(1)))$object - dots <- match.call(call = sys.call(sys.parent(1)), - expand.dots = FALSE)$"..." - - L2Fam <- eval(object at CallL2Fam) - - if(missing(scaleX.fct)){ - scaleX.fct <- p(L2Fam) - scaleX.inv <- q(L2Fam) - } - - withbox <- TRUE - if(!is.null(dots[["withbox"]])) withbox <- dots[["withbox"]] - dots["withbox"] <- NULL - dots["type"] <- NULL - xlab <- dots$xlab; if(is.null(xlab)) xlab <- "x" - dots$xlab <- dots$ylab <- NULL - - trafO <- trafo(L2Fam at param) - dimsA <- dims <- nrow(trafO) - dimm <- ncol(trafO) - - to.draw <- 1:(dims+1) - dimnms <- rownames(trafO) - if(is.null(dimnms)) - dimnms <- names(main(L2Fam at param))# paste("dim",1:dims,sep="") - pdimnms <- c("Abs",dimnms) - if(! is.null(to.draw.arg)){ - if(is.character(to.draw.arg)) - to.draw <- pmatch(to.draw.arg, pdimnms) - else if(is.numeric(to.draw.arg)) - to.draw <- to.draw.arg - } - - to.draw1 <- to.draw[to.draw>1] - dims0 <- length(to.draw1) - nrows <- trunc(sqrt(dims0)) - ncols <- ceiling(dims0/nrows) - in1to.draw <- (1%in%to.draw) - - if(!is.null(cex.pts.fun)){ - cex.pts.fun <- .fillList(cex.pts.fun, (dims0+in1to.draw)*2) - } - - scaleY.fct <- .fillList(scaleY.fct, length(to.draw1)) - scaleY.inv <- .fillList(scaleY.inv, length(to.draw1)) - - if(!is.null(x.ticks)) dots$xaxt <- "n" - if(!is.null(y.ticks)){ - y.ticks <- .fillList(y.ticks, dims0+in1to.draw) - dots$yaxt <- "n" - } - - if(with.legend){ - if(missing(legend.location)){ - legend.location <- .fillList("topright", dims0+in1to.draw ) - if (in1to.draw) legend.location[[1]] <- "bottomright" - }else{ - legend.location <- as.list(legend.location) - legend.location <- .fillList(legend.location, dims0+in1to.draw ) - } - if(is.null(legend)){ - legend <- vector("list",dims0+in1to.draw) - legend <- .fillList(list(as.list(c("class. opt. IC", objectc))), - dims0+in1to.draw) - } - } - distr <- L2Fam at distribution - if(!is(distr, "UnivariateDistribution") | is(distr, "CondDistribution")) - stop("not yet implemented") - - if(is(distr, "UnivariateDistribution")){ - xlim <- eval(dots$xlim) - if(!is.null(xlim)){ - xm <- min(xlim) - xM <- max(xlim) - dots$xlim <- NULL - } - if(is(distr, "AbscontDistribution")){ - lower0 <- getLow(distr, eps = getdistrOption("TruncQuantile")*2) - upper0 <- getUp(distr, eps = getdistrOption("TruncQuantile")*2) - me <- median(distr); s <- IQR(distr) - lower1 <- me - 6 * s - upper1 <- me + 6 * s - lower <- max(lower0, lower1) - upper <- min(upper0, upper1) - if(!is.null(xlim)){ - lower <- min(lower,xm) - upper <- max(upper,xM) - } - h <- upper - lower - if(is.null(x.vec)){ - if(scaleX){ - xpl <- scaleX.fct(lower - 0.1*h) - xpu <- scaleX.fct(upper + 0.1*h) - xp.vec <- seq(from = xpl, to = xpu, length = 1000) - x.vec <- scaleX.inv(xp.vec) - }else{ - x.vec <- seq(from = lower - 0.1*h, to = upper + 0.1*h, length = 1000) - } - } - plty <- "l" - if(missing(lty)) lty <- "solid" - }else{ - if(!is.null(x.vec)){ - if(is(distr, "DiscreteDistribution")) - x.vec <- intersect(x.vec,support(distr)) - }else{ - if(is(distr, "DiscreteDistribution")) x.vec <- support(distr) - else{ - x.vec <- r(distr)(1000) - x.vec <- sort(unique(x.vec)) - } - } - plty <- "p" - if(missing(lty)) lty <- "dotted" - if(!is.null(xlim)) x.vec <- x.vec[(x.vec>=xm) & (x.vec<=xM)] - } - } - ylim <- eval(dots$ylim) - if(!is.null(ylim)){ - if(!length(ylim) %in% c(2,2*(dims0+in1to.draw))) - stop("Wrong length of Argument ylim"); - ylim <- matrix(ylim, nrow=2,ncol=dims0+in1to.draw) - dots$ylim <- NULL - } - - dotsP <- dots - dotsP$type <- dotsP$lty <- dotsP$col <- dotsP$lwd <- NULL - dotsP$xlab <- dotsP$ylab <- NULL - - dotsL <- .makedotsLowLevel(dotsP) - dotsT <- dotsL - dotsT["main"] <- dotsT["cex.main"] <- dotsT["col.main"] <- NULL - dotsT["line"] <- NULL - dotsP$xlim <- xlim - - trafo <- trafo(L2Fam at param) - - - mainL <- FALSE - subL <- FALSE - lineT <- NA - - .mpresubs <- if(withSubst){function(inx) - .presubs(inx, c("%C", "%D", "%A"), - c(as.character(class(object)[1]), - as.character(date()), - as.character(deparse(objectc)))) - } else function(inx)inx - - if (hasArg(main)){ - mainL <- TRUE - if (is.logical(main)){ - if (!main) mainL <- FALSE - else - main <- gettextf("Information Plot for IC %%A") ### - ### double %% as % is special for gettextf - } - main <- .mpresubs(main) - if (mainL) { - if(missing(tmar)) - tmar <- 5 - if(missing(cex.inner)) - cex.inner <- .65 - lineT <- 0.6 - } - } - if (hasArg(sub)){ - subL <- TRUE - if (is.logical(sub)){ - if (!sub) subL <- FALSE - else sub <- gettextf("generated %%D") - ### double %% as % is special for gettextf - } - sub <- .mpresubs(sub) - if (subL) - if (missing(bmar)) bmar <- 6 - } - mnm <- names(L2Fam at param@main) - mnms <- if(is.null(mnm)) NULL else paste("'", mnm, "' = ", sep = "") - innerParam <- paste(gettext("\nwith main parameter ("), - paste(mnms, round(L2Fam at param@main, 3), - collapse = ", "), - ")", sep = "") - if(!is.null(L2Fam at param@nuisance)){ - nnm <- names(L2Fam at param@nuisance) - nnms <- if(is.null(nnm)) NULL else paste("'", nnm, "' = ", sep = "") - innerParam <- paste(innerParam, - gettext("\nand nuisance parameter ("), - paste(nnms, round(L2Fam at param@nuisance, 3), - collapse = ", "), - ")", sep ="") - } - if(!is.null(L2Fam at param@fixed)){ - fnm <- names(L2Fam at param@fixed) - fnms <- if(is.null(fnm)) NULL else paste("'", fnm, "' = ", sep = "") - innerParam <- paste(innerParam, - gettext("\nand fixed known parameter ("), - paste(fnms, round(L2Fam at param@fixed, 3), - collapse = ", "), - ")", sep ="") - } - if(!is.logical(inner)){ - #if(!is.character(inner)) - #stop("Argument 'inner' must either be 'logical' or a 'list'") - if(!is.list(inner)) - inner <- as.list(inner) - innerT <- .fillList(inner,1+dims) - if(dims01 ) - {if (is(normtype(object),"QFNorm")) QFc <- QuadForm(normtype(object)) - QFc0 <- solve( trafo %*% solve(L2Fam at FisherInfo) %*% t(trafo )) - if (is(normtype(object),"SelfNorm")|is(normtype(object),"InfoNorm")) - QFc <- QFc0 - } - - absInfoEval <- function(x,y, withNorm = FALSE){ - aI <- sapply(x, y at Map[[1]]) - if(withNorm) aI <- aI / max(aI) - return(aI) - } - - - QFc.5 <- sqrt(PosSemDefSymmMatrix(QFc)) - - classIC <- as(trafo %*% solve(L2Fam at FisherInfo) %*% L2Fam at L2deriv, "EuclRandVariable") - absInfoClass.f <- t(classIC) %*% QFc %*% classIC - absInfoClass <- absInfoEval(x.vec, absInfoClass.f) - - QF <- diag(dimsA) - if(is(object,"ContIC") & dimsA>1 ) - {if (is(normtype(object),"QFNorm")) QF <- QuadForm(normtype(object))} - QF.5 <- sqrt(PosSemDefSymmMatrix(QF)) - - IC1 <- as(diag(dimsA) %*% object at Curve, "EuclRandVariable") - absInfo.f <- t(IC1) %*% QF %*% IC1 - absInfo <- absInfoEval(x.vec, absInfo.f) - - - w0 <- getOption("warn") - options(warn = -1) - on.exit(options(warn = w0)) - opar <- par(no.readonly = TRUE) -# opar$cin <- opar$cra <- opar$csi <- opar$cxy <- opar$din <- NULL - if(mfColRow) on.exit(par(opar)) -# if (!withSweave) -# devNew() - - omar <- par("mar") - lpA <- max(length(to.draw),1) - parArgsL <- vector("list",lpA) - bmar <- rep(bmar, length.out=lpA) - tmar <- rep(tmar, length.out=lpA) - xaxt0 <- if(is.null(dots$xaxt)) { - if(is.null(dots$axes)||eval(dots$axes)) - rep(par("xaxt"),lpA) else rep("n",lpA) - }else rep(eval(dots$xaxt),lpA) - yaxt0 <- if(is.null(dots$yaxt)) { - if(is.null(dots$axes)||eval(dots$axes)) - rep(par("yaxt"),lpA) else rep("n",lpA) - }else rep(eval(dots$yaxt),lpA) - - for( i in 1:lpA){ - parArgsL[[i]] <- list(mar = c(bmar[i],omar[2],tmar[i],omar[4]) - ,xaxt=xaxt0[i], yaxt= yaxt0[i] - ) - } - - - pL <- expression({}) - if(!is.null(dots[["panel.last"]])){ - pL <- .panel.mingle(dots,"panel.last") - } - pL <- .fillList(pL, length(to.draw)) - if(in1to.draw){ - pL.rel <- pL[[1]] - pL.abs <- pL[-1] - }else{ pL.abs <- pL } - - - pF <- expression({}) - if(!is.null(dots[["panel.first"]])){ - pF <- .panel.mingle(dots,"panel.first") - } - ..panelFirst <- .fillList(pF, length(to.draw)) - if(with.automatic.grid) - ..panelFirst <- .producePanelFirstS( - ..panelFirst,object, to.draw.arg, TRUE, - x.ticks = x.ticks, scaleX = scaleX, scaleX.fct = scaleX.fct, - y.ticks = y.ticks, scaleY = scaleY, scaleY.fct = scaleY.fct) - gridS <- if(with.automatic.grid) - substitute({grid <- function(...){}}) else expression({}) - if(in1to.draw){ - pF.rel <- substitute({ gridS0 - .absInd <- FALSE - pF0 <- pF - pF0[[1+i]] }, list(pF=..panelFirst, gridS0=gridS)) - pF.abs <- substitute({ gridS0 - .absInd <- TRUE - pF - }, list(pF=..panelFirst[[1]], gridS0=gridS)) - }else{ - pF.abs <- NULL - pF.rel <- substitute({ gridS0 - .absInd <- FALSE - pF0 <- pF - pF0[[i]] - }, list(pF=..panelFirst, gridS0=gridS)) - } - dotsP$panel.last <- dotsP$panel.first <- NULL - - if(!is.null(data)){ - - n <- if(!is.null(dim(data))) nrow(data) else length(data) - if(!is.null(lab.pts)) - lab.pts <- matrix(rep(lab.pts, length.out=2*n),n,2) - - sel <- .SelectOrderData(data, function(x)absInfoEval(x,absInfo.f), - which.lbs, which.Order) - sel.C <- .SelectOrderData(data, function(x)absInfoEval(x,absInfoClass.f), - which.lbs, which.Order) - i.d <- sel$ind - i.dC <- sel.C$ind - i0.d <- sel$ind1 - i0.dC <- sel.C$ind1 - y.d <- sel$y - y.dC <- sel.C$y - x.d <- sel$data - x.dC <- sel.C$data - n <- length(i.d) - - if(missing(col.pts)) col.pts <- c(col, colI) - col.pts <- rep(col.pts, length.out=2) - pch.pts <- matrix(rep(pch.pts, length.out=2*n),n,2) - cex.pts <- rep(cex.pts,length.out=2) - jitter.fac <- rep(jitter.fac, length.out=2) - with.lab <- rep(with.lab, length.out=2) - lab.font <- rep(lab.font, length.out=2) - - - resc.dat <-.rescalefct(x.d, function(x) absInfoEval(x,absInfo.f), - scaleX, scaleX.fct, scaleX.inv, - scaleY, scaleY.fct, dots$xlim, dots$ylim, dots) - resc.datC <-.rescalefct(x.d, function(x) absInfoEval(x,absInfoClass.f), - scaleX, scaleX.fct, scaleX.inv, - scaleY, scaleY.fct, dots$xlim, dots$ylim, dots) - - x.dr <- resc.dat$X - x.dCr <- resc.datC$X - y.dr <- resc.dat$Y - y.dCr <- resc.datC$Y - - lab.pts <- if(is.null(lab.pts)) - cbind(i.d, i.dC) - else cbind(lab.pts[i.d],lab.pts[i.dC]) - - - dots.points <- .makedotsPt(dots) - - do.pts <- function(x,y,cxa,ca,pa) - do.call(points,args=c(list(x,y,cex=cxa,col=ca,pch=pa), - dots.points)) - tx <- function(xa,ya,lb,cx,ca) - text(x=xa,y=ya,labels=lb,cex=cx, col=ca) - - alp.v <- rep(alpha.trsp, length.out = dims0+in1to.draw) - - - pL.abs <- substitute({ - ICy0r1 <- ICy0r - ICy0cr1 <- ICy0cr - if(is(distr, "DiscreteDistribution")){ - ICy0r1 <- jitter(ICy0r1, factor = jitter.fac0[1]) - ICy0cr1 <- jitter(ICy0cr1, factor = jitter.fac0[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 - - do.pts(y0, ICy0r1, f1,col.pts[1],pch0[,1]) - do.pts(y0c, ICy0cr1, f1c,col.pts[2],pch0[,2]) - if(with.lab0){ - tx(y0, ICy0r1, lab.pts0, f1/2, col0[1]) - tx(y0c, ICy0cr1, lab.pts0C, f1c/2, col0[2]) - } - pL0 - }, list(ICy0c = y.dC, ICy0 = y.d, - ICy0r = y.dr, ICy0cr = y.dCr, - pL0 = pL, y0 = x.dr, y0c = x.dCr, - cex0 = cex.pts, - 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, cexfun = cex.pts.fun) - ) - - pL.rel <- substitute({ - y0.vec <- sapply(y0, IC1.i.5 at Map[[indi]])^2/ICy0 - y0c.vec <- sapply(y0c, classIC.i.5 at Map[[indi]])^2/ICy0c - if(is(distr, "DiscreteDistribution")){ - y0.vec <- jitter(y0.vec, factor = jitter.fac0[1]) - y0c.vec <- jitter(y0c.vec, factor = jitter.fac0[2]) - } - - col.pts <- if(!is.na(al0)) sapply(col0, - addAlphTrsp2col, alpha=al0[i1]) else col0 - dotsP0 <- dotsP - resc.rel <- .rescalefct(y0, cbind(y0.vec,ICy0), - scaleX, scaleX.fct, scaleX.inv, - FALSE, scaleY.fct[[i]], dots$xlim, dots$ylim, dotsP0) - resc.rel.c <- .rescalefct(y0c, cbind(y0c.vec,ICy0c), - scaleX, scaleX.fct, scaleX.inv, - FALSE, scaleY.fct[[i]], dots$xlim, dots$ylim, dotsP0) - - 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){ - tx(resc.rel$X, resc.rel$Y, lab.pts0, f1/2, col0[1]) - tx(resc.rel.c$X, resc.rel.c$Y, lab.pts0C, f1c/2, col0[2]) - } - pL0 - }, list(ICy0c = y.dC, ICy0 = y.d, - ICy0r = y.dr, ICy0cr = y.dCr, - pL0 = pL, y0 = x.d, y0c = x.dC, - 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, cexfun = cex.pts.fun - )) - } - - if(!is.null(ylim)) - dotsP$ylim <- ylim[,1] - - fac.leg <- if(dims0>1) 3/4 else .75/.8 - - - dotsP$axes <- NULL - if(1 %in% to.draw){ - resc <-.rescalefct(x.vec, function(x) absInfoEval(x,absInfo.f), - scaleX, scaleX.fct, scaleX.inv, - scaleY, scaleY.fct, dots$xlim, dots$ylim, dotsP) - resc.C <-.rescalefct(x.vec, function(x) absInfoEval(x,absInfoClass.f), - scaleX, scaleX.fct, scaleX.inv, - scaleY, scaleY.fct, dots$xlim, dots$ylim, dotsP) - dotsP1 <- dotsP <- resc$dots - dotsP$yaxt <- dots$yaxt - - do.call(par, args = parArgsL[[1]]) - - do.call(plot, args=c(list(resc.C$X, resc.C$Y, type = plty, - lty = ltyI, col = colI, lwd = lwdI, - xlab = .mpresubs(xlab), ylab = .mpresubs(ylab.abs), panel.last = pL.abs, - panel.first = pF.abs), - dotsP1)) - do.call(lines, args=c(list(resc$X, resc$Y, type = plty, - lty = lty, lwd = lwd, col = col), dotsL)) - scaleX0 <- scaleX & (xaxt0[1]!="n") - scaleY0 <- scaleY & (yaxt0[1]!="n") - x.ticks0 <- if(xaxt0[1]!="n") x.ticks else NULL - y.ticks0 <- if(yaxt0[1]!="n") y.ticks[[1]] else NULL - - finiteEndpoints <- rep(FALSE,4) - if(scaleX){ - finiteEndpoints[1] <- is.finite(scaleX.inv(min(resc.C$X, xlim[1],na.rm=TRUE))) - finiteEndpoints[2] <- is.finite(scaleX.inv(max(resc.C$X, xlim[2],na.rm=TRUE))) - } - if(scaleY){ - finiteEndpoints[3] <- is.finite(scaleY.inv[[1]](min(resc.C$Y, ylim[1,1],na.rm=TRUE))) - finiteEndpoints[4] <- is.finite(scaleY.inv[[1]](max(resc.C$Y, ylim[2,1],na.rm=TRUE))) - } - - .plotRescaledAxis(scaleX0, scaleX.fct, scaleX.inv, - scaleY0,scaleY.fct, scaleY.inv, - dots$xlim, dots$ylim, resc$X, ypts = 400, - n = scaleN, x.ticks = x.ticks0, - y.ticks = y.ticks0, withbox = withbox) - if(with.legend) - legend(.legendCoord(legend.location[[1]], scaleX, scaleX.fct, - scaleY, scaleY.fct), legend = legend[[1]], bg = legend.bg, - lty = c(ltyI, lty), col = c(colI, col), - lwd = c(lwdI, lwd), cex = legend.cex*fac.leg) - - - if(innerL) - do.call(title, args=c(list(main = innerT[[1]]), dotsT, - line = lineT, cex.main = cex.inner, col.main = col.inner)) - } - - if(dims > 1 && length(to.draw[to.draw!=1])>0){ - nrows <- trunc(sqrt(dims0)) - ncols <- ceiling(dims0/nrows) - if (!withSweave||!mfColRow) - dN <- substitute({devNew()}) else substitute({}) - - IC1.i.5 <- QF.5%*%IC1 - classIC.i.5 <- QFc.5%*%classIC - for(i in 1:dims0){ - indi <- to.draw1[i]-1 - i1 <- i + in1to.draw - if(!is.null(ylim)) - dotsP$ylim <- ylim[,in1to.draw+i] - else dotsP$ylim <- c(0,1) - - y.vec1 <- sapply(resc$x, IC1.i.5 at Map[[indi]])^2/ - absInfoEval(resc$x,absInfo.f) - y.vec1C <- sapply(resc.C$x, classIC.i.5 at Map[[indi]])^2/ - absInfoEval(resc.C$x,absInfoClass.f) - - if(mfColRow){ - parArgsL[[i+in1to.draw]] <- c(parArgsL[[i+in1to.draw]],list(mfrow = c(nrows, ncols))) - eval(dN) - if(i==1) do.call(par,args=parArgsL[[i+in1to.draw]]) - }else{do.call(par,args=parArgsL[[i+in1to.draw]])} - - do.call(plot, args=c(list(resc$X, y.vec1, type = plty, - lty = lty, xlab = .mpresubs(xlab), ylab = .mpresubs(ylab.rel), - col = col, lwd = lwd, panel.last = pL.rel, - panel.first = pF.rel), dotsP)) - - do.call(lines, args = c(list(resc.C$X, y.vec1C, type = plty, - lty = ltyI, col = colI, lwd = lwdI), dotsL)) - scaleX0 <- scaleX & (xaxt0[i+in1to.draw]!="n") - scaleY0 <- scaleY & (yaxt0[i+in1to.draw]!="n") - x.ticks0 <- if(xaxt0[i+in1to.draw]!="n") x.ticks else NULL - y.ticks0 <- if(yaxt0[i+in1to.draw]!="n") y.ticks[[i+in1to.draw]] else NULL - - finiteEndpoints <- rep(FALSE,4) - if(scaleX){ - finiteEndpoints[1] <- is.finite(scaleX.inv(min(resc$X, xlim[1],na.rm=TRUE))) - finiteEndpoints[2] <- is.finite(scaleX.inv(max(resc$X, xlim[2],na.rm=TRUE))) - } - if(scaleY){ - finiteEndpoints[3] <- is.finite(scaleY.inv[[i+in1to.draw]](min(y.vec1, ylim[1,i+in1to.draw],na.rm=TRUE))) - finiteEndpoints[4] <- is.finite(scaleY.inv[[i+in1to.draw]](max(y.vec1, ylim[2,i+in1to.draw],na.rm=TRUE))) - } - - .plotRescaledAxis(scaleX0, scaleX.fct, scaleX.inv, - FALSE,scaleY.fct[[i+in1to.draw]], - scaleY.inv[[i+in1to.draw]], dots$xlim, - dots$ylim, resc$X, ypts = 400, n = scaleN, - finiteEndpoints = finiteEndpoints, - x.ticks = x.ticks0, - y.ticks = y.ticks0, withbox = withbox) - if(with.legend) - legend(.legendCoord(legend.location[[i1]], - scaleX, scaleX.fct, scaleY, scaleY.fct[[i]]), - bg = legend.bg, legend = legend[[i1]], - col = c(colI, col), lwd = c(lwdI, lwd), - lty = c(ltyI, lty), cex = legend.cex*fac.leg) - if(innerL) - do.call(title, args = c(list(main = innerT[[1+indi]]), - dotsT, line = lineT, cex.main = cex.inner, - col.main = col.inner)) - } - } - cex.main <- if(!hasArg(cex.main)) par("cex.main") else dots$"cex.main" - col.main <- if(!hasArg(col.main)) par("col.main") else dots$"col.main" - if (mainL) - mtext(text = main, side = 3, cex = cex.main, adj = .5, - outer = TRUE, padj = 1.4, col = col.main) - - cex.sub <- if(!hasArg(cex.sub)) par("cex.sub") else dots$"cex.sub" - col.sub <- if(!hasArg(col.sub)) par("col.sub") else dots$"col.sub" - if (subL) - mtext(text = sub, side = 1, cex = cex.sub, adj = .5, - outer = TRUE, line = -1.6, col = col.sub) - - if(return.Order) return(list(IC=i0.d,IC.class=i0.dC)) - - invisible() - } - ) - +setMethod("infoPlot", "IC", + function(object, data = NULL, + ..., withSweave = getdistrOption("withSweave"), + col = par("col"), lwd = par("lwd"), lty, + colI = grey(0.5), lwdI = 0.7*par("lwd"), ltyI = "dotted", + main = FALSE, inner = TRUE, sub = FALSE, + col.inner = par("col.main"), cex.inner = 0.8, + bmar = par("mar")[1], tmar = par("mar")[3], + with.automatic.grid = TRUE, + with.legend = TRUE, legend = NULL, legend.bg = "white", + legend.location = "bottomright", legend.cex = 0.8, + x.vec = NULL, scaleX = FALSE, scaleX.fct, scaleX.inv, + 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, 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, + ylab.abs = "absolute information", + ylab.rel= "relative information", + withSubst = TRUE){ + + objectc <- match.call(call = sys.call(sys.parent(1)))$object + dots <- match.call(call = sys.call(sys.parent(1)), + expand.dots = FALSE)$"..." + + L2Fam <- eval(object at CallL2Fam) + + if(missing(scaleX.fct)){ + scaleX.fct <- p(L2Fam) + scaleX.inv <- q(L2Fam) + } + + withbox <- TRUE + if(!is.null(dots[["withbox"]])) withbox <- dots[["withbox"]] + dots["withbox"] <- NULL + dots["type"] <- NULL + xlab <- dots$xlab; if(is.null(xlab)) xlab <- "x" + dots$xlab <- dots$ylab <- NULL + + trafO <- trafo(L2Fam at param) + dimsA <- dims <- nrow(trafO) + dimm <- ncol(trafO) + + to.draw <- 1:(dims+1) + dimnms <- rownames(trafO) + if(is.null(dimnms)) + dimnms <- names(main(L2Fam at param))# paste("dim",1:dims,sep="") + pdimnms <- c("Abs",dimnms) + if(! is.null(to.draw.arg)){ + if(is.character(to.draw.arg)) + to.draw <- pmatch(to.draw.arg, pdimnms) + else if(is.numeric(to.draw.arg)) + to.draw <- to.draw.arg + } + + to.draw1 <- to.draw[to.draw>1] + dims0 <- length(to.draw1) + nrows <- trunc(sqrt(dims0)) + ncols <- ceiling(dims0/nrows) + in1to.draw <- (1%in%to.draw) + + if(!is.null(cex.pts.fun)){ + cex.pts.fun <- .fillList(cex.pts.fun, (dims0+in1to.draw)*2) + } + + scaleY.fct <- .fillList(scaleY.fct, length(to.draw1)) + scaleY.inv <- .fillList(scaleY.inv, length(to.draw1)) + + if(!is.null(x.ticks)) dots$xaxt <- "n" + if(!is.null(y.ticks)){ + y.ticks <- .fillList(y.ticks, dims0+in1to.draw) + dots$yaxt <- "n" + } + + if(with.legend){ + if(missing(legend.location)){ + legend.location <- .fillList("topright", dims0+in1to.draw ) + if (in1to.draw) legend.location[[1]] <- "bottomright" + }else{ + legend.location <- as.list(legend.location) [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/robast -r 939 From noreply at r-forge.r-project.org Tue May 29 21:18:00 2018 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Tue, 29 May 2018 21:18:00 +0200 (CEST) Subject: [Robast-commits] r940 - pkg/RobAStBase/inst Message-ID: <20180529191800.8E926189E3B@r-forge.r-project.org> Author: stamats Date: 2018-05-29 21:18:00 +0200 (Tue, 29 May 2018) New Revision: 940 Modified: pkg/RobAStBase/inst/NEWS Log: update of NEWS file Modified: pkg/RobAStBase/inst/NEWS =================================================================== --- pkg/RobAStBase/inst/NEWS 2018-05-29 19:07:51 UTC (rev 939) +++ pkg/RobAStBase/inst/NEWS 2018-05-29 19:18:00 UTC (rev 940) @@ -1,433 +1,438 @@ -############################################################################### -## News: to package RobAStBase -############################################################################### - -(first two numbers of package versions do not necessarily reflect - package-individual development, but rather are chosen for the - RobAStXXX family as a whole in order to ease updating "depends" - information) - -####################################### -version 1.0.1 -####################################### -user-visible CHANGES: -+ moved getFiRisk from ROptEst to RobAstBase - -####################################### -version 1.0 -####################################### - -user-visible CHANGES: -+ comparePlot, infoPlot, and the plot-Method for ICs gain an argument - with.automatic.grid; if TRUE a corresponding grid oriented at tickmarks - is produced; this also works for rescaled axes -+ comparePlot, infoPlot, and the plot-Method for ICs gain optional - pattern substitution (like plot) which can be switched off by - argument withSubst -+ arguments panel.first, panel.last for plot-methods can now be lists -+ 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 -+ .ddPlot.MatNtNtCoCo, and also ddPlot, outlyingnessPlot gain an - additional argument 'doplot' defaulting to TRUE; if FALSE, no plot - is produced and only the return value is calculated. -+ arguments scaleY.fct and scaleY.inv in the plot-method for ICs, - and in comparePlot und infoPlot now also may be lists of functions, - one for each of the panels to be plot; hence scaling of the y-axis - can now be done individually for each panel. -+ introduce jitter for points in ddPlot for DiscreteDistributions -+ comparePlot, infoPlot, and the plot-Method for ICs gain an argument x.vec; - if given it is the x-grid on which to evaluate the ICs; by default this - argument is NULL; then (as before) the grid is selected automatically - according to the distribution of the IC. This can be useful for usage with a - rescaling of the x-Axis to avoid that the evaluation points be selected too - unevenly (i.e. on an equally spaced grid in the original scale, but then, after - rescaling non-equally... The grid has to be specified in original scale; i.e.; - when used with rescaling, should be chosen non-equally spaced... -+ wrapper functions ICPlot, InfoPlot, and ComparePlot use refined grids, i.e., - the grids are plotted on user given coordinates (or rescaled coordinates) -+ comparePlot, infoPlot, and the plot-Method for ICs now if scaleX is TRUE by - default use an equidistant grid on the rescaled x-Axis. -+ qqplot-method for c("ANY","InfRobModel") gains argument - 'cex.pts.fun' to better control the scaling of points-sizes -+ new helper function cutoff.quant() to produce cutoff from model quantiles - -GENERAL ENHANCEMENTS: - -under the hood: -+ introduced automatic scaling of points in comparePlot.R and infoPlot.R -+ .cexscale is now documented -+ the argument of .fillList is now automatically cast to list (if necessary). -+ interpolRisks gain biastype and normtype methods, as well as getRiskFctBV - => now cniperPointPlot should work for GPD-type data -+ added reference for copied routine stats:::format.perc -+ in the axis annotation (after rescaling) there are checks now - whether values +-infinity are taken at all. (This was a bug - before for distributions passed on as cdf and quantile function - with finite left or right endpoint.) -+ output in kStepEstimator() and oneStepEstimator() is filtered - by .checkEstClassForParamFamily(); this allows to return an - object of S4 class specific to the resp. parametric family (by means of - S4 method dispatch); this is used in pkg 'RobExtremes' to produce, e.g., - objects of class "GEVkStepEstimate", i.e. which inherit from both - "kStepEstimate", so that a diag-method for "GEVEstimate" becomes - available for this class. -+ enhanced imports in DESCRIPTION by explicating second order imports - - -BUGFIXES: -+ two bugs in plotWrapper.R in pkgs RobAStBase and ROptEst detected by Misha -+ bug in kStepEstimator: after evaluation of starting estimator, IC must be - shifted to correct parameter value -> new arguments withPreModif, withPostModif -+ in comparePlot it should be resc.Dargs instead of rescD.args -+ fixed errors detected by Matthias / Misha, Bernhard in comparePlot.R, cutoff-class.R, - ddPlot_utils.R, infoPlot.R, outlyingPlot.R -+ comparePlot now plots the whole range -+ ddPlots / outlyingPlot.R now have alpha transparency and jitter and cex.pts -+ infoPlot plots the correct y-axis (no overplotting) -+ minor fixes in InfoPlotWrapper.Rd, outlyingPlotIC.Rd -+ fixed NA-buglet in plotWrapper.R (detected by Dasha Pupashenko) -+ fixed a little bug with the use of .cexscale (with list of functions) -+ bugfix in outlyingnessPlot: for robCov.y ==TRUE (default) the - inverse covariance matrix was used for standardization instead - of the original one - - -####################################### -version 0.9 -####################################### - -user-visible CHANGES: -+ new wrapper function InfoPlot, ComparePlot, PlotIC - - -GENERAL ENHANCEMENTS: - -+ RobASt-Pkgs: DESCRIPTION depends become stricter (requiring distrMod, distrEx, distr >=2.4 to be on the safe side) -+ deleted chm folders --- they are no longer needed -+ added argument no.readonly = TRUE in all assignments of type opar <- par(); -+ commented out all assignments of type omar$cin <- NULL -+ removed calls to require from R sources and replaced it by directives in the NAMESPACE file -+ all packages get a DESCRIPTION tag "ByteCompile" - -under the hood: - -+ wrapper functions use default rescaling controlled by S4-method rescaleFct - dispatching on the respective model - -+ added .Rbuildignore - -+ cleaned DESCRIPTION and NAMESPACE file as to Imports/Depends - -+ created new interpolRisk-class to be able to use speed up in (new version) of roptest -+ interpolRisks extended by slot samplesize - -+ implemented scale estimation on log-scale for kStepEstimator -+ in kStepEstimator asyvar of starting estimator is no longer computed - (unless done so anyway in the call to the starting estimator)/ as not needed -+ in kStepEstimator one can now delay evaluations of covariance matrices, - depending on new argument withEvalAsVar -+ a small change in kStepEstimator -- now uses the (possibly nonlinear) - trafo instead of the Jacobian to get the pIC-estimator from the untransformed estimator -+ in kStepEstimator we force an argument list (to avoid an "argument missing" error) - -+ checkIC now also reports relative errors (has possibly already been there - but not merged?) - -+ new S4methods/functions moveL2Fam2RefParam and moveICBackFromRefParam to only - solve optimization problems for ICs at reference parameters (if these are - available) and the to backtransform the IC to the original parameter - (is not yet in place in optIC; still testing necessary). - -+ the accessor to slot Risks now checks if all items of the list are already - evaluated or if some calls still have to be forced; to this end it uses - new auxiliary .evalListRec - -+ minor Enhancements of ddPlot, changes in outlyingPlot -+ modularized diagnostic plots; still checking + debugging necessary - -+ documented helper functions - -+ thx to hint by Matthias (NAMESPACE), and some (more specific) Rd-links to - gettextf, now no more notes or warnings in R-2.16.0dev - -+ .rescalefct looses argument scaleY.inv (not needed). - -+ use of unit tests - -BUGFIXES: - -+ Bug in infoPlot(), detected by Nataliya Horbenko, tentatively fixed -+ use of colnames instead of sampleNames to avoid the error on CRAN ... -+ fixed some 1-dim vs >1-dim issues in kStepEstimator.R -+ ...and yet some correction as to variances -+ Removed "..." in definition of generic for "samplesize<-", this had led to a warning in R CMD check. -+ .evalListRec was not prepared for length 0 -+ some substitute functions have not been passed as arguments... - - - -####################################### -version 0.8 -####################################### - -USER-VISIBLE CHANGES -+ new helper methods makeIC to apply to functions or list of functions - for easily producing (suboptimal) ICs -+ included risk computation for sin,cos-IC in makeIC-methods.Rd - -+ qqplot for RobModel now produces outlier adjusted CIs - -+ ddPlot: additional annotation parameters - (all with reasonable defaults) - - -text.abline: controls whether cutoff lines get labeled - -text.abline.x, - -text.abline.y: text to be added as labels, - defaults to something like "95%-cutoff = 4.32" - 4.32 the cutoff value) - - -cex.abline, - -col.abline, - -font.abline, - -adj.abline: respective parameters for labels - - -text.abline.x.x, - -text.abline.x.y, - -text.abline.y.x, - -text.abline.y.y: coordinates of labels, - - -text.abline.x.fmt.cx, - -text.abline.x.fmt.qx, - -text.abline.y.fmt.cy, - -text.abline.y.fmt.qy: format strings for cutoff quantiles - and values in labels - - -arguments cex.idn and col.idn now if missing first check against arguments - cex and col respectively before using defaults par("cex") and par("col") respectively - -+ for restoring old par() values, not all attributes may be set; - hence deleted them from stored value in plot functions by something like - opar$cin <- opar$cra <- opar$csi <- opar$cxy <- opar$din <- NULL - -+ infoPlot gains arguments ylab.rel and ylab.abs to set the label - for y axis (as requested by N. Horbenko) - -+ DESCRIPTION files and package-help files gain a tag SVNRevision - to be filled by get[All]RevNr.R from utils in distr - -BUGFIXES - -+ you could not place single plots where you wanted... -+ Nataliya found yet another bug in infoPlot.R - -####################################### -version 0.7 -####################################### - -user-visible CHANGES: - -+ enhanced plotting: - * new diagnostic function qqplot to check the quality of a model fit - + special methods for second argument of class - "RobModel", "InfRobModel", and "kStepEstimate" - + comes with corresponding (pointwise/simultaneous) confidence intervals - + for "RobModel", "InfRobModel": sizing of points and labels according to - Mahalanobis size of points / any other distance function - + for "kStepEstimate": fading / sizing of points and labels according to - weight of corresponding [p]IC - * suggestions by A. Unwin, Augsburg; - plot for ICs, infoPlot, and comparePlot may be restricted to selected subplots; - * ylim can now be matrix-valued... - * infoPlot and comparePlot now have a placeable legend location - argument - * plot functions gain data argument: - it is "y" for plot(IC, numeric) and for comparePlot, - for infoPlot it is argument "data" - * plot functions gain arguments - - which.lbs : select some data indices for plotting, - - which.Order : select some order statistics from the remaining data - for plotting (ordered; w.r.t. norm of IC) (in descending order) - - return.Order : shall ordering be printed out? -+ documentation - * added some UML class diagrams -+ checking functions - * checkIC gains ... argument to pass on accuracy arguments to E() -+ estimators - * unified treatmend of NAs: - - class Estimate gains slot completecases to control for NA in the input - - slot samplesize only counts remaining cases - - samplesize accessor has argument onlycompletecases and hence can issue both remaining - and original samplesize - - locMEstimator gains arg na.rm - * class kStepEstimator gains slots - - start: argument start of kStepEstimator - - startval:matrix of transformed starting values - - ustarval:matrix of untransformed starting values - - ksteps: matrix of (intermediate) transformed estimates - - uksteps: matrix of (intermediate) untransformed estimates - - ICList: optional: the (intermediate) (total) ICs - - pICList: optional: the (intermediate) [p]ICs - and corresponding accessors - * oneStepEstimator and kStepEstimator gain an argument startArgList - -+ ICs - * we now can digest case p=1, k>1 for asymmetric biastypes as well as for total variation - -+ new getRobAStBaseOption-s - * "all.verbose" : globally set verbose to TRUE - * "withUpdateInKer" --- what to do in kStep on ker(D) - * "IC.UpdateInKer" --- IC to use in kStep on ker(D) - -+ utilities: - * robModel gains trafo and trafo<- methods to access/modify - slot trafo - * RobAStBaseMASK for masked methods - * replacement function radius for Neighborhood - - -GENERAL ENHANCEMENTS: - -+ added tests/Examples folder with file RobAStBase-Ex.Rout.save to have - some automatic testing -+ added TOBEDONE (sic!) files; in English (for possible collaborators) -+ added keyword robust and made some minor corrections ... -+ added/updated NEWS files, updated CITATION files using code by A. Zeileis - -+ Rd-parsing: - * patch for Brian Ripley's - Re: [Rd] Warning: missing text for item ... in \describe? - * fixed errors / warnings in .Rd files detected by parser 2 - (c.f. [Rd] More intensive checking of R help files, Prof Brian Ripley, 09.01.2009 10:25) - -+ svn-revision-tags - * added in all DESCRIPTION files - * added field "Encoding: latin1" to all DESCRIPTION files because - substituting $LastChangedDate by svn would cause problems for - packages built under Windows (German) local when checking under Linux. - -+ removed pdf-file from version control - Rnw-file is sufficient - - -INTERNALLY: -+ estimators - * implementation of oneStepEstimator simplified, no longer dispatching on argument "start". -+ plotting - * also named parameters are used in axis annotation if available. - * plot-methods now accept to.draw.arg no matter whether mfColRow==TRUE or FALSE - -+ for consistency mat item in trafo slot is now always matrix(1) - -+ changes for treatment of kStepEstimator with nuisance parameters... - -+ oneStepEstimator and kStepEstimator implemented anew - * oneStepEstimator and kStepEstimator no longer are generic. - * kStepEstimator - - now only uses one function - - works with non-trivial trafo - - has new arguments - withUpdateInKer : shall we update IC in ker(D)? - IC.UpdateInKer : which is the default IC to be taken for ker(D) -- default = NULL - in which case we use getBoundedIC - na.rm : unified treatment of missings - * new generic function kStepEstimatorStart to produce starting values for one/kstep - works with - - numeric - - estimate - - function (to be evaluated at data x) - * kStepEstimatorStart-method for function now has arguments - (start, x, nrvalues, na.rm, L2Fam, startList) - * oneStepEstimator now basically calls kStepEstimator except for the case - when IC is not of class "IC", in which similar code is adapted by hand - -+ kStepEstimator - - - we do update only on demand, i.e. when with.u.var is TRUE - (which is true only in the last iteration step) - if (! var.to.be.c), ie. if asvar information is missing in - the optimized IC, we calculate it as - var0 <- matrix(E(L2Fam, IC.c %*% t(IC.c)),p,p) - - - deletion of dim attribute (which enters after rowMean(....) - - naming of coordinates of [untransformed.]estimate and - [untransformed.]asvar is done consistently to slot param - - in case no variance is computed in optIC asvar is determined - by E() in pxp dimension (= !var.to.be.c) - - computations in k-Space are more problematic than thought - if matrix D has not got full rank or nuisance parameters are present: - - * k-dimensional untransformed.estimate - this was clear; no problems as to this; - works for both options withUpdateInKer TRUE or FALSE - - * k-dimensional IC - - D^- %*% pIC is not an IC in case ker D is not trivial. - - two options: - -> withUpdateInKer FALSE: be content - with a solution in Psi^(D^-D) ... - IC.tot = IC.tot1 = D^- %*% pIC - -> withUpdateInKer TRUE: complete IC.tot1 - by addition of IC.tot2 = projker %*% IC2 - for projker = I - D^-D and IC2 is either - a given IC IC.UpdateInKer or a default bounded IC gotten by getBoundedIC. - - * kxk dimensinoal var - this is most problematic in case ker D is non-trivial: - - if argument start is of class ALEstimate and has a non-NULL pIC-slot - IC0, this one is taken for computation of untransformed.asvar, i.e. - IC.tot.0 = projker %*% IC0 + D^- %*% pIC - and untransformed.asvar = E(IC.tot.0 %*% IC.tot.0' ) - otherwise NULL is returned in this case - - - - if argument start is of class Estimate and has a non-NULL asvar-slot - the one is taken later - - - variances u.var and var0 are calculated in internal function - -+ new function getBoundedIC to produce (arbitrarily; in fact rather large b) bounded IC as EuclRandVariable - used in kStepEstimator to give default IC to be projected on ker D. - -+ .onAttach now uses startupmessages -+ StartClass now also contains "matrix" -+ argument "start" in kStepEstimator and oneStepEstimator is NULL by default - (and then replaced by L2Fam at startPar) -+ clip and start obtain signatures acc. to graphics/stats methods -+ introduce particular show methods for [Optional]pICList -+ new file kStepEstimate.R (forgot to upload so far) -+ S4 methods for masked functions in masked.R -+ new generic radius<- for Neighborhood - -BUGFIXES: - -+ in plotting functions: - * fixed xlim and ylim args for plots; - * fixed some bugs with lty[I], lwd[I], col[I] in comparePlot and infoPlot - * legend.location was missing in usage-section - * bug(?) in plot corrected now works for trafo ... - similar bug in plot method for L2ParamFamily?! - * minor correction of plot title - * infoPlot.R minor bugs corrected - seems to work now, but code has some fragile points ... - * removed some little bug in comparePlot.R -+ Rd docu: - * minor documentation error in infoPlot.Rd -+ small bug in checkIC corrected -+ the "dim" attribute issue: - * new kstepEstimator returned [untransformed.]estimates with dim - attribute ... - this caused e.g. problems in RobLox, in rlsOptIC.AL.Rd, changed this; - * yet another small change ... to eliminate non-wanted dim-attribute -+ minor typo in kStepEstimator - - - -####################################### -version 0.1.3 -####################################### -+ new plotting features similar to package distr -+ new plotting functionality: ddPlot and outlyingPlot -+ introduced option("newDevice") to control new opening of graphic devices -+ use of on.exit() to restore old settings for options() and par() at the end - of functions -+ introduction of NEWS-file -+ update of CITATION-file (based on code provided by A. Zeileis on R help) +############################################################################### +## News: to package RobAStBase +############################################################################### + +(first two numbers of package versions do not necessarily reflect + package-individual development, but rather are chosen for the + RobAStXXX family as a whole in order to ease updating "depends" + information) + +####################################### +version 1.0.2 +####################################### ++ corrected to if-conditions with length > 1 + +####################################### +version 1.0.1 +####################################### +user-visible CHANGES: ++ moved getFiRisk from ROptEst to RobAstBase + +####################################### +version 1.0 +####################################### + +user-visible CHANGES: ++ comparePlot, infoPlot, and the plot-Method for ICs gain an argument + with.automatic.grid; if TRUE a corresponding grid oriented at tickmarks + is produced; this also works for rescaled axes ++ comparePlot, infoPlot, and the plot-Method for ICs gain optional + pattern substitution (like plot) which can be switched off by + argument withSubst ++ arguments panel.first, panel.last for plot-methods can now be lists ++ 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 ++ .ddPlot.MatNtNtCoCo, and also ddPlot, outlyingnessPlot gain an + additional argument 'doplot' defaulting to TRUE; if FALSE, no plot + is produced and only the return value is calculated. ++ arguments scaleY.fct and scaleY.inv in the plot-method for ICs, + and in comparePlot und infoPlot now also may be lists of functions, + one for each of the panels to be plot; hence scaling of the y-axis + can now be done individually for each panel. ++ introduce jitter for points in ddPlot for DiscreteDistributions ++ comparePlot, infoPlot, and the plot-Method for ICs gain an argument x.vec; + if given it is the x-grid on which to evaluate the ICs; by default this + argument is NULL; then (as before) the grid is selected automatically + according to the distribution of the IC. This can be useful for usage with a + rescaling of the x-Axis to avoid that the evaluation points be selected too + unevenly (i.e. on an equally spaced grid in the original scale, but then, after + rescaling non-equally... The grid has to be specified in original scale; i.e.; + when used with rescaling, should be chosen non-equally spaced... ++ wrapper functions ICPlot, InfoPlot, and ComparePlot use refined grids, i.e., + the grids are plotted on user given coordinates (or rescaled coordinates) ++ comparePlot, infoPlot, and the plot-Method for ICs now if scaleX is TRUE by + default use an equidistant grid on the rescaled x-Axis. ++ qqplot-method for c("ANY","InfRobModel") gains argument + 'cex.pts.fun' to better control the scaling of points-sizes ++ new helper function cutoff.quant() to produce cutoff from model quantiles + +GENERAL ENHANCEMENTS: + +under the hood: ++ introduced automatic scaling of points in comparePlot.R and infoPlot.R ++ .cexscale is now documented ++ the argument of .fillList is now automatically cast to list (if necessary). ++ interpolRisks gain biastype and normtype methods, as well as getRiskFctBV + => now cniperPointPlot should work for GPD-type data ++ added reference for copied routine stats:::format.perc ++ in the axis annotation (after rescaling) there are checks now + whether values +-infinity are taken at all. (This was a bug + before for distributions passed on as cdf and quantile function + with finite left or right endpoint.) ++ output in kStepEstimator() and oneStepEstimator() is filtered + by .checkEstClassForParamFamily(); this allows to return an + object of S4 class specific to the resp. parametric family (by means of + S4 method dispatch); this is used in pkg 'RobExtremes' to produce, e.g., + objects of class "GEVkStepEstimate", i.e. which inherit from both + "kStepEstimate", so that a diag-method for "GEVEstimate" becomes + available for this class. ++ enhanced imports in DESCRIPTION by explicating second order imports + + +BUGFIXES: ++ two bugs in plotWrapper.R in pkgs RobAStBase and ROptEst detected by Misha ++ bug in kStepEstimator: after evaluation of starting estimator, IC must be + shifted to correct parameter value -> new arguments withPreModif, withPostModif ++ in comparePlot it should be resc.Dargs instead of rescD.args ++ fixed errors detected by Matthias / Misha, Bernhard in comparePlot.R, cutoff-class.R, + ddPlot_utils.R, infoPlot.R, outlyingPlot.R ++ comparePlot now plots the whole range ++ ddPlots / outlyingPlot.R now have alpha transparency and jitter and cex.pts ++ infoPlot plots the correct y-axis (no overplotting) ++ minor fixes in InfoPlotWrapper.Rd, outlyingPlotIC.Rd ++ fixed NA-buglet in plotWrapper.R (detected by Dasha Pupashenko) ++ fixed a little bug with the use of .cexscale (with list of functions) ++ bugfix in outlyingnessPlot: for robCov.y ==TRUE (default) the + inverse covariance matrix was used for standardization instead + of the original one + + +####################################### +version 0.9 +####################################### + +user-visible CHANGES: ++ new wrapper function InfoPlot, ComparePlot, PlotIC + + +GENERAL ENHANCEMENTS: + ++ RobASt-Pkgs: DESCRIPTION depends become stricter (requiring distrMod, distrEx, distr >=2.4 to be on the safe side) ++ deleted chm folders --- they are no longer needed ++ added argument no.readonly = TRUE in all assignments of type opar <- par(); ++ commented out all assignments of type omar$cin <- NULL ++ removed calls to require from R sources and replaced it by directives in the NAMESPACE file ++ all packages get a DESCRIPTION tag "ByteCompile" + +under the hood: + ++ wrapper functions use default rescaling controlled by S4-method rescaleFct + dispatching on the respective model + ++ added .Rbuildignore + ++ cleaned DESCRIPTION and NAMESPACE file as to Imports/Depends + ++ created new interpolRisk-class to be able to use speed up in (new version) of roptest ++ interpolRisks extended by slot samplesize + ++ implemented scale estimation on log-scale for kStepEstimator ++ in kStepEstimator asyvar of starting estimator is no longer computed + (unless done so anyway in the call to the starting estimator)/ as not needed ++ in kStepEstimator one can now delay evaluations of covariance matrices, + depending on new argument withEvalAsVar ++ a small change in kStepEstimator -- now uses the (possibly nonlinear) + trafo instead of the Jacobian to get the pIC-estimator from the untransformed estimator ++ in kStepEstimator we force an argument list (to avoid an "argument missing" error) + ++ checkIC now also reports relative errors (has possibly already been there + but not merged?) + ++ new S4methods/functions moveL2Fam2RefParam and moveICBackFromRefParam to only + solve optimization problems for ICs at reference parameters (if these are + available) and the to backtransform the IC to the original parameter + (is not yet in place in optIC; still testing necessary). + ++ the accessor to slot Risks now checks if all items of the list are already + evaluated or if some calls still have to be forced; to this end it uses + new auxiliary .evalListRec + ++ minor Enhancements of ddPlot, changes in outlyingPlot ++ modularized diagnostic plots; still checking + debugging necessary + ++ documented helper functions + ++ thx to hint by Matthias (NAMESPACE), and some (more specific) Rd-links to + gettextf, now no more notes or warnings in R-2.16.0dev + ++ .rescalefct looses argument scaleY.inv (not needed). + ++ use of unit tests + +BUGFIXES: + ++ Bug in infoPlot(), detected by Nataliya Horbenko, tentatively fixed ++ use of colnames instead of sampleNames to avoid the error on CRAN ... ++ fixed some 1-dim vs >1-dim issues in kStepEstimator.R ++ ...and yet some correction as to variances ++ Removed "..." in definition of generic for "samplesize<-", this had led to a warning in R CMD check. ++ .evalListRec was not prepared for length 0 ++ some substitute functions have not been passed as arguments... + + + +####################################### +version 0.8 +####################################### + +USER-VISIBLE CHANGES ++ new helper methods makeIC to apply to functions or list of functions + for easily producing (suboptimal) ICs ++ included risk computation for sin,cos-IC in makeIC-methods.Rd + ++ qqplot for RobModel now produces outlier adjusted CIs + ++ ddPlot: additional annotation parameters + (all with reasonable defaults) + + -text.abline: controls whether cutoff lines get labeled + -text.abline.x, + -text.abline.y: text to be added as labels, + defaults to something like "95%-cutoff = 4.32" + 4.32 the cutoff value) + + -cex.abline, + -col.abline, + -font.abline, + -adj.abline: respective parameters for labels + + -text.abline.x.x, + -text.abline.x.y, + -text.abline.y.x, + -text.abline.y.y: coordinates of labels, + + -text.abline.x.fmt.cx, + -text.abline.x.fmt.qx, + -text.abline.y.fmt.cy, + -text.abline.y.fmt.qy: format strings for cutoff quantiles + and values in labels + + -arguments cex.idn and col.idn now if missing first check against arguments + cex and col respectively before using defaults par("cex") and par("col") respectively + ++ for restoring old par() values, not all attributes may be set; + hence deleted them from stored value in plot functions by something like + opar$cin <- opar$cra <- opar$csi <- opar$cxy <- opar$din <- NULL + ++ infoPlot gains arguments ylab.rel and ylab.abs to set the label + for y axis (as requested by N. Horbenko) + ++ DESCRIPTION files and package-help files gain a tag SVNRevision + to be filled by get[All]RevNr.R from utils in distr + +BUGFIXES + ++ you could not place single plots where you wanted... ++ Nataliya found yet another bug in infoPlot.R + +####################################### +version 0.7 +####################################### + +user-visible CHANGES: + ++ enhanced plotting: + * new diagnostic function qqplot to check the quality of a model fit + + special methods for second argument of class + "RobModel", "InfRobModel", and "kStepEstimate" + + comes with corresponding (pointwise/simultaneous) confidence intervals + + for "RobModel", "InfRobModel": sizing of points and labels according to + Mahalanobis size of points / any other distance function + + for "kStepEstimate": fading / sizing of points and labels according to + weight of corresponding [p]IC + * suggestions by A. Unwin, Augsburg; + plot for ICs, infoPlot, and comparePlot may be restricted to selected subplots; + * ylim can now be matrix-valued... + * infoPlot and comparePlot now have a placeable legend location - argument + * plot functions gain data argument: + it is "y" for plot(IC, numeric) and for comparePlot, + for infoPlot it is argument "data" + * plot functions gain arguments + - which.lbs : select some data indices for plotting, + - which.Order : select some order statistics from the remaining data + for plotting (ordered; w.r.t. norm of IC) (in descending order) + - return.Order : shall ordering be printed out? ++ documentation + * added some UML class diagrams ++ checking functions + * checkIC gains ... argument to pass on accuracy arguments to E() ++ estimators + * unified treatmend of NAs: + - class Estimate gains slot completecases to control for NA in the input + - slot samplesize only counts remaining cases + - samplesize accessor has argument onlycompletecases and hence can issue both remaining + and original samplesize + - locMEstimator gains arg na.rm + * class kStepEstimator gains slots + - start: argument start of kStepEstimator + - startval:matrix of transformed starting values + - ustarval:matrix of untransformed starting values + - ksteps: matrix of (intermediate) transformed estimates + - uksteps: matrix of (intermediate) untransformed estimates + - ICList: optional: the (intermediate) (total) ICs + - pICList: optional: the (intermediate) [p]ICs + and corresponding accessors + * oneStepEstimator and kStepEstimator gain an argument startArgList + ++ ICs + * we now can digest case p=1, k>1 for asymmetric biastypes as well as for total variation + ++ new getRobAStBaseOption-s + * "all.verbose" : globally set verbose to TRUE + * "withUpdateInKer" --- what to do in kStep on ker(D) + * "IC.UpdateInKer" --- IC to use in kStep on ker(D) + ++ utilities: + * robModel gains trafo and trafo<- methods to access/modify + slot trafo + * RobAStBaseMASK for masked methods + * replacement function radius for Neighborhood + + +GENERAL ENHANCEMENTS: + ++ added tests/Examples folder with file RobAStBase-Ex.Rout.save to have + some automatic testing ++ added TOBEDONE (sic!) files; in English (for possible collaborators) ++ added keyword robust and made some minor corrections ... ++ added/updated NEWS files, updated CITATION files using code by A. Zeileis + ++ Rd-parsing: + * patch for Brian Ripley's + Re: [Rd] Warning: missing text for item ... in \describe? + * fixed errors / warnings in .Rd files detected by parser 2 + (c.f. [Rd] More intensive checking of R help files, Prof Brian Ripley, 09.01.2009 10:25) + ++ svn-revision-tags + * added in all DESCRIPTION files + * added field "Encoding: latin1" to all DESCRIPTION files because + substituting $LastChangedDate by svn would cause problems for + packages built under Windows (German) local when checking under Linux. + ++ removed pdf-file from version control - Rnw-file is sufficient + + +INTERNALLY: ++ estimators [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/robast -r 940