[Distr-commits] r432 - branches/distr-2.2/pkg/distrEx/R pkg/distrEx/R pkg/distrEx/chm

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Mar 23 15:05:01 CET 2009


Author: ruckdeschel
Date: 2009-03-23 15:05:01 +0100 (Mon, 23 Mar 2009)
New Revision: 432

Modified:
   branches/distr-2.2/pkg/distrEx/R/ClippedMoments.R
   pkg/distrEx/R/ClippedMoments.R
   pkg/distrEx/chm/00Index.html
   pkg/distrEx/chm/distrEx.chm
   pkg/distrEx/chm/distrEx.toc
   pkg/distrEx/chm/m2df.html
Log:
fixed a buglet in m2df method for LatticeDistribution (a catch for existing fun argument was missing).

Modified: branches/distr-2.2/pkg/distrEx/R/ClippedMoments.R
===================================================================
--- branches/distr-2.2/pkg/distrEx/R/ClippedMoments.R	2009-03-23 13:52:40 UTC (rev 431)
+++ branches/distr-2.2/pkg/distrEx/R/ClippedMoments.R	2009-03-23 14:05:01 UTC (rev 432)
@@ -170,9 +170,18 @@
     function(object, upper, ...){
       E(as(object, "DiscreteDistribution"), upp = upper, ...)
     })
+
 setMethod("m2df", "LatticeDistribution",
     function(object, upper, ...){
-        E(as(object, "DiscreteDistribution"), fun=function(x)x^2, upp = upper, ...)
+        mc <- as.list(match.call(call = sys.call(sys.parent(1))))[-1]
+        mc1 <- mc        
+        fun0 <- if(is.null(mc$fun)) 
+                   function(x)x^2 else function(x) (eval(mc1$fun)(x))^2
+        mc$fun <- fun0
+        mc$upper <- NULL
+        mc$upp <- upper
+        mc$object <- as(object, "DiscreteDistribution")
+        return(do.call("E", args=mc ))
     })
 
 setMethod("m1df", "AffLinDistribution", 

Modified: pkg/distrEx/R/ClippedMoments.R
===================================================================
--- pkg/distrEx/R/ClippedMoments.R	2009-03-23 13:52:40 UTC (rev 431)
+++ pkg/distrEx/R/ClippedMoments.R	2009-03-23 14:05:01 UTC (rev 432)
@@ -170,9 +170,18 @@
     function(object, upper, ...){
       E(as(object, "DiscreteDistribution"), upp = upper, ...)
     })
+
 setMethod("m2df", "LatticeDistribution",
     function(object, upper, ...){
-        E(as(object, "DiscreteDistribution"), fun=function(x)x^2, upp = upper, ...)
+        mc <- as.list(match.call(call = sys.call(sys.parent(1))))[-1]
+        mc1 <- mc        
+        fun0 <- if(is.null(mc$fun)) 
+                   function(x)x^2 else function(x) (eval(mc1$fun)(x))^2
+        mc$fun <- fun0
+        mc$upper <- NULL
+        mc$upp <- upper
+        mc$object <- as(object, "DiscreteDistribution")
+        return(do.call("E", args=mc ))
     })
 
 setMethod("m1df", "AffLinDistribution", 

Modified: pkg/distrEx/chm/00Index.html
===================================================================
--- pkg/distrEx/chm/00Index.html	2009-03-23 13:52:40 UTC (rev 431)
+++ pkg/distrEx/chm/00Index.html	2009-03-23 14:05:01 UTC (rev 432)
@@ -546,14 +546,10 @@
 <td>Function to change the global variables of the package 'distrEx'</td></tr>
 <tr><td width="25%"><a href="m2df.html">m2df</a></td>
 <td>Generic function for the computation of clipped second moments</td></tr>
-<tr><td width="25%"><a href="m2df.html">m2df,AbscontDistribution-method</a></td>
-<td>Generic function for the computation of clipped second moments</td></tr>
 <tr><td width="25%"><a href="m2df.html">m2df,Binom-method</a></td>
 <td>Generic function for the computation of clipped second moments</td></tr>
 <tr><td width="25%"><a href="m2df.html">m2df,Chisq-method</a></td>
 <td>Generic function for the computation of clipped second moments</td></tr>
-<tr><td width="25%"><a href="m2df.html">m2df,DiscreteDistribution-method</a></td>
-<td>Generic function for the computation of clipped second moments</td></tr>
 <tr><td width="25%"><a href="m2df.html">m2df,Exp-method</a></td>
 <td>Generic function for the computation of clipped second moments</td></tr>
 <tr><td width="25%"><a href="m2df.html">m2df,LatticeDistribution-method</a></td>

Modified: pkg/distrEx/chm/distrEx.chm
===================================================================
(Binary files differ)

Modified: pkg/distrEx/chm/distrEx.toc
===================================================================
--- pkg/distrEx/chm/distrEx.toc	2009-03-23 13:52:40 UTC (rev 431)
+++ pkg/distrEx/chm/distrEx.toc	2009-03-23 14:05:01 UTC (rev 432)
@@ -914,10 +914,6 @@
 <param name="Local" value="m2df.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
-<param name="Name" value="m2df,AbscontDistribution-method">
-<param name="Local" value="m2df.html">
-</OBJECT>
-<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="m2df,Binom-method">
 <param name="Local" value="m2df.html">
 </OBJECT>
@@ -926,10 +922,6 @@
 <param name="Local" value="m2df.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
-<param name="Name" value="m2df,DiscreteDistribution-method">
-<param name="Local" value="m2df.html">
-</OBJECT>
-<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="m2df,Exp-method">
 <param name="Local" value="m2df.html">
 </OBJECT>

Modified: pkg/distrEx/chm/m2df.html
===================================================================
--- pkg/distrEx/chm/m2df.html	2009-03-23 13:52:40 UTC (rev 431)
+++ pkg/distrEx/chm/m2df.html	2009-03-23 14:05:01 UTC (rev 432)
@@ -8,8 +8,6 @@
 <param name="keyword" value="R:   m2df">
 <param name="keyword" value="R:   m2df-methods">
 <param name="keyword" value="R:   m2df,UnivariateDistribution-method">
-<param name="keyword" value="R:   m2df,AbscontDistribution-method">
-<param name="keyword" value="R:   m2df,DiscreteDistribution-method">
 <param name="keyword" value="R:   m2df,LatticeDistribution-method">
 <param name="keyword" value="R:   m2df,Binom-method">
 <param name="keyword" value="R:   m2df,Pois-method">



More information about the Distr-commits mailing list