[Robast-commits] r413 - in branches/robast-0.8/pkg/ROptEst: . R inst/scripts man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Sep 2 22:32:21 CEST 2010


Author: ruckdeschel
Date: 2010-09-02 22:32:21 +0200 (Thu, 02 Sep 2010)
New Revision: 413

Added:
   branches/robast-0.8/pkg/ROptEst/R/asL1L4.R
   branches/robast-0.8/pkg/ROptEst/inst/scripts/NormalLocationModel.R
   branches/robast-0.8/pkg/ROptEst/man/asAnscombe-class.Rd
   branches/robast-0.8/pkg/ROptEst/man/asAnscombe.Rd
   branches/robast-0.8/pkg/ROptEst/man/asL1-class.Rd
   branches/robast-0.8/pkg/ROptEst/man/asL1.Rd
   branches/robast-0.8/pkg/ROptEst/man/asL4-class.Rd
   branches/robast-0.8/pkg/ROptEst/man/asL4.Rd
Modified:
   branches/robast-0.8/pkg/ROptEst/NAMESPACE
   branches/robast-0.8/pkg/ROptEst/R/AllClass.R
   branches/robast-0.8/pkg/ROptEst/R/getAsRisk.R
   branches/robast-0.8/pkg/ROptEst/R/getInfClip.R
   branches/robast-0.8/pkg/ROptEst/R/getInfRobIC_asAnscombe.R
   branches/robast-0.8/pkg/ROptEst/R/getInfRobIC_asBias.R
   branches/robast-0.8/pkg/ROptEst/inst/scripts/NormalScaleModel.R
   branches/robast-0.8/pkg/ROptEst/man/getAsRisk.Rd
   branches/robast-0.8/pkg/ROptEst/man/getInfClip.Rd
Log:
ROptEst: 
  + new risk asL1 asL4 (for asy. mean absolute error and asy mean power 4 error) 
    with generators etc
  + fixed some bug in Anscombe-risk for univariate L2deriv
  + committed some missing Rd files for Anscombe class
  + added demo script for Normal Location case

Modified: branches/robast-0.8/pkg/ROptEst/NAMESPACE
===================================================================
--- branches/robast-0.8/pkg/ROptEst/NAMESPACE	2010-08-29 10:27:58 UTC (rev 412)
+++ branches/robast-0.8/pkg/ROptEst/NAMESPACE	2010-09-02 20:32:21 UTC (rev 413)
@@ -4,7 +4,7 @@
 import("distrMod")
 import("RobAStBase")
 
-exportClasses("asAnscombe") 
+exportClasses("asAnscombe", "asL1", "asL4") 
 exportMethods("optIC", 
               "getInfRobIC", 
               "getFixRobIC",
@@ -27,5 +27,5 @@
               "getModifyIC",
               "cniperCont", "cniperPoint", "cniperPointPlot")
 exportMethods("updateNorm", "scaleUpdateIC", "eff")
-export("getL2normL2deriv","asAnscombe")
+export("getL2normL2deriv","asAnscombe", "asL1", "asL4")
 export("roptest","getLagrangeMultByOptim","getLagrangeMultByIter")

Modified: branches/robast-0.8/pkg/ROptEst/R/AllClass.R
===================================================================
--- branches/robast-0.8/pkg/ROptEst/R/AllClass.R	2010-08-29 10:27:58 UTC (rev 412)
+++ branches/robast-0.8/pkg/ROptEst/R/AllClass.R	2010-09-02 20:32:21 UTC (rev 413)
@@ -19,3 +19,10 @@
                 else TRUE
             })
 
+
+## asymptotic L4 error
+setClass("asL4", contains = "asGRisk",
+            prototype = prototype(type = "asymptotic mean power4 error"))
+## asymptotic L1 error
+setClass("asL1", contains = "asGRisk",
+            prototype = prototype(type = "asymptotic mean absolute error"))

Added: branches/robast-0.8/pkg/ROptEst/R/asL1L4.R
===================================================================
--- branches/robast-0.8/pkg/ROptEst/R/asL1L4.R	                        (rev 0)
+++ branches/robast-0.8/pkg/ROptEst/R/asL1L4.R	2010-09-02 20:32:21 UTC (rev 413)
@@ -0,0 +1,11 @@
+## generating function
+
+asL4 <- 
+## The function is currently defined as
+function(biastype = symmetricBias(), normtype = NormType()){ 
+         new("asL4", biastype = biastype, normtype = normtype) }
+
+asL1 <- 
+## The function is currently defined as
+function(biastype = symmetricBias(), normtype = NormType()){ 
+         new("asL1", biastype = biastype, normtype = normtype) }

Modified: branches/robast-0.8/pkg/ROptEst/R/getAsRisk.R
===================================================================
--- branches/robast-0.8/pkg/ROptEst/R/getAsRisk.R	2010-08-29 10:27:58 UTC (rev 412)
+++ branches/robast-0.8/pkg/ROptEst/R/getAsRisk.R	2010-09-02 20:32:21 UTC (rev 413)
@@ -206,6 +206,7 @@
 
         return(list(trAsCov = sum(diag(std%*%as.matrix(Cov)))))
     })
+
 setMethod("getAsRisk", signature(risk = "trAsCov",
                                  L2deriv = "RealRandVariable",
                                  neighbor = "ContNeighborhood", 
@@ -221,7 +222,6 @@
 
         p <- nrow(stand)
         std <- if(is(normtype,"QFNorm")) QuadForm(normtype) else diag(p)
-        print(std)
         
         return(list(trAsCov = sum(diag(std%*%Cov))))
     })
