[Robast-commits] r590 - in pkg/ROptEstOld: . R inst man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 7 20:45:29 CET 2013


Author: ruckdeschel
Date: 2013-02-07 20:45:29 +0100 (Thu, 07 Feb 2013)
New Revision: 590

Added:
   pkg/ROptEstOld/R/AllInitialize.R
   pkg/ROptEstOld/R/Functionals.R
   pkg/ROptEstOld/R/Gumbel.R
   pkg/ROptEstOld/R/GumbelLocationFamily.R
   pkg/ROptEstOld/R/Kurtosis.R
   pkg/ROptEstOld/R/Skewness.R
   pkg/ROptEstOld/man/Gumbel-class.Rd
   pkg/ROptEstOld/man/Gumbel.Rd
   pkg/ROptEstOld/man/GumbelParameter-class.Rd
   pkg/ROptEstOld/man/ROptEstOldConstants.Rd
Removed:
   pkg/ROptEstOld/chm/
Modified:
   pkg/ROptEstOld/DESCRIPTION
   pkg/ROptEstOld/NAMESPACE
   pkg/ROptEstOld/R/AllClass.R
   pkg/ROptEstOld/R/AllGeneric.R
   pkg/ROptEstOld/R/Expectation.R
   pkg/ROptEstOld/inst/NEWS
   pkg/ROptEstOld/man/GumbelLocationFamily.Rd
Log:
merged ROptEstOld from branch robast-0.9 back to trunk; can now be submitted to avoid failure after reconstruction of pkg distrEx

Modified: pkg/ROptEstOld/DESCRIPTION
===================================================================
--- pkg/ROptEstOld/DESCRIPTION	2013-02-07 19:44:03 UTC (rev 589)
+++ pkg/ROptEstOld/DESCRIPTION	2013-02-07 19:45:29 UTC (rev 590)
@@ -1,17 +1,17 @@
 Package: ROptEstOld
-Version: 0.8.1
-Date: 2011-09-30
+Version: 0.9
+Date: 2010-12-03
 Title: Optimally robust estimation - old version
 Description: Optimally robust estimation using S4 classes and methods. Old version still needed
         for current versions of ROptRegTS and RobRex.
-Depends: R(>= 2.4.0), methods, distr(>= 2.2), distrEx(>= 2.2), RandVar(>= 0.7)
+Depends: R(>= 2.4.0), methods, distr(>= 2.4), distrEx(>= 2.4), RandVar(>= 0.8), evd
 Author: Matthias Kohl
 Maintainer: Matthias Kohl <Matthias.Kohl at stamats.de>
+LazyLoad: yes
 ByteCompile: yes
-LazyLoad: yes
 License: LGPL-3
 URL: http://robast.r-forge.r-project.org/
 Encoding: latin1
 LastChangedDate: {$LastChangedDate$}
 LastChangedRevision: {$LastChangedRevision$}
-SVNRevision: 454
+SVNRevision: 588

Modified: pkg/ROptEstOld/NAMESPACE
===================================================================
--- pkg/ROptEstOld/NAMESPACE	2013-02-07 19:44:03 UTC (rev 589)
+++ pkg/ROptEstOld/NAMESPACE	2013-02-07 19:45:29 UTC (rev 590)
@@ -1,3 +1,4 @@
+import("methods")
 import("distr")
 import("distrEx")
 import("RandVar")
@@ -134,3 +135,10 @@
        "IC", 
        "ContIC", 
        "TotalVarIC")
+exportClasses("GumbelParameter", "Gumbel")
+exportMethods("initialize", "loc", "loc<-")
+exportMethods("scale", "scale<-", "+", "*",
+              "E", "var", "skewness", "kurtosis")
+export("EULERMASCHERONICONSTANT","APERYCONSTANT")
+export("Gumbel")
+export("loc", "loc<-")	   
\ No newline at end of file

Modified: pkg/ROptEstOld/R/AllClass.R
===================================================================
--- pkg/ROptEstOld/R/AllClass.R	2013-02-07 19:44:03 UTC (rev 589)
+++ pkg/ROptEstOld/R/AllClass.R	2013-02-07 19:45:29 UTC (rev 590)
@@ -1,10 +1,57 @@
 .onLoad <- function(lib, pkg){
-    require("methods", character = TRUE, quietly = TRUE) 
-    require("distr", character = TRUE, quietly = TRUE) 
-    require("distrEx", character = TRUE, quietly = TRUE) 
-    require("RandVar", character = TRUE, quietly = TRUE) 
 }
 
