[Distr-commits] r174 - in branches/distr-2.0/pkg/distrEx: R man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Fri Jun 6 13:59:20 CEST 2008


Author: stamats
Date: 2008-06-06 13:59:20 +0200 (Fri, 06 Jun 2008)
New Revision: 174

Modified:
   branches/distr-2.0/pkg/distrEx/R/Expectation.R
   branches/distr-2.0/pkg/distrEx/R/Functionals.R
   branches/distr-2.0/pkg/distrEx/R/Kurtosis.R
   branches/distr-2.0/pkg/distrEx/R/Skewness.R
   branches/distr-2.0/pkg/distrEx/man/E.Rd
   branches/distr-2.0/pkg/distrEx/man/HellingerDist.Rd
   branches/distr-2.0/pkg/distrEx/man/TotalVarDist.Rd
   branches/distr-2.0/pkg/distrEx/man/Var.Rd
Log:
Corrected documentation errors - detected by setting environment variable _R_CHECK_CODOC_S4_METHODS_=true. Made the code more consistent with S4-method dispatching.
Now distrEx checks and installs without any warning or error under 2.7.0 (r45868) and 2.8.0 (r45868) also using environment variable _R_CHECK_CODOC_S4_METHODS_=true.

Modified: branches/distr-2.0/pkg/distrEx/R/Expectation.R
===================================================================
--- branches/distr-2.0/pkg/distrEx/R/Expectation.R	2008-06-06 09:36:22 UTC (rev 173)
+++ branches/distr-2.0/pkg/distrEx/R/Expectation.R	2008-06-06 11:59:20 UTC (rev 174)
@@ -2,13 +2,13 @@
 setMethod("E", signature(object = "UnivariateDistribution", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object, fun){
+    function(object, fun, cond){
         return(mean(r(object)(.distrExOptions$MCIterations)))
     })
 setMethod("E", signature(object = "AbscontDistribution", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object, fun){
+    function(object, fun, cond){
         integrand <- function(x, dfun){ x * dfun(x) }
         return(distrExIntegrate(f = integrand, 
                     lower = q(object)(.distrExOptions$ElowerTruncQuantile),
@@ -19,7 +19,7 @@
 setMethod("E", signature(object = "DiscreteDistribution", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object, fun){
+    function(object, fun, cond){
         supp <- support(object)
         dfun <- d(object)
         return(sum(supp * dfun(supp)))
@@ -28,7 +28,7 @@
 setMethod("E", signature(object = "AffLinDistribution", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object, fun){
+    function(object, fun, cond){
              object at a * E(object at X0) + object at b
     })
 
@@ -57,13 +57,13 @@
 setMethod("E", signature(object = "MultivariateDistribution", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object, fun){
+    function(object, fun, cond){
         return(colMeans(r(object)(.distrExOptions$MCIterations)))
     })
 setMethod("E", signature(object = "DiscreteMVDistribution", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object, fun){
+    function(object, fun, cond){
         supp <- support(object)
         integrand <- function(x, dfun){ x * dfun(t(x)) }
         erg <- apply(supp, 1, integrand, dfun = d(object))
@@ -75,7 +75,7 @@
 setMethod("E", signature(object = "UnivariateDistribution", 
                          fun = "function", 
                          cond = "missing"),
-    function(object, fun, useApply = TRUE, ...){
+    function(object, fun, cond, useApply = TRUE, ...){
         if(useApply)        
             return(mean(sapply(r(object)(.distrExOptions$MCIterations), fun, ...)))
         else
@@ -84,7 +84,7 @@
 setMethod("E", signature(object = "AbscontDistribution", 
                          fun = "function", 
                          cond = "missing"),
-    function(object, fun, useApply = TRUE, ...){
+    function(object, fun, cond, useApply = TRUE, ...){
         if(useApply){
             integrand <- function(x, dfun, fun, ...){ 
                 sapply(x, fun, ...) * dfun(x) 
@@ -103,7 +103,7 @@
 setMethod("E", signature(object = "DiscreteDistribution", 
                          fun = "function", 
                          cond = "missing"),
-    function(object, fun, useApply = TRUE, ...){
+    function(object, fun, cond, useApply = TRUE, ...){
         supp <- support(object)
         if(useApply){
             integrand <- function(x, dfun, fun, ...){
@@ -119,7 +119,7 @@
 setMethod("E", signature(object = "MultivariateDistribution", 
                          fun = "function", 
                          cond = "missing"),
-    function(object, fun, useApply = TRUE, ...){
+    function(object, fun, cond, useApply = TRUE, ...){
         x <- r(object)(.distrExOptions$MCIterations)
         if(useApply)
             erg <- apply(x, 1, fun, ...)
@@ -136,7 +136,7 @@
 setMethod("E", signature(object = "DiscreteMVDistribution", 
                          fun = "function", 
                          cond = "missing"),
-    function(object, fun, useApply = TRUE, ...){
+    function(object, fun, cond, useApply = TRUE, ...){
         supp <- support(object)
         if(useApply){
             integrand <- function(x, fun, dfun, ...){ fun(x, ...) * dfun(t(x)) }
@@ -156,13 +156,13 @@
 setMethod("E", signature(object = "UnivariateCondDistribution", 
                          fun = "missing", 
                          cond = "numeric"),
-    function(object, cond){
+    function(object, fun, cond){
         return(mean(r(object)(.distrExOptions$MCIterations, cond)))
     })
 setMethod("E", signature(object = "AbscontCondDistribution", 
                          fun = "missing", 
                          cond = "numeric"),
-    function(object, cond, useApply = TRUE){
+    function(object, fun, cond, useApply = TRUE){
         fct <- function(x, dfun, cond){ x * dfun(x, cond) }
         if(useApply){
             integrand <- function(x, dfun, cond){ 
@@ -180,7 +180,7 @@
 setMethod("E", signature(object = "DiscreteCondDistribution", 
                          fun = "missing",
                          cond = "numeric"),
-    function(object, cond, useApply = TRUE){
+    function(object, fun, cond, useApply = TRUE){
         supp <- support(object)(cond)
         fct <- function(x, dfun, cond){ x * dfun(x, cond) }
         if(useApply)
@@ -276,14 +276,14 @@
 setMethod("E", signature(object = "Norm", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(mean(object))
     })
 
 setMethod("E", signature(object = "Beta", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         if(!isTRUE(all.equal(ncp(object),0)))
           return(E(as(object,"AbscontDistribution"),...))
         else
@@ -293,28 +293,28 @@
 setMethod("E", signature(object = "Binom", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(size(object)*prob(object))
     })
 
 setMethod("E", signature(object = "Cauchy", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(NA)
     })
 
 setMethod("E", signature(object = "Chisq", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(df(object)+ncp(object))
     })
 
 setMethod("E", signature(object = "Dirac", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(location(object))
     })
 
@@ -322,14 +322,14 @@
 setMethod("E", signature(object = "DExp", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(0)
     })
 
 setMethod("E", signature(object = "Exp", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(1/rate(object))
     })
 
@@ -337,7 +337,7 @@
 setMethod("E", signature(object = "Fd", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){ 
+    function(object, fun, cond){ 
         df1 <- df1(object)
         df2 <- df2(object)
         d <- ncp(object)
@@ -347,56 +347,56 @@
 setMethod("E", signature(object = "Gammad", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(shape(object)*scale(object))
     })
 
 setMethod("E", signature(object = "Geom", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(1/ prob(object) -1)
     })
 
 setMethod("E", signature(object = "Hyper", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(k(object)*n(object)/(m(object)+n(object)))
     })
 
 setMethod("E", signature(object = "Logis", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(location(object))
     })
 
 setMethod("E", signature(object = "Lnorm", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(exp(meanlog(object)+sdlog(object)^2/2))
     })
 
 setMethod("E", signature(object = "Nbinom", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(size(object)*(1-prob(object))/prob(object))
     })
 
 setMethod("E", signature(object = "Pois", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(lambda(object))
     })
 
 setMethod("E", signature(object = "Td", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         ## correction thanks to G.Jay Kerns
         return(ifelse( df(object)>1, 
                        ncp(object)*sqrt(df(object)/2)*
@@ -407,13 +407,13 @@
 setMethod("E", signature(object = "Unif", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return((Max(object)+Min(object))/2)
     })
 
 setMethod("E", signature(object = "Weibull", 
                          fun = "missing", 
                          cond = "missing"),
-    function(object){
+    function(object, fun, cond){
         return(scale(object)*gamma(1+1/shape(object)))
     })

Modified: branches/distr-2.0/pkg/distrEx/R/Functionals.R
===================================================================
--- branches/distr-2.0/pkg/distrEx/R/Functionals.R	2008-06-06 09:36:22 UTC (rev 173)
+++ branches/distr-2.0/pkg/distrEx/R/Functionals.R	2008-06-06 11:59:20 UTC (rev 174)
@@ -180,7 +180,7 @@
     })
 
 setMethod("var", signature(x = "Dirac"),
-    function(x){return(0)})
+    function(x, ...){return(0)})
 
 
 setMethod("var", signature(x = "DExp"),

Modified: branches/distr-2.0/pkg/distrEx/R/Kurtosis.R
===================================================================
--- branches/distr-2.0/pkg/distrEx/R/Kurtosis.R	2008-06-06 09:36:22 UTC (rev 173)
+++ branches/distr-2.0/pkg/distrEx/R/Kurtosis.R	2008-06-06 11:59:20 UTC (rev 174)
@@ -93,7 +93,7 @@
     })
 #
 setMethod("kurtosis", signature(x = "Dirac"),
-    function(x){return(0)})
+    function(x, ...){return(0)})
 
 #
 setMethod("kurtosis", signature(x = "DExp"),

Modified: branches/distr-2.0/pkg/distrEx/R/Skewness.R
===================================================================
--- branches/distr-2.0/pkg/distrEx/R/Skewness.R	2008-06-06 09:36:22 UTC (rev 173)
+++ branches/distr-2.0/pkg/distrEx/R/Skewness.R	2008-06-06 11:59:20 UTC (rev 174)
@@ -83,7 +83,7 @@
     })
 #
 setMethod("skewness", signature(x = "Dirac"),
-    function(x){return(0)})
+    function(x, ...){return(0)})
 
 #
 setMethod("skewness", signature(x = "DExp"),

Modified: branches/distr-2.0/pkg/distrEx/man/E.Rd
===================================================================
--- branches/distr-2.0/pkg/distrEx/man/E.Rd	2008-06-06 09:36:22 UTC (rev 173)
+++ branches/distr-2.0/pkg/distrEx/man/E.Rd	2008-06-06 11:59:20 UTC (rev 174)
@@ -59,17 +59,17 @@
 
 \S4method{E}{DiscreteDistribution,function,missing}(object, fun, cond, useApply = TRUE, ...)
 
-\S4method{E}{AffLinDistribution,missing,missing}(object)
+\S4method{E}{AffLinDistribution,missing,missing}(object, fun, cond)
 
-\S4method{E}{AffLinUnivarLebDecDistribution,missing,missing}(object)
+\S4method{E}{AffLinUnivarLebDecDistribution,missing,missing}(object, fun, cond)
 
 \S4method{E}{MultivariateDistribution,function,missing}(object, fun, cond, useApply = TRUE, ...)
 
 \S4method{E}{DiscreteMVDistribution,function,missing}(object, fun, cond, useApply = TRUE, ...)
 
-\S4method{E}{AbscontCondDistribution,missing,numeric}(object, cond, useApply = TRUE)
+\S4method{E}{AbscontCondDistribution,missing,numeric}(object, fun, cond, useApply = TRUE)
 
-\S4method{E}{DiscreteCondDistribution,missing,numeric}(object, cond, useApply = TRUE)
+\S4method{E}{DiscreteCondDistribution,missing,numeric}(object, fun, cond, useApply = TRUE)
 
 \S4method{E}{UnivariateCondDistribution,function,numeric}(object, fun, cond, withCond = FALSE, useApply = TRUE, ...)
 

Modified: branches/distr-2.0/pkg/distrEx/man/HellingerDist.Rd
===================================================================
--- branches/distr-2.0/pkg/distrEx/man/HellingerDist.Rd	2008-06-06 09:36:22 UTC (rev 173)
+++ branches/distr-2.0/pkg/distrEx/man/HellingerDist.Rd	2008-06-06 11:59:20 UTC (rev 174)
@@ -29,11 +29,11 @@
 \S4method{HellingerDist}{numeric,DiscreteDistribution}(e1, e2)
 \S4method{HellingerDist}{DiscreteDistribution,numeric}(e1, e2)
 \S4method{HellingerDist}{numeric,AbscontDistribution}(e1, e2, asis.smooth.discretize = "discretize", 
-            n.discr = getdistrModOption("nDiscretize"), low.discr = getLow(e2),
-            up.discr = getUp(e2), h.smooth = getdistrModOption("hSmooth"))
+            n.discr = getdistrExOption("nDiscretize"), low.discr = getLow(e2),
+            up.discr = getUp(e2), h.smooth = getdistrExOption("hSmooth"))
 \S4method{HellingerDist}{AbscontDistribution,numeric}(e1, e2, asis.smooth.discretize = "discretize", 
-            n.discr = getdistrModOption("nDiscretize"), low.discr = getLow(e2),
-            up.discr = getUp(e2), h.smooth = getdistrModOption("hSmooth"))
+            n.discr = getdistrExOption("nDiscretize"), low.discr = getLow(e1),
+            up.discr = getUp(e1), h.smooth = getdistrExOption("hSmooth"))
 \S4method{HellingerDist}{AcDcLcDistribution,AcDcLcDistribution}(e1,e2)
 }
 \arguments{

Modified: branches/distr-2.0/pkg/distrEx/man/TotalVarDist.Rd
===================================================================
--- branches/distr-2.0/pkg/distrEx/man/TotalVarDist.Rd	2008-06-06 09:36:22 UTC (rev 173)
+++ branches/distr-2.0/pkg/distrEx/man/TotalVarDist.Rd	2008-06-06 11:59:20 UTC (rev 174)
@@ -28,11 +28,11 @@
 \S4method{TotalVarDist}{numeric,DiscreteDistribution}(e1, e2)
 \S4method{TotalVarDist}{DiscreteDistribution,numeric}(e1, e2)
 \S4method{TotalVarDist}{numeric,AbscontDistribution}(e1, e2, asis.smooth.discretize = "discretize", 
-            n.discr = getdistrModOption("nDiscretize"), low.discr = getLow(e2),
-            up.discr = getUp(e2), h.smooth = getdistrModOption("hSmooth"))
+            n.discr = getdistrExOption("nDiscretize"), low.discr = getLow(e2),
+            up.discr = getUp(e2), h.smooth = getdistrExOption("hSmooth"))
 \S4method{TotalVarDist}{AbscontDistribution,numeric}(e1, e2, asis.smooth.discretize = "discretize", 
-            n.discr = getdistrModOption("nDiscretize"), low.discr = getLow(e2),
-            up.discr = getUp(e2), h.smooth = getdistrModOption("hSmooth"))
+            n.discr = getdistrExOption("nDiscretize"), low.discr = getLow(e1),
+            up.discr = getUp(e1), h.smooth = getdistrExOption("hSmooth"))
 \S4method{TotalVarDist}{AcDcLcDistribution,AcDcLcDistribution}(e1, e2)
 }
 \arguments{

Modified: branches/distr-2.0/pkg/distrEx/man/Var.Rd
===================================================================
--- branches/distr-2.0/pkg/distrEx/man/Var.Rd	2008-06-06 09:36:22 UTC (rev 173)
+++ branches/distr-2.0/pkg/distrEx/man/Var.Rd	2008-06-06 11:59:20 UTC (rev 174)
@@ -188,71 +188,71 @@
 
 \S4method{var}{UnivariateDistribution}(x, fun, cond, withCond, useApply, ...)
 \S4method{var}{AffLinDistribution}(x, fun, cond, withCond, useApply, ...)
-\S4method{var}{Binom}(x)
-\S4method{var}{Beta}(x)
-\S4method{var}{Cauchy}(x)
-\S4method{var}{Chisq}(x)
-\S4method{var}{Dirac}(x)
-\S4method{var}{DExp}(x)
-\S4method{var}{Exp}(x)
-\S4method{var}{Fd}(x)
-\S4method{var}{Gammad}(x)
-\S4method{var}{Geom}(x)
-\S4method{var}{Hyper}(x)
-\S4method{var}{Logis}(x)
-\S4method{var}{Lnorm}(x)
-\S4method{var}{Nbinom}(x)
-\S4method{var}{Norm}(x)
-\S4method{var}{Pois}(x)
-\S4method{var}{Td}(x)
-\S4method{var}{Unif}(x)
-\S4method{var}{Weibull}(x)
+\S4method{var}{Binom}(x, ...)
+\S4method{var}{Beta}(x, ...)
+\S4method{var}{Cauchy}(x, ...)
+\S4method{var}{Chisq}(x, ...)
+\S4method{var}{Dirac}(x, ...)
+\S4method{var}{DExp}(x, ...)
+\S4method{var}{Exp}(x, ...)
+\S4method{var}{Fd}(x, ...)
+\S4method{var}{Gammad}(x, ...)
+\S4method{var}{Geom}(x, ...)
+\S4method{var}{Hyper}(x, ...)
+\S4method{var}{Logis}(x, ...)
+\S4method{var}{Lnorm}(x, ...)
+\S4method{var}{Nbinom}(x, ...)
+\S4method{var}{Norm}(x, ...)
+\S4method{var}{Pois}(x, ...)
+\S4method{var}{Td}(x, ...)
+\S4method{var}{Unif}(x, ...)
+\S4method{var}{Weibull}(x, ...)
 
 skewness(x, ...)
 \S4method{skewness}{UnivariateDistribution}(x, fun, cond, withCond, useApply, ...)
 \S4method{skewness}{AffLinDistribution}(x, fun, cond, withCond, useApply, ...)
-\S4method{skewness}{Binom}(x)
-\S4method{skewness}{Beta}(x)
-\S4method{skewness}{Cauchy}(x)
-\S4method{skewness}{Chisq}(x)
-\S4method{skewness}{Dirac}(x)
-\S4method{skewness}{DExp}(x)
-\S4method{skewness}{Exp}(x)
-\S4method{skewness}{Fd}(x)
-\S4method{skewness}{Gammad}(x)
-\S4method{skewness}{Geom}(x)
-\S4method{skewness}{Hyper}(x)
-\S4method{skewness}{Logis}(x)
-\S4method{skewness}{Lnorm}(x)
-\S4method{skewness}{Nbinom}(x)
-\S4method{skewness}{Norm}(x)
-\S4method{skewness}{Pois}(x)
-\S4method{skewness}{Td}(x)
-\S4method{skewness}{Unif}(x)
-\S4method{skewness}{Weibull}(x)
+\S4method{skewness}{Binom}(x, ...)
+\S4method{skewness}{Beta}(x, ...)
+\S4method{skewness}{Cauchy}(x, ...)
+\S4method{skewness}{Chisq}(x, ...)
+\S4method{skewness}{Dirac}(x, ...)
+\S4method{skewness}{DExp}(x, ...)
+\S4method{skewness}{Exp}(x, ...)
+\S4method{skewness}{Fd}(x, ...)
+\S4method{skewness}{Gammad}(x, ...)
+\S4method{skewness}{Geom}(x, ...)
+\S4method{skewness}{Hyper}(x, ...)
+\S4method{skewness}{Logis}(x, ...)
+\S4method{skewness}{Lnorm}(x, ...)
+\S4method{skewness}{Nbinom}(x, ...)
+\S4method{skewness}{Norm}(x, ...)
+\S4method{skewness}{Pois}(x, ...)
+\S4method{skewness}{Td}(x, ...)
+\S4method{skewness}{Unif}(x, ...)
+\S4method{skewness}{Weibull}(x, ...)
 
 kurtosis(x, ...)
 \S4method{kurtosis}{UnivariateDistribution}(x, fun, cond, withCond, useApply, ...)
 \S4method{kurtosis}{AffLinDistribution}(x, fun, cond, withCond, useApply, ...)
-\S4method{kurtosis}{Binom}(x)
-\S4method{kurtosis}{Beta}(x)
-\S4method{kurtosis}{Cauchy}(x)
-\S4method{kurtosis}{Chisq}(x)
-\S4method{kurtosis}{Dirac}(x)
-\S4method{kurtosis}{DExp}(x)
-\S4method{kurtosis}{Exp}(x)
-\S4method{kurtosis}{Fd}(x)
-\S4method{kurtosis}{Gammad}(x)
-\S4method{kurtosis}{Geom}(x)
-\S4method{kurtosis}{Hyper}(x)
-\S4method{kurtosis}{Logis}(x)
-\S4method{kurtosis}{Lnorm}(x)
-\S4method{kurtosis}{Nbinom}(x)
-\S4method{kurtosis}{Norm}(x)
-\S4method{kurtosis}{Pois}(x)
-\S4method{kurtosis}{Td}(x)
-\S4method{kurtosis}{Unif}(x)
-\S4method{kurtosis}{Weibull}(x)
+\S4method{kurtosis}{Binom}(x, ...)
+\S4method{kurtosis}{Beta}(x, ...)
+\S4method{kurtosis}{Cauchy}(x, ...)
+\S4method{kurtosis}{Chisq}(x, ...)
+\S4method{kurtosis}{Dirac}(x, ...)
+\S4method{kurtosis}{DExp}(x, ...)
+\S4method{kurtosis}{Exp}(x, ...)
+\S4method{kurtosis}{Fd}(x, ...)
+\S4method{kurtosis}{Gammad}(x, ...)
+\S4method{kurtosis}{Geom}(x, ...)
+\S4method{kurtosis}{Hyper}(x, ...)
+\S4method{kurtosis}{Logis}(x, ...)
+\S4method{kurtosis}{Lnorm}(x, ...)
+\S4method{kurtosis}{Nbinom}(x, ...)
+\S4method{kurtosis}{Norm}(x, ...)
+\S4method{kurtosis}{Pois}(x, ...)
+\S4method{kurtosis}{Td}(x, ...)
+\S4method{kurtosis}{Unif}(x, ...)
+\S4method{kurtosis}{Weibull}(x, ...)
 }
 \arguments{
   \item{x}{ object of class \code{"UnivariateDistribution"}}



More information about the Distr-commits mailing list