[Robast-commits] r619 - in branches/robast-0.9/pkg/RobExtremes: . R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Feb 23 23:44:11 CET 2013


Author: ruckdeschel
Date: 2013-02-23 23:44:11 +0100 (Sat, 23 Feb 2013)
New Revision: 619

Added:
   branches/robast-0.9/pkg/RobExtremes/R/move2bckRefParam.R
   branches/robast-0.9/pkg/RobExtremes/man/mov2bckRef-methods.Rd
Modified:
   branches/robast-0.9/pkg/RobExtremes/NAMESPACE
   branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R
   branches/robast-0.9/pkg/RobExtremes/R/GParetoFamily.R
   branches/robast-0.9/pkg/RobExtremes/R/WeibullFamily.R
Log:
RobExtremes: 
+ added particular moveL2Fam2RefParam, moveICBackFromRefParam methods for scale shape models
+ GEVD, GPD and Weibull Families now have slots .withEvalAsVar, .withEvalL2derivDistr equal to FALSE

Modified: branches/robast-0.9/pkg/RobExtremes/NAMESPACE
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/NAMESPACE	2013-02-23 22:11:21 UTC (rev 618)
+++ branches/robast-0.9/pkg/RobExtremes/NAMESPACE	2013-02-23 22:44:11 UTC (rev 619)
@@ -24,6 +24,8 @@
               "Min", "Min<-",
               "E", "var", "IQR", "skewness", "kurtosis", "median", "dispersion")
 exportMethods("modifyModel", "getStartIC")
+exportMethods("moveL2Fam2RefParam",
+			  "moveICBackFromRefParam")			  
 
 export("EULERMASCHERONICONSTANT","APERYCONSTANT")
 export("Gumbel", "Pareto", "GPareto", "GEV")

Modified: branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R	2013-02-23 22:11:21 UTC (rev 618)
+++ branches/robast-0.9/pkg/RobExtremes/R/GEVFamily.R	2013-02-23 22:44:11 UTC (rev 619)
@@ -371,6 +371,8 @@
     L2Fam at L2deriv <- L2deriv
     L2Fam at L2derivDistr <- L2derivDistr
     L2Fam at .withMDE <- FALSE
+    L2Fam at .withEvalAsVar <- FALSE
+    L2Fam at .withEvalL2derivDistr <- FALSE
     return(L2Fam)
 }
 

Modified: branches/robast-0.9/pkg/RobExtremes/R/GParetoFamily.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/GParetoFamily.R	2013-02-23 22:11:21 UTC (rev 618)
+++ branches/robast-0.9/pkg/RobExtremes/R/GParetoFamily.R	2013-02-23 22:44:11 UTC (rev 619)
@@ -254,6 +254,8 @@
     L2Fam at L2deriv <- L2deriv
     L2Fam at L2derivDistr <- L2derivDistr
     L2Fam at .withMDE <- FALSE
+    L2Fam at .withEvalAsVar <- FALSE
+    L2Fam at .withEvalL2derivDistr <- FALSE
 
     return(L2Fam)
 }

Modified: branches/robast-0.9/pkg/RobExtremes/R/WeibullFamily.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/WeibullFamily.R	2013-02-23 22:11:21 UTC (rev 618)
+++ branches/robast-0.9/pkg/RobExtremes/R/WeibullFamily.R	2013-02-23 22:44:11 UTC (rev 619)
@@ -246,6 +246,8 @@
     L2Fam at L2deriv <- L2deriv
     L2Fam at L2derivDistr <- L2derivDistr
     L2Fam at .withMDE <- FALSE
+    L2Fam at .withEvalAsVar <- FALSE
+    L2Fam at .withEvalL2derivDistr <- FALSE
 
     return(L2Fam)
 }