+# parameter of Gumbel distribution
+setClass("GumbelParameter", representation(loc = "numeric",
+                                           scale = "numeric"),
+            prototype(name = gettext("parameter of a Gumbel distribution"),
+                      loc = 0, scale = 1),
+            contains = "Parameter",
+            validity = function(object){
+                if(length(object at scale) != 1)
+                    stop("length of 'scale' is not equal to 1")
+                if(length(object at loc) != 1)
+                    stop("length of 'loc' is not equal to 1")
+                if(object at scale <= 0)
+                    stop("'scale' has to be positive")
+                else return(TRUE)
+            })
+
+# Gumbel distribution
+setClass("Gumbel",
+            prototype = prototype(r = function(n){ rgumbel(n, loc = 0, scale = 1) },
+                                  d = function(x, log){ dgumbel(x, loc = 0, scale = 1, log = FALSE) },
+                                  p = function(q, lower.tail = TRUE, log.p = FALSE){
+                                         p0 <- pgumbel(q, loc = 0, scale = 1, lower.tail = lower.tail)
+                                         if(log.p) return(log(p0)) else return(p0)
+                                  },
+                                  q = function(p, loc = 0, scale = 1, lower.tail = TRUE, log.p = FALSE){
+                                      ## P.R.: changed to vectorized form
+                                      p1 <- if(log.p) exp(p) else p
+
+                                      in01 <- (p1>1 | p1<0)
+                                      i01 <- distr:::.isEqual01(p1)
+                                      i0 <- (i01 & p1<1)
+                                      i1 <- (i01 & p1>0)
+                                      ii01 <- distr:::.isEqual01(p1) | in01
+
+                                      p0 <- p
+                                      p0[ii01] <- if(log.p) log(0.5) else 0.5
+
+                                      q1 <- qgumbel(p0, loc = 0, scale = 1,
+                                                    lower.tail = lower.tail)
+                                      q1[i0] <- if(lower.tail) -Inf else Inf
+                                      q1[i1] <- if(!lower.tail) -Inf else Inf
+                                      q1[in01] <- NaN
+
+                                      return(q1)
+                                      },
+                                  img = new("Reals"),
+                                  param = new("GumbelParameter"),
+                                  .logExact = FALSE,
+                                  .lowerExact = TRUE),
+            contains = "AbscontDistribution")
+
 # symmetry of functions
 setClass("FunctionSymmetry", contains = c("Symmetry", "VIRTUAL"))
 

Modified: pkg/ROptEstOld/R/AllGeneric.R
===================================================================
--- pkg/ROptEstOld/R/AllGeneric.R	2013-02-07 19:44:03 UTC (rev 589)
+++ pkg/ROptEstOld/R/AllGeneric.R	2013-02-07 19:45:29 UTC (rev 590)
@@ -230,3 +230,10 @@
 if(!isGeneric("infoPlot")){
     setGeneric("infoPlot", function(object) standardGeneric("infoPlot"))
 }
+if(!isGeneric("loc")){
+   setGeneric("loc", function(object) standardGeneric("loc"))
+}
+
+if(!isGeneric("loc<-")){
+   setGeneric("loc<-", function(object, value) standardGeneric("loc<-"))
+}

