From noreply at r-forge.r-project.org Thu Sep 1 15:06:08 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 15:06:08 +0200 (CEST) Subject: [Robast-commits] r875 - branches Message-ID: <20160901130608.9C207187BA0@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 15:06:08 +0200 (Thu, 01 Sep 2016) New Revision: 875 Added: branches/robast-1.1/ Log: created new branch branches/robast-1.1 From noreply at r-forge.r-project.org Thu Sep 1 15:07:14 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 15:07:14 +0200 (CEST) Subject: [Robast-commits] r876 - branches/robast-1.1 Message-ID: <20160901130714.4824D187BA0@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 15:07:14 +0200 (Thu, 01 Sep 2016) New Revision: 876 Added: branches/robast-1.1/pkg/ Log: svn branch From noreply at r-forge.r-project.org Thu Sep 1 15:12:33 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 15:12:33 +0200 (CEST) Subject: [Robast-commits] r877 - branches/robast-1.0/pkg/RobAStBase Message-ID: <20160901131233.CFEE4187F5D@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 15:12:33 +0200 (Thu, 01 Sep 2016) New Revision: 877 Modified: branches/robast-1.0/pkg/RobAStBase/DESCRIPTION branches/robast-1.0/pkg/RobAStBase/NAMESPACE Log: DESCRIPTION and NAMESPACE updated Modified: branches/robast-1.0/pkg/RobAStBase/DESCRIPTION =================================================================== --- branches/robast-1.0/pkg/RobAStBase/DESCRIPTION 2016-09-01 13:07:14 UTC (rev 876) +++ branches/robast-1.0/pkg/RobAStBase/DESCRIPTION 2016-09-01 13:12:33 UTC (rev 877) @@ -1,23 +1,23 @@ Package: RobAStBase Version: 1.0 -Date: 2015-05-03 +Date: 2016-09-01 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) Suggests: ROptEst, RUnit (>= 0.4.26) Imports: startupmsg -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("Mykhailo", "Pupashenko", role="ctb", comment="contributed wrapper functions for diagnostic plots"), - person("Gerald", "Kroisandt", role="ctb", comment="contributed testing routines"), - person("Peter", "Ruckdeschel", role=c("aut", "cph")), - person("R Core Team", role = c("ctb", "cph"), - comment="for source file 'format.perc'")) +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("Mykhailo", "Pupashenko", role="ctb", comment="contributed wrapper + functions for diagnostic plots"), person("Gerald", "Kroisandt", role="ctb", + comment="contributed testing routines"), person("Peter", "Ruckdeschel", role=c("aut", + "cph")), person("R Core Team", role = c("ctb", "cph"), comment="for source file + 'format.perc'")) ByteCompile: yes License: LGPL-3 Encoding: latin1 URL: http://robast.r-forge.r-project.org/ LastChangedDate: {$LastChangedDate$} LastChangedRevision: {$LastChangedRevision$} -SVNRevision: -Inf +SVNRevision: 874 Modified: branches/robast-1.0/pkg/RobAStBase/NAMESPACE =================================================================== --- branches/robast-1.0/pkg/RobAStBase/NAMESPACE 2016-09-01 13:07:14 UTC (rev 876) +++ branches/robast-1.0/pkg/RobAStBase/NAMESPACE 2016-09-01 13:12:33 UTC (rev 877) @@ -5,6 +5,12 @@ import("distrMod") import("RandVar") importFrom("startupmsg", "buildStartupMessage", "infoShow") +importFrom("grDevices", "colorRamp", "grey", "rgb") +importFrom("graphics", "abline", "axis", "box", "lines", "matlines", + "matpoints", "mtext", "par", "points", "text", "title") +importFrom("stats", "complete.cases", "dbinom", "dnorm", "fft", + "na.omit", "pbinom", "pnorm", "qnorm", "quantile", + "uniroot", "approxfun") exportClasses("Neighborhood", "UncondNeighborhood", From noreply at r-forge.r-project.org Thu Sep 1 15:13:08 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 15:13:08 +0200 (CEST) Subject: [Robast-commits] r878 - branches/robast-1.1/pkg/RobAStBase Message-ID: <20160901131308.6B44E187F5D@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 15:13:08 +0200 (Thu, 01 Sep 2016) New Revision: 878 Modified: branches/robast-1.1/pkg/RobAStBase/DESCRIPTION branches/robast-1.1/pkg/RobAStBase/NAMESPACE Log: DESCRIPTION and NAMESPACE in branches 1.1 updated Modified: branches/robast-1.1/pkg/RobAStBase/DESCRIPTION =================================================================== --- branches/robast-1.1/pkg/RobAStBase/DESCRIPTION 2016-09-01 13:12:33 UTC (rev 877) +++ branches/robast-1.1/pkg/RobAStBase/DESCRIPTION 2016-09-01 13:13:08 UTC (rev 878) @@ -1,23 +1,23 @@ Package: RobAStBase -Version: 1.0 -Date: 2015-05-03 +Version: 1.1 +Date: 2016-04-25 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) Suggests: ROptEst, RUnit (>= 0.4.26) Imports: startupmsg -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("Mykhailo", "Pupashenko", role="ctb", comment="contributed wrapper functions for diagnostic plots"), - person("Gerald", "Kroisandt", role="ctb", comment="contributed testing routines"), - person("Peter", "Ruckdeschel", role=c("aut", "cph")), - person("R Core Team", role = c("ctb", "cph"), - comment="for source file 'format.perc'")) +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("Mykhailo", "Pupashenko", role="ctb", comment="contributed wrapper + functions for diagnostic plots"), person("Gerald", "Kroisandt", role="ctb", + comment="contributed testing routines"), person("Peter", "Ruckdeschel", role=c("aut", + "cph")), person("R Core Team", role = c("ctb", "cph"), comment="for source file + 'format.perc'")) ByteCompile: yes License: LGPL-3 Encoding: latin1 URL: http://robast.r-forge.r-project.org/ LastChangedDate: {$LastChangedDate$} LastChangedRevision: {$LastChangedRevision$} -SVNRevision: -Inf +SVNRevision: 874 Modified: branches/robast-1.1/pkg/RobAStBase/NAMESPACE =================================================================== --- branches/robast-1.1/pkg/RobAStBase/NAMESPACE 2016-09-01 13:12:33 UTC (rev 877) +++ branches/robast-1.1/pkg/RobAStBase/NAMESPACE 2016-09-01 13:13:08 UTC (rev 878) @@ -5,6 +5,12 @@ import("distrMod") import("RandVar") importFrom("startupmsg", "buildStartupMessage", "infoShow") +importFrom("grDevices", "colorRamp", "grey", "rgb") +importFrom("graphics", "abline", "axis", "box", "lines", "matlines", + "matpoints", "mtext", "par", "points", "text", "title") +importFrom("stats", "complete.cases", "dbinom", "dnorm", "fft", + "na.omit", "pbinom", "pnorm", "qnorm", "quantile", + "uniroot", "approxfun") exportClasses("Neighborhood", "UncondNeighborhood", From noreply at r-forge.r-project.org Thu Sep 1 15:15:27 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 15:15:27 +0200 (CEST) Subject: [Robast-commits] r879 - branches/robast-1.1/pkg/RobAStBase/inst Message-ID: <20160901131528.0D59E187F5D@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 15:15:27 +0200 (Thu, 01 Sep 2016) New Revision: 879 Modified: branches/robast-1.1/pkg/RobAStBase/inst/NEWS Log: News for branch 1.1 Modified: branches/robast-1.1/pkg/RobAStBase/inst/NEWS =================================================================== --- branches/robast-1.1/pkg/RobAStBase/inst/NEWS 2016-09-01 13:13:08 UTC (rev 878) +++ branches/robast-1.1/pkg/RobAStBase/inst/NEWS 2016-09-01 13:15:27 UTC (rev 879) @@ -12,6 +12,17 @@ ####################################### user-visible CHANGES: ++ comparePlot, infoPlot, and the plot-Method for ICs now return a list containing + all information to reproduce the plot, e.g. in another graphics engine like ggplot ++ the subset selection mechanism used to determine which observations to show + with labels in comparePlot, infoPlot, and the plot-Method for ICs has been + revised and now also allows a second subset (nonlbl) to be plotted as well + (unlabelled) ++ the data plotting mechanism in comparePlot, infoPlot, and the plot-Method for + ICs has been revised and now allows vectorized input for col.pts, cex.pts, + pch.pts, cex.pts.fun (and, similarly, for the nonlbl counterparts) + as well as for lab.col, lab.pts, lab.adj, and alpha.trsp, so that this + can even be tuned observation-wise. + 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 From noreply at r-forge.r-project.org Thu Sep 1 15:19:20 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 15:19:20 +0200 (CEST) Subject: [Robast-commits] r880 - branches/robast-1.1/pkg/RobAStBase/tests Message-ID: <20160901131920.764D7188206@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 15:19:20 +0200 (Thu, 01 Sep 2016) New Revision: 880 Modified: branches/robast-1.1/pkg/RobAStBase/tests/doRUnit.R Log: Unit Test branch 1.1 Modified: branches/robast-1.1/pkg/RobAStBase/tests/doRUnit.R =================================================================== --- branches/robast-1.1/pkg/RobAStBase/tests/doRUnit.R 2016-09-01 13:15:27 UTC (rev 879) +++ branches/robast-1.1/pkg/RobAStBase/tests/doRUnit.R 2016-09-01 13:19:20 UTC (rev 880) @@ -1,61 +1,61 @@ -## unit tests will not be done if RUnit is not available -if(require("RUnit", quietly=TRUE)) { - - ## --- Setup --- - - pkg <- "RobAStBase" - - if((Sys.getenv("RCMDCHECK") == "") - || (Sys.getenv("RCMDCHECK") == "FALSE")) { - ## Path to unit tests for standalone running under Makefile (not R CMD check) - ## PKG/tests/../inst/unitTests - path <- file.path(getwd(), "..", "inst", "unitTests") - } else { - ## Path to unit tests for R CMD check - ## PKG.Rcheck/tests/../PKG/unitTests - path <- system.file(package=pkg, "unitTests") - } - cat("\nRunning unit tests\n") - print(list(pkg=pkg, getwd=getwd(), pathToUnitTests=path)) - - library(package=pkg, character.only=TRUE) - - ## If desired, load the name space to allow testing of private functions - ## if (is.element(pkg, loadedNamespaces())) - ## attach(loadNamespace(pkg), name=paste("namespace", pkg, sep=":"), pos=3) - ## - ## or simply call PKG:::myPrivateFunction() in tests - - ## --- Testing --- - - ## Define tests - testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), - dirs=path) - ## Run - tests <- runTestSuite(testSuite) - - ## Default report name - pathReport <- file.path(path, "report") - - ## Report to stdout and text files - cat("------------------- UNIT TEST SUMMARY ---------------------\n\n") - printTextProtocol(tests, showDetails=FALSE) - printTextProtocol(tests, showDetails=FALSE, - fileName=paste(pathReport, "Summary.txt", sep="")) - printTextProtocol(tests, showDetails=TRUE, - fileName=paste(pathReport, ".txt", sep="")) - - ## Report to HTML file - printHTMLProtocol(tests, fileName=paste(pathReport, ".html", sep="")) - - ## Return stop() to cause R CMD check stop in case of - ## - failures i.e. FALSE to unit tests or - ## - errors i.e. R errors - tmp <- getErrors(tests) - if(tmp$nFail > 0 | tmp$nErr > 0) { - stop(paste("\n\nunit testing failed (#test failures: ", tmp$nFail, - ", #R errors: ", tmp$nErr, ")\n\n", sep="")) - } -} else { - warning("cannot run unit tests -- package RUnit is not available") -} +## unit tests will not be done if RUnit is not available +if(require("RUnit", quietly=TRUE)) { + + ## --- Setup --- + + pkg <- "RobAStBase" + + if((Sys.getenv("RCMDCHECK") == "") + || (Sys.getenv("RCMDCHECK") == "FALSE")) { + ## Path to unit tests for standalone running under Makefile (not R CMD check) + ## PKG/tests/../inst/unitTests + path <- file.path(getwd(), "..", "inst", "unitTests") + } else { + ## Path to unit tests for R CMD check + ## PKG.Rcheck/tests/../PKG/unitTests + path <- system.file(package=pkg, "unitTests") + } + cat("\nRunning unit tests\n") + print(list(pkg=pkg, getwd=getwd(), pathToUnitTests=path)) + + library(package=pkg, character.only=TRUE) + + ## If desired, load the name space to allow testing of private functions + ## if (is.element(pkg, loadedNamespaces())) + ## attach(loadNamespace(pkg), name=paste("namespace", pkg, sep=":"), pos=3) + ## + ## or simply call PKG:::myPrivateFunction() in tests + + ## --- Testing --- + + ## Define tests + testSuite <- defineTestSuite(name=paste(pkg, "unit testing"), + dirs=path) + ## Run + tests <- runTestSuite(testSuite) + + ## Default report name + pathReport <- file.path(path, "report") + + ## Report to stdout and text files + cat("------------------- UNIT TEST SUMMARY ---------------------\n\n") + printTextProtocol(tests, showDetails=FALSE) + printTextProtocol(tests, showDetails=FALSE, + fileName=paste(pathReport, "Summary.txt", sep="")) + printTextProtocol(tests, showDetails=TRUE, + fileName=paste(pathReport, ".txt", sep="")) + + ## Report to HTML file + printHTMLProtocol(tests, fileName=paste(pathReport, ".html", sep="")) + + ## Return stop() to cause R CMD check stop in case of + ## - failures i.e. FALSE to unit tests or + ## - errors i.e. R errors + tmp <- getErrors(tests) + if(tmp$nFail > 0 | tmp$nErr > 0) { + stop(paste("\n\nunit testing failed (#test failures: ", tmp$nFail, + ", #R errors: ", tmp$nErr, ")\n\n", sep="")) + } +} else { + warning("cannot run unit tests -- package RUnit is not available") +} From noreply at r-forge.r-project.org Thu Sep 1 15:30:41 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 15:30:41 +0200 (CEST) Subject: [Robast-commits] r881 - branches/robast-1.0/pkg/RobAStBase/R Message-ID: <20160901133041.CBFB718824D@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 15:30:41 +0200 (Thu, 01 Sep 2016) New Revision: 881 Modified: branches/robast-1.0/pkg/RobAStBase/R/00internal.R Log: code borrowed inserted Modified: branches/robast-1.0/pkg/RobAStBase/R/00internal.R =================================================================== --- branches/robast-1.0/pkg/RobAStBase/R/00internal.R 2016-09-01 13:19:20 UTC (rev 880) +++ branches/robast-1.0/pkg/RobAStBase/R/00internal.R 2016-09-01 13:30:41 UTC (rev 881) @@ -6,6 +6,52 @@ paste(format(100 * probs, trim = TRUE, scientific = FALSE, digits = digits), "%") +.DistrCollapse <- function(support, prob, + eps = getdistrOption("DistrResolution")){ + supp <- support + prob <- as.vector(prob) + suppIncr <- diff(c(supp[1]-2*eps,supp)) < eps + groups <- cumsum(!suppIncr) + prob <- as.vector(tapply(prob, groups, sum)) + supp0 <- as.vector(tapply(supp, groups, quantile, probs = 0.5, type = 1)) + reps <- .getRefIdx(supp,supp0,eps) +# cat("III\n") +# print(length(reps)) +# print(length(supp0)) +# cat("III\n") + ### in order to get a "support member" take the leftmost median + return(list(supp = supp0, prob = prob, groups=groups, reps = reps)) +# newDistribution <- DiscreteDistribution(supp=supp,prob=prob) +# return(newDistribution) +} + +.getRefIdx <- function(x,y, eps = getdistrOption("DistrResolution")){ + ## x and y are sorted; y=unique(x) (modulo rounding) + ## wI gives the first index in x such that x is representing the group + wI <- y*0 + j <- 1 + rmin <- Inf + for(i in 1:length(wI)){ + again <- TRUE + while(again&&j<=length(x)){ + rmina <- abs(x[j]-y[i]) + if(rmina< rmin-eps){ + rmin <- rmina + wI[i] <- j + }else{ + if(rmina>rmin+eps){ + rmin <- Inf + again <- FALSE + j <- j-1 + } + } + j <- j + 1 + } + } + if(wI[i] == 0) wI[i] <- length(x) + return(wI) +} + #------------------------------------------------------------------------------ ### for distrXXX pre 2.5 #------------------------------------------------------------------------------ From noreply at r-forge.r-project.org Thu Sep 1 16:00:13 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 16:00:13 +0200 (CEST) Subject: [Robast-commits] r882 - pkg/RobAStBase Message-ID: <20160901140013.AD1361881F2@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 16:00:13 +0200 (Thu, 01 Sep 2016) New Revision: 882 Modified: pkg/RobAStBase/DESCRIPTION pkg/RobAStBase/NAMESPACE Log: updated from branch to trunk Modified: pkg/RobAStBase/DESCRIPTION =================================================================== --- pkg/RobAStBase/DESCRIPTION 2016-09-01 13:30:41 UTC (rev 881) +++ pkg/RobAStBase/DESCRIPTION 2016-09-01 14:00:13 UTC (rev 882) @@ -1,17 +1,23 @@ Package: RobAStBase -Version: 0.9.1 -Date: 2013-09-11 +Version: 1.0 +Date: 2016-09-01 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.4), distrMod(>= 2.5.2), RandVar(>= 0.9.2) +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 +Imports: startupmsg +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("Mykhailo", "Pupashenko", role="ctb", comment="contributed wrapper + functions for diagnostic plots"), person("Gerald", "Kroisandt", role="ctb", + comment="contributed testing routines"), 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 Encoding: latin1 URL: http://robast.r-forge.r-project.org/ LastChangedDate: {$LastChangedDate$} LastChangedRevision: {$LastChangedRevision$} -SVNRevision: 694 +SVNRevision: 874 Modified: pkg/RobAStBase/NAMESPACE =================================================================== --- pkg/RobAStBase/NAMESPACE 2016-09-01 13:30:41 UTC (rev 881) +++ pkg/RobAStBase/NAMESPACE 2016-09-01 14:00:13 UTC (rev 882) @@ -4,6 +4,13 @@ import("distrEx") import("distrMod") import("RandVar") +importFrom("startupmsg", "buildStartupMessage", "infoShow") +importFrom("grDevices", "colorRamp", "grey", "rgb") +importFrom("graphics", "abline", "axis", "box", "lines", "matlines", + "matpoints", "mtext", "par", "points", "text", "title") +importFrom("stats", "complete.cases", "dbinom", "dnorm", "fft", + "na.omit", "pbinom", "pnorm", "qnorm", "quantile", + "uniroot", "approxfun") exportClasses("Neighborhood", "UncondNeighborhood", @@ -72,7 +79,7 @@ export("InfluenceCurve", "IC", "ContIC", "TotalVarIC") export(".eq", ".getDistr", "getBoundedIC") export("RobAStBaseOptions", "getRobAStBaseOption") -export("cutoff","cutoff.chisq","cutoff.sememp") +export("cutoff","cutoff.chisq","cutoff.sememp", "cutoff.quant") export("outlyingPlotIC", "RobAStBaseMASK") export("OMSRRisk","MBRRisk","RMXRRisk") export("getRiskFctBV") From noreply at r-forge.r-project.org Thu Sep 1 16:00:37 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 16:00:37 +0200 (CEST) Subject: [Robast-commits] r883 - pkg/RobAStBase/inst Message-ID: <20160901140037.3C0F11881F2@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 16:00:36 +0200 (Thu, 01 Sep 2016) New Revision: 883 Modified: pkg/RobAStBase/inst/NEWS Log: updated from branch to trunk Modified: pkg/RobAStBase/inst/NEWS =================================================================== --- pkg/RobAStBase/inst/NEWS 2016-09-01 14:00:13 UTC (rev 882) +++ pkg/RobAStBase/inst/NEWS 2016-09-01 14:00:36 UTC (rev 883) @@ -8,6 +8,85 @@ information) ####################################### +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 ####################################### @@ -81,9 +160,6 @@ - - - ####################################### version 0.8 ####################################### From noreply at r-forge.r-project.org Thu Sep 1 16:11:24 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 16:11:24 +0200 (CEST) Subject: [Robast-commits] r884 - pkg/RobAStBase/man Message-ID: <20160901141124.BCFD5188206@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 16:11:24 +0200 (Thu, 01 Sep 2016) New Revision: 884 Added: pkg/RobAStBase/man/biastype-methods.Rd pkg/RobAStBase/man/internal_GridHelpers.Rd pkg/RobAStBase/man/normtype-methods.Rd Modified: pkg/RobAStBase/man/0RobAStBase-package.Rd pkg/RobAStBase/man/InfoPlotWrapper.Rd pkg/RobAStBase/man/comparePlot.Rd pkg/RobAStBase/man/cutoff.Rd pkg/RobAStBase/man/ddPlot-methods.Rd pkg/RobAStBase/man/infoPlot.Rd pkg/RobAStBase/man/internal_plots.Rd pkg/RobAStBase/man/internals_ddPlot.Rd pkg/RobAStBase/man/outlyingPlotIC.Rd pkg/RobAStBase/man/plot-methods.Rd Log: Manuals updated Modified: pkg/RobAStBase/man/0RobAStBase-package.Rd =================================================================== --- pkg/RobAStBase/man/0RobAStBase-package.Rd 2016-09-01 14:00:36 UTC (rev 883) +++ pkg/RobAStBase/man/0RobAStBase-package.Rd 2016-09-01 14:11:24 UTC (rev 884) @@ -11,11 +11,12 @@ \details{ \tabular{ll}{ Package: \tab RobAStBase \cr -Version: \tab 0.9 \cr -Date: \tab 2013-09-11 \cr -Depends: \tab R(>= 2.12.0), methods, distr(>= 2.0), distrEx(>= 2.0), -distrMod(>= 2.0), RandVar(>= 0.6.3)\cr -LazyLoad: \tab yes \cr +Version: \tab 1.0 \cr +Date: \tab 2015-05-03 \cr +Depends: \tab R(>= 2.14.0), methods, rrcov, distr(>= 2.5.2), distrEx(>= 2.5), distrMod(>= 2.5.2), RandVar(>= 0.9.2)\cr +Suggests: \tab ROptEst, RUnit (>= 0.4.26)\cr +Imports: \tab startupmsg\cr +ByteCompile: \tab yes \cr License: \tab LGPL-3 \cr URL: \tab http://robast.r-forge.r-project.org/\cr SVNRevision: \tab 694 \cr Modified: pkg/RobAStBase/man/InfoPlotWrapper.Rd =================================================================== --- pkg/RobAStBase/man/InfoPlotWrapper.Rd 2016-09-01 14:00:36 UTC (rev 883) +++ pkg/RobAStBase/man/InfoPlotWrapper.Rd 2016-09-01 14:11:24 UTC (rev 884) @@ -43,7 +43,7 @@ fam <- GammaFamily() IC <- optIC(model = fam, risk = asCov()) Y <- distribution(fam) -data <- r(Y)(1000) +data <- r(Y)(500) InfoPlot(IC, data, withCall = FALSE) } Copied: pkg/RobAStBase/man/biastype-methods.Rd (from rev 881, branches/robast-1.0/pkg/RobAStBase/man/biastype-methods.Rd) =================================================================== --- pkg/RobAStBase/man/biastype-methods.Rd (rev 0) +++ pkg/RobAStBase/man/biastype-methods.Rd 2016-09-01 14:11:24 UTC (rev 884) @@ -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(samplesize=100) +biastype(myrisk) +} +\concept{risk} +\keyword{classes} Modified: pkg/RobAStBase/man/comparePlot.Rd =================================================================== --- pkg/RobAStBase/man/comparePlot.Rd 2016-09-01 14:00:36 UTC (rev 883) +++ pkg/RobAStBase/man/comparePlot.Rd 2016-09-01 14:11:24 UTC (rev 884) @@ -17,18 +17,21 @@ col = par("col"), lwd = par("lwd"), lty, col.inner = par("col.main"), cex.inner = 0.8, bmar = par("mar")[1], tmar = par("mar")[3], + with.automatic.grid = TRUE, with.legend = FALSE, legend = NULL, legend.bg = "white", legend.location = "bottomright", legend.cex = 0.8, withMBR = FALSE, MBRB = NA, MBR.fac = 2, col.MBR = par("col"), lty.MBR = "dashed", lwd.MBR = 0.8, - scaleX = FALSE, scaleX.fct, scaleX.inv, + 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, col.pts = par("col"), - pch.pts = 1, jitter.fac = 1, with.lab = FALSE, + cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"), + pch.pts = 1, jit.fac = 1, jit.tol = .Machine$double.eps, with.lab = FALSE, lab.pts = NULL, lab.font = NULL, alpha.trsp = NA, - which.lbs = NULL, which.Order = NULL, return.Order = FALSE) + which.lbs = NULL, which.Order = NULL, return.Order = FALSE, + draw.nonlbl = TRUE, cex.nonlbl=0.3, pch.nonlbl=".", + withSubst = TRUE) } \arguments{ \item{obj1}{ object of class \code{"InfluenceCurve"} } @@ -61,6 +64,9 @@ to the current setting of \code{cex}; as in \code{\link[graphics]{par}}} \item{col.inner}{character or integer code; color for the inner title} + \item{with.automatic.grid}{logical; should a grid be plotted alongside + with the ticks of the axes, automatically? If \code{TRUE} a respective + call to \code{grid} in argument \code{panel.first} is ignored. } \item{with.legend}{logical; shall a legend be plotted?} \item{legend}{either \code{NULL} or a list of length (number of plotted panels) of items which can be used as argument \code{legend} in @@ -80,6 +86,15 @@ \item{col.MBR}{color for the MBR lines; as usual \code{col}-argument;} \item{lty.MBR}{line type for the MBR lines; as usual \code{lty}-argument;} \item{lwd.MBR}{line width for the MBR lines; as usual \code{lwd}-argument;} + \item{x.vec}{a numeric vector of grid points to evaluate the influence curve; + by default, \code{x.vec} is \code{NULL}; then the grid is + produced automatically according to the distribution of the IC. + \code{x.vec} 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, it should be chosen non-equally spaced. } \item{scaleX}{logical; shall X-axis be rescaled (by default according to the cdf of the underlying distribution)?} \item{scaleY}{logical; shall Y-axis be rescaled (by default according to a probit scale)?} @@ -94,10 +109,14 @@ missing, the quantile function of the underlying observation distribution.} \item{scaleY.fct}{an isotone, vectorized function mapping for each coordinate the range of the respective coordinate of the IC - to [0,1]; defaulting to the cdf of \eqn{{\cal N}(0,1)}{N(0,1)}.} + to [0,1]; defaulting to the cdf of \eqn{{\cal N}(0,1)}{N(0,1)}; + can also be a list of functions with one list element for each + of the panels to be plot. } \item{scaleY.inv}{an isotone, vectorized function mapping for each coordinate the range [0,1] into the range of the respective coordinate of the IC; - defaulting to the quantile function of \eqn{{\cal N}(0,1)}{N(0,1)}.} + defaulting to the quantile function of \eqn{{\cal N}(0,1)}{N(0,1)}; + can also be a list of functions with one list element for each + of the panels to be plot. } \item{scaleN}{integer; defaults to 9; on rescaled axes, number of x and y ticks if drawn automatically;} \item{x.ticks}{numeric; defaults to NULL; (then ticks are chosen automatically); @@ -117,7 +136,17 @@ vector \code{"dim"}, \code{dimnr} running through the number of rows of the trafo matrix. } + \item{withSubst}{logical; if \code{TRUE} (default) pattern substitution for + titles and lables is used; otherwise no substitution is used. } \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?} @@ -132,8 +161,10 @@ while for the remaining ones, the alpha channel in rgb space is set to the respective coordinate value of \code{alpha.trsp}. The non-NA entries must be integers in [0,255] (0 invisible, 255 opaque).} - \item{jitter.fac}{jittering factor used in case of a \code{DiscreteDistribution} + \item{jit.fac}{jittering factor used in case of a \code{DiscreteDistribution} for plotting points of the \code{data} argument in a jittered fashion.} + \item{jit.tol}{threshold for jittering: if distance between points is smaller + than \code{jit.tol}, points are considered replicates.} \item{which.lbs}{either an integer vector with the indices of the observations to be plotted into graph or \code{NULL} --- then no observation is excluded} \item{which.Order}{for each of the given ICs, we order the observations (descending) @@ -149,6 +180,9 @@ reduction by argument \code{which.lbs}, and ordering is according to the norm given by \code{normtype(object)}); othervise we return \code{invisible()} as usual.} + \item{draw.nonlbl}{logical; should non-labelled observations be drawn?} + \item{cex.nonlbl}{character expansion(s) for non-labelled observations} + \item{pch.nonlbl}{plotting symbol(s) for non-labelled observations} \item{\dots}{further arguments to be passed to \code{plot}} } \details{ @@ -166,7 +200,8 @@ and a "generated on "-tag in case of \code{sub}. Of course, if \code{main} / \code{inner} / \code{sub} are \code{character}, this is used for the title; in case of \code{inner} it is then checked whether it -has correct length. In all title arguments, the following patterns are substituted: +has correct length. If argument \code{withSubst} is \code{TRUE}, in all title +and axis lable arguments, the following patterns are substituted: \describe{ \item{\code{"\%C1"},\code{"\%C2"},[\code{"\%C3"},][\code{"\%C4"}]}{class of argument \code{obj}, i=1,..4} @@ -180,6 +215,13 @@ length 2*(number of plotted dimensions); in the case of longer length, these are the values for \code{ylim} for the plotted dimensions of the IC, one pair for each dimension. + +In addition, argument \code{\dots} may contain arguments \code{panel.first}, +\code{panel.last}, i.e., hook expressions to be evaluated at the very beginning +and at the very end of each panel (within the then valid coordinates). +To be able to use these hooks for each panel individually, they may also be +lists of expressions (of the same length as the number of panels and +run through in the same order as the panels). } %\value{} Modified: pkg/RobAStBase/man/cutoff.Rd =================================================================== --- pkg/RobAStBase/man/cutoff.Rd 2016-09-01 14:00:36 UTC (rev 883) +++ pkg/RobAStBase/man/cutoff.Rd 2016-09-01 14:11:24 UTC (rev 884) @@ -2,6 +2,7 @@ \alias{cutoff} \alias{cutoff.sememp} \alias{cutoff.chisq} +\alias{cutoff.quant} \title{Generating function(s) for class 'cutoff'} \description{ @@ -11,8 +12,9 @@ cutoff(name = "empirical", body.fct0, cutoff.quantile = 0.95, norm = NormType(), QF, nsim = 100000) -cutoff.sememp() -cutoff.chisq() +cutoff.sememp(cutoff.quantile = 0.95) +cutoff.chisq(cutoff.quantile = 0.95) +cutoff.quant(qfct) } \arguments{ \item{name}{argument for name slot of \code{cutoff} object} @@ -26,6 +28,7 @@ normal and \eqn{Q} a corresponding quadratic form} \item{QF}{ a quadratic (positive semidefinite, symmetric) matrix used as quadratic form } + \item{qfct}{ a (nominal) quantile function } } \details{ \code{cutoff} generates a valid object of class \code{"cutoff"}. @@ -47,6 +50,13 @@ \code{cutoff.chisq()} is a helper function generating the theoretical (asymptotic) quantile of (the square root of) a (self-standardized) quadratic form, assuming multivariate normality; i.e.; a corresponding quantile of a Chi-Square distribution. + +\code{cutoff.quant()} is a helper function generating the theoretical quantile +corresponding to the quantile function \code{qfct}; if \code{qfct} is missing, +it searches the caller environment for an object \code{..ICloc}, and if this +exists it uses the respective model quantile function; the fallback is +\code{qnorm}. At any rate, if there is an object \code{..trf} in the scope of +the function it is used to transfer the quantile (after its evaluation). } \value{Object of class \code{"cutoff"}.} \author{ Modified: pkg/RobAStBase/man/ddPlot-methods.Rd =================================================================== --- pkg/RobAStBase/man/ddPlot-methods.Rd 2016-09-01 14:00:36 UTC (rev 883) +++ pkg/RobAStBase/man/ddPlot-methods.Rd 2016-09-01 14:11:24 UTC (rev 884) @@ -13,7 +13,7 @@ cutoff.x, cutoff.y, ..., cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x, transform.x, transform.y = transform.x, - id.n, lab.pts, adj, cex.idn, + id.n, cex.pts = 1,lab.pts, jit.pts = 0, alpha.trsp = NA, adj =0, cex.idn, col.idn, lty.cutoff, lwd.cutoff, col.cutoff, text.abline = TRUE, text.abline.x = NULL, text.abline.y = NULL, cex.abline = par("cex"), col.abline = col.cutoff, @@ -22,12 +22,12 @@ text.abline.y.x = NULL, text.abline.y.y = NULL, text.abline.x.fmt.cx = "\%7.2f", text.abline.x.fmt.qx = "\%4.2f\%\%", text.abline.y.fmt.cy = "\%7.2f", text.abline.y.fmt.qy = "\%4.2f\%\%", - jitt.fac) + jit.fac, jit.tol = .Machine$double.eps,doplot = TRUE) \S4method{ddPlot}{numeric}(data, dist.x = NormType(), dist.y = NormType(), cutoff.x, cutoff.y, ..., cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x, transform.x, transform.y = transform.x, - id.n, lab.pts, adj, cex.idn, + id.n, cex.pts = 1,lab.pts, jit.pts = 0, alpha.trsp = NA, adj =0, cex.idn, col.idn, lty.cutoff, lwd.cutoff, col.cutoff, text.abline = TRUE, text.abline.x = NULL, text.abline.y = NULL, cex.abline = par("cex"), col.abline = col.cutoff, @@ -36,12 +36,12 @@ text.abline.y.x = NULL, text.abline.y.y = NULL, text.abline.x.fmt.cx = "\%7.2f", text.abline.x.fmt.qx = "\%4.2f\%\%", text.abline.y.fmt.cy = "\%7.2f", text.abline.y.fmt.qy = "\%4.2f\%\%", - jitt.fac) + jit.fac, jit.tol=.Machine$double.eps, doplot = TRUE) \S4method{ddPlot}{data.frame}(data, dist.x = NormType(), dist.y = NormType(), cutoff.x, cutoff.y, ..., cutoff.quantile.x = 0.95, cutoff.quantile.y = cutoff.quantile.x, transform.x, transform.y = transform.x, - id.n, lab.pts, adj, cex.idn, + id.n, cex.pts = 1,lab.pts, jit.pts = 0, alpha.trsp = NA, adj =0, cex.idn, col.idn, lty.cutoff, lwd.cutoff, col.cutoff, text.abline = TRUE, text.abline.x = NULL, text.abline.y = NULL, cex.abline = par("cex"), col.abline = col.cutoff, @@ -50,7 +50,7 @@ text.abline.y.x = NULL, text.abline.y.y = NULL, text.abline.x.fmt.cx = "\%7.2f", text.abline.x.fmt.qx = "\%4.2f\%\%", text.abline.y.fmt.cy = "\%7.2f", text.abline.y.fmt.qy = "\%4.2f\%\%", - jitt.fac) + jit.fac, jit.tol=.Machine$double.eps, doplot = TRUE) } \arguments{ \item{data}{data coercable to \code{matrix}; the data at which to produce the \code{ddPlot}.} @@ -69,7 +69,18 @@ distances of the \code{y} axis.} \item{id.n}{a set of indices (or a corresponding logical vector); to select a subset of the data in argument \code{data}.} + \item{cex.pts}{the corresponding \code{cex} argument for plotted points.} \item{lab.pts}{a vector of labels for the (unsubsetted) \code{data}.} + \item{jit.pts}{the corresponding \code{jitter} argument for plotted points; + may be a vector of length 2 -- for separate factors for x- and y-coordinate.} + \item{alpha.trsp}{alpha transparency to be added ex post to colors + \code{col.pch} and \code{col.lbl}; if one-dim and NA all colors are + left unchanged. Otherwise, with usual recycling rules \code{alpha.trsp} + gets shorted/prolongated to length the data-symbols to be plotted. + Coordinates of this vector \code{alpha.trsp} with NA are left unchanged, + while for the remaining ones, the alpha channel in rgb space is set + to the respective coordinate value of \code{alpha.trsp}. The non-NA + entries must be integers in [0,255] (0 invisible, 255 opaque).} \item{adj}{the corresponding argument for \code{\link[graphics]{text}} for labelling the outliers.} \item{cex.idn}{the corresponding \code{cex} argument for @@ -108,7 +119,10 @@ \item{text.abline.x.fmt.qx}{format string to format cutoff probability in label in x direction.} \item{text.abline.y.fmt.cy}{format string to format the cutoff value in label in y direction.} \item{text.abline.y.fmt.qy}{format string to format cutoff probability in label in y direction.} - \item{jitt.fac}{factor for jittering, see \code{jitter};} + \item{jit.fac}{factor for jittering, see \code{jitter};} + \item{jit.tol}{threshold for jittering: if distance between points is smaller + than \code{jit.tol}, points are considered replicates.} + \item{doplot}{logical; shall a plot be produced? if \code{FALSE} only the return values are produced.} } \details{ The \code{matrix}-method calls \code{.ddPlot.MatNtNtCoCo}, @@ -126,7 +140,7 @@ } } \value{ -a list with items +a list (returned as \code{invisible()}) with items \item{id.x}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{x}-cutoff} \item{id.y}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{y}-cutoff} \item{id.xy}{the indices of (possibly transformed) data (within subset \code{id.n}) beyond the \code{x}-cutoff and the \code{y}-cutoff} Modified: pkg/RobAStBase/man/infoPlot.Rd =================================================================== --- pkg/RobAStBase/man/infoPlot.Rd 2016-09-01 14:00:36 UTC (rev 883) +++ pkg/RobAStBase/man/infoPlot.Rd 2016-09-01 14:11:24 UTC (rev 884) @@ -16,18 +16,21 @@ 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, - scaleX = FALSE, scaleX.fct, scaleX.inv, + 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, col.pts = par("col"), - pch.pts = 1, jitter.fac = 1, with.lab = FALSE, + cex.pts = 1, cex.pts.fun = NULL, col.pts = par("col"), + pch.pts = 1, jit.fac = 1, jit.tol = .Machine$double.eps, with.lab = FALSE, lab.pts = NULL, lab.font = NULL, alpha.trsp = NA, which.lbs = NULL, which.Order = NULL, return.Order = FALSE, + draw.nonlbl = TRUE, cex.nonlbl=0.3, pch.nonlbl=".", ylab.abs = "absolute information", - ylab.rel= "relative information") + ylab.rel= "relative information", + withSubst = TRUE) } \arguments{ \item{object}{object of class \code{"InfluenceCurve"} } @@ -62,6 +65,9 @@ to the current setting of \code{cex}; as in \code{\link[graphics]{par}}.} \item{col.inner}{character or integer code; color for the inner title} + \item{with.automatic.grid}{logical; should a grid be plotted alongside + with the ticks of the axes, automatically? If \code{TRUE} a respective + call to \code{grid} in argument \code{panel.first} is ignored. } \item{with.legend}{logical; shall a legend be plotted?} \item{legend}{either \code{NULL} or a list of length (number of plotted panels) of items which can be used as argument \code{legend} in @@ -72,6 +78,15 @@ of such arguments, one for each plotted panel.} \item{legend.bg}{background color for the legend} \item{legend.cex}{magnification factor for the legend} + \item{x.vec}{a numeric vector of grid points to evaluate the influence curve; + by default, \code{x.vec} is \code{NULL}; then the grid is + produced automatically according to the distribution of the IC. + \code{x.vec} 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, it should be chosen non-equally spaced. } \item{scaleX}{logical; shall X-axis be rescaled (by default according to the cdf of the underlying distribution)?} \item{scaleY}{logical; shall Y-axis be rescaled for abs.info-plot @@ -84,13 +99,17 @@ such that for any \code{x} in the domain, \code{scaleX.inv(scaleX.fct(x))==x}; if \code{scaleX} is \code{TRUE} and \code{scaleX.inv} is - missing, the quantile function of the underlying observation distribution.} + missing, the quantile function of the underlying observation distribution. } \item{scaleY.fct}{an isotone, vectorized function mapping the range of the norm of the IC to [0,1]; defaulting - to the cdf of \eqn{{\cal N}(0,1)}{N(0,1)}.} + to the cdf of \eqn{{\cal N}(0,1)}{N(0,1)}; + can also be a list of functions with one list element for each + of the panels to be plot.} \item{scaleY.inv}{an isotone, vectorized function mapping [0,1] into the range of the norm of the IC; defaulting to the quantile function - of \eqn{{\cal N}(0,1)}{N(0,1)}.} + of \eqn{{\cal N}(0,1)}{N(0,1)}; + can also be a list of functions with one list element for each + of the panels to be plot.} \item{scaleN}{integer; defaults to 9; on rescaled axes, number of x and y ticks if drawn automatically;} \item{x.ticks}{numeric; defaults to NULL; (then ticks are chosen automatically); @@ -113,7 +132,19 @@ vector \code{"dim"}, \code{dimnr} running through the number of rows of the trafo matrix. } + \item{withSubst}{logical; if \code{TRUE} (default) pattern substitution for + titles and lables is used; otherwise no substitution is used. } \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?} @@ -128,8 +159,10 @@ while for the remaining ones, the alpha channel in rgb space is set to the respective coordinate value of \code{alpha.trsp}. The non-NA entries must be integers in [0,255] (0 invisible, 255 opaque).} - \item{jitter.fac}{jittering factor used in case of a \code{DiscreteDistribution} + \item{jit.fac}{jittering factor used in case of a \code{DiscreteDistribution} for plotting points of the \code{data} argument in a jittered fashion.} + \item{jit.tol}{threshold for jittering: if distance between points is smaller + than \code{jit.tol}, points are considered replicates.} \item{which.lbs}{either an integer vector with the indices of the observations to be plotted into graph or \code{NULL} --- then no observation is excluded} \item{which.Order}{we order the observations (descending) according to the norm given by @@ -145,6 +178,9 @@ reduction by argument \code{which.lbs}, and ordering is according to the norm given by \code{normtype(object)}); otherwise we return \code{invisible()} as usual.} + \item{draw.nonlbl}{logical; should non-labelled observations be drawn?} + \item{cex.nonlbl}{character expansion(s) for non-labelled observations} + \item{pch.nonlbl}{plotting symbol(s) for non-labelled observations} \item{ylab.abs}{character; label to be used for y-axis in absolute information panel} \item{ylab.rel}{character; label to be used for y-axis in relative information panel} \item{\dots}{further parameters for \code{plot}} @@ -170,7 +206,8 @@ and a "generated on "-tag in case of \code{sub}. Of course, if \code{main} / \code{inner} / \code{sub} are \code{character}, this is used for the title; in case of \code{inner} it is then checked whether it -has correct length. In all title arguments, the following patterns are substituted: +has correct length. If argument \code{withSubst} is \code{TRUE}, in all title +and axis lable arguments, the following patterns are substituted: \describe{ \item{\code{"\%C"}}{class of argument \code{object}} \item{\code{"\%A"}}{deparsed argument \code{object}} @@ -195,6 +232,13 @@ The \code{\dots} argument may also contain an argument \code{withbox} which if \code{TRUE} warrants that even if \code{xaxt} and \code{yaxt} both are \code{FALSE}, a box is drawn around the respective panel. + +In addition, argument \code{\dots} may contain arguments \code{panel.first}, +\code{panel.last}, i.e., hook expressions to be evaluated at the very beginning +and at the very end of each panel (within the then valid coordinates). +To be able to use these hooks for each panel individually, they may also be +lists of expressions (of the same length as the number of panels and +run through in the same order as the panels). } %\value{} \references{ Copied: pkg/RobAStBase/man/internal_GridHelpers.Rd (from rev 881, branches/robast-1.0/pkg/RobAStBase/man/internal_GridHelpers.Rd) =================================================================== --- pkg/RobAStBase/man/internal_GridHelpers.Rd (rev 0) +++ pkg/RobAStBase/man/internal_GridHelpers.Rd 2016-09-01 14:11:24 UTC (rev 884) @@ -0,0 +1,59 @@ +\name{internal_helpers_for_producing_grids_in_plots_RobAStBase} +\alias{internal_helpers_for_producing_grids_in_plots_RobAStBase} +\alias{.getDimsTD} +\alias{.producePanelFirstS} + +\title{Internal / Helper functions of package RobAStBase for grids in plot functions} + +\description{ +These functions are internally used helper functions for \code{\link{plot}}, +\code{\link{infoPlot}} \code{\link{comparePlot}} in package \pkg{RobAStBase}.} + +\usage{ +.getDimsTD(L2Fam,to.draw.arg) +.producePanelFirstS(panelFirst,IC,to.draw.arg, isInfoPlot=FALSE, + x.ticks, scaleX, scaleX.fct, + y.ticks, scaleY, scaleY.fct) +} +\arguments{ + \item{L2Fam}{the model at which the plot is produced (of class \code{L2ParamFamily}).} + \item{to.draw.arg}{Either \code{NULL} (default; + everything is plotted) or a vector of either integers + (the indices of the subplots to be drawn) or characters + --- the names of the subplots to be drawn: these + names are to be chosen either among the row names of + the trafo matrix + \code{rownames(trafo(eval(x at CallL2Fam)@param))} + or if the last expression is \code{NULL} a + vector \code{"dim"}, \code{dimnr} running through + the number of rows of the trafo matrix. + } + \item{panelFirst}{argument \code{panel.first} to be mingled for grid plotting.} + \item{IC}{object of class \code{"InfluenceCurve"} } + \item{isInfoPlot}{logical; is this function to be used in \code{infoPlot} or + (\code{TRUE}) in another plot (\code{FALSE})? } + \item{x.ticks}{numeric: coordinates in original scale of user-given ticks on x-axis.} + \item{scaleX}{logical; shall X-axis be rescaled (by default according to the cdf of + the underlying distribution)?} + \item{scaleX.fct}{an isotone, vectorized function mapping the domain of the IC + to [0,1]; if \code{scaleX} is \code{TRUE} and \code{scaleX.fct} is + missing, the cdf of the underlying observation distribution.} + \item{y.ticks}{numeric: coordinates in original scale of user-given ticks on y-axis.} + \item{scaleY}{logical; shall Y-axis be rescaled (by default according to a probit scale)?} + \item{scaleY.fct}{an isotone, vectorized function mapping for each coordinate the + range of the respective coordinate of the IC + to [0,1]; defaulting to the cdf of \eqn{{\cal N}(0,1)}{N(0,1)}.} +} +\details{ +\code{.getDimsTD} computes the number of panels to be plotted. +\code{.producePanelFirstS} produces an unevaluated expression to be +used as argument \code{panel.first} in the diagnostic plots; i.e.; +knowing the actual tickmarks of the axis at the time of evaluation, +code is inserted to plot horizontal and vertical grid lines through +these tickmarks. +} + + +\keyword{internal} +\concept{utilities} +\keyword{hplot} Modified: pkg/RobAStBase/man/internal_plots.Rd =================================================================== --- pkg/RobAStBase/man/internal_plots.Rd 2016-09-01 14:00:36 UTC (rev 883) +++ pkg/RobAStBase/man/internal_plots.Rd 2016-09-01 14:11:24 UTC (rev 884) @@ -6,6 +6,7 @@ \alias{.SelectOrderData} \alias{.makedotsP} \alias{.makedotsLowLevel} +\alias{.cexscale} \title{Internal / Helper functions of package RobAStBase for plot functions} @@ -19,11 +20,13 @@ xlim, ylim, dots) .plotRescaledAxis(scaleX, scaleX.fct, scaleX.inv, scaleY,scaleY.fct, scaleY.inv, xlim, ylim, X, ypts = 400, n = 11, + finiteEndpoints = rep(FALSE,4), x.ticks = NULL, y.ticks = NULL, withbox = TRUE) .legendCoord(x, scaleX, scaleX.fct, scaleY, scaleY.fct) .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 @@ -51,6 +54,8 @@ scale).} \item{ylim}{numeric vector of length 2: limits of the plotted y region (in original scale).} + \item{finiteEndpoints}{a logical of length 4: are the unscaled \code{xlim[1]}, + \code{xlim[2]}, \code{ylim[1]}, \code{ylim[2]} finite? } \item{x.ticks}{numeric: coordinates in original scale of user-given ticks on x-axis.} \item{y.ticks}{numeric: coordinates in original scale of user-given ticks on y-axis.} \item{n}{integer: number of default ticks in x and y axis.} @@ -75,6 +80,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 @@ -113,12 +124,27 @@ \code{data}, ie., the selected/thinned out data, \code{y}, ie., the values of \code{fct(data)}, \code{ind}, ie., the indices of the selected data in the original data (after possibly two selections), and \code{ind1} the -indices of the data selected by \code{which.lbs} in the original data. +indices of the data selected by \code{which.lbs} in the original data; in +addition also the non selected data, \code{data.ns}, the respective +y-values \code{y.ns} and the corresponding index elements \code{ind.ns} are +returned as list items. \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 [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/robast -r 884 From noreply at r-forge.r-project.org Thu Sep 1 16:11:58 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 16:11:58 +0200 (CEST) Subject: [Robast-commits] r885 - pkg/RobAStBase/R Message-ID: <20160901141158.E3674188244@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 16:11:58 +0200 (Thu, 01 Sep 2016) New Revision: 885 Added: pkg/RobAStBase/R/internalGridHelpers.R Modified: pkg/RobAStBase/R/00internal.R pkg/RobAStBase/R/AllPlot.R pkg/RobAStBase/R/AllShow.R pkg/RobAStBase/R/bALEstimate.R pkg/RobAStBase/R/comparePlot.R pkg/RobAStBase/R/cutoff-class.R pkg/RobAStBase/R/ddPlot.R pkg/RobAStBase/R/ddPlot_utils.R pkg/RobAStBase/R/getRiskBV.R pkg/RobAStBase/R/infoPlot.R pkg/RobAStBase/R/interpolRisks.R pkg/RobAStBase/R/kStepEstimate.R pkg/RobAStBase/R/kStepEstimator.R pkg/RobAStBase/R/oneStepEstimator.R pkg/RobAStBase/R/outlyingPlot.R pkg/RobAStBase/R/plotRescaledAxis.R pkg/RobAStBase/R/plotWrapper.R pkg/RobAStBase/R/qqplot.R pkg/RobAStBase/R/selectorder.R Log: R-Code updated from branch Modified: pkg/RobAStBase/R/00internal.R =================================================================== --- pkg/RobAStBase/R/00internal.R 2016-09-01 14:11:24 UTC (rev 884) +++ pkg/RobAStBase/R/00internal.R 2016-09-01 14:11:58 UTC (rev 885) @@ -6,6 +6,52 @@ paste(format(100 * probs, trim = TRUE, scientific = FALSE, digits = digits), "%") +.DistrCollapse <- function(support, prob, + eps = getdistrOption("DistrResolution")){ + supp <- support + prob <- as.vector(prob) + suppIncr <- diff(c(supp[1]-2*eps,supp)) < eps + groups <- cumsum(!suppIncr) + prob <- as.vector(tapply(prob, groups, sum)) + supp0 <- as.vector(tapply(supp, groups, quantile, probs = 0.5, type = 1)) + reps <- .getRefIdx(supp,supp0,eps) +# cat("III\n") +# print(length(reps)) +# print(length(supp0)) +# cat("III\n") + ### in order to get a "support member" take the leftmost median + return(list(supp = supp0, prob = prob, groups=groups, reps = reps)) +# newDistribution <- DiscreteDistribution(supp=supp,prob=prob) +# return(newDistribution) +} + +.getRefIdx <- function(x,y, eps = getdistrOption("DistrResolution")){ + ## x and y are sorted; y=unique(x) (modulo rounding) + ## wI gives the first index in x such that x is representing the group + wI <- y*0 + j <- 1 + rmin <- Inf + for(i in 1:length(wI)){ + again <- TRUE + while(again&&j<=length(x)){ + rmina <- abs(x[j]-y[i]) + if(rmina< rmin-eps){ + rmin <- rmina + wI[i] <- j + }else{ + if(rmina>rmin+eps){ + rmin <- Inf + again <- FALSE + j <- j-1 + } + } + j <- j + 1 + } + } + if(wI[i] == 0) wI[i] <- length(x) + return(wI) +} + #------------------------------------------------------------------------------ ### for distrXXX pre 2.5 #------------------------------------------------------------------------------ @@ -17,6 +63,8 @@ {as.character(arg) %in% names(formals(fct))} .fillList <- function(list0, len = length(list0)){ + if(is.null(list0)) return(vector("list",len)) + if(!is.list(list0)) list0 <- list(list0) if(len == length(list0)) return(list0) i <- 0 @@ -128,3 +176,18 @@ } +.panel.mingle <- function(dots, element){ + pF <- dots[[element]] + if(is.list(pF)) return(pF) + pFr <- if(typeof(pF)=="symbol") eval(pF) else{ + pFc <- as.call(pF) + if(as.list(pFc)[[1]] == "list"){ + lis <- vector("list",length(as.list(pFc))-1) + for(i in 1:length(lis)){ + lis[[i]] <- pFc[[i+1]] + } + lis + }else pF + } + return(pFr) +} Modified: pkg/RobAStBase/R/AllPlot.R =================================================================== --- pkg/RobAStBase/R/AllPlot.R 2016-09-01 14:11:24 UTC (rev 884) +++ pkg/RobAStBase/R/AllPlot.R 2016-09-01 14:11:58 UTC (rev 885) @@ -3,20 +3,30 @@ 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 = FALSE, legend = NULL, legend.bg = "white", legend.location = "bottomright", legend.cex = 0.8, withMBR = FALSE, MBRB = NA, MBR.fac = 2, col.MBR = par("col"), lty.MBR = "dashed", lwd.MBR = 0.8, - scaleX = FALSE, scaleX.fct, scaleX.inv, + 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){ + mfColRow = TRUE, to.draw.arg = NULL, withSubst = TRUE){ xc <- match.call(call = sys.call(sys.parent(1)))$x + xcc <- as.character(deparse(xc)) dots <- match.call(call = sys.call(sys.parent(1)), expand.dots = FALSE)$"..." dotsLeg <- dotsT <- dotsL <- .makedotsLowLevel(dots) + .mpresubs <- if(withSubst){ + function(inx) + .presubs(inx, c("%C", "%A", "%D" ), + c(as.character(class(x)[1]), + as.character(date()), + xcc)) + }else function(inx)inx + if(!is.logical(inner)){ if(!is.list(inner)) inner <- as.list(inner) @@ -52,10 +62,45 @@ 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" } + scaleY.fct <- .fillList(scaleY.fct, dims0) + scaleY.inv <- .fillList(scaleY.inv, dims0) + + pF <- expression({}) + if(!is.null(dots[["panel.first"]])){ + pF <- .panel.mingle(dots,"panel.first") + } + ..panelFirst <- .fillList(pF,dims0) + if(with.automatic.grid) + ..panelFirst <- .producePanelFirstS( + ..panelFirst,x, to.draw.arg, FALSE, + 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({}) + pF <- vector("list",dims0) + if(dims0>0) + for(i in 1:dims0){ + pF[[i]] <- substitute({ gridS0 + pF0}, + list(pF0=..panelFirst[[i]], gridS0=gridS)) + } + + pL <- expression({}) + if(!is.null(dots[["panel.last"]])){ + pL <- .panel.mingle(dots,"panel.last") + } + ..panelLast <- .fillList(pL,dims0) + pL <- vector("list",dims0) + if(dims0>0) + for(i in 1:dims0) + pL[[i]] <- if(is.null(..panelLast[[i]])) expression({}) else ..panelLast[[i]] + + dots$panel.last <- dots$panel.first <- NULL + MBRB <- matrix(rep(t(MBRB), length.out=dims0*2),ncol=2, byrow=T) MBRB <- MBRB * MBR.fac @@ -84,14 +129,28 @@ upper <- max(upper,xM) } h <- upper - lower - x.vec <- seq(from = lower - 0.1*h, to = upper + 0.1*h, length = 1000) + 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" lty <- "solid" }else{ - if(is(e1, "DiscreteDistribution")) x.vec <- support(e1) - else{ - x.vec <- r(e1)(1000) - x.vec <- sort(unique(x.vec)) + if(!is.null(x.vec)){ + if(is(distr, "DiscreteDistribution")) + x.vec <- intersect(x.vec,support(e1)) + }else{ + if(is(e1, "DiscreteDistribution")) x.vec <- support(e1) + else{ + x.vec <- r(e1)(1000) + x.vec <- sort(unique(x.vec)) + } } plty <- "p" lty <- "dotted" @@ -119,11 +178,6 @@ subL <- FALSE lineT <- NA - .mpresubs <- function(inx) - .presubs(inx, c("%C", "%D", "%A"), - c(as.character(class(x)[1]), - as.character(date()), - as.character(deparse(xc)))) if (hasArg(main)){ mainL <- TRUE @@ -195,7 +249,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) @@ -237,18 +291,33 @@ fct <- function(x) sapply(x, IC1 at Map[[indi]]) print(xlim[,i]) resc <-.rescalefct(x.vec, fct, scaleX, scaleX.fct, - scaleX.inv, scaleY, scaleY.fct, xlim[,i], + scaleX.inv, scaleY, scaleY.fct[[i]], xlim[,i], ylim[,i], dots) dots <- resc$dots dots$xlim <- xlim[,i] dots$ylim <- ylim[,i] x.vec1 <- resc$X y.vec1 <- resc$Y + + finiteEndpoints <- rep(FALSE,4) + if(scaleX){ + finiteEndpoints[1] <- is.finite(scaleX.inv(min(x.vec1, xlim[1,i]))) + finiteEndpoints[2] <- is.finite(scaleX.inv(max(x.vec1, xlim[2,i]))) + } + if(scaleY){ + finiteEndpoints[3] <- is.finite(scaleY.inv[[i]](min(y.vec1, ylim[1,i]))) + finiteEndpoints[4] <- is.finite(scaleY.inv[[i]](max(y.vec1, ylim[2,i]))) + } + + do.call(plot, args=c(list(x=x.vec1, y=y.vec1, type = plty, lty = lty, - xlab = xlab, ylab = ylab), dots)) + xlab = .mpresubs(xlab), ylab = .mpresubs(ylab), + panel.first = pF[[i]], + panel.last = pL[[i]]), dots)) .plotRescaledAxis(scaleX, scaleX.fct, scaleX.inv, - scaleY,scaleY.fct, scaleY.inv, + scaleY,scaleY.fct[[i]], scaleY.inv[[i]], xlim[,i], ylim[,i], x.vec1, ypts = 400, n = scaleN, + finiteEndpoints = finiteEndpoints, x.ticks = x.ticks, y.ticks = y.ticks[[i]]) if(withMBR){ MBR.i <- MBRB[i,] @@ -258,7 +327,7 @@ if(is(e1, "DiscreteDistribution")){ x.vec1D <- seq(from = min(x.vec), to = max(x.vec), length = 1000) rescD <-.rescalefct(x.vec1D, fct, scaleX, scaleX.fct, - scaleX.inv, scaleY, scaleY.fct, xlim[,i], + scaleX.inv, scaleY, scaleY.fct[[i]], xlim[,i], ylim[,i], dots) x.vecD <- rescD$X y.vecD <- rescD$Y @@ -327,19 +396,25 @@ dots.without <- dots dots.without$col <- dots.without$cex <- dots.without$pch <- NULL + dims0 <- .getDimsTD(L2Fam,dots[["to.draw.arg"]]) pL <- expression({}) if(!is.null(dots$panel.last)) - pL <- dots$panel.last + pL <- .panel.mingle(dots,"panel.last") + pL <- .fillList(pL, dims0) + if(dims0) for(i in 1:dims0){ + if(is.null(pL[[i]])) pL[[i]] <- expression({}) + } dots$panel.last <- NULL + pL <- substitute({ y1 <- y0s ICy <- sapply(y0s,ICMap0[[indi]]) - print(xlim[,i]) + #print(xlim[,i]) resc.dat <-.rescalefct(y0s, function(x) sapply(x,ICMap0[[indi]]), scaleX, scaleX.fct, scaleX.inv, - scaleY, scaleY.fct, xlim[,i], ylim[,i], + scaleY, scaleY.fct[[i]], xlim[,i], ylim[,i], dwo0) y1 <- resc.dat$X ICy <- resc.dat$Y Modified: pkg/RobAStBase/R/AllShow.R =================================================================== --- pkg/RobAStBase/R/AllShow.R 2016-09-01 14:11:24 UTC (rev 884) +++ pkg/RobAStBase/R/AllShow.R 2016-09-01 14:11:58 UTC (rev 885) @@ -136,9 +136,9 @@ if(is(oI,"IC")) show(oI) - else{oIC <- object[[i]]@Curve + else{oIC <- oI at Curve for(j in 1:length(oIC)) show(oIC[[j]]@Map) } } -}) \ No newline at end of file +}) Modified: pkg/RobAStBase/R/bALEstimate.R =================================================================== --- pkg/RobAStBase/R/bALEstimate.R 2016-09-01 14:11:24 UTC (rev 884) +++ pkg/RobAStBase/R/bALEstimate.R 2016-09-01 14:11:58 UTC (rev 885) @@ -1,163 +1,163 @@ -############################################################################### -## Functions and methods for "ALEstimate" classes and subclasses -############################################################################### - -setMethod("pIC", "ALEstimate", function(object) object at pIC) -setMethod("asbias", "ALEstimate", function(object) object at asbias) -setMethod("steps", "kStepEstimate", function(object) object at steps) -setMethod("Mroot", "MEstimate", function(object) object at Mroot) - -setMethod("confint", signature(object="ALEstimate", method="missing"), - function(object, method, level = 0.95) { - objN <- paste(deparse(substitute(object)),sep="",collapse="") - - if(is.null(object at asvar)){ - cat(gettextf("Slot 'asvar' of object %s has not (yet) been filled.\n", objN)) - return(NULL) - } - - sd0 <- sqrt(diag(as.matrix(object at asvar))/object at samplesize) - names(sd0) <- names(object at estimate) - -### code borrowed from confint.default from package stats - a <- (1 - level)/2 - a <- c(a, 1 - a) - pct <- .format.perc(a, 3) - fac <- qnorm(a) - ci <- array(NA, dim = c(length(object at estimate), 2), - dimnames = list(names(object at estimate), pct)) - ci[] <- main(object) + sd0 %o% fac -### end of borrowed code - - new("Confint", type = gettext("asymptotic (LAN-based)"), - samplesize.estimate = object at samplesize, - call.estimate = object at estimate.call, - name.estimate = object at name, - trafo.estimate = object at trafo, - nuisance.estimate = nuisance(object), - fixed.estimate = fixed(object), - confint = ci) -}) - -setMethod("confint", signature(object="ALEstimate", method="symmetricBias"), - function(object, method, level = 0.95) { - objN <- paste(deparse(substitute(object)),sep="",collapse="") - - if(is.null(object at asvar)){ - cat(gettextf("Slot 'asvar' of object %s has not (yet) been filled.\n", objN)) - return(NULL) - } - if(is.null(object at asbias)){ - cat(gettextf("Slot 'asbias' of object %s has not (yet) been filled.\n", objN)) - return(confint(object)) - } - - sd0 <- sqrt(diag(as.matrix(object at asvar))/object at samplesize) - names(sd0) <- names(object at estimate) - -### code borrowed from confint.default from package stats - a <- (1 - level)/2 - a <- c(a, 1 - a) - pct <- .format.perc(a, 3) - fac <- qnorm(a, mean = c(-object at asbias, object at asbias)) - ci <- array(NA, dim = c(length(object at estimate), 2), - dimnames = list(names(object at estimate), pct)) - ci[] <- main(object) + sd0 %o% fac -### end of borrowed code - - new("Confint", type = c( - gettext("asymptotic (LAN-based), uniform (bias-aware)\n"), - gettextf("for %s", name(method)) - ), - samplesize.estimate = object at samplesize, - call.estimate = object at estimate.call, - name.estimate = object at name, - trafo.estimate = object at trafo, - nuisance.estimate = nuisance(object), - fixed.estimate = fixed(object), - confint = ci) -}) - -setMethod("confint", signature(object="ALEstimate", method="onesidedBias"), - function(object, method, level = 0.95) { - objN <- paste(deparse(substitute(object)),sep="",collapse="") - - if(is.null(object at asvar)){ - cat(gettextf("Slot 'asvar' of object %s has not (yet) been filled.\n", objN)) - return(NULL) - } - if(is.null(object at asbias)){ - cat(gettextf("Slot 'asbias' of object %s has not (yet) been filled.\n", objN)) - return(confint(object)) - } - - sd0 <- sqrt(diag(as.matrix(object at asvar))/object at samplesize) - names(sd0) <- names(object at estimate) - -### code borrowed from confint.default from package stats - a <- (1 - level)/2 - a <- c(a, 1 - a) - pct <- .format.perc(a, 3) - if(method at sign == -1) - M <- c(-object at asbias, 0) - else - M <- c(0, object at asbias) - fac <- qnorm(a, mean = M) - ci <- array(NA, dim = c(length(object at estimate), 2), - dimnames = list(names(object at estimate), pct)) - ci[] <- main(object) + sd0 %o% fac -### end of borrowed code - - new("Confint", type = c( - gettext("asymptotic (LAN-based), uniform (bias-aware)\n"), - gettextf("for %s", name(method)) - ), - samplesize.estimate = object at samplesize, - call.estimate = object at estimate.call, - name.estimate = object at name, - trafo.estimate = object at trafo, - nuisance.estimate = nuisance(object), - fixed.estimate = fixed(object), - confint = ci) -}) - -setMethod("confint", signature(object="ALEstimate", method="asymmetricBias"), - function(object, method, level = 0.95) { - objN <- paste(deparse(substitute(object)),sep="",collapse="") - - if(is.null(object at asvar)){ - cat(gettextf("Slot 'asvar' of object %s has not (yet) been filled.\n", objN)) - return(NULL) - } - if(is.null(object at asbias)){ - cat(gettextf("Slot 'asbias' of object %s has not (yet) been filled.\n", objN)) - return(confint(object)) - } - - sd0 <- sqrt(diag(as.matrix(object at asvar))/object at samplesize) - names(sd0) <- names(object at estimate) - -### code borrowed from confint.default from package stats - a <- (1 - level)/2 - a <- c(a, 1 - a) - pct <- .format.perc(a, 3) - fac <- qnorm(a, mean = c(-object at asbias, object at asbias)/method at nu) - ci <- array(NA, dim = c(length(object at estimate), 2), - dimnames = list(names(object at estimate), pct)) - ci[] <- main(object) + sd0 %o% fac -### end of borrowed code - - nuround <- round(nu,3) - new("Confint", type = c( - gettext("asymptotic (LAN-based), uniform (bias-aware)\n"), - gettextf("for %s with nu =(%f,%f)", - name(method), nuround[1], nuround[2]) - ), - samplesize.estimate = object at samplesize, - call.estimate = object at estimate.call, - name.estimate = object at name, - trafo.estimate = object at trafo, - nuisance.estimate = nuisance(object), - fixed.estimate = fixed(object), - confint = ci) -}) +############################################################################### +## Functions and methods for "ALEstimate" classes and subclasses +############################################################################### + +setMethod("pIC", "ALEstimate", function(object) object at pIC) +setMethod("asbias", "ALEstimate", function(object) object at asbias) +setMethod("steps", "kStepEstimate", function(object) object at steps) +setMethod("Mroot", "MEstimate", function(object) object at Mroot) + +setMethod("confint", signature(object="ALEstimate", method="missing"), + function(object, method, level = 0.95) { + objN <- paste(deparse(substitute(object)),sep="",collapse="") + + if(is.null(object at asvar)){ + cat(gettextf("Slot 'asvar' of object %s has not (yet) been filled.\n", objN)) + return(NULL) + } + + sd0 <- sqrt(diag(as.matrix(object at asvar))/object at samplesize) + names(sd0) <- names(object at estimate) + +### code borrowed from confint.default from package stats + a <- (1 - level)/2 + a <- c(a, 1 - a) + pct <- .format.perc(a, 3) + fac <- qnorm(a) + ci <- array(NA, dim = c(length(object at estimate), 2), + dimnames = list(names(object at estimate), pct)) + ci[] <- main(object) + sd0 %o% fac +### end of borrowed code + + new("Confint", type = gettext("asymptotic (LAN-based)"), + samplesize.estimate = object at samplesize, + call.estimate = object at estimate.call, + name.estimate = object at name, + trafo.estimate = object at trafo, + nuisance.estimate = nuisance(object), + fixed.estimate = fixed(object), + confint = ci) +}) + +setMethod("confint", signature(object="ALEstimate", method="symmetricBias"), + function(object, method, level = 0.95) { + objN <- paste(deparse(substitute(object)),sep="",collapse="") + + if(is.null(object at asvar)){ + cat(gettextf("Slot 'asvar' of object %s has not (yet) been filled.\n", objN)) + return(NULL) + } + if(is.null(object at asbias)){ + cat(gettextf("Slot 'asbias' of object %s has not (yet) been filled.\n", objN)) + return(confint(object)) + } + + sd0 <- sqrt(diag(as.matrix(object at asvar))/object at samplesize) + names(sd0) <- names(object at estimate) + +### code borrowed from confint.default from package stats + a <- (1 - level)/2 + a <- c(a, 1 - a) + pct <- .format.perc(a, 3) + fac <- qnorm(a, mean = c(-object at asbias, object at asbias)) + ci <- array(NA, dim = c(length(object at estimate), 2), + dimnames = list(names(object at estimate), pct)) + ci[] <- main(object) + sd0 %o% fac +### end of borrowed code + + new("Confint", type = c( + gettext("asymptotic (LAN-based), uniform (bias-aware)\n"), + gettextf("for %s", name(method)) + ), + samplesize.estimate = object at samplesize, + call.estimate = object at estimate.call, + name.estimate = object at name, + trafo.estimate = object at trafo, + nuisance.estimate = nuisance(object), + fixed.estimate = fixed(object), + confint = ci) +}) + +setMethod("confint", signature(object="ALEstimate", method="onesidedBias"), + function(object, method, level = 0.95) { + objN <- paste(deparse(substitute(object)),sep="",collapse="") + + if(is.null(object at asvar)){ + cat(gettextf("Slot 'asvar' of object %s has not (yet) been filled.\n", objN)) + return(NULL) + } + if(is.null(object at asbias)){ + cat(gettextf("Slot 'asbias' of object %s has not (yet) been filled.\n", objN)) + return(confint(object)) + } + + sd0 <- sqrt(diag(as.matrix(object at asvar))/object at samplesize) + names(sd0) <- names(object at estimate) + +### code borrowed from confint.default from package stats + a <- (1 - level)/2 + a <- c(a, 1 - a) + pct <- .format.perc(a, 3) + if(method at sign == -1) + M <- c(-object at asbias, 0) + else + M <- c(0, object at asbias) + fac <- qnorm(a, mean = M) + ci <- array(NA, dim = c(length(object at estimate), 2), + dimnames = list(names(object at estimate), pct)) + ci[] <- main(object) + sd0 %o% fac +### end of borrowed code + + new("Confint", type = c( + gettext("asymptotic (LAN-based), uniform (bias-aware)\n"), + gettextf("for %s", name(method)) + ), + samplesize.estimate = object at samplesize, + call.estimate = object at estimate.call, + name.estimate = object at name, + trafo.estimate = object at trafo, + nuisance.estimate = nuisance(object), + fixed.estimate = fixed(object), + confint = ci) +}) + +setMethod("confint", signature(object="ALEstimate", method="asymmetricBias"), + function(object, method, level = 0.95) { + objN <- paste(deparse(substitute(object)),sep="",collapse="") + + if(is.null(object at asvar)){ + cat(gettextf("Slot 'asvar' of object %s has not (yet) been filled.\n", objN)) + return(NULL) + } + if(is.null(object at asbias)){ + cat(gettextf("Slot 'asbias' of object %s has not (yet) been filled.\n", objN)) + return(confint(object)) + } + + sd0 <- sqrt(diag(as.matrix(object at asvar))/object at samplesize) + names(sd0) <- names(object at estimate) + +### code borrowed from confint.default from package stats + a <- (1 - level)/2 + a <- c(a, 1 - a) + pct <- .format.perc(a, 3) + fac <- qnorm(a, mean = c(-object at asbias, object at asbias)/method at nu) + ci <- array(NA, dim = c(length(object at estimate), 2), + dimnames = list(names(object at estimate), pct)) + ci[] <- main(object) + sd0 %o% fac +### end of borrowed code + + nuround <- round(nu,3) + new("Confint", type = c( + gettext("asymptotic (LAN-based), uniform (bias-aware)\n"), + gettextf("for %s with nu =(%f,%f)", + name(method), nuround[1], nuround[2]) + ), + samplesize.estimate = object at samplesize, + call.estimate = object at estimate.call, + name.estimate = object at name, + trafo.estimate = object at trafo, + nuisance.estimate = nuisance(object), + fixed.estimate = fixed(object), + confint = ci) +}) Modified: pkg/RobAStBase/R/comparePlot.R =================================================================== --- pkg/RobAStBase/R/comparePlot.R 2016-09-01 14:11:24 UTC (rev 884) +++ pkg/RobAStBase/R/comparePlot.R 2016-09-01 14:11:58 UTC (rev 885) @@ -6,30 +6,32 @@ col = par("col"), lwd = par("lwd"), lty, col.inner = par("col.main"), cex.inner = 0.8, bmar = par("mar")[1], tmar = par("mar")[3], + with.automatic.grid = TRUE, with.legend = FALSE, legend = NULL, legend.bg = "white", legend.location = "bottomright", legend.cex = 0.8, withMBR = FALSE, MBRB = NA, MBR.fac = 2, col.MBR = par("col"), lty.MBR = "dashed", lwd.MBR = 0.8, - scaleX = FALSE, scaleX.fct, scaleX.inv, + 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, 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){ + which.lbs = NULL, which.Order = NULL, return.Order = FALSE, + withSubst = TRUE){ .mc <- match.call(call = sys.call(sys.parent(1))) .xc<- function(obj) as.character(deparse(.mc[[obj]])) xc <- c(.xc("obj1"), .xc("obj2")) if(!is.null(obj3)) xc <- c(xc, .xc("obj3")) if(!is.null(obj4)) xc <- c(xc, .xc("obj4")) - dots <- match.call(call = sys.call(sys.parent(1)), expand.dots = FALSE)$"..." dotsP <- dots dotsLeg <- dotsT <- dotsL <- .makedotsLowLevel(dots) - + dots.points <- .makedotsPt(dots) + ncomp <- 2+ (!missing(obj3)|!is.null(obj3)) + (!missing(obj4)|!is.null(obj4)) @@ -78,10 +80,18 @@ 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(cex.pts.fun, dims0*ncomp) + } + + + scaleY.fct <- .fillList(scaleY.fct, dims0) + scaleY.inv <- .fillList(scaleY.inv, dims0) + MBRB <- matrix(rep(t(MBRB), length.out=dims0*2),ncol=2, byrow=T) MBRB <- MBRB * MBR.fac @@ -107,13 +117,27 @@ upper <- max(upper,xM) } h <- upper - lower - x.vec <- seq(from = lower - 0.1*h, to = upper + 0.1*h, length = 1000) + 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(distr, "DiscreteDistribution")) x.vec <- support(distr) else{ - x.vec <- r(distr)(1000) - x.vec <- sort(unique(x.vec)) + 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" @@ -147,7 +171,8 @@ lineT <- NA - .mpresubs <- function(inx) + + .mpresubs <- if(withSubst){function(inx) .presubs(inx, c(paste("%C",1:ncomp,sep=""), "%D", paste("%A",1:ncomp,sep="")), @@ -156,7 +181,7 @@ if(is.null(obj3))NULL else as.character(class(obj3)[1]), if(is.null(obj4))NULL else as.character(class(obj4)[1]), as.character(date()), - xc)) + xc))} else function(inx)inx mainL <- FALSE if (hasArg(main)){ @@ -231,7 +256,31 @@ dotsT$main <- dotsT$cex.main <- dotsT$col.main <- dotsT$line <- NULL - pL <- if(!is.null(dotsP$panel.last)) dotsP$panel.last else expression({}) + pF <- expression({}) + if(!is.null(dots[["panel.first"]])){ + pF <- .panel.mingle(dots,"panel.first") + } + ..panelFirst <- .fillList(pF,dims0) + if(with.automatic.grid) + ..panelFirst <- .producePanelFirstS( + ..panelFirst,obj1 , to.draw.arg, FALSE, + 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({}) + pF <- vector("list",dims0) + if(dims0>0) + for(i in 1:dims0){ + pF[[i]] <- substitute({ gridS0 + pF0}, + list(pF0=..panelFirst[[i]], gridS0=gridS)) + } + dots$panel.first <- NULL + pL <- expression({}) + if(!is.null(dots[["panel.last"]])){ + pL <- .panel.mingle(dots,"panel.last") + } + pL <- .fillList(pL, dims0) dotsP$panel.last <- NULL sel1 <- sel2 <- sel3 <- sel4 <- NULL @@ -253,9 +302,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 @@ -264,7 +318,7 @@ pL <- substitute({ doIt <- function(sel.l,fct.l,j.l){ rescd <- .rescalefct(sel.l$data, fct.l, scaleX, scaleX.fct, - scaleX.inv, scaleY, scaleY.fct, xlim[,i], + scaleX.inv, scaleY, scaleY.fct[[i]], xlim[,i], ylim[,i], dotsP) if(is(distr, "DiscreteDistribution")) rescd$Y <- jitter(rescd$Y, factor = jitter.fac0[j.l]) @@ -275,7 +329,10 @@ 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] + + 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, [TRUNCATED] To get the complete diff run: svnlook diff /svnroot/robast -r 885 From noreply at r-forge.r-project.org Thu Sep 1 16:13:04 2016 From: noreply at r-forge.r-project.org (noreply at r-forge.r-project.org) Date: Thu, 1 Sep 2016 16:13:04 +0200 (CEST) Subject: [Robast-commits] r886 - pkg/RobAStBase Message-ID: <20160901141304.4FE3D188244@r-forge.r-project.org> Author: ruckdeschel Date: 2016-09-01 16:13:04 +0200 (Thu, 01 Sep 2016) New Revision: 886 Removed: pkg/RobAStBase/RobAStBase-Ex.R Modified: pkg/RobAStBase/ Log: RobAStBase-Ex.R unversioned Property changes on: pkg/RobAStBase ___________________________________________________________________ Added: svn:ignore + RobAStBase-Ex.R Deleted: pkg/RobAStBase/RobAStBase-Ex.R =================================================================== --- pkg/RobAStBase/RobAStBase-Ex.R 2016-09-01 14:11:58 UTC (rev 885) +++ pkg/RobAStBase/RobAStBase-Ex.R 2016-09-01 14:13:04 UTC (rev 886) @@ -1,1102 +0,0 @@ -pkgname <- "RobAStBase" -source(file.path(R.home("share"), "R", "examples-header.R")) -options(warn = 1) -options(pager = "console") -library('RobAStBase') - -assign(".oldSearch", search(), pos = 'CheckExEnv') -cleanEx() -nameEx("0RobAStBase-package") -### * 0RobAStBase-package - -flush(stderr()); flush(stdout()) - -### Name: RobAStBase-package -### Title: Robust Asymptotic Statistics -### Aliases: RobAStBase-package RobAStBase -### Keywords: package - -### ** Examples - -library(RobAStBase) - -## some L2 differentiable parametric family from package distrMod, e.g. -B <- BinomFamily(size = 25, prob = 0.25) - -## classical optimal IC -IC0 <- optIC(model = B, risk = asCov()) -plot(IC0) # plot IC -checkIC(IC0, B) - - - -cleanEx() -nameEx("ALEstimate-class") -### * ALEstimate-class - -flush(stderr()); flush(stdout()) - -### Name: ALEstimate-class -### Title: ALEstimate-class. -### Aliases: ALEstimate-class pIC pIC,ALEstimate-method asbias -### asbias,ALEstimate-method show,ALEstimate-method -### confint,ALEstimate,missing-method -### confint,ALEstimate,symmetricBias-method -### confint,ALEstimate,onesidedBias-method -### confint,ALEstimate,asymmetricBias-method -### Keywords: classes - -### ** Examples - -## prototype -new("ALEstimate") - - - -cleanEx() -nameEx("BdStWeight-class") -### * BdStWeight-class - -flush(stderr()); flush(stdout()) - -### Name: BdStWeight-class -### Title: Robust Weight classes for bounded, standardized weights -### Aliases: BdStWeight-class stand,BdStWeight-method -### stand<-,BdStWeight-method -### Keywords: classes - -### ** Examples - -## prototype -new("BdStWeight") - - - -cleanEx() -nameEx("BoundedWeight-class") -### * BoundedWeight-class - -flush(stderr()); flush(stdout()) - -### Name: BoundedWeight-class -### Title: Robust Weight classes for bounded weights -### Aliases: BoundedWeight-class clip,BoundedWeight-method -### clip<-,BoundedWeight-method -### Keywords: classes - -### ** Examples - -## prototype -new("BoundedWeight") - - - -cleanEx() -nameEx("ContIC-class") -### * ContIC-class - -flush(stderr()); flush(stdout()) - -### Name: ContIC-class -### Title: Influence curve of contamination type -### Aliases: ContIC-class CallL2Fam<-,ContIC-method cent cent,ContIC-method -### cent<- cent<-,ContIC-method clip,ContIC-method clip<- -### clip<-,ContIC-method lowerCase<- lowerCase<-,ContIC-method stand<- -### stand<-,ContIC-method neighbor,ContIC-method -### generateIC,ContNeighborhood,L2ParamFamily-method show,ContIC-method -### Keywords: classes - -### ** Examples - -IC1 <- new("ContIC") -plot(IC1) - - - -cleanEx() -nameEx("ContIC") -### * ContIC - -flush(stderr()); flush(stdout()) - -### Name: ContIC -### Title: Generating function for ContIC-class -### Aliases: ContIC -### Keywords: robust - -### ** Examples - -IC1 <- ContIC() -plot(IC1) - - - -cleanEx() -nameEx("ContNeighborhood-class") -### * ContNeighborhood-class - -flush(stderr()); flush(stdout()) - -### Name: ContNeighborhood-class -### Title: Contamination Neighborhood -### Aliases: ContNeighborhood-class -### Keywords: classes models - -### ** Examples - -new("ContNeighborhood") - - - -cleanEx() -nameEx("ContNeighborhood") -### * ContNeighborhood - -flush(stderr()); flush(stdout()) - -### Name: ContNeighborhood -### Title: Generating function for ContNeighborhood-class -### Aliases: ContNeighborhood -### Keywords: models - -### ** Examples - -ContNeighborhood() - -## The function is currently defined as -function(radius = 0){ - new("ContNeighborhood", radius = radius) -} - - - -cleanEx() -nameEx("FixRobModel-class") -### * FixRobModel-class - -flush(stderr()); flush(stdout()) - -### Name: FixRobModel-class -### Title: Robust model with fixed (unconditional) neighborhood -### Aliases: FixRobModel-class neighbor<-,FixRobModel-method -### show,FixRobModel-method -### Keywords: classes models - -### ** Examples - -new("FixRobModel") - - - -cleanEx() -nameEx("FixRobModel") -### * FixRobModel - -flush(stderr()); flush(stdout()) - -### Name: FixRobModel -### Title: Generating function for FixRobModel-class -### Aliases: FixRobModel -### Keywords: models - -### ** Examples - -(M1 <- FixRobModel()) - -## The function is currently defined as -function(center = ParamFamily(), neighbor = ContNeighborhood()){ - new("FixRobModel", center = center, neighbor = neighbor) -} - - - -cleanEx() -nameEx("HampIC-class") -### * HampIC-class - -flush(stderr()); flush(stdout()) - -### Name: HampIC-class -### Title: Influence curve of Hampel type -### Aliases: HampIC-class lowerCase lowerCase,HampIC-method neighborRadius -### neighborRadius,HampIC-method neighborRadius<- -### neighborRadius<-,HampIC-method stand stand,HampIC-method -### weight,HampIC-method biastype,HampIC-method normtype,HampIC-method -### Keywords: classes - -### ** Examples - -IC1 <- new("HampIC") -plot(IC1) - - - -cleanEx() -nameEx("HampelWeight-class") -### * HampelWeight-class - -flush(stderr()); flush(stdout()) - -### Name: HampelWeight-class -### Title: Robust Weight classes for weights of Hampel type -### Aliases: HampelWeight-class cent,HampelWeight-method -### cent<-,HampelWeight-method -### Keywords: classes - -### ** Examples - -## prototype -new("HampelWeight") - - - -cleanEx() -nameEx("IC-class") -### * IC-class - -flush(stderr()); flush(stdout()) - -### Name: IC-class -### Title: Influence curve -### Aliases: IC-class CallL2Fam CallL2Fam,IC-method CallL2Fam<- -### CallL2Fam<-,IC-method modifyIC modifyIC,IC-method -### checkIC,IC,missing-method checkIC,IC,L2ParamFamily-method -### evalIC,IC,numeric-method evalIC,IC,matrix-method show,IC-method -### Keywords: classes robust - -### ** Examples - -IC1 <- new("IC") -plot(IC1) - - - -cleanEx() -nameEx("IC") -### * IC - -flush(stderr()); flush(stdout()) - -### Name: IC -### Title: Generating function for IC-class -### Aliases: IC -### Keywords: robust - -### ** Examples - -IC1 <- IC() -plot(IC1) - - - -cleanEx() -nameEx("InfRobModel-class") -### * InfRobModel-class - -flush(stderr()); flush(stdout()) - -### Name: InfRobModel-class -### Title: Robust model with infinitesimal (unconditional) neighborhood -### Aliases: InfRobModel-class neighbor<-,InfRobModel-method -### show,InfRobModel-method -### Keywords: classes models - -### ** Examples - -new("InfRobModel") - - - -cleanEx() -nameEx("InfRobModel") -### * InfRobModel - -flush(stderr()); flush(stdout()) - -### Name: InfRobModel -### Title: Generating function for InfRobModel-class -### Aliases: InfRobModel -### Keywords: models - -### ** Examples - -(M1 <- InfRobModel()) - -## The function is currently defined as -function(center = L2ParamFamily(), neighbor = ContNeighborhood()){ - new("InfRobModel", center = center, neighbor = neighbor) -} - - - -cleanEx() -nameEx("InfluenceCurve-class") -### * InfluenceCurve-class - -flush(stderr()); flush(stdout()) - -### Name: InfluenceCurve-class -### Title: Influence curve -### Aliases: InfluenceCurve-class addInfo<- addInfo<-,InfluenceCurve-method -### addRisk<- addRisk<-,InfluenceCurve-method Curve -### Curve,InfluenceCurve-method Domain,InfluenceCurve-method Infos -### Infos,InfluenceCurve-method Infos<- Infos<-,InfluenceCurve-method -### Map,InfluenceCurve-method name,InfluenceCurve-method -### name<-,InfluenceCurve-method Range,InfluenceCurve-method Risks -### Risks,InfluenceCurve-method Risks<- Risks<-,InfluenceCurve-method -### show,InfluenceCurve-method -### Keywords: classes robust - -### ** Examples - -new("InfluenceCurve") - - - -cleanEx() -nameEx("InfluenceCurve") -### * InfluenceCurve - -flush(stderr()); flush(stdout()) - -### Name: InfluenceCurve -### Title: Generating function for InfluenceCurve-class -### Aliases: InfluenceCurve -### Keywords: robust - -### ** Examples - -InfluenceCurve() - -## The function is currently defined as -InfluenceCurve <- function(name, Curve = EuclRandVarList(EuclRandVariable(Domain = Reals())), - Risks, Infos){ - if(missing(name)) - name <- "influence curve" - if(missing(Risks)) - Risks <- list() - if(missing(Infos)) - Infos <- matrix(c(character(0),character(0)), ncol=2, - dimnames=list(character(0), c("method", "message"))) - - return(new("InfluenceCurve", name = name, Curve = Curve, - Risks = Risks, Infos = Infos)) -} - - - -cleanEx() -nameEx("MEstimate-class") -### * MEstimate-class - -flush(stderr()); flush(stdout()) - -### Name: MEstimate-class -### Title: MEstimate-class. -### Aliases: MEstimate-class Mroot Mroot,MEstimate-method -### show,MEstimate-method -### Keywords: classes - -### ** Examples - -## prototype -new("MEstimate") - - - -cleanEx() -nameEx("RobAStBaseMASK") -### * RobAStBaseMASK - -flush(stderr()); flush(stdout()) - -### Name: RobAStBaseMASK -### Title: Masking of/by other functions in package "RobAStBase" -### Aliases: RobAStBaseMASK MASKING -### Keywords: programming distribution documentation - -### ** Examples - -RobAStBaseMASK() - - - -cleanEx() -nameEx("RobAStBaseOptions") -### * RobAStBaseOptions - -flush(stderr()); flush(stdout()) - -### Name: RobAStBaseOptions -### Title: Function to change the global variables of the package -### 'RobAStBase' -### Aliases: RobAStBaseOptions getRobAStBaseOption kStepUseLast -### Keywords: misc robust - -### ** Examples - -RobAStBaseOptions() -RobAStBaseOptions("kStepUseLast") -RobAStBaseOptions("kStepUseLast" = TRUE) -# or -RobAStBaseOptions(kStepUseLast = 1e-6) -getRobAStBaseOption("kStepUseLast") - - - -cleanEx() -nameEx("RobWeight-class") -### * RobWeight-class - -flush(stderr()); flush(stdout()) - -### Name: RobWeight-class -### Title: Robust Weight classes -### Aliases: RobWeight-class name,RobWeight-method name<-,RobWeight-method -### weight weight,RobWeight-method weight<- weight<--methods -### weight<-,RobWeight-method -### Keywords: classes - -### ** Examples - -## prototype -new("RobWeight") - - - -cleanEx() -nameEx("TotalVarIC-class") -### * TotalVarIC-class - -flush(stderr()); flush(stdout()) - -### Name: TotalVarIC-class -### Title: Influence curve of total variation type -### Aliases: TotalVarIC-class CallL2Fam<-,TotalVarIC-method clipLo -### clip,TotalVarIC-method clipLo,TotalVarIC-method clipLo<- -### clipLo<-,TotalVarIC-method clipUp clipUp,TotalVarIC-method clipUp<- -### clipUp<-,TotalVarIC-method lowerCase<-,TotalVarIC-method -### neighbor,TotalVarIC-method show,TotalVarIC-method -### stand<-,TotalVarIC-method -### generateIC,TotalVarNeighborhood,L2ParamFamily-method -### Keywords: classes robust - -### ** Examples - -IC1 <- new("TotalVarIC") -plot(IC1) - - - -cleanEx() -nameEx("TotalVarIC") -### * TotalVarIC - -flush(stderr()); flush(stdout()) - -### Name: TotalVarIC -### Title: Generating function for TotalVarIC-class -### Aliases: TotalVarIC -### Keywords: robust - -### ** Examples - -IC1 <- TotalVarIC() -plot(IC1) - - - -cleanEx() -nameEx("TotalVarNeighborhood-class") -### * TotalVarNeighborhood-class - -flush(stderr()); flush(stdout()) - -### Name: TotalVarNeighborhood-class -### Title: Total variation neighborhood -### Aliases: TotalVarNeighborhood-class -### Keywords: classes models - -### ** Examples - -new("TotalVarNeighborhood") - - - -cleanEx() -nameEx("TotalVarNeighborhood") -### * TotalVarNeighborhood - -flush(stderr()); flush(stdout()) - -### Name: TotalVarNeighborhood -### Title: Generating function for TotalVarNeighborhood-class -### Aliases: TotalVarNeighborhood -### Keywords: models - -### ** Examples - -TotalVarNeighborhood() - -## The function is currently defined as -function(radius = 0){ - new("TotalVarNeighborhood", radius = radius) -} - - - -cleanEx() -nameEx("checkIC") -### * checkIC - -flush(stderr()); flush(stdout()) - -### Name: checkIC -### Title: Generic Function for Checking ICs -### Aliases: checkIC -### Keywords: robust - -### ** Examples - -IC1 <- new("IC") -checkIC(IC1) - - - -cleanEx() -nameEx("comparePlot") -### * comparePlot - -flush(stderr()); flush(stdout()) - -### Name: comparePlot-methods -### Title: Compare - Plots -### Aliases: comparePlot comparePlot-methods comparePlot,IC,IC-method -### Keywords: robust - -### ** Examples - -if(require(ROptEst)){ - -N0 <- NormLocationScaleFamily(mean=0, sd=1) -N0.Rob1 <- InfRobModel(center = N0, neighbor = ContNeighborhood(radius = 0.5)) - -IC1 <- optIC(model = N0, risk = asCov()) -IC2 <- optIC(model = N0.Rob1, risk = asMSE()) - -comparePlot(IC1,IC2) - -set.seed(12); data <- r(N0)(20) -comparePlot(IC1, IC2, data=data, with.lab = TRUE, - which.lbs = c(1:4,15:20), - which.Order = 1:6, - return.Order = TRUE) - -## don't run to reduce check time on CRAN -## Not run: -##D ## selection of subpanels for plotting -##D par(mfrow=c(1,1)) -##D comparePlot(IC1, IC2 ,mfColRow = FALSE, to.draw.arg=c("mean"), -##D panel.first= grid(),ylim=c(-4,4),xlim=c(-6,6)) -##D ## matrix-valued ylim -##D comparePlot(IC1, IC2, panel.first= grid(),ylim=c(-4,4,0,4),xlim=c(-6,6)) -##D -##D x <- c(data,-12,10) -##D comparePlot(IC1, IC2, data=x, which.Order=10, -##D panel.first= grid(), ylim=c(-4,4,0,4), xlim=c(-6,6)) -##D -##D Y <- Chisq(df=1)* DiscreteDistribution(c(-1,1)) -##D comparePlot(IC1, IC2, data=x, which.Order=10, -##D scaleX = TRUE, scaleX.fct=pnorm, scaleX.inv=qnorm, -##D scaleY = TRUE, scaleY.fct=p(Y), scaleY.inv=q(Y), -##D panel.first= grid(), ylim=c(-4,4,0,4), xlim=c(-6,6)) -##D comparePlot(IC1, IC2, data=x, which.Order=10, -##D scaleX = TRUE, scaleX.fct=pnorm, scaleX.inv=qnorm, -##D scaleY = TRUE, scaleY.fct=p(Y), scaleY.inv=q(Y), -##D x.ticks = c(-Inf, -10, -1,0,1,10,Inf), -##D y.ticks = c(-Inf, -5, -1,0,1,5,Inf), -##D panel.first= grid(), ylim=c(-4,4,0,4), xlim=c(-6,6)) -##D -##D ## with use of trafo-matrix: -##D G <- GammaFamily(scale = 1, shape = 2) -##D ## explicitely transforming to -##D ## MASS parametrization: -##D mtrafo <- function(x){ -##D nms0 <- names(c(main(param(G)),nuisance(param(G)))) -##D nms <- c("shape","rate") -##D fval0 <- c(x[2], 1/x[1]) -##D names(fval0) <- nms -##D mat0 <- matrix( c(0, -1/x[1]^2, 1, 0), nrow = 2, ncol = 2, -##D dimnames = list(nms,nms0)) -##D list(fval = fval0, mat = mat0)} -##D G2 <- G -##D trafo(G2) <- mtrafo -##D G2 -##D G2.Rob1 <- InfRobModel(center = G2, neighbor = ContNeighborhood(radius = 0.5)) -##D system.time(IC1 <- optIC(model = G2, risk = asCov())) -##D system.time(IC2 <- optIC(model = G2.Rob1, risk = asMSE())) -##D system.time(IC2.i <- optIC(model = G2.Rob1, risk = asMSE(normtype=InfoNorm()))) -##D system.time(IC2.s <- optIC(model = G2.Rob1, risk = asMSE(normtype=SelfNorm()))) -##D -##D comparePlot(IC1,IC2, IC2.i, IC2.s) -## End(Not run) - -} - - - -cleanEx() -nameEx("cutoff-class") -### * cutoff-class - -flush(stderr()); flush(stdout()) - -### Name: cutoff-class -### Title: Cutoff class for distance-distance plots -### Aliases: cutoff-class cutoff.quantile<-,cutoff-method cutoff.quantile<- -### cutoff.quantile,cutoff-method cutoff.quantile name,cutoff-method -### fct,cutoff-method -### Keywords: classes - -### ** Examples - -cutoff() - - - -cleanEx() -nameEx("cutoff") -### * cutoff - -flush(stderr()); flush(stdout()) - -### Name: cutoff -### Title: Generating function(s) for class 'cutoff' -### Aliases: cutoff cutoff.sememp cutoff.chisq -### Keywords: hplot - -### ** Examples - -cutoff() -cutoff.sememp() -cutoff.chisq() - - - -cleanEx() -nameEx("ddPlot-methods") -### * ddPlot-methods - -flush(stderr()); flush(stdout()) - -### Name: ddPlot-methods -### Title: Methods for Function ddPlot in Package 'RobAStBase' -### Aliases: ddPlot ddPlot-methods ddPlot,matrix-method -### ddPlot,numeric-method ddPlot,data.frame-method -### Keywords: methods hplot - -### ** Examples - -MX <- matrix(rnorm(1500),nrow=6) -QM <- matrix(rnorm(36),nrow=6); QM <- QM %*% t(QM) -ddPlot(data=MX, dist.y=QFNorm(QuadF=PosSemDefSymmMatrix(QM))) - - - -cleanEx() -nameEx("getRiskFctBV-methods") -### * getRiskFctBV-methods - -flush(stderr()); flush(stdout()) - -### Name: getRiskFctBV-methods -### Title: Methods for Function getRiskFctBV in Package 'RobAStBase' -### Aliases: getRiskFctBV getRiskFctBV-methods -### getRiskFctBV,asGRisk,ANY-method getRiskFctBV,asMSE,ANY-method -### getRiskFctBV,asSemivar,onesidedBias-method -### getRiskFctBV,asSemivar,asymmetricBias-method -### Keywords: classes - -### ** Examples - -myrisk <- asMSE() -getRiskFctBV(myrisk) - - - -cleanEx() -nameEx("infoPlot") -### * infoPlot - -flush(stderr()); flush(stdout()) - -### Name: infoPlot -### Title: Plot absolute and relative information -### Aliases: infoPlot infoPlot-methods infoPlot,IC-method -### Keywords: robust - -### ** Examples - -N <- NormLocationScaleFamily(mean=0, sd=1) -IC1 <- optIC(model = N, risk = asCov()) -infoPlot(IC1) - -## don't run to reduce check time on CRAN -## Not run: -##D ## selection of subpanels for plotting -##D par(mfrow=c(1,2)) -##D infoPlot(IC1, mfColRow = FALSE, to.draw.arg=c("Abs","sd")) -##D infoPlot(IC1, mfColRow = FALSE, to.draw.arg=c("Abs","sd"), log="y") -##D -##D infoPlot(IC1, mfColRow = FALSE, to.draw.arg=c("Abs","mean"), -##D panel.first= grid(), ylim = c(0,4), xlim = c(-6,6)) -##D infoPlot(IC1, mfColRow = FALSE, to.draw.arg=c("Abs","mean"), -##D panel.first= grid(), ylim = c(0,4,-3,3), xlim = c(-6,6)) -##D -##D par(mfrow=c(1,3)) -##D infoPlot(IC1, mfColRow = FALSE, panel.first= grid(), -##D ylim = c(0,4,0,.3,0,.8), xlim=c(-6,6)) -##D par(mfrow=c(1,1)) -##D -##D data <- r(N)(20) -##D par(mfrow=c(1,3)) -##D infoPlot(IC1, data=data, mfColRow = FALSE, panel.first= grid(), -##D with.lab = TRUE, cex.pts=2, -##D which.lbs = c(1:4,15:20), which.Order = 1:6, -##D return.Order = TRUE) -##D infoPlot(IC1, data=data[1:10], mfColRow = FALSE, panel.first= grid(), -##D with.lab = TRUE, cex.pts=0.7) -##D par(mfrow=c(1,1)) -## End(Not run) - - - - -cleanEx() -nameEx("internals_ddPlot") -### * internals_ddPlot - -flush(stderr()); flush(stdout()) - -### Name: internals_for_RobAStBase_ddPlot -### Title: Internal / Helper functions of package RobAStBase for ddPlot -### Aliases: internals_for_RobAStBase_ddPlot .ddPlot.MatNtNtCoCo -### Keywords: internal hplot - -### ** Examples - -MX <- matrix(rnorm(1500),nrow=6) -QM <- matrix(rnorm(36),nrow=6); QM <- QM %*% t(QM) -RobAStBase:::.ddPlot.MatNtNtCoCo(data=MX, - dist.y=QFNorm(QuadF=PosSemDefSymmMatrix(QM)), - xlab="Norm.x",ylab="Norm.y", cex.idn = 1.3, offset=0, - lwd=2, lwd.cutoff=4, lty=2, col.cutoff =2, col.idn="green", - col = "blue", adj=0.4, pos=4,id.n = sample(1:200,size=100), - lab.pts=letters,log="x", main="GA", sub="NO",cex.sub=0.2) - - - -cleanEx() -nameEx("interpolRisk-class") -### * interpolRisk-class - -flush(stderr()); flush(stdout()) - -### Name: interpolRisk-class -### Title: Interpolated Risks -### Aliases: interpolRisk-class OMSRRisk-class RMXRRisk-class MBRRisk-class -### OMSRRisk RMXRRisk MBRRisk -### Keywords: classes - -### ** Examples - -new("OMSRRisk") -OMSRRisk() -RMXRRisk() -MBRRisk() -myrisk <- MBRRisk(samplesize=100) -samplesize(myrisk) -samplesize(myrisk) <- 20 - - - -cleanEx() -nameEx("kStepEstimator") -### * kStepEstimator - -flush(stderr()); flush(stdout()) - -### Name: kStepEstimator -### Title: Function for the computation of k-step estimates -### Aliases: kStepEstimator -### Keywords: univar robust - -### ** Examples - -if(require(ROptEst)){ -## 1. generate a contaminated sample -ind <- rbinom(100, size=1, prob=0.05) -x <- rnorm(100, mean=0, sd=(1-ind) + ind*9) - -## 2. Kolmogorov(-Smirnov) minimum distance estimator -(est0 <- MDEstimator(x=x, NormLocationScaleFamily())) - -## 3. k-step estimation: radius known -N1 <- NormLocationScaleFamily(mean=estimate(est0)["mean"], sd=estimate(est0)["sd"]) -N1.Rob <- InfRobModel(center = N1, neighbor = ContNeighborhood(radius = 0.5)) -IC1 <- optIC(model = N1.Rob, risk = asMSE()) -(est1 <- kStepEstimator(x, IC1, est0, steps = 3, withPIC = TRUE)) -estimate(est1) -ksteps(est1) -pICList(est1) -start(est1) - -## don't run to reduce check time on CRAN -## Not run: -##D ## a transformed model -##D tfct <- function(x){ -##D nms0 <- c("mean","sd") -##D nms <- "comb" -##D fval0 <- x[1]+2*x[2] -##D names(fval0) <- nms -##D mat0 <- matrix(c(1,2), nrow = 1, dimnames = list(nms,nms0)) -##D return(list(fval = fval0, mat = mat0)) -##D } -##D -##D N1.traf <- N1; trafo(N1.traf) <- tfct -##D N1R.traf <- N1.Rob; trafo(N1R.traf) <- tfct -##D IC1.traf <- optIC(model = N1R.traf, risk = asMSE()) -##D (est0.traf <- MDEstimator(x, N1.traf)) -##D (est1.traf <- kStepEstimator(x, IC1.traf, est0, steps = 3, -##D withIC = TRUE, withPIC = TRUE, withUpdateInKer = FALSE)) -##D (est1a.traf <- kStepEstimator(x, IC1.traf, est0, steps = 3, -##D withIC = TRUE, withPIC = TRUE, withUpdateInKer = TRUE)) -##D estimate(est1.traf) -##D ksteps(est1.traf) -##D pICList(est1.traf) -##D startval(est1.traf) -##D -##D untransformed.estimate(est1.traf) -##D uksteps(est1.traf) -##D ICList(est1.traf) -##D ustartval(est1.traf) -##D -##D estimate(est1a.traf) -##D ksteps(est1a.traf) -##D pICList(est1a.traf) -##D startval(est1a.traf) -##D -##D untransformed.estimate(est1a.traf) -##D uksteps(est1a.traf) -##D ICList(est1a.traf) -##D ustartval(est1a.traf) -## End(Not run) -} - - - -cleanEx() -nameEx("makeIC-methods") -### * makeIC-methods - -flush(stderr()); flush(stdout()) - -### Name: makeIC-methods -### Title: Generic Function for making ICs consistent at a possibly -### different model -### Aliases: makeIC makeIC-methods makeIC,IC,missing-method -### makeIC,IC,L2ParamFamily-method makeIC,list,L2ParamFamily-method -### makeIC,function,L2ParamFamily-method -### Keywords: robust - -### ** Examples - -## default IC -IC1 <- new("IC") - -## L2-differentiable parametric family -B <- BinomFamily(13, 0.3) - -## check IC properties -checkIC(IC1, B) - -## make IC -IC2 <- makeIC(IC1, B) - -## check IC properties -checkIC(IC2) - -## slot modifyIC is filled in case of IC2 -IC3 <- modifyIC(IC2)(BinomFamily(13, 0.2), IC2) -checkIC(IC3) -## identical to -checkIC(IC3, BinomFamily(13, 0.2)) - -IC4 <- makeIC(sin, B) -checkIC(IC4) - -(IC5 <- makeIC(list(function(x)x^3), B, name="a try")) -plot(IC5) -checkIC(IC5) - -## don't run to reduce check time on CRAN -## Not run: -##D N0 <- NormLocationScaleFamily() -##D IC6 <- makeIC(list(sin,cos),N0) -##D plot(IC6) -##D checkIC(IC6) -##D -##D getRiskIC(IC6,risk=trAsCov())$trAsCov$value -##D getRiskIC(IC6,risk=asBias(),neighbor=ContNeighborhood())$asBias$value -## End(Not run) - - - - -cleanEx() -nameEx("optIC") -### * optIC - -flush(stderr()); flush(stdout()) - -### Name: optIC -### Title: Generic function for the computation of optimally robust ICs -### Aliases: optIC optIC-methods optIC,L2ParamFamily,asCov-method -### Keywords: robust - -### ** Examples - -B <- BinomFamily(size = 25, prob = 0.25) - -## classical optimal IC -IC0 <- optIC(model = B, risk = asCov()) -plot(IC0) # plot IC -checkIC(IC0, B) - - - -cleanEx() -nameEx("outlyingPlotIC") -### * outlyingPlotIC - -flush(stderr()); flush(stdout()) - -### Name: outlyingPlotIC -### Title: Function outlyingPlotIC in Package 'RobAStBase' -### Aliases: outlyingPlotIC -### Keywords: hplot - -### ** Examples - -if(require(ROptEst)){ -## generates normal location and scale family with mean = -2 and sd = 3 -N0 <- NormLocationScaleFamily() -N0.IC0 <- optIC(model = N0, risk = asCov()) -N0.Rob1 <- InfRobModel(center = N0, neighbor = ContNeighborhood(radius = 0.5)) -N0.IC1 <- optIC(model = N0.Rob1, risk = asMSE()) -xn <- c(rnorm(100),rcauchy(20)+20) -outlyingPlotIC(xn, IC.x=N0.IC0) -outlyingPlotIC(xn, IC.x=N0.IC1) -} - - - -cleanEx() -nameEx("plot-methods") -### * plot-methods - -flush(stderr()); flush(stdout()) - -### Name: plot-methods -### Title: Methods for Function plot in Package 'RobAStBase' -### Aliases: plot plot-methods plot,IC,missing-method -### plot,IC,numeric-method -### Keywords: methods distribution - -### ** Examples - -IC1 <- new("IC") -plot(IC1) -plot(IC1, main = TRUE, panel.first= grid(), - col = "blue", cex.main = 2, cex.inner = 1) - -### selection of subpanels for plotting -N <- NormLocationScaleFamily(mean=0, sd=1) -IC2 <- optIC(model = N, risk = asCov()) -par(mfrow=c(1,1)) -plot(IC2, main = TRUE, panel.first= grid(), - col = "blue", cex.main = 2, cex.inner = 0.6, - mfColRow = FALSE, to.draw.arg=c("sd")) - -## xlim and ylim arguments -plot(IC2, main = TRUE, panel.first= grid(), - ylim=c(-3,3), xlim=c(-2,3)) -plot(IC2, main = TRUE, panel.first= grid(), - ylim=c(-3,3,-1,3), xlim=c(-2,3), - with.legend = TRUE) - -data <- r(N)(30) -plot(IC2, data, panel.first= grid(), - ylim = c(-3,3,-1,3), xlim=c(-2,3), - cex.pts = 3, pch.pts = 1:2, col.pts="green", - with.lab = TRUE, which.lbs = c(1:4,15:20), - which.Order = 1:6, return.Order = TRUE) - - - -graphics::par(get("par.postscript", pos = 'CheckExEnv')) -cleanEx() -nameEx("qqplot") -### * qqplot - -flush(stderr()); flush(stdout()) - -### Name: qqplot -### Title: Methods for Function qqplot in Package 'RobAStBase' -### Aliases: qqplot qqplot-methods qqplot,ANY,RobModel-method -### qqplot,ANY,InfRobModel-method qqplot,ANY,kStepEstimate-method -### Keywords: hplot distribution - -### ** Examples - -qqplot(r(Norm(15,sqrt(30)))(40), Chisq(df=15)) -RobM <- InfRobModel(center = NormLocationFamily(mean=13,sd=sqrt(28)), - neighbor = ContNeighborhood(radius = 0.4)) -x <- r(Norm(15,sqrt(30)))(20) -qqplot(x, RobM) -qqplot(x, RobM, alpha.CI=0.9) -## further examples for ANY,kStepEstimator-method -## in example to roptest() in package ROptEst - - - -cleanEx() -nameEx("samplesize-methods") -### * samplesize-methods - -flush(stderr()); flush(stdout()) - -### Name: samplesize-methods -### Title: Methods for Function samplesize in Package 'RobAStBase' -### Aliases: samplesize,interpolRisk-method samplesize -### samplesize<-,interpolRisk-method samplesize<- -### Keywords: classes - -### ** Examples - -myrisk <- MBRRisk(samplesize=100) -samplesize(myrisk) -samplesize(myrisk) <- 20 - - - -### *