[Robast-commits] r498 - in branches/robast-0.9/pkg/RobAStBase: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Jul 2 19:09:36 CEST 2012


Author: ruckdeschel
Date: 2012-07-02 19:09:36 +0200 (Mon, 02 Jul 2012)
New Revision: 498

Modified:
   branches/robast-0.9/pkg/RobAStBase/NAMESPACE
   branches/robast-0.9/pkg/RobAStBase/R/AllClass.R
   branches/robast-0.9/pkg/RobAStBase/R/AllGeneric.R
   branches/robast-0.9/pkg/RobAStBase/R/interpolRisks.R
   branches/robast-0.9/pkg/RobAStBase/man/interpolRisk-class.Rd
Log:
RobAStBase: interpolRisks extended by slot samplesize

Modified: branches/robast-0.9/pkg/RobAStBase/NAMESPACE
===================================================================
--- branches/robast-0.9/pkg/RobAStBase/NAMESPACE	2012-07-01 21:39:06 UTC (rev 497)
+++ branches/robast-0.9/pkg/RobAStBase/NAMESPACE	2012-07-02 17:09:36 UTC (rev 498)
@@ -60,6 +60,7 @@
               "start", "startval", "ustartval")
 exportMethods("ddPlot", "qqplot")
 exportMethods("cutoff.quantile", "cutoff.quantile<-")
+exportMethods("samplesize<-", "samplesize")
 export("oneStepEstimator", "kStepEstimator")
 export("ContNeighborhood", "TotalVarNeighborhood") 
 export("FixRobModel", "InfRobModel") 

Modified: branches/robast-0.9/pkg/RobAStBase/R/AllClass.R
===================================================================
--- branches/robast-0.9/pkg/RobAStBase/R/AllClass.R	2012-07-01 21:39:06 UTC (rev 497)
+++ branches/robast-0.9/pkg/RobAStBase/R/AllClass.R	2012-07-02 17:09:36 UTC (rev 498)
@@ -317,7 +317,8 @@
 #################################################
 # new risk classes
 #################################################
-setClass("interpolRisk", contains = c("RiskType", "VIRTUAL"))
-setClass("OMSRRisk", contains = "interpolRisk")
-setClass("RMXRRisk", contains = "interpolRisk")
-setClass("MBRRisk", contains = "interpolRisk")
+setClass("interpolRisk", representation = representation(samplesize="numeric"),
+                         contains = c("RiskType", "VIRTUAL"))
+setClass("OMSRRisk", contains = "interpolRisk", prototype(samplesize=100))
+setClass("RMXRRisk", contains = "interpolRisk", prototype(samplesize=100))
+setClass("MBRRisk", contains = "interpolRisk", prototype(samplesize=100))

Modified: branches/robast-0.9/pkg/RobAStBase/R/AllGeneric.R
===================================================================
--- branches/robast-0.9/pkg/RobAStBase/R/AllGeneric.R	2012-07-01 21:39:06 UTC (rev 497)
+++ branches/robast-0.9/pkg/RobAStBase/R/AllGeneric.R	2012-07-02 17:09:36 UTC (rev 498)
@@ -214,3 +214,14 @@
     setGeneric("kStepEstimator.start",
                 function(start,...) standardGeneric("kStepEstimator.start"))
 }
+if(!isGeneric("radius")){
+    setGeneric("radius", function(object) standardGeneric("radius"))
+}
+if(!isGeneric("radius")){
+    setGeneric("radius", function(object) standardGeneric("radius"))
+}
+
+if(!isGeneric("samplesize<-")){
+    setGeneric("samplesize<-",
+        function(object, value, ...) standardGeneric("samplesize<-"))
+}

Modified: branches/robast-0.9/pkg/RobAStBase/R/interpolRisks.R
===================================================================
--- branches/robast-0.9/pkg/RobAStBase/R/interpolRisks.R	2012-07-01 21:39:06 UTC (rev 497)
+++ branches/robast-0.9/pkg/RobAStBase/R/interpolRisks.R	2012-07-02 17:09:36 UTC (rev 498)
@@ -1,4 +1,7 @@
 #### Generating functions for subclasses of interpolRisk
-OMSRRisk <- function() new("OMSRRisk",type=".OMSE")
-MBRRisk <- function()  new("MBRRisk",type=".MBRE")
-RMXRRisk <- function()  new("RMXRRisk",type=".RMXE")
\ No newline at end of file
+OMSRRisk <- function(samplesize = 100) new("OMSRRisk",type=".OMSE", samplesize = samplesize)
+MBRRisk <- function(samplesize = 100)  new("MBRRisk",type=".MBRE", samplesize = samplesize)
+RMXRRisk <- function(samplesize = 100)  new("RMXRRisk",type=".RMXE", samplesize = samplesize)
+setMethod("samplesize","interpolRisk", function(object)object at samplesize)
+setReplaceMethod("samplesize","interpolRisk", function(object, value){
+       object at samplesize <- value; object})
\ No newline at end of file

Modified: branches/robast-0.9/pkg/RobAStBase/man/interpolRisk-class.Rd
===================================================================
--- branches/robast-0.9/pkg/RobAStBase/man/interpolRisk-class.Rd	2012-07-01 21:39:06 UTC (rev 497)
+++ branches/robast-0.9/pkg/RobAStBase/man/interpolRisk-class.Rd	2012-07-02 17:09:36 UTC (rev 498)
@@ -7,7 +7,17 @@
 \alias{OMSRRisk}
 \alias{RMXRRisk}
 \alias{MBRRisk}
+\alias{samplesize}
+\alias{samplesize,interpolRisk-method}
+\alias{samplesize<-}
+\alias{samplesize<-,interpolRisk-method}
 
+\usage{
+MBRRisk(samplesize=100)
+OMSRRisk(samplesize=100)
+RMXRRisk(samplesize=100)
+}
+
 \title{Interpolated Risks}
 \description{Class of risks for which algorithms dispatch to speed-up algorithms}
 \section{Objects from the Class}{\code{interpolRisk} is a virtual class: No objects may be created from it.
@@ -28,6 +38,8 @@
 a radius r of \code{0.5}), \code{RMXRRisk} stands for optimal
 optimally RMX-robust estimation and \code{MBRRisk} stands for optimal
 Bias-robust estimation.
+All these risks have an additional slot samplesize, defaulting to \code{100},
+and for which there is a replacement and an accessor method.
 }
 %\references{}
 \author{Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}}
@@ -36,6 +48,9 @@
 OMSRRisk()
 RMXRRisk()
 MBRRisk()
+myrisk <- MBRRisk(samplesize=100)
+samplesize(myrisk)
+samplesize(myrisk) <- 20
 }
 
 %\note{}



More information about the Robast-commits mailing list