Added: pkg/ROptEstOld/R/AllInitialize.R
===================================================================
--- pkg/ROptEstOld/R/AllInitialize.R	                        (rev 0)
+++ pkg/ROptEstOld/R/AllInitialize.R	2013-02-07 19:45:29 UTC (rev 590)
@@ -0,0 +1,45 @@
+## initialize method 
+setMethod("initialize", "Gumbel",
+    function(.Object, loc = 0, scale = 1) {
+        .Object at img <- Reals()
+        .Object at param <- new("GumbelParameter", loc = loc, scale = scale, 
+                             name = gettext("parameter of a Gumbel distribution"))
+        .Object at r <- function(n){}
+        body(.Object at r) <- substitute({ rgumbel(n, loc = loc1, scale = scale1) },
+                                     list(loc1 = loc, scale1 = scale))
+        .Object at d <- function(x, log = FALSE){}
+        body(.Object at d) <- substitute({  dgumbel(x, loc = loc1, scale = scale1, log = log) },
+                                     list(loc1 = loc, scale1 = scale))
+        .Object at p <- function(q, lower.tail = TRUE, log.p = FALSE){}
+        body(.Object at p) <- substitute({p1 <- pgumbel(q, loc = loc1, scale = scale1, lower.tail = lower.tail) 
+                                       return(if(log.p) log(p1) else p1)},
+                                     list(loc1 = loc, scale1 = scale))
+        .Object at q <- function(p, loc = loc1, scale = scale1, lower.tail = TRUE, log.p = FALSE){}
+            body(.Object at q) <- substitute({
+                        ## P.R.: changed to vectorized form 
+                        p1 <- if(log.p) exp(p) else p
+                                                                        
+                        in01 <- (p1>1 | p1<0)
+                        i01 <- distr:::.isEqual01(p1)
+                        i0 <- (i01 & p1<1)   
+                        i1 <- (i01 & p1>0)
+                        ii01 <- distr:::.isEqual01(p1) | in01
+                                      
+                        p0 <- p
+                        p0[ii01] <- if(log.p) log(0.5) else 0.5
+                                      
+                        q1 <- qgumbel(p0, loc = loc1, scale = scale1, 
+                                      lower.tail = lower.tail) 
+                        q1[i0] <- if(lower.tail) -Inf else Inf
+                        q1[i1] <- if(!lower.tail) -Inf else Inf
+                        q1[in01] <- NaN
+                        
+                        return(q1)  
+                     },  list(loc1 = loc, scale1 = scale))
+        .Object at .withSim   <- FALSE
+        .Object at .withArith <- FALSE
+        .Object at .logExact <- FALSE
+        .Object at .lowerExact <- TRUE
+        .Object
+    })
+

Modified: pkg/ROptEstOld/R/Expectation.R
===================================================================
--- pkg/ROptEstOld/R/Expectation.R	2013-02-07 19:44:03 UTC (rev 589)
+++ pkg/ROptEstOld/R/Expectation.R	2013-02-07 19:45:29 UTC (rev 590)
@@ -22,3 +22,13 @@
 
         return(res)
     })
+setMethod("E", signature(object = "Gumbel",
+                         fun = "missing",
+                         cond = "missing"),
+    function(object, low = NULL, upp = NULL, ...){a <- loc(object); b <- scale(object)
+    if(is.null(low) && is.null(upp))
+           return(a- EULERMASCHERONICONSTANT * b)
+    else
+        return(E(as(object,"AbscontDistribution"), low=low, upp=upp, ...))
+    })
+## http://mathworld.wolfram.com/GumbelDistribution.html

Added: pkg/ROptEstOld/R/Functionals.R
===================================================================
--- pkg/ROptEstOld/R/Functionals.R	                        (rev 0)
+++ pkg/ROptEstOld/R/Functionals.R	2013-02-07 19:45:29 UTC (rev 590)
@@ -0,0 +1,15 @@
+
+setMethod("var", signature(x = "Gumbel"),
+    function(x, ...){
+    dots <- match.call(call = sys.call(sys.parent(1)), 
+                       expand.dots = FALSE)$"..."
+    fun <- NULL; cond <- NULL; low <- NULL; upp <- NULL
+    if(hasArg(low)) low <- dots$low
+    if(hasArg(upp)) upp <- dots$upp
+    if(hasArg(fun)||hasArg(cond)||!is.null(low)||!is.null(upp)) 
+        return(var(as(x,"AbscontDistribution"),...))
+    else{  b <- scale(x)
+            return(b^2 * pi^2/6)
+    }})
+## http://mathworld.wolfram.com/GumbelDistribution.html
+