@@ -351,3 +351,44 @@
             semvar <- (v+r^2*b^2)*pnorm(sv)+ r*b*sqrt(v)*dnorm(sv)
         return(list(asSemivar = semvar))
     })
+
+###############################################################################
+## asymptotic L1 risk
+###############################################################################           
+setMethod("getAsRisk", signature(risk = "asL1",
+                                 L2deriv = "UnivariateDistribution",
+                                 neighbor = "Neighborhood", 
+                                 biastype = "ANY"),
+    function(risk, L2deriv, neighbor, biastype, normtype = NULL, clip = NULL, cent = NULL, stand, trafo, ...){
+        if(!is.finite(neighbor at radius))
+            L1 <- Inf
+        else{
+             s <- getInfV(L2deriv, neighbor, biastype, clip, cent, stand)
+             r <- neighbor at radius
+             b <- clip
+             w <- r*b/s^.5
+             pp <- 2*pnorm(w)-1
+             dp <- 2*dnorm(w)
+             L1 <- b*pp+s*dp
+        }
+        return(list(asL1 = L1))
+    })
+
+###############################################################################
+## asymptotic L4 risk
+###############################################################################           
+setMethod("getAsRisk", signature(risk = "asL4",
+                                 L2deriv = "UnivariateDistribution",
+                                 neighbor = "Neighborhood", 
+                                 biastype = "ANY"),
+    function(risk, L2deriv, neighbor, biastype, normtype = NULL, clip = NULL, cent = NULL, stand, trafo, ...){
+        if(!is.finite(neighbor at radius))
+            L4 <- Inf
+        else{
+              s <- getInfV(L2deriv, neighbor, biastype, clip, cent, stand)
+              r <- neighbor at radius
+              b <- clip
+              L4 <- 3*s^2+6*s*b^2+b^4
+        }
+        return(list(asL4 = L4))
+    })

Modified: branches/robast-0.8/pkg/ROptEst/R/getInfClip.R
===================================================================
--- branches/robast-0.8/pkg/ROptEst/R/getInfClip.R	2010-08-29 10:27:58 UTC (rev 412)
+++ branches/robast-0.8/pkg/ROptEst/R/getInfClip.R	2010-09-02 20:32:21 UTC (rev 413)
@@ -1,6 +1,7 @@
 ###############################################################################
 ## optimal clipping bound for asymptotic MSE
 ###############################################################################
+
 setMethod("getInfClip", signature(clip = "numeric", 
                                   L2deriv = "UnivariateDistribution",
                                   risk = "asMSE", 
@@ -11,6 +12,7 @@
                getInfGamma(L2deriv = L2deriv, risk = risk, 
                            neighbor = neighbor, biastype = biastype, cent = cent, clip = clip))
     })
+
 setMethod("getInfClip", signature(clip = "numeric", 
                                   L2deriv = "UnivariateDistribution",
                                   risk = "asMSE", 
@@ -27,6 +29,7 @@
                                neighbor = neighbor, biastype = biastype, cent = cent, clip = clip))
         }
     })
+
 setMethod("getInfClip", signature(clip = "numeric", 
                                   L2deriv = "EuclRandVariable",
                                   risk = "asMSE", 
@@ -40,6 +43,92 @@
     })
 
 ###############################################################################
