[Robast-commits] r141 - in branches/robast-0.6/pkg/RobAStBase: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Aug 4 10:44:08 CEST 2008


Author: stamats
Date: 2008-08-04 10:44:08 +0200 (Mon, 04 Aug 2008)
New Revision: 141

Modified:
   branches/robast-0.6/pkg/RobAStBase/DESCRIPTION
   branches/robast-0.6/pkg/RobAStBase/R/AllClass.R
   branches/robast-0.6/pkg/RobAStBase/R/AllShow.R
   branches/robast-0.6/pkg/RobAStBase/R/kStepEstimator.R
   branches/robast-0.6/pkg/RobAStBase/R/locMEstimator.R
   branches/robast-0.6/pkg/RobAStBase/R/oneStepEstimator.R
   branches/robast-0.6/pkg/RobAStBase/man/ALEstimate-class.Rd
   branches/robast-0.6/pkg/RobAStBase/man/MEstimate-class.Rd
   branches/robast-0.6/pkg/RobAStBase/man/kStepEstimate-class.Rd
Log:
adaption to new implementation of class "Estimate"

Modified: branches/robast-0.6/pkg/RobAStBase/DESCRIPTION
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/DESCRIPTION	2008-08-03 04:02:37 UTC (rev 140)
+++ branches/robast-0.6/pkg/RobAStBase/DESCRIPTION	2008-08-04 08:44:08 UTC (rev 141)
@@ -1,9 +1,9 @@
 Package: RobAStBase
 Version: 0.1.0
-Date: 2008-07-30
+Date: 2008-08-04
 Title: Robust Asymptotic Statistics
 Description: Base S4-classes and functions for robust asymptotic statistics.
-Depends: R(>= 2.6.0), methods, distr(>= 2.0), distrEx(>= 2.0), distrMod(>= 2.0), RandVar(>= 0.6.2)
+Depends: R(>= 2.6.0), methods, distr(>= 2.0), distrEx(>= 2.0), distrMod(>= 2.0), RandVar(>= 0.6.3)
 Author: Matthias Kohl, Peter Ruckdeschel
 Maintainer: Matthias Kohl <Matthias.Kohl at stamats.de>
 LazyLoad: yes

Modified: branches/robast-0.6/pkg/RobAStBase/R/AllClass.R
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/R/AllClass.R	2008-08-03 04:02:37 UTC (rev 140)
+++ branches/robast-0.6/pkg/RobAStBase/R/AllClass.R	2008-08-04 08:44:08 UTC (rev 141)
@@ -217,36 +217,54 @@
          prototype(name = "Asymptotically linear estimate",
                    estimate = numeric(0),
                    samplesize = numeric(0),
+                   estimate.call = call("{}"),
                    asvar = NULL,
                    asbias = NULL,
                    pIC = NULL,
                    nuis.idx = NULL,
+                   trafo = list(fct = function(x){
+                                      list(fval = x, mat = matrix(0))}, 
+                                mat = matrix(1)), ### necessary for comparison with unit matrix
                    Infos = matrix(c(character(0),character(0)), ncol=2,
-                                  dimnames=list(character(0), c("method", "message")))),
+                                  dimnames=list(character(0), c("method", "message"))),
+                   untransformed.estimate = NULL,
+                   untransformed.asvar = NULL),
          contains = "Estimate")
 setClass("kStepEstimate", 
          representation(steps = "integer"),
-         prototype(name = "k-step estimate",
+         prototype(name = "Asymptotically linear estimate",
                    estimate = numeric(0),
                    samplesize = numeric(0),
+                   estimate.call = call("{}"),
+                   steps = integer(0),
                    asvar = NULL,
                    asbias = NULL,
                    pIC = NULL,
                    nuis.idx = NULL,
-                   steps = integer(0),
+                   trafo = list(fct = function(x){
+                                      list(fval = x, mat = matrix(0))}, 
+                                mat = matrix(1)), ### necessary for comparison with unit matrix
                    Infos = matrix(c(character(0),character(0)), ncol=2,
-                                  dimnames=list(character(0), c("method", "message")))),
+                                  dimnames=list(character(0), c("method", "message"))),
+                   untransformed.estimate = NULL,
+                   untransformed.asvar = NULL),
          contains = "ALEstimate")
 setClass("MEstimate", 
          representation(Mroot = "numeric"),
-         prototype(name = "M estimate",
+         prototype(name = "Asymptotically linear estimate",
                    estimate = numeric(0),
                    samplesize = numeric(0),
+                   estimate.call = call("{}"),
+                   Mroot = numeric(0),
                    asvar = NULL,
                    asbias = NULL,
                    pIC = NULL,
                    nuis.idx = NULL,
-                   Mroot = numeric(0),
+                   trafo = list(fct = function(x){
+                                      list(fval = x, mat = matrix(0))}, 
+                                mat = matrix(1)), ### necessary for comparison with unit matrix
                    Infos = matrix(c(character(0),character(0)), ncol=2,
-                                  dimnames=list(character(0), c("method", "message")))),
+                                  dimnames=list(character(0), c("method", "message"))),
+                   untransformed.estimate = NULL,
+                   untransformed.asvar = NULL),
          contains = "ALEstimate")