Added: branches/robast-0.9/pkg/RobExtremes/R/move2bckRefParam.R
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/R/move2bckRefParam.R	                        (rev 0)
+++ branches/robast-0.9/pkg/RobExtremes/R/move2bckRefParam.R	2013-02-23 22:44:11 UTC (rev 619)
@@ -0,0 +1,28 @@
+setMethod("moveL2Fam2RefParam", signature(L2Fam = "L2ScaleShapeUnion"),
+          function(L2Fam, ...){ param <- param(L2Fam)
+                                scale <- 1
+                                shape <- main(param)[2]
+                                main(param) <- c(scale, shape)
+                                fixed(param) <- 0
+                                modifyModel(L2Fam, param)})
+
+################################################################################
+
+### remains to be done: Risk trafo !!!
+
+
+setMethod("moveICBackFromRefParam", signature(IC = "IC",
+           L2Fam = "L2ScaleShapeUnion"), function(IC, L2Fam, ...){
+              param <- param(L2Fam)
+              L2call <- L2Fam at fam.call
+              param <- param(L2Fam)
+              loc <- .loc(L2Fam)
+              scale <- main(param)[1]
+              IC.cf1 <- IC at Curve[[1]]@Map[[1]]
+              IC at Curve[[1]]@Map[[1]] <- function(x) scale*IC.cf1((x-loc)/scale)
+              IC.cf2 <- IC at Curve[[1]]@Map[[2]]
+              IC at Curve[[1]]@Map[[2]] <- function(x) IC.cf2((x-loc)/scale)
+              CallL2Fam(IC) <- L2call
+              return(IC)})
+
+

Added: branches/robast-0.9/pkg/RobExtremes/man/mov2bckRef-methods.Rd
===================================================================
--- branches/robast-0.9/pkg/RobExtremes/man/mov2bckRef-methods.Rd	                        (rev 0)
+++ branches/robast-0.9/pkg/RobExtremes/man/mov2bckRef-methods.Rd	2013-02-23 22:44:11 UTC (rev 619)
@@ -0,0 +1,51 @@
+\name{movToRef-methods}
+\docType{methods}
+\alias{moveL2Fam2RefParam}
+\alias{moveICBackFromRefParam}
+\alias{moveL2Fam2RefParam-methods}
+\alias{moveICBackFromRefParam-methods}
+\alias{moveL2Fam2RefParam,L2ScaleShapeUnion-method}
+\alias{moveICBackFromRefParam,IC,L2ScaleShapeUnion-method}
+
+\title{Methods for Functions moving from and to reference parameter in Package
+    `RobExtremes' }
+
+\description{In \code{optIC} a gain in accuracy can be obtained when computing
+ the optimally-robust ICs at a reference parameter of the model (instead of an
+ arbtirary one). To this end, \code{moveL2Fam2RefParam} moved the model to
+ the reference parameter and \code{moveICBackFromRefParam} moves the obtained
+ optimal IC back to the original parameter.}
+
+\usage{moveL2Fam2RefParam(L2Fam, ...)
+       moveICBackFromRefParam(IC, L2Fam,...)
+}
+
+\arguments{
+  \item{L2Fam}{object of class \code{L2ParamFamily}}
+  \item{IC}{IC of class \code{HampIC}}
+  \item{\dots}{further arguments to be passed to particular methods}
+}
+\section{Methods}{\describe{
+\item{moveL2Fam2RefParam}{\code{signature(L2Fam = "L2ScaleShapeUnion")}:
+      moves \code{L2Fam} to scale \code{1} (and, if existing location to
+       \code{0}). }
+\item{moveICBackFromRefParam}{\code{signature(IC = "IC", L2Fam = "L2ScaleShapeUnion")}:
+      moves IC in \code{IC} back to original location and scale in \code{L2Fam}
+      (and in addition changes Lagrange multipliers accordingly),
+      rescaling risk where necessary. }
+}}
+\value{
+\item{\code{moveL2Fam2RefParam}}{the L2 Family transformed to reference parameter.}
+\item{\code{moveICBackFromRefParam}}{the backtransformed IC.}
+}
+
+\details{\code{moveL2Fam2RefParam} and \code{moveICBackFromRefParam} are used
+internally in functions \code{robest} and \code{roptest} to compute the
+optimally robust influence function according to the arguments given to them.}
+\author{Peter Ruckdeschel \email{Peter.Ruckdeschel at itwm.fraunhofer.de}}
+\seealso{\code{\link{robest}},\code{\link{optIC}}, \code{\link{radiusMinimaxIC}}}
+%\examples{}
+\concept{asymptotic risk}
+\concept{risk}
+\keyword{classes}
+



More information about the Robast-commits mailing list