+## optimal clipping bound for asymptotic L1risk
+###############################################################################
+
+setMethod("getInfClip", signature(clip = "numeric", 
+                                  L2deriv = "UnivariateDistribution",
+                                  risk = "asL1", 
+                                  neighbor = "ContNeighborhood"),
+    function(clip, L2deriv, risk, neighbor, biastype, 
+             cent, symm, trafo){
+        s <- getInfV(L2deriv, neighbor, biastype, clip, cent, stand=1)
+        r <- neighbor at radius
+        w <- r * clip / s^.5
+        dp <- 2*dnorm(w)
+        pp <- 2*pnorm(w)-1
+        return(s^.5*r*pp/dp + 
+               getInfGamma(L2deriv = L2deriv, risk = risk, 
+                           neighbor = neighbor, biastype = biastype, cent = cent, clip = clip))
+    })
+
+setMethod("getInfClip", signature(clip = "numeric", 
+                                  L2deriv = "UnivariateDistribution",
+                                  risk = "asL1", 
+                                  neighbor = "TotalVarNeighborhood"),
+    function(clip, L2deriv, risk, neighbor, biastype, 
+             cent, symm, trafo){
+        s <- getInfV(L2deriv, neighbor, biastype, clip, cent, stand=1)
+        r <- neighbor at radius
+        w <- r * clip / s^.5
+        dp <- 2*dnorm(w)
+        pp <- 2*pnorm(w)-1
+        lhs <- s^.5*r*pp/dp
+        if(symm){
+            return(lhs + 
+                   getInfGamma(L2deriv = sign(as.vector(trafo))*L2deriv, risk = risk, 
+                               neighbor = neighbor, biastype = biastype, cent = -clip/2, clip = clip))
+        }else{
+            return(lhs + 
+                   getInfGamma(L2deriv = sign(as.vector(trafo))*L2deriv, risk = risk, 
+                               neighbor = neighbor, biastype = biastype, cent = cent, clip = clip))
+        }
+    })
+
+
+###############################################################################
+## optimal clipping bound for asymptotic L4 risk
+###############################################################################
+
+setMethod("getInfClip", signature(clip = "numeric", 
+                                  L2deriv = "UnivariateDistribution",
+                                  risk = "asL4", 
+                                  neighbor = "ContNeighborhood"),
+    function(clip, L2deriv, risk, neighbor, biastype, 
+             cent, symm, trafo){
+        s <- getInfV(L2deriv, neighbor, biastype, clip, cent, stand=1)
+        r <- neighbor at radius
+        mse <- r^2 *clip^2 + s
+        mse4 <- (r^2 *clip^2/3 + s)/mse
+        return(r^2*clip*mse4 + 
+               getInfGamma(L2deriv = L2deriv, risk = risk, 
+                           neighbor = neighbor, biastype = biastype, cent = cent, clip = clip))
+    })
+
+setMethod("getInfClip", signature(clip = "numeric", 
+                                  L2deriv = "UnivariateDistribution",
+                                  risk = "asL4", 
+                                  neighbor = "TotalVarNeighborhood"),
+    function(clip, L2deriv, risk, neighbor, biastype, 
+             cent, symm, trafo){
+        s <- getInfV(L2deriv, neighbor, biastype, clip, cent, stand=1)
+        r <- neighbor at radius
+        mse <- r^2 *clip^2 + s
+        mse4 <- r^2 *clip^2/3 + s
+        if(symm){
+            return(r^2*clip*mse4 + 
+                   getInfGamma(L2deriv = sign(as.vector(trafo))*L2deriv, risk = risk, 
+                               neighbor = neighbor, biastype = biastype, cent = -clip/2, clip = clip))
+        }else{
+            return(r^2*clip*mse4 + 
+                   getInfGamma(L2deriv = sign(as.vector(trafo))*L2deriv, risk = risk, 
+                               neighbor = neighbor, biastype = biastype, cent = cent, clip = clip))
+        }
+    })
+
+
+
+###############################################################################
 ## optimal clipping bound for asymptotic under-/overshoot risk
 ###############################################################################
 setMethod("getInfClip", signature(clip = "numeric", 

Modified: branches/robast-0.8/pkg/ROptEst/R/getInfRobIC_asAnscombe.R
===================================================================
--- branches/robast-0.8/pkg/ROptEst/R/getInfRobIC_asAnscombe.R	2010-08-29 10:27:58 UTC (rev 412)
+++ branches/robast-0.8/pkg/ROptEst/R/getInfRobIC_asAnscombe.R	2010-09-02 20:32:21 UTC (rev 413)
@@ -25,21 +25,6 @@
         FI <- sum(diag(std%*%FI0))
                 
         
-        if(is.null(upper))
-           upper <- q(L2deriv)(eff^.5)*3
-        e.up <- 0
-        while(e.up < eff){
-             risk.b <- asHampel(bound = upper, biastype = biastype(risk), 
-                             normtype = normtype(risk))
-             upBerg <- getInfRobIC(L2deriv, risk.b, neighbor, symm, Finfo, trafo, 
-                                   upper = upper, lower = lower, maxiter = maxi, 
-                                   tol = toli, warn, noLow = noLow,
-                                   verbose = FALSE, checkBounds = FALSE) 
-             trV <- upBerg$risk$trAsCov$value
-             e.up <- FI/trV
-             upper <- upper * 3
-           } 
-        upper <- upper / 3
         
         lowBerg <- minmaxBias(L2deriv = L2deriv, neighbor = neighbor,
                    biastype = biastype(risk), symm = symm, 
@@ -49,7 +34,7 @@
         trV <- sum(diag(std%*%V))
         
         
-        if(1/(Vbmin*Finfo)>eff){
+        if(FI/trV >eff){
            lowBerg$eff <- FI/trV
            return(lowBerg)
         }
@@ -58,27 +43,46 @@
         erg <- 0
         if(is.null(lower) || lower < lowBerg$risk$asBias$value) 
            { lower <- lowBerg$risk$asBias$value
-             f.low <- 1/(Vbmin*Finfo)-eff
+             f.low <- FI/trV-eff
            } else f.low <- NULL        
         
+        if(is.null(upper))
+           upper <- max(4*lower,q(L2deriv)(eff^.5)*3)
+  
+        e.up <- 0
+        while(e.up < eff){
+             risk.b <- asHampel(bound = upper, biastype = biastype(risk), 
+                             normtype = normtype(risk))
+             upBerg <- getInfRobIC(L2deriv, risk.b, neighbor, symm, Finfo, trafo, 
+                                   upper = 3*upper, lower = lower, maxiter = maxi, 
+                                   tol = toli, warn, noLow = noLow,
+                                   verbose = FALSE, checkBounds = FALSE) 
+             trV <- upBerg$risk$trAsCov$value
+             e.up <- FI/trV
+             upper <- upper * 3
+           } 
+        upper <- upper / 3
+  
+
         funb <- function(b0){
           risk.b <- asHampel(bound = b0, biastype = biastype(risk), 
                            normtype = normtype(risk))
           it.erg <<- it.erg + 1
           maxi <- min(5,maxiter%/%4^(1/it.erg))
           toli <- min(tol*100^(1/it.erg),1e-3)
+          checkBounds <- checkBounds & it.erg>10
           erg <<- getInfRobIC(L2deriv, risk.b, neighbor, symm, Finfo, trafo, 
              upper = upper, lower = lower, maxiter = maxi, tol = toli, warn, noLow = noLow,
              verbose = verbose, checkBounds = checkBounds)
           trV <- erg$risk$trAsCov$value
           if(verbose) cat("Outer iteration:", it.erg,"  b_0=", round(b0,3), 
-                          " eff=", round(1/(v0*Finfo),3), "\n")  
-          return(1/(v0*Finfo)-eff)
+                          " eff=", round(FI/trV,3), "\n")  
+          return(FI/trV-eff)
           }
 
         if(is.null(f.low)) f.low  <- fun(lower)  
 
-        print(c(lower,upper, f.lower=f.low, f.upper=e.up-eff))
+        if(verbose) print(c(lower,upper, f.lower=f.low, f.upper=e.up-eff))
         
         b <- uniroot(funb, interval=c(lower,upper), f.lower=f.low, 
                      f.upper=e.up-eff,tol=tol,maxiter=maxiter)

Modified: branches/robast-0.8/pkg/ROptEst/R/getInfRobIC_asBias.R
===================================================================
--- branches/robast-0.8/pkg/ROptEst/R/getInfRobIC_asBias.R	2010-08-29 10:27:58 UTC (rev 412)
+++ branches/robast-0.8/pkg/ROptEst/R/getInfRobIC_asBias.R	2010-09-02 20:32:21 UTC (rev 413)
@@ -144,7 +144,6 @@
         clip(w) <- b
         weight(w) <- minbiasweight(w, neighbor = neighbor, biastype = biastype,
                        normW = NormType())
-
         return(list(A = A, a = zi*z, b = b, d = d, risk = Risk, info = info, 
                     w = w, biastype = biastype, normtype = NormType()))
     })

Added: branches/robast-0.8/pkg/ROptEst/inst/scripts/NormalLocationModel.R
===================================================================
--- branches/robast-0.8/pkg/ROptEst/inst/scripts/NormalLocationModel.R	                        (rev 0)
+++ branches/robast-0.8/pkg/ROptEst/inst/scripts/NormalLocationModel.R	2010-09-02 20:32:21 UTC (rev 413)
@@ -0,0 +1,149 @@
+###############################################################################
+## Example: Normal Location
+###############################################################################
+require(ROptEst)
+options("newDevice"=TRUE)
+
+## generates Normal Location Family with scale = 3
+N0 <- NormLocationFamily(mean=2, sd=3)
+N0        # show G0
+plot(N0)  # plot of Norm(mean = 2, sd = 3) and L_2 derivative
+checkL2deriv(N0)
+
+## classical optimal IC
+N0.IC0 <- optIC(model = N0, risk = asCov())
+N0.IC0       # show IC
+plot(N0.IC0) # plot IC
+checkIC(N0.IC0)
+Risks(N0.IC0)
+
+## L_2 family + infinitesimal neighborhood
+N0.Rob1 <- InfRobModel(center = N0, neighbor = ContNeighborhood(radius = 0.5))
+N0.Rob1     # show N0.Rob1
+N0.Rob2 <- InfRobModel(center = N0, neighbor = TotalVarNeighborhood(radius = 0.5))
+
+## OBRE solution (ARE 95%)
+
+system.time(N0.ICA <- optIC(model = N0.Rob1, risk = asAnscombe(.95),upper=NULL,lower=NULL, verbose=TRUE))
+checkIC(N0.ICA)
+Risks(N0.ICA)
+plot(N0.ICA)
+
+system.time(N0.ICA2 <- optIC(model = N0.Rob2, risk = asAnscombe(.95),upper=NULL,lower=NULL, verbose=TRUE))
+checkIC(N0.ICA2)
+Risks(N0.ICA2)
+plot(N0.ICA2)
+
+
+## MSE solution
+(N0.IC1 <- optIC(model=N0.Rob1, risk=asMSE()))
+checkIC(N0.IC1)
+Risks(N0.IC1)
+plot(N0.IC1)
+
+(N0.IC2 <- optIC(model=N0.Rob2, risk=asMSE()))
+checkIC(N0.IC2)
+Risks(N0.IC2)
+plot(N0.IC2)
+
+## L1 solution
+
+(N0.IC1.L1 <- optIC(model=N0.Rob1, risk=asL1()))
+checkIC(N0.IC1.L1)
+Risks(N0.IC1.L1)
+plot(N0.IC1.L1)
+
+(N0.IC2.L1 <- optIC(model=N0.Rob2, risk=asL1()))
+checkIC(N0.IC2.L1)
+Risks(N0.IC2.L1)
+plot(N0.IC2.L1)
+
+## L4 solution
+
+(N0.IC1.L4 <- optIC(model=N0.Rob1, risk=asL4()))
+checkIC(N0.IC1.L4)
+Risks(N0.IC1.L4)
+plot(N0.IC1.L4)
+
+(N0.IC2.L4 <- optIC(model=N0.Rob2, risk=asL4()))
+checkIC(N0.IC2.L4)
+Risks(N0.IC2.L4)
+plot(N0.IC2.L4)
+
+## semivar-solution
+
+(N0.IC1.SemiV.p <- optIC(model=N0.Rob1, risk=asSemivar(sign=1)))
+checkIC(N0.IC1.SemiV.p)
+Risks(N0.IC1.SemiV.p)
+plot(N0.IC1.SemiV.p)
+
+(N0.IC1.SemiV.m <- optIC(model=N0.Rob1, risk=asSemivar(sign=-1)))
+checkIC(N0.IC1.SemiV.m)
+Risks(N0.IC1.SemiV.m)
+plot(N0.IC1.SemiV.m)
+
+## lower case solutions
+(N0.IC3 <- optIC(model=N0.Rob1, risk=asBias()))
+checkIC(N0.IC3)
+Risks(N0.IC3)
+plot(N0.IC3)
+(N0.IC4 <- optIC(model=N0.Rob2, risk=asBias()))
+checkIC(N0.IC4)
+Risks(N0.IC4)
+plot(N0.IC4)
+
+## Hampel solution
+(N0.IC5 <- optIC(model=N0.Rob1, risk=asHampel(bound=clip(N0.IC1))))
+checkIC(N0.IC5)
+Risks(N0.IC5)
+plot(N0.IC5)
+(N0.IC6 <- optIC(model=N0.Rob2, risk=asHampel(bound=Risks(N0.IC2)$asBias$value), maxiter = 200))
+checkIC(N0.IC6)
+Risks(N0.IC6)
+plot(N0.IC6)
+
+## radius minimax IC
+(N0.IC7 <- radiusMinimaxIC(L2Fam=N0, neighbor=ContNeighborhood(),
+                risk=asMSE(), loRad=0, upRad=Inf))
+checkIC(N0.IC7)
+Risks(N0.IC7)
+plot(N0.IC7)
+(N0.IC8 <- radiusMinimaxIC(L2Fam=N0, neighbor=TotalVarNeighborhood(),
+                risk=asMSE(), loRad=0, upRad=Inf))
+checkIC(N0.IC8)
+Risks(N0.IC8)
+plot(N0.IC8)
+
+## least favorable radius
+## (may take quite some time!)
+(N0.r.rho1 <- leastFavorableRadius(L2Fam=N0, neighbor=ContNeighborhood(),
+                    risk=asMSE(), rho=0.5))
+(N0.r.rho2 <- leastFavorableRadius(L2Fam=N0, neighbor=TotalVarNeighborhood(),
+                    risk=asMSE(), rho=1/3))
+
+
+## For estimation use function roptest
+ind <- rbinom(1e2, size=1, prob=0.05)
+x <- rnorm(1e2, mean=1, sd = (1-ind)+ind*9)
+
+## 1-step: contamination known
+est1 <- roptest(x, eps = 0.05, L2Fam = NormLocationFamily(mean = 1))
+est1v <- roptest(x, eps = 0.025, L2Fam = NormLocationFamily(mean = 1),
+                 neighbor = TotalVarNeighborhood())
+
+## k-step: contamination known
+est2 <- roptest(x, eps = 0.05, L2Fam = NormLocationFamily(mean = 1), steps = 3)
+est2v <- roptest(x, eps = 0.025, L2Fam = NormLocationFamily(mean = 1),
+                 neighbor = TotalVarNeighborhood(), steps = 3)
+
+## comparison
+estimate(est1)
+estimate(est2)
+estimate(est1v)
+estimate(est2v)
+
+## confidence intervals
+confint(est1, symmetricBias())
+confint(est2, symmetricBias())
+confint(est1v, symmetricBias())
+confint(est2v, symmetricBias())

Modified: branches/robast-0.8/pkg/ROptEst/inst/scripts/NormalScaleModel.R
===================================================================
--- branches/robast-0.8/pkg/ROptEst/inst/scripts/NormalScaleModel.R	2010-08-29 10:27:58 UTC (rev 412)
+++ branches/robast-0.8/pkg/ROptEst/inst/scripts/NormalScaleModel.R	2010-09-02 20:32:21 UTC (rev 413)
@@ -46,8 +46,42 @@
 Risks(N0.IC2)
 plot(N0.IC2)
 
+## L1 solution
 
+(N0.IC1.L1 <- optIC(model=N0.Rob1, risk=asL1()))
+checkIC(N0.IC1.L1)
+Risks(N0.IC1.L1)
+plot(N0.IC1.L1)
 
+(N0.IC2.L1 <- optIC(model=N0.Rob2, risk=asL1()))
+checkIC(N0.IC2.L1)
+Risks(N0.IC2.L1)
+plot(N0.IC2.L1)
+
+## L4 solution
+
+(N0.IC1.L4 <- optIC(model=N0.Rob1, risk=asL4()))
+checkIC(N0.IC1.L4)
+Risks(N0.IC1.L4)
+plot(N0.IC1.L4)
+
+(N0.IC2.L4 <- optIC(model=N0.Rob2, risk=asL4()))
+checkIC(N0.IC2.L4)
+Risks(N0.IC2.L4)
+plot(N0.IC2.L4)
+
+## semivar-solution
+
+(N0.IC1.SemiV.p <- optIC(model=N0.Rob1, risk=asSemivar(sign=1)))
+checkIC(N0.IC1.SemiV.p)
+Risks(N0.IC1.SemiV.p)
+plot(N0.IC1.SemiV.p)
+
+(N0.IC1.SemiV.m <- optIC(model=N0.Rob1, risk=asSemivar(sign=-1)))
+checkIC(N0.IC1.SemiV.m)
+Risks(N0.IC1.SemiV.m)
+plot(N0.IC1.SemiV.m)
+
 ## lower case solutions
 (N0.IC3 <- optIC(model=N0.Rob1, risk=asBias()))
 checkIC(N0.IC3)

Added: branches/robast-0.8/pkg/ROptEst/man/asAnscombe-class.Rd
===================================================================
--- branches/robast-0.8/pkg/ROptEst/man/asAnscombe-class.Rd	                        (rev 0)
+++ branches/robast-0.8/pkg/ROptEst/man/asAnscombe-class.Rd	2010-09-02 20:32:21 UTC (rev 413)
@@ -0,0 +1,55 @@
+\name{asAnscombe-class}
+\docType{class}
+\alias{asAnscombe-class}
+\alias{eff}
+\alias{eff,asAnscombe-method}
+\alias{show,asAnscombe-method}
+
+\title{Asymptotic Anscombe risk}
+\description{Class of asymptotic Anscombe risk which is
+  the ARE (asymptotic relative efficiency) in the ideal model
+  obtained by an optimal bias robust IC . }
+\section{Objects from the Class}{
+  Objects can be created by calls of the form \code{new("asAnscombe", ...)}.
+  More frequently they are created via the generating function 
+  \code{asAnscombe}. 
+}
+\section{Slots}{
+  \describe{
+    \item{\code{type}}{Object of class \code{"character"}: 
+      \dQuote{optimal bias robust IC (OBRI) for given ARE (asymptotic relative efficiency)}. }
+    \item{\code{eff}}{Object of class \code{"numeric"}: 
+      given ARE (asymptotic relative efficiency) to be attained in the ideal model. }
+    \item{\code{biastype}}{Object of class \code{"BiasType"}: 
+      symmetric, one-sided or asymmetric }
+  }
+}
+\section{Extends}{
+Class \code{"asRiskwithBias"}, directly.\cr
+Class \code{"asRisk"}, by class \code{"asRiskwithBias"}.
+Class \code{"RiskType"}, by class \code{"asRisk"}.
+}
+\section{Methods}{
+  \describe{
+    \item{eff}{\code{signature(object = "asAnscombe")}: 
+      accessor function for slot \code{eff}. }
+    \item{show}{\code{signature(object = "asAnscombe")}}
+  }
+}
+\references{Hampel et al. (1986) \emph{Robust Statistics}. 
+  The Approach Based on Influence Functions. New York: Wiley.
+  
+  Rieder, H. (1994) \emph{Robust Asymptotic Statistics}. New York: Springer.
+
+  Kohl, M. (2005) \emph{Numerical Contributions to the Asymptotic Theory of Robustness}. 
+  Bayreuth: Dissertation.
+}
+\author{Peter Ruckdeschel \email{peter.ruckdeschel at fraunhofer.itwm.de}}
+%\note{}
+\seealso{\code{\link{asRisk-class}}, \code{\link{asAnscombe}}}
+\examples{
+new("asAnscombe")
+}
+\concept{Hampel risk}
+\concept{risk}
+\keyword{classes}

Added: branches/robast-0.8/pkg/ROptEst/man/asAnscombe.Rd
===================================================================
--- branches/robast-0.8/pkg/ROptEst/man/asAnscombe.Rd	                        (rev 0)
+++ branches/robast-0.8/pkg/ROptEst/man/asAnscombe.Rd	2010-09-02 20:32:21 UTC (rev 413)
@@ -0,0 +1,37 @@
+\name{asAnscombe}
+\alias{asAnscombe}
+
+\title{Generating function for asAnscombe-class}
+\description{
+  Generates an object of class \code{"asAnscombe"}.
+}
+\usage{asAnscombe(eff = .95, biastype = symmetricBias(), normtype = NormType())}
+\arguments{
+  \item{eff}{ value in (0,1]: ARE in the ideal model }
+  \item{biastype}{ a bias type of class \code{BiasType}}
+  \item{normtype}{ a norm type of class \code{NormType}}
+}
+%\details{}
+\value{Object of class \code{asAnscombe}}
+\references{
+  Hampel et al. (1986) \emph{Robust Statistics}. 
+  The Approach Based on Influence Functions. New York: Wiley.
+  
+  Rieder, H. (1994) \emph{Robust Asymptotic Statistics}. New York: Springer.
+
+  Kohl, M. (2005) \emph{Numerical Contributions to the Asymptotic Theory of Robustness}. 
+  Bayreuth: Dissertation.
+}
+\author{Peter Ruckdeschel \email{peter.ruckdeschel at fraunhofer.itwm.de}}
+%\note{}
+\seealso{\code{\link{asAnscombe-class}}}
+\examples{
+asAnscombe()
+
+## The function is currently defined as
+function(eff = .95, biastype = symmetricBias(), normtype = NormType()){ 
+    new("asAnscombe", eff = eff, biastype = biastype, normtype = normtype) }
+}
+\concept{Hampel risk}
+\concept{risk}
+\keyword{robust}

Added: branches/robast-0.8/pkg/ROptEst/man/asL1-class.Rd
===================================================================
--- branches/robast-0.8/pkg/ROptEst/man/asL1-class.Rd	                        (rev 0)
+++ branches/robast-0.8/pkg/ROptEst/man/asL1-class.Rd	2010-09-02 20:32:21 UTC (rev 413)
@@ -0,0 +1,43 @@
+\name{asL1-class}
+\docType{class}
+\alias{asL1-class}
+
+\title{Asymptotic mean absolute error}
+\description{Class of asymptotic mean absolute error.}
+\section{Objects from the Class}{
+  Objects can be created by calls of the form \code{new("asL1", ...)}.
+  More frequently they are created via the generating function 
+  \code{asL1}.   
+}
+\section{Slots}{
+  \describe{
+    \item{\code{type}}{Object of class \code{"character"}: 
+      \dQuote{asymptotic mean square error}. }
+    \item{\code{biastype}}{Object of class \code{"BiasType"}: 
+      symmetric, one-sided or asymmetric }
+    \item{\code{normtype}}{Object of class \code{"NormType"}: 
+      norm in which a multivariate parameter is considered}
+  }
+}
+\section{Extends}{
+Class \code{"asGRisk"}, directly.\cr
+Class \code{"asRiskwithBias"}, by class \code{"asGRisk"}.\cr
+Class \code{"asRisk"}, by class \code{"asRiskwithBias"}.\cr
+Class \code{"RiskType"}, by class \code{"asGRisk"}.
+}
+\section{Methods}{
+No methods defined with class "asL1" in the signature.
+}
+\references{
+  Ruckdeschel, P. and Rieder, H. (2004) Optimal Influence Curves for
+  General Loss Functions. Statistics & Decisions \emph{22}, 201-223.
+}
+\author{Peter Ruckdeschel \email{peter.ruckdeschel at itwm.fraunhofer.de}}
+%\note{}
+\seealso{\code{\link{asGRisk-class}}, \code{\link{asMSE}}, \code{\link{asMSE-class}}, \code{\link{asL4-class}}, \code{\link{asL1}}}
+\examples{
+new("asMSE")
+}
+\concept{mean absolute error risk}
+\concept{risk}
+\keyword{classes}

Added: branches/robast-0.8/pkg/ROptEst/man/asL1.Rd
===================================================================
--- branches/robast-0.8/pkg/ROptEst/man/asL1.Rd	                        (rev 0)
+++ branches/robast-0.8/pkg/ROptEst/man/asL1.Rd	2010-09-02 20:32:21 UTC (rev 413)
@@ -0,0 +1,32 @@
+\name{asL1}
+\alias{asL1}
+
+\title{Generating function for asMSE-class}
+\description{
+  Generates an object of class \code{"asMSE"}.
+}
+\usage{asL1(biastype = symmetricBias(), normtype = NormType())}
+\arguments{
+  \item{biastype}{a bias type of class \code{BiasType}}
+  \item{normtype}{ a norm type of class \code{NormType}}
+}
+
+%\details{}
+\value{Object of class \code{"asMSE"}}
+\references{ 
+  Ruckdeschel, P. and Rieder, H. (2004) Optimal Influence Curves for
+  General Loss Functions. Statistics & Decisions \emph{22}, 201-223.
+}
+\author{Peter Ruckdeschel \email{peter.ruckdeschel at itwm.fraunhofer.de}}
+%\note{}
+\seealso{\code{\link{asL1-class}}, \code{\link{asMSE}}, \code{\link{asL4}}}
+\examples{
+asL1()
+
+## The function is currently defined as
+function(biastype = symmetricBias(), normtype = NormType()){ 
+         new("asL1", biastype = biastype, normtype = normtype) }
+}
+\concept{asymptotic mean square error}
+\concept{risk}
+\keyword{robust}

Added: branches/robast-0.8/pkg/ROptEst/man/asL4-class.Rd
===================================================================
--- branches/robast-0.8/pkg/ROptEst/man/asL4-class.Rd	                        (rev 0)
+++ branches/robast-0.8/pkg/ROptEst/man/asL4-class.Rd	2010-09-02 20:32:21 UTC (rev 413)
@@ -0,0 +1,43 @@
+\name{asL4-class}
+\docType{class}
+\alias{asL4-class}
+
+\title{Asymptotic mean power 4 error}
+\description{Class of asymptotic mean power 4 error.}
+\section{Objects from the Class}{
+  Objects can be created by calls of the form \code{new("asL4", ...)}.
+  More frequently they are created via the generating function 
+  \code{asL4}.   
+}
+\section{Slots}{
+  \describe{
+    \item{\code{type}}{Object of class \code{"character"}: 
+      \dQuote{asymptotic mean square error}. }
+    \item{\code{biastype}}{Object of class \code{"BiasType"}: 
+      symmetric, one-sided or asymmetric }
+    \item{\code{normtype}}{Object of class \code{"NormType"}: 
+      norm in which a multivariate parameter is considered}
+  }
+}
+\section{Extends}{
+Class \code{"asGRisk"}, directly.\cr
+Class \code{"asRiskwithBias"}, by class \code{"asGRisk"}.\cr
+Class \code{"asRisk"}, by class \code{"asRiskwithBias"}.\cr
+Class \code{"RiskType"}, by class \code{"asGRisk"}.
+}
+\section{Methods}{
+No methods defined with class "asL4" in the signature.
+}
+\references{
+  Ruckdeschel, P. and Rieder, H. (2004) Optimal Influence Curves for
+  General Loss Functions. Statistics & Decisions \emph{22}, 201-223.
+}
+\author{Peter Ruckdeschel \email{peter.ruckdeschel at itwm.fraunhofer.de}}
+%\note{}
+\seealso{\code{\link{asGRisk-class}}, \code{\link{asMSE}}, \code{\link{asMSE-class}}, \code{\link{asL1-class}}, \code{\link{asL4}}}
+\examples{
+new("asMSE")
+}
+\concept{asymptotic risk}
+\concept{risk}
+\keyword{classes}

Added: branches/robast-0.8/pkg/ROptEst/man/asL4.Rd
===================================================================
--- branches/robast-0.8/pkg/ROptEst/man/asL4.Rd	                        (rev 0)
+++ branches/robast-0.8/pkg/ROptEst/man/asL4.Rd	2010-09-02 20:32:21 UTC (rev 413)
@@ -0,0 +1,32 @@
+\name{asL4}
+\alias{asL4}
+
+\title{Generating function for asL4-class}
+\description{
+  Generates an object of class \code{"asL4"}.
+}
+\usage{asL4(biastype = symmetricBias(), normtype = NormType())}
+\arguments{
+  \item{biastype}{a bias type of class \code{BiasType}}
+  \item{normtype}{ a norm type of class \code{NormType}}
+}
+
+%\details{}
+\value{Object of class \code{"asL4"}}
+\references{ 
+  Ruckdeschel, P. and Rieder, H. (2004) Optimal Influence Curves for
+  General Loss Functions. Statistics & Decisions \emph{22}, 201-223.
+}
+\author{Peter Ruckdeschel \email{peter.ruckdeschel at itwm.fraunhofer.de}}
+%\note{}
+\seealso{\code{\link{asL4-class}}, \code{\link{asMSE}}, \code{\link{asL1}}}
+\examples{
+asL4()
+
+## The function is currently defined as
+function(biastype = symmetricBias(), normtype = NormType()){ 
+         new("asL4", biastype = biastype, normtype = normtype) }
+}
+\concept{asymptotic mean square error}
+\concept{risk}
+\keyword{robust}

Modified: branches/robast-0.8/pkg/ROptEst/man/getAsRisk.Rd
===================================================================
--- branches/robast-0.8/pkg/ROptEst/man/getAsRisk.Rd	2010-08-29 10:27:58 UTC (rev 412)
+++ branches/robast-0.8/pkg/ROptEst/man/getAsRisk.Rd	2010-09-02 20:32:21 UTC (rev 413)
@@ -2,6 +2,8 @@
 \alias{getAsRisk}
 \alias{getAsRisk-methods}
 \alias{getAsRisk,asMSE,UnivariateDistribution,Neighborhood,ANY-method}
+\alias{getAsRisk,asL1,UnivariateDistribution,Neighborhood,ANY-method}
+\alias{getAsRisk,asL4,UnivariateDistribution,Neighborhood,ANY-method}
 \alias{getAsRisk,asMSE,EuclRandVariable,Neighborhood,ANY-method}
 \alias{getAsRisk,asBias,UnivariateDistribution,ContNeighborhood,ANY-method}
 \alias{getAsRisk,asBias,UnivariateDistribution,ContNeighborhood,onesidedBias-method}
@@ -31,6 +33,12 @@
 \S4method{getAsRisk}{asMSE,UnivariateDistribution,Neighborhood,ANY}(risk,
     L2deriv, neighbor, biastype, normtype = NULL, clip = NULL, cent = NULL, stand, trafo, ...)
 
+\S4method{getAsRisk}{asL1,UnivariateDistribution,Neighborhood,ANY}(risk,
+    L2deriv, neighbor, biastype, normtype = NULL, clip = NULL, cent = NULL, stand, trafo, ...)
+
+\S4method{getAsRisk}{asL4,UnivariateDistribution,Neighborhood,ANY}(risk,
+    L2deriv, neighbor, biastype, normtype = NULL, clip = NULL, cent = NULL, stand, trafo, ...)
+
 \S4method{getAsRisk}{asMSE,EuclRandVariable,Neighborhood,ANY}(risk,
     L2deriv, neighbor, biastype, normtype = NULL, clip = NULL, cent = NULL, stand, trafo, ...)
 
@@ -128,6 +136,16 @@
     computes asymptotic mean square error in methods for
     function \code{getInfRobIC}. }
 