Modified: branches/robast-0.6/pkg/RobAStBase/R/AllShow.R
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/R/AllShow.R	2008-08-03 04:02:37 UTC (rev 140)
+++ branches/robast-0.6/pkg/RobAStBase/R/AllShow.R	2008-08-04 08:44:08 UTC (rev 141)
@@ -92,3 +92,34 @@
         cat("\n### Infos:\n")
         show(object at Infos)
     })
+setMethod("show", "ALEstimate", 
+    function(object){
+        digits <- getOption("digits")
+        show(as(object,"Estimate"))
+        if(getdistrModOption("show.details") != "minimal"){
+            cat("asymptotic bias:\n")
+            print(asbias(object), quote = FALSE)
+        }
+        if(getdistrModOption("show.details") == "maximal"){
+            cat("(partial) influence curve:\n")
+            print(pIC(object), quote = FALSE)
+        }
+    })
+setMethod("show", "kStepEstimate", 
+    function(object){
+        digits <- getOption("digits")
+        show(as(object,"ALEstimate"))
+        if(getdistrModOption("show.details") != "minimal"){
+            cat("steps:\n")
+            print(steps(object), quote = FALSE)
+        }
+    })
+setMethod("show", "MEstimate", 
+    function(object){
+        digits <- getOption("digits")
+        show(as(object,"ALEstimate"))
+        if(getdistrModOption("show.details") != "minimal"){
+            cat("value of M equation:\n")
+            print(Mroot(object), quote = FALSE)
+        }
+    })

Modified: branches/robast-0.6/pkg/RobAStBase/R/kStepEstimator.R
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/R/kStepEstimator.R	2008-08-03 04:02:37 UTC (rev 140)
+++ branches/robast-0.6/pkg/RobAStBase/R/kStepEstimator.R	2008-08-04 08:44:08 UTC (rev 141)
@@ -64,8 +64,7 @@
                     asBias <- NULL
                 }
             }
-            return(new("kStepEstimate", 
-                               estimate.call = es.call,
+            return(new("kStepEstimate", estimate.call = es.call,
                        name = paste(steps, "-step estimate", sep = ""),
                        estimate = res, samplesize = length(x), asvar = asVar,
                        asbias = asBias, pIC = IC, steps = 1L, Infos = Infos))
@@ -114,8 +113,7 @@
                     asBias <- NULL
                 }
             }