Added: pkg/ROptEstOld/R/Gumbel.R
===================================================================
--- pkg/ROptEstOld/R/Gumbel.R	                        (rev 0)
+++ pkg/ROptEstOld/R/Gumbel.R	2013-02-07 19:45:29 UTC (rev 590)
@@ -0,0 +1,55 @@
+## access methods
+setMethod("loc", "GumbelParameter", function(object) object at loc)
+setMethod("scale", "GumbelParameter", 
+    function(x, center = TRUE, scale = TRUE) x at scale)
+
+## replace Methods
+setReplaceMethod("loc", "GumbelParameter", 
+    function(object, value){ object at loc <- value; object })
+setReplaceMethod("scale", "GumbelParameter", 
+    function(object, value){ object at scale <- value; object})
+
+
+## generating function
+Gumbel <- function(loc = 0, scale = 1){ new("Gumbel", loc = loc, scale = scale) }
+
+## wrapped access methods
+setMethod("loc", "Gumbel", function(object) loc(object at param))
+setMethod("scale", "Gumbel", 
+    function(x, center = TRUE, scale = TRUE) scale(x at param))
+
+## wrapped replace methods
+setMethod("loc<-", "Gumbel", 
+    function(object, value){ 
+        new("Gumbel", loc = value, scale = scale(object))
+    })
+setMethod("scale<-", "Gumbel", 
+    function(object, value){ 
+        if(length(value) != 1 || value <= 0)
+            stop("'value' has to be a single positive number")
+        new("Gumbel", loc = loc(object), scale = value)
+    })
+
+## extra methods for Gumbel distribution
+setMethod("+", c("Gumbel","numeric"),
+          function(e1, e2){
+            if (length(e2)>1) stop("length of operator must be 1")
+            new("Gumbel", loc = loc(e1) + e2, scale = scale(e1)) 
+          })
+
+setMethod("*", c("Gumbel","numeric"),
+          function(e1, e2){
+            if (length(e2)>1) stop("length of operator must be 1")
+            if (isTRUE(all.equal(e2,0))) 
+                return(new("Dirac", location = 0, .withArith = TRUE))
+            new("Gumbel", loc = loc(e1) * e2, scale = scale(e1)*abs(e2))
+          })
+
+### Euler Mascheroni constant:
+EULERMASCHERONICONSTANT <- -digamma(1) ### after http://mathworld.wolfram.com/Euler-MascheroniConstant.html (48)
+
+### Apéry constant
+##local helper function:
+.fctApery <- function(n) (-1)^n*choose(2*n,n)*n^3
+##
+APERYCONSTANT <- -sum(sapply(1:50,.fctApery)^(-1))*5/2 ## after http://mathworld.wolfram.com/AperysConstant.html (8)

Added: pkg/ROptEstOld/R/GumbelLocationFamily.R
===================================================================
--- pkg/ROptEstOld/R/GumbelLocationFamily.R	                        (rev 0)
+++ pkg/ROptEstOld/R/GumbelLocationFamily.R	2013-02-07 19:45:29 UTC (rev 590)
@@ -0,0 +1,31 @@
+##################################################################
+## Gumbel location family
+##################################################################
+GumbelLocationFamily <- function(loc = 0, scale = 1, trafo){
+    if(missing(trafo)) trafo <- matrix(1, dimnames = list("loc","loc"))
+    modParam <- function(theta){}
+    body(modParam) <- substitute({ Gumbel(loc = theta, scale = sd) },
+                                 list(sd = scale))
+    res <- L2LocationFamily(loc = loc,
+                     name = "Gumbel location family",
+                     locname = c("loc"="loc"),
+                     centraldistribution = Gumbel(loc = 0, scale = scale),
+                     modParam = modParam,
+                     LogDeriv = function(x) (1 - exp(-x/scale))/scale,
+                     L2derivDistr.0 = (1 - Exp(rate = 1))/scale,
+                     FisherInfo.0 = matrix(1/scale^2,
+                                    dimnames = list("loc","loc")),
+                     distrSymm = NoSymmetry(),
+                     L2derivSymm = FunSymmList(NonSymmetric()),
+                     L2derivDistrSymm = DistrSymmList(NoSymmetry()),
+                     trafo = trafo, .returnClsName = "GumbelLocationFamily")
+    if(!is.function(trafo))
+       f.call <- substitute(GumbelLocationFamily(loc = l, scale = s,
+                          trafo = matrix(Tr, dimnames = list("loc","loc"))),
+  	                     list(l = loc, s = scale, Tr = trafo))
+  	else
+       f.call <- substitute(GumbelLocationFamily(loc = l, scale = s, trafo = Tr),
+  	                     list(l = loc, s = scale, Tr = trafo))
+    res at fam.call <- f.call
+    return(res)
+}