+  \item{risk = "asL1", L2deriv = "UnivariateDistribution",
+        neighbor = "Neighborhood", biastype = "ANY":}{
+    computes asymptotic mean absolute error in methods for
+    function \code{getInfRobIC}. }
+
+  \item{risk = "asL4", L2deriv = "UnivariateDistribution",
+        neighbor = "Neighborhood", biastype = "ANY":}{
+    computes asymptotic mean power 4 error in methods for
+    function \code{getInfRobIC}. }
+
   \item{risk = "asMSE", L2deriv = "EuclRandVariable",
         neighbor = "Neighborhood", biastype = "ANY":}{
     computes asymptotic mean square error in methods for

Modified: branches/robast-0.8/pkg/ROptEst/man/getInfClip.Rd
===================================================================
--- branches/robast-0.8/pkg/ROptEst/man/getInfClip.Rd	2010-08-29 10:27:58 UTC (rev 412)
+++ branches/robast-0.8/pkg/ROptEst/man/getInfClip.Rd	2010-09-02 20:32:21 UTC (rev 413)
@@ -3,6 +3,10 @@
 \alias{getInfClip-methods}
 \alias{getInfClip,numeric,UnivariateDistribution,asMSE,ContNeighborhood-method}
 \alias{getInfClip,numeric,UnivariateDistribution,asMSE,TotalVarNeighborhood-method}
+\alias{getInfClip,numeric,UnivariateDistribution,asL1,ContNeighborhood-method}
+\alias{getInfClip,numeric,UnivariateDistribution,asL1,TotalVarNeighborhood-method}
+\alias{getInfClip,numeric,UnivariateDistribution,asL4,ContNeighborhood-method}
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/robast -r 413


More information about the Robast-commits mailing list