-            return(new("kStepEstimate", 
-                               estimate.call = es.call,
+            return(new("kStepEstimate", estimate.call = es.call,
                        name = paste(steps, "-step estimate", sep = ""),
                        estimate = res, samplesize = length(x), asvar = asVar,
                        asbias = asBias, pIC = IC, steps = steps, Infos = Infos))
@@ -126,6 +124,7 @@
                                       IC = "IC",
                                       start = "numeric"),
     function(x, IC, start, steps = 1, useLast = getRobAStBaseOption("kStepUseLast")){
+        es.call <- match.call()
         if(!is.integer(steps))
           steps <- as.integer(steps)
         if(steps < 1)
@@ -186,8 +185,7 @@
                     asBias <- NULL
                 }
             }
-            return(new("kStepEstimate", 
-                               estimate.call = es.call,
+            return(new("kStepEstimate", estimate.call = es.call,
                        name = paste(steps, "-step estimate", sep = ""),
                        estimate = res, samplesize = ncol(x), asvar = asVar,
                        asbias = asBias, pIC = IC, steps = 1L, Infos = Infos))
@@ -236,8 +234,7 @@
                     asBias <- NULL
                 }
             }
-            return(new("kStepEstimate", 
-                               estimate.call = es.call,
+            return(new("kStepEstimate", estimate.call = es.call,
                        name = paste(steps, "-step estimate", sep = ""),
                        estimate = res, samplesize = ncol(x), asvar = asVar,
                        asbias = asBias, pIC = IC, steps = steps, Infos = Infos))
@@ -247,6 +244,7 @@
                                       IC = "IC",
                                       start = "Estimate"),
     function(x, IC, start, steps = 1, useLast = getRobAStBaseOption("kStepUseLast")){
+        es.call <- match.call()
         if(!is.integer(steps))
           steps <- as.integer(steps)
         if(steps < 1)
@@ -306,8 +304,7 @@
                     asBias <- NULL
                 }
             }
-            return(new("kStepEstimate", 
-                               estimate.call = es.call,
+            return(new("kStepEstimate", estimate.call = es.call,
                        name = paste(steps, "-step estimate", sep = ""),
                        estimate = res, samplesize = length(x), asvar = asVar,
                        asbias = asBias, pIC = IC, steps = 1L, Infos = Infos))
@@ -356,8 +353,7 @@
                     asBias <- NULL
                 }
             }
-            return(new("kStepEstimate", 
-                               estimate.call = es.call,
+            return(new("kStepEstimate", estimate.call = es.call,
                        name = paste(steps, "-step estimate", sep = ""),
                        estimate = res, samplesize = length(x), asvar = asVar,
                        asbias = asBias, pIC = IC, steps = steps, Infos = Infos))
@@ -367,6 +363,7 @@
                                       IC = "IC",
                                       start = "Estimate"),
     function(x, IC, start, steps = 1, useLast = getRobAStBaseOption("kStepUseLast")){
+        es.call <- match.call()
         if(!is.integer(steps))
           steps <- as.integer(steps)
         if(steps < 1)
@@ -428,8 +425,7 @@
                     asBias <- NULL
                 }
             }
-            return(new("kStepEstimate", 
-                               estimate.call = es.call,
+            return(new("kStepEstimate", estimate.call = es.call,
                        name = paste(steps, "-step estimate", sep = ""),
                        estimate = res, samplesize = ncol(x), asvar = asVar,
                        asbias = asBias, pIC = IC, steps = 1L, Infos = Infos))
@@ -478,8 +474,7 @@
                     asBias <- NULL
                 }
             }