Added: pkg/ROptEstOld/R/Kurtosis.R
===================================================================
--- pkg/ROptEstOld/R/Kurtosis.R	                        (rev 0)
+++ pkg/ROptEstOld/R/Kurtosis.R	2013-02-07 19:45:29 UTC (rev 590)
@@ -0,0 +1,24 @@
+###################################################################################
+#kurtosis  --- code due to G. Jay Kerns, gkerns at ysu.edu
+###################################################################################
+
+
+
+setMethod("kurtosis", signature(x = "Gumbel"),
+    function(x, ...){
+    dots <- match.call(call = sys.call(sys.parent(1)), 
+                       expand.dots = FALSE)$"..."
+    fun <- NULL; cond <- NULL; low <- NULL; upp <- NULL
+    if(hasArg(low)) low <- dots$low
+    if(hasArg(upp)) upp <- dots$upp
+    if(hasArg(fun)||hasArg(cond)||!is.null(low)||!is.null(upp)) 
+        return(kurtosis(as(x,"AbscontDistribution"),...))
+    else{
+         return(12/5)
+# http://mathworld.wolfram.com/GumbelDistribution.html         
+    }
+})
+
+### source http://en.wikipedia.org/wiki/Generalized_extreme_value_distribution
+###        http://en.wikipedia.org/wiki/Gumbel_distribution
+###        http://en.wikipedia.org/wiki/Riemann_zeta_function 

Added: pkg/ROptEstOld/R/Skewness.R
===================================================================
--- pkg/ROptEstOld/R/Skewness.R	                        (rev 0)
+++ pkg/ROptEstOld/R/Skewness.R	2013-02-07 19:45:29 UTC (rev 590)
@@ -0,0 +1,16 @@
+
+setMethod("skewness", signature(x = "Gumbel"),
+    function(x, ...){
+    dots <- match.call(call = sys.call(sys.parent(1)), 
+                       expand.dots = FALSE)$"..."
+    fun <- NULL; cond <- NULL; low <- NULL; upp <- NULL
+    if(hasArg(low)) low <- dots$low
+    if(hasArg(upp)) upp <- dots$upp
+    if(hasArg(fun)||hasArg(cond)||!is.null(low)||!is.null(upp))  
+        return(skewness(as(x,"AbscontDistribution"),...))
+    else{
+         return( -12 * sqrt(6) * APERYCONSTANT / pi^3 ) 
+# http://mathworld.wolfram.com/GumbelDistribution.html         
+    }
+})
+

Modified: pkg/ROptEstOld/inst/NEWS
===================================================================
--- pkg/ROptEstOld/inst/NEWS	2013-02-07 19:44:03 UTC (rev 589)
+++ pkg/ROptEstOld/inst/NEWS	2013-02-07 19:45:29 UTC (rev 590)
@@ -8,6 +8,14 @@
  information)
 
 #######################################
+version 0.9
+#######################################
+EVD functionality (including Gumbel distribution) has
+moved from distrEx to new pkg RobExtremes; to avoid failure
+of ROptEstOld, this functionality has been copied to ROptEstOld
+as well.
+
+#######################################
 version 0.8
 #######################################
 

Added: pkg/ROptEstOld/man/Gumbel-class.Rd
===================================================================
--- pkg/ROptEstOld/man/Gumbel-class.Rd	                        (rev 0)
+++ pkg/ROptEstOld/man/Gumbel-class.Rd	2013-02-07 19:45:29 UTC (rev 590)
@@ -0,0 +1,150 @@
+\name{Gumbel-class}
+\docType{class}
+\alias{Gumbel-class}
+\alias{initialize,Gumbel-method}
+\alias{loc,Gumbel-method}
+\alias{loc<-,Gumbel-method}
+\alias{scale,Gumbel-method}
+\alias{scale<-,Gumbel-method}
+\alias{+,Gumbel,numeric-method}
+\alias{*,Gumbel,numeric-method}
+\alias{E}
+\alias{E-methods}
+\alias{E,Gumbel,missing,missing-method}
+\alias{var}
+\alias{var-methods}
+\alias{var,Gumbel-method}
+\alias{skewness}
+\alias{skewness-methods}
+\alias{skewness,Gumbel-method}
+\alias{kurtosis}
+\alias{kurtosis-methods}
+\alias{kurtosis,Gumbel-method}
+
+\title{Gumbel distribution}
+\description{The Gumbel cumulative distribution function with 
+  location parameter \code{loc} \eqn{= \mu}{= mu} and scale 
+  parameter \code{scale} \eqn{= \sigma}{= sigma} is
+  \deqn{F(x) = \exp(-\exp[-(x-\mu)/\sigma])}{F(x) = exp(-exp[-(x-mu)/sigma])}
+  for all real x, where \eqn{\sigma > 0}{sigma > 0}; 
+  c.f. \code{rgumbel}. This distribution is also known as
+  extreme value distribution of type I; confer Chapter~22 of 
+  Johnson et al. (1995).
+}
+\section{Objects from the Class}{
+  Objects can be created by calls of the form \code{new("Gumbel", loc, scale)}.
+  More frequently they are created via the generating function 
+  \code{Gumbel}.
+}
+\section{Slots}{
+  \describe{
+    \item{\code{img}}{Object of class \code{"Reals"}. }
+    \item{\code{param}}{Object of class \code{"GumbelParameter"}. }
+    \item{\code{r}}{\code{rgumbel}}
+    \item{\code{d}}{\code{dgumbel}}
+    \item{\code{p}}{\code{pgumbel}}
+    \item{\code{q}}{\code{qgumbel}}
+    \item{\code{gaps}}{(numeric) matrix or \code{NULL}}
+    \item{\code{.withArith}}{logical: used internally to issue warnings as to 
+            interpretation of arithmetics}
+    \item{\code{.withSim}}{logical: used internally to issue warnings as to 
+          accuracy}
+    \item{\code{.logExact}}{logical: used internally to flag the case where 
+    there are explicit formulae for the log version of density, cdf, and 
+    quantile function}
+    \item{\code{.lowerExact}}{logical: used internally to flag the case where 
+    there are explicit formulae for the lower tail version of cdf and quantile 
+    function}
+    \item{\code{Symmetry}}{object of class \code{"DistributionSymmetry"};
+     used internally to avoid unnecessary calculations.}
+  }
+}
+\section{Extends}{
+Class \code{"AbscontDistribution"}, directly.\cr
+Class \code{"UnivariateDistribution"}, by class \code{"AbscontDistribution"}.\cr
+Class \code{"Distribution"}, by class \code{"AbscontDistribution"}.
+}
+\section{Methods}{
+  \describe{
+    \item{initialize}{\code{signature(.Object = "Gumbel")}: initialize method. }
+
+    \item{loc}{\code{signature(object = "Gumbel")}: wrapped access method for
+      slot \code{loc} of slot \code{param}. }
+
+    \item{scale}{\code{signature(x = "Gumbel")}: wrapped access method for
+      slot \code{scale} of slot \code{param}. }
+
+    \item{loc<-}{\code{signature(object = "Gumbel")}: wrapped replace method for
+      slot \code{loc} of slot \code{param}. }
+
+    \item{scale<-}{\code{signature(x = "Gumbel")}: wrapped replace method for
+      slot \code{scale} of slot \code{param}. }
+
+    \item{\code{+}}{\code{signature(e1 = "Gumbel", e2 = "numeric")}: result again of 
+      class \code{"Gumbel"}; exact. }
+
+    \item{\code{*}}{\code{signature(e1 = "Gumbel", e2 = "numeric")}: result again of 
+      class \code{"Gumbel"}; exact. }
+
+    \item{E}{\code{signature(object = "Gumbel", fun = "missing", cond = "missing")}: 
+      exact evaluation of expectation using explicit expressions.}
+
+     \item{var}{\code{signature(x = "Gumbel")}: 
+      exact evaluation of expectation using explicit expressions.}
+
+     \item{skewness}{\code{signature(x = "Gumbel")}: 
+      exact evaluation of expectation using explicit expressions.}
+
+     \item{kurtosis}{\code{signature(x = "Gumbel")}: 
+      exact evaluation of expectation using explicit expressions.}
+
+     \item{median}{\code{signature(x = "Gumbel")}: 
+      exact evaluation of expectation using explicit expressions.}
+
+     \item{IQR}{\code{signature(x = "Gumbel")}: 
+      exact evaluation of expectation using explicit expressions.}
+  }
+}
+\usage{
+E(object, fun, cond, ...)
+\S4method{E}{Gumbel,missing,missing}(object, low = NULL, upp = NULL, ...)
+var(x, ...)
+\S4method{var}{Gumbel}(x, ...)
+skewness(x, ...)
+\S4method{skewness}{Gumbel}(x, ...)
+kurtosis(x, ...)
+\S4method{kurtosis}{Gumbel}(x, ...)
+
+}
+\arguments{
+  \item{object}{ object of class \code{"Distribution"}}
+  \item{fun}{ if missing the (conditional) expectation is computed
+    else the (conditional) expection of \code{fun} is computed. }
+  \item{cond}{ if not missing the conditional expectation
+    given \code{cond} is computed. }
+  \item{low}{lower bound of integration range.}
+  \item{upp}{upper bound of integration range.}
+  \item{x}{ object of class \code{"UnivariateDistribution"}}
+  \item{\dots}{ additional arguments to \code{fun} }
+}
+
+
+\references{Johnson et al. (1995) \emph{Continuous Univariate Distributions. Vol. 2. 2nd ed.}
+    New York: Wiley.}
+\author{Matthias Kohl \email{Matthias.Kohl at stamats.de}}
+\note{This class is based on the code provided by the package \pkg{evd}.}
+\seealso{\code{\link[evd:gumbel]{rgumbel}}, \code{\link[distr]{AbscontDistribution-class}}}
+\examples{
+(G1 <- new("Gumbel", loc = 1, scale = 2))
+plot(G1)
+loc(G1)
+scale(G1)
+loc(G1) <- -1
+scale(G1) <- 2
+plot(G1)
+}
+\concept{Gumbel}
+\keyword{distribution}
+\concept{extreme value distribution}
+\concept{absolutely continuous distribution}
+\concept{S4 distribution class}