-            return(new("kStepEstimate", 
-                               estimate.call = es.call,
+            return(new("kStepEstimate", estimate.call = es.call,
                        name = paste(steps, "-step estimate", sep = ""),
                        estimate = res, samplesize = ncol(x), asvar = asVar,
                        asbias = asBias, pIC = IC, steps = steps, Infos = Infos))

Modified: branches/robast-0.6/pkg/RobAStBase/R/locMEstimator.R
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/R/locMEstimator.R	2008-08-03 04:02:37 UTC (rev 140)
+++ branches/robast-0.6/pkg/RobAStBase/R/locMEstimator.R	2008-08-04 08:44:08 UTC (rev 141)
@@ -3,7 +3,7 @@
 ###############################################################################
 setMethod("locMEstimator", signature(x = "numeric", IC = "InfluenceCurve"),
     function(x, IC, eps = .Machine$double.eps^0.5){
-    es.call <- match.call()
+        es.call <- match.call()
         if(numberOfMaps(IC at Curve) > 1)
             stop("number of Maps of 'IC' has to be 1")
 
@@ -27,7 +27,6 @@
             asvar <- NULL
         }
         new("MEstimate", name = "Location M estimate", estimate = res$root, 
-                               estimate.call = es.call,
-            pIC = IC, Mroot = res$f.root, Infos = Infos, samplesize = length(x),
-            asvar = asVar, asbias = asBias)
+            estimate.call = es.call, pIC = IC, Mroot = res$f.root, 
+            Infos = Infos, samplesize = length(x), asvar = asVar, asbias = asBias)
     })

Modified: branches/robast-0.6/pkg/RobAStBase/R/oneStepEstimator.R
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/R/oneStepEstimator.R	2008-08-03 04:02:37 UTC (rev 140)
+++ branches/robast-0.6/pkg/RobAStBase/R/oneStepEstimator.R	2008-08-04 08:44:08 UTC (rev 141)
@@ -5,7 +5,7 @@
                                         IC = "InfluenceCurve",
                                         start = "numeric"),
     function(x, IC, start, useLast = getRobAStBaseOption("kStepUseLast")){
-    es.call <- match.call()
+        es.call <- match.call()
         nrvalues <- dimension(IC at Curve)
         if(is.list(start)) start <- unlist(start)
         if(nrvalues != length(start))
@@ -66,14 +66,14 @@
         }
 
         new("kStepEstimate", name = "1-step estimate", estimate = res, 
-                               estimate.call = es.call,
-            samplesize = length(x), asvar = asVar, asbias = asBias, pIC = IC, 
-            steps = 1L, Infos = Infos)
+            estimate.call = es.call, samplesize = length(x), asvar = asVar, 
+            asbias = asBias, pIC = IC, steps = 1L, Infos = Infos)
     })
 setMethod("oneStepEstimator", signature(x = "matrix", 
                                         IC = "InfluenceCurve",
                                         start = "numeric"),
     function(x, IC, start, useLast = getRobAStBaseOption("kStepUseLast")){
+        es.call <- match.call()
         nrvalues <- dimension(IC at Curve)
         if(is.list(start)) start <- unlist(start)
         if(nrvalues != length(start))
@@ -136,14 +136,14 @@
         }
 
         new("kStepEstimate", name = "1-step estimate", estimate = res, 
-                               estimate.call = es.call,
-            samplesize = ncol(x), asvar = asVar, asbias = asBias, pIC = IC, steps = 1L, 
-            Infos = Infos)
+            estimate.call = es.call, samplesize = ncol(x), asvar = asVar, 
+            asbias = asBias, pIC = IC, steps = 1L, Infos = Infos)
     })
 setMethod("oneStepEstimator", signature(x = "numeric", 
                                         IC = "InfluenceCurve",
                                         start = "Estimate"),
     function(x, IC, start, useLast = getRobAStBaseOption("kStepUseLast")){
+        es.call <- match.call()
         nrvalues <- dimension(IC at Curve)
         start0 <- estimate(start)
         if(is.list(start0)) start0 <- unlist(start0)
@@ -205,14 +205,14 @@
         }
 
         new("kStepEstimate", name = "1-step estimate", estimate = res, 
-                               estimate.call = es.call,
-            samplesize = length(x), asvar = asVar, asbias = asBias, pIC = IC, steps = 1L, 
-            Infos = Infos)
+            estimate.call = es.call, samplesize = length(x), asvar = asVar, 
+            asbias = asBias, pIC = IC, steps = 1L, Infos = Infos)
     })
 setMethod("oneStepEstimator", signature(x = "matrix", 
                                         IC = "InfluenceCurve",
                                         start = "Estimate"),
     function(x, IC, start, useLast = getRobAStBaseOption("kStepUseLast")){
+        es.call <- match.call()
         nrvalues <- dimension(IC at Curve)
         start0 <- estimate(start)
         if(is.list(start0)) start0 <- unlist(start0)
@@ -276,7 +276,6 @@
         }
 
         new("kStepEstimate", name = "1-step estimate", estimate = res, 
-                               estimate.call = es.call,
-            samplesize = ncol(x), asvar = asVar, asbias = asBias, pIC = IC, steps = 1L, 
-            Infos = Infos)
+            estimate.call = es.call, samplesize = ncol(x), asvar = asVar, 
+            asbias = asBias, pIC = IC, steps = 1L, Infos = Infos)
     })