Added: pkg/ROptEstOld/man/Gumbel.Rd
===================================================================
--- pkg/ROptEstOld/man/Gumbel.Rd	                        (rev 0)
+++ pkg/ROptEstOld/man/Gumbel.Rd	2013-02-07 19:45:29 UTC (rev 590)
@@ -0,0 +1,43 @@
+\name{Gumbel}
+\alias{Gumbel}
+
+\title{Generating function for Gumbel-class}
+\description{
+  Generates an object of class \code{"Gumbel"}.
+}
+\usage{Gumbel(loc = 0, scale = 1)}
+\arguments{
+  \item{loc}{ real number: location parameter of 
+    the Gumbel distribution. }
+  \item{scale}{ positive real number: scale parameter
+    of the Gumbel distribution }
+}
+%\details{}
+\value{Object of class \code{"Gumbel"}}
+%\references{}
+\author{Matthias Kohl \email{Matthias.Kohl at stamats.de}}
+\note{The class \code{"Gumbel"} is based on the code provided 
+  by the package \pkg{evd}.}
+\seealso{\code{\link{Gumbel-class}}, \code{\link[evd:gumbel]{rgumbel}}}
+\examples{
+(G1 <- Gumbel(loc = 1, scale = 2))
+plot(G1)
+loc(G1)
+scale(G1)
+loc(G1) <- -1
+scale(G1) <- 2
+plot(G1)
+
+E(Gumbel()) # Euler's constant
+E(G1, function(x){x^2})
+
+## The function is currently defined as
+function(loc = 0, scale = 1){ 
+  new("Gumbel", loc = loc, scale = scale)
+}
+}
+\concept{Gumbel}
+\keyword{distribution}
+\concept{absolutely continuous distribution}
+\concept{Gumbel distribution}
+\concept{generating function}

Modified: pkg/ROptEstOld/man/GumbelLocationFamily.Rd
===================================================================
--- pkg/ROptEstOld/man/GumbelLocationFamily.Rd	2013-02-07 19:44:03 UTC (rev 589)
+++ pkg/ROptEstOld/man/GumbelLocationFamily.Rd	2013-02-07 19:45:29 UTC (rev 590)
@@ -25,7 +25,7 @@
 }
 \author{Matthias Kohl \email{Matthias.Kohl at stamats.de}}
 %\note{}