Modified: branches/robast-0.6/pkg/RobAStBase/man/ALEstimate-class.Rd
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/man/ALEstimate-class.Rd	2008-08-03 04:02:37 UTC (rev 140)
+++ branches/robast-0.6/pkg/RobAStBase/man/ALEstimate-class.Rd	2008-08-04 08:44:08 UTC (rev 141)
@@ -5,6 +5,7 @@
 \alias{pIC,ALEstimate-method}
 \alias{asbias}
 \alias{asbias,ALEstimate-method}
+\alias{show,ALEstimate-method}
 
 \title{ALEstimate-class.}
 \description{Class of asymptotically linear estimates.}
@@ -39,6 +40,8 @@
   \describe{
     \item{pIC}{\code{signature(object = "ALEstimate")}: 
       accessor function for slot \code{pIC}. }
+
+    \item{show}{\code{signature(object = "ALEstimate")} }
   }
 }
 %\references{}

Modified: branches/robast-0.6/pkg/RobAStBase/man/MEstimate-class.Rd
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/man/MEstimate-class.Rd	2008-08-03 04:02:37 UTC (rev 140)
+++ branches/robast-0.6/pkg/RobAStBase/man/MEstimate-class.Rd	2008-08-04 08:44:08 UTC (rev 141)
@@ -3,6 +3,7 @@
 \alias{MEstimate-class}
 \alias{Mroot}
 \alias{Mroot,MEstimate-method}
+\alias{show,MEstimate-method}
 
 \title{MEstimate-class.}
 \description{Class of asymptotically linear estimates.}
@@ -42,12 +43,17 @@
   \describe{
     \item{Mroot}{\code{signature(object = "MEstimate")}: 
       accessor function for slot \code{Mroot}. }
+
+    \item{show}{\code{signature(object = "MEstimate")} }
   }
 }
 %\references{}
 \author{Matthias Kohl \email{Matthias.Kohl at stamats.de}}
 %\note{}
 \seealso{\code{\link{ALEstimate-class}}}
-%\examples{}
+\examples{
+## prototype
+new("MEstimate")
+}
 \concept{estimate}
 \keyword{classes}

Modified: branches/robast-0.6/pkg/RobAStBase/man/kStepEstimate-class.Rd
===================================================================
--- branches/robast-0.6/pkg/RobAStBase/man/kStepEstimate-class.Rd	2008-08-03 04:02:37 UTC (rev 140)
+++ branches/robast-0.6/pkg/RobAStBase/man/kStepEstimate-class.Rd	2008-08-04 08:44:08 UTC (rev 141)
@@ -3,6 +3,7 @@
 \alias{kStepEstimate-class}
 \alias{steps}
 \alias{steps,kStepEstimate-method}
+\alias{show,kStepEstimate-method}
 
 \title{kStepEstimate-class.}
 \description{Class of asymptotically linear estimates.}
@@ -42,6 +43,8 @@
   \describe{
     \item{steps}{\code{signature(object = "kStepEstimate")}: 
       accessor function for slot \code{steps}. }
+
+    \item{show}{\code{signature(object = "kStepEstimate")} }
   }
 }
 %\references{}



More information about the Robast-commits mailing list