-\seealso{\code{\link{L2ParamFamily-class}}, \code{\link[distrEx]{Gumbel-class}}}
+\seealso{\code{\link{L2ParamFamily-class}}, \code{\link{Gumbel-class}}}
 \examples{
 distrExOptions("ElowerTruncQuantile" = 1e-15) # problem with 
                                             # non-finite function value

Added: pkg/ROptEstOld/man/GumbelParameter-class.Rd
===================================================================
--- pkg/ROptEstOld/man/GumbelParameter-class.Rd	                        (rev 0)
+++ pkg/ROptEstOld/man/GumbelParameter-class.Rd	2013-02-07 19:45:29 UTC (rev 590)
@@ -0,0 +1,57 @@
+\name{GumbelParameter-class}
+\docType{class}
+\alias{GumbelParameter-class}
+\alias{loc}
+\alias{loc,GumbelParameter-method}
+\alias{loc<-}
+\alias{loc<-,GumbelParameter-method}
+\alias{scale,GumbelParameter-method}
+\alias{scale<-,GumbelParameter-method}
+
+\title{Paramter of Gumbel distributions}
+\description{The class of the parameter of Gumbel distributions.}
+\section{Objects from the Class}{
+Objects can be created by calls of the form \code{new("GumbelParameter", ...)}.
+}
+\section{Slots}{
+  \describe{
+    \item{\code{loc}}{ real number: location parameter of 
+      a Gumbel distribution. }
+    \item{\code{scale}}{ positive real number: scale
+      parameter of a Gumbel distribution. }
+    \item{\code{name}}{ default name is 
+      \dQuote{parameter of a Gumbel distribution}. }
+  }
+}
+\section{Extends}{
+Class \code{"Parameter"}, directly.\cr
+Class \code{"OptionalParameter"}, by class \code{"Parameter"}.
+}
+\section{Methods}{
+  \describe{
+    \item{loc}{\code{signature(object = "GumbelParameter")}: access method for
+      slot \code{loc}. }
+    \item{scale}{\code{signature(x = "GumbelParameter")}: access method for
+      slot \code{scale}. }
+    \item{loc<-}{\code{signature(object = "GumbelParameter")}: replace method for
+      slot \code{loc}. }
+    \item{scale<-}{\code{signature(x = "GumbelParameter")}: replace method for
+      slot \code{scale}. }
+  }
+}
+%\references{}
+\author{Matthias Kohl \email{Matthias.Kohl at stamats.de}}
+%\note{}
+\seealso{\code{\link{Gumbel-class}}, \code{\link[distr]{Parameter-class}}}
+\examples{
+new("GumbelParameter")
+}
+\concept{Gumbel distribution}
+\keyword{distribution}
+\concept{parameter}
+\concept{S4 parameter class}
+\keyword{models}
+\concept{generating function}
+\concept{scale}
+\concept{location}
+\concept{location scale model}

Added: pkg/ROptEstOld/man/ROptEstOldConstants.Rd
===================================================================
--- pkg/ROptEstOld/man/ROptEstOldConstants.Rd	                        (rev 0)
+++ pkg/ROptEstOld/man/ROptEstOldConstants.Rd	2013-02-07 19:45:29 UTC (rev 590)
@@ -0,0 +1,34 @@
+\name{ROptEstOldConstants}
+\alias{EULERMASCHERONICONSTANT}
+\alias{APERYCONSTANT}
+\encoding{latin1} 
+\title{Built-in Constants in package ROptEstOld}
+\description{
+  Constants built into \pkg{ROptEstOld}.
+}
+\usage{
+EULERMASCHERONICONSTANT
+APERYCONSTANT
+}
+\details{
+  \pkg{ROptEstOld} has a small number of built-in constants.
+
+  The following constants are available:
+  \itemize{
+    \item \code{EULERMASCHERONICONSTANT}: the Euler Mascheroni constant 
+    \deqn{\gamma=-\Gamma'(1)}{gamma=-digamma(1)}
+    given in \url{http://mathworld.wolfram.com/Euler-MascheroniConstant.html} (48);
+    \item \code{APERYCONSTANT}: the \enc{Apéry}{Apery} constant 
+        \deqn{\zeta(3)= \frac{5}{2} (\sum_{k\ge 1}\frac{(-1)^{k-1}}{k^3 {2k\choose k}})}{
+             zeta(3) = 5/2 sum_{k>=0} (-1)^(k-1)/(k^3 * choose(2k,k))}
+    as given in \url{http://mathworld.wolfram.com/AperysConstant.html}, equation (8);
+  }
+
+  These are implemented as variables in the \pkg{ROptEstOld} name space taking
+  appropriate values. 
+}
+\examples{
+EULERMASCHERONICONSTANT
+APERYCONSTANT
+}
+\keyword{sysdata}



More information about the Robast-commits mailing list