[Distr-commits] r434 - branches/distr-2.2/pkg/distr/R branches/distr-2.2/pkg/distr/man branches/distr-2.2/pkg/distrMod/man pkg/distr/R pkg/distr/chm pkg/distr/man pkg/distrMod/chm pkg/distrMod/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Mon Mar 23 21:16:31 CET 2009


Author: ruckdeschel
Date: 2009-03-23 21:16:31 +0100 (Mon, 23 Mar 2009)
New Revision: 434

Modified:
   branches/distr-2.2/pkg/distr/R/Truncate.R
   branches/distr-2.2/pkg/distr/man/Truncate-methods.Rd
   branches/distr-2.2/pkg/distrMod/man/L2ParamFamily-class.Rd
   pkg/distr/R/Truncate.R
   pkg/distr/chm/Distr.chm
   pkg/distr/chm/Truncate-methods.html
   pkg/distr/man/Truncate-methods.Rd
   pkg/distrMod/chm/00Index.html
   pkg/distrMod/chm/L2ParamFamily-class.html
   pkg/distrMod/chm/distrMod.chm
   pkg/distrMod/chm/distrMod.toc
   pkg/distrMod/man/L2ParamFamily-class.Rd
Log:
fixed an inconsistency of Truncate for DiscreteDistributions; to better match Huberize and Min/Max
Truncation should be done for m<=object<=M instead of m<object<=M --- also the reason why 
demo censoredPois of distrMod threw errors.

Modified: branches/distr-2.2/pkg/distr/R/Truncate.R
===================================================================
--- branches/distr-2.2/pkg/distr/R/Truncate.R	2009-03-23 14:31:10 UTC (rev 433)
+++ branches/distr-2.2/pkg/distr/R/Truncate.R	2009-03-23 20:16:31 UTC (rev 434)
@@ -142,11 +142,11 @@
                  M1 <- ceiling(abs(M-p)/abs(w))
                  m1 <- floor(abs(p-m)/abs(w))
                  s1 <- if(m1>1 && m<p) 
-                          rev(seq(from = p, by = -abs(w), length.out = m1)) else NULL
+                          rev(seq(from = p, by = -abs(w), length.out = m1+1)) else NULL
                  S1 <- if(M1>1 && M>p) 
                           seq(from = p, by = abs(w), length.out = M1)[-1] else NULL
-                 support <- c(s1,p,S1)
-                 support <- support[support<=M & support>m]
+                 support <- sort(unique(c(s1,p,S1)))
+                 support <- support[support<=M & support>=m]
                  
                  X <- LatticeDistribution(check = FALSE, 
                        DiscreteDistribution = new("DiscreteDistribution", 
@@ -167,7 +167,7 @@
             if((lower <= getLow(object))&&(upper >= getUp(object)))
                return(object)
             supp <- support(object)
-            newsupport <- supp[supp<=upper & supp>lower]
+            newsupport <- supp[supp<=upper & supp>=lower]
             if(! length(newsupport))
                stop("too little mass between args 'lower' and 'upper'")
             pnewsupport <- d(object)(newsupport)/sum(d(object)(newsupport))

Modified: branches/distr-2.2/pkg/distr/man/Truncate-methods.Rd
===================================================================
--- branches/distr-2.2/pkg/distr/man/Truncate-methods.Rd	2009-03-23 14:31:10 UTC (rev 433)
+++ branches/distr-2.2/pkg/distr/man/Truncate-methods.Rd	2009-03-23 20:16:31 UTC (rev 434)
@@ -29,7 +29,7 @@
 \section{Methods}{\describe{
 \item{Truncate}{\code{signature(object = "AbscontDistribution")}: 
 returns the distribution of \code{min(upper,max(X,lower))}
-conditioned to \code{lower<X<=upper}, if \code{X} is 
+conditioned to \code{lower<=X<=upper}, if \code{X} is 
 distributed according to \code{object};
 if slot \code{.logExact} of argument \code{object} is \code{TRUE} 
 and if either there is only one-sided truncation or both truncation
@@ -47,7 +47,7 @@
 }
 \item{Truncate}{\code{signature(object = "DiscreteDistribution")}: 
 returns the distribution of \code{min(upper,max(X,lower))}
-conditioned to \code{lower<X<=upper}, if \code{X} is 
+conditioned to \code{lower<=X<=upper}, if \code{X} is 
 distributed according to \code{object};
 the result is again of class \code{"DiscreteDistribution"}}
 \item{Truncate}{\code{signature(object = "LatticeDistribution")}: 
@@ -59,7 +59,7 @@
 the result is again of class \code{"LatticeDistribution"}}
 \item{Truncate}{\code{signature(object = "UnivarLebDecDistribution")}: 
 returns the distribution of \code{min(upper,max(X,lower))}
-conditioned to \code{lower<X<=upper}, if \code{X} is 
+conditioned to \code{lower<=X<=upper}, if \code{X} is 
 distributed according to \code{object};
 the result is again of class \code{"UnivarLebDecDistribution"}}
 }}

Modified: branches/distr-2.2/pkg/distrMod/man/L2ParamFamily-class.Rd
===================================================================
--- branches/distr-2.2/pkg/distrMod/man/L2ParamFamily-class.Rd	2009-03-23 14:31:10 UTC (rev 433)
+++ branches/distr-2.2/pkg/distrMod/man/L2ParamFamily-class.Rd	2009-03-23 20:16:31 UTC (rev 434)
@@ -1,5 +1,7 @@
 \name{L2ParamFamily-class}
 \docType{class}
+\alias{plot}
+\alias{plot-methods}
 \alias{L2ParamFamily-class}
 \alias{FisherInfo}
 \alias{FisherInfo,L2ParamFamily,missing-method}

Modified: pkg/distr/R/Truncate.R
===================================================================
--- pkg/distr/R/Truncate.R	2009-03-23 14:31:10 UTC (rev 433)
+++ pkg/distr/R/Truncate.R	2009-03-23 20:16:31 UTC (rev 434)
@@ -142,11 +142,11 @@
                  M1 <- ceiling(abs(M-p)/abs(w))
                  m1 <- floor(abs(p-m)/abs(w))
                  s1 <- if(m1>1 && m<p) 
-                          rev(seq(from = p, by = -abs(w), length.out = m1)) else NULL
+                          rev(seq(from = p, by = -abs(w), length.out = m1+1)) else NULL
                  S1 <- if(M1>1 && M>p) 
                           seq(from = p, by = abs(w), length.out = M1)[-1] else NULL
-                 support <- c(s1,p,S1)
-                 support <- support[support<=M & support>m]
+                 support <- sort(unique(c(s1,p,S1)))
+                 support <- support[support<=M & support>=m]
                  
                  X <- LatticeDistribution(check = FALSE, 
                        DiscreteDistribution = new("DiscreteDistribution", 
@@ -167,7 +167,7 @@
             if((lower <= getLow(object))&&(upper >= getUp(object)))
                return(object)
             supp <- support(object)
-            newsupport <- supp[supp<=upper & supp>lower]
+            newsupport <- supp[supp<=upper & supp>=lower]
             if(! length(newsupport))
                stop("too little mass between args 'lower' and 'upper'")
             pnewsupport <- d(object)(newsupport)/sum(d(object)(newsupport))

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

Modified: pkg/distr/chm/Truncate-methods.html
===================================================================
--- pkg/distr/chm/Truncate-methods.html	2009-03-23 14:31:10 UTC (rev 433)
+++ pkg/distr/chm/Truncate-methods.html	2009-03-23 20:16:31 UTC (rev 434)
@@ -73,7 +73,7 @@
 <dl>
 <dt>Truncate</dt><dd><code>signature(object = "AbscontDistribution")</code>: 
 returns the distribution of <code>min(upper,max(X,lower))</code>
-conditioned to <code>lower&lt;X&lt;=upper</code>, if <code>X</code> is 
+conditioned to <code>lower&lt;=X&lt;=upper</code>, if <code>X</code> is 
 distributed according to <code>object</code>;
 if slot <code>.logExact</code> of argument <code>object</code> is <code>TRUE</code> 
 and if either there is only one-sided truncation or both truncation
@@ -91,7 +91,7 @@
 </dd>
 <dt>Truncate</dt><dd><code>signature(object = "DiscreteDistribution")</code>: 
 returns the distribution of <code>min(upper,max(X,lower))</code>
-conditioned to <code>lower&lt;X&lt;=upper</code>, if <code>X</code> is 
+conditioned to <code>lower&lt;=X&lt;=upper</code>, if <code>X</code> is 
 distributed according to <code>object</code>;
 the result is again of class <code>"DiscreteDistribution"</code></dd>
 <dt>Truncate</dt><dd><code>signature(object = "LatticeDistribution")</code>: 
@@ -103,7 +103,7 @@
 the result is again of class <code>"LatticeDistribution"</code></dd>
 <dt>Truncate</dt><dd><code>signature(object = "UnivarLebDecDistribution")</code>: 
 returns the distribution of <code>min(upper,max(X,lower))</code>
-conditioned to <code>lower&lt;X&lt;=upper</code>, if <code>X</code> is 
+conditioned to <code>lower&lt;=X&lt;=upper</code>, if <code>X</code> is 
 distributed according to <code>object</code>;
 the result is again of class <code>"UnivarLebDecDistribution"</code></dd>
 </dl>

Modified: pkg/distr/man/Truncate-methods.Rd
===================================================================
--- pkg/distr/man/Truncate-methods.Rd	2009-03-23 14:31:10 UTC (rev 433)
+++ pkg/distr/man/Truncate-methods.Rd	2009-03-23 20:16:31 UTC (rev 434)
@@ -29,7 +29,7 @@
 \section{Methods}{\describe{
 \item{Truncate}{\code{signature(object = "AbscontDistribution")}: 
 returns the distribution of \code{min(upper,max(X,lower))}
-conditioned to \code{lower<X<=upper}, if \code{X} is 
+conditioned to \code{lower<=X<=upper}, if \code{X} is 
 distributed according to \code{object};
 if slot \code{.logExact} of argument \code{object} is \code{TRUE} 
 and if either there is only one-sided truncation or both truncation
@@ -47,7 +47,7 @@
 }
 \item{Truncate}{\code{signature(object = "DiscreteDistribution")}: 
 returns the distribution of \code{min(upper,max(X,lower))}
-conditioned to \code{lower<X<=upper}, if \code{X} is 
+conditioned to \code{lower<=X<=upper}, if \code{X} is 
 distributed according to \code{object};
 the result is again of class \code{"DiscreteDistribution"}}
 \item{Truncate}{\code{signature(object = "LatticeDistribution")}: 
@@ -59,7 +59,7 @@
 the result is again of class \code{"LatticeDistribution"}}
 \item{Truncate}{\code{signature(object = "UnivarLebDecDistribution")}: 
 returns the distribution of \code{min(upper,max(X,lower))}
-conditioned to \code{lower<X<=upper}, if \code{X} is 
+conditioned to \code{lower<=X<=upper}, if \code{X} is 
 distributed according to \code{object};
 the result is again of class \code{"UnivarLebDecDistribution"}}
 }}

Modified: pkg/distrMod/chm/00Index.html
===================================================================
--- pkg/distrMod/chm/00Index.html	2009-03-23 14:31:10 UTC (rev 433)
+++ pkg/distrMod/chm/00Index.html	2009-03-23 20:16:31 UTC (rev 434)
@@ -587,10 +587,14 @@
 <td>Generating function for ParamFamParameter-class</td></tr>
 <tr><td width="25%"><a href="ParamFamParameter-class.html">ParamFamParameter-class</a></td>
 <td>Parameter of a parametric family of probability measures</td></tr>
+<tr><td width="25%"><a href="L2ParamFamily-class.html">plot</a></td>
+<td>L2 differentiable parametric family</td></tr>
 <tr><td width="25%"><a href="L2ParamFamily-class.html">plot,L2ParamFamily,missing-method</a></td>
 <td>L2 differentiable parametric family</td></tr>
 <tr><td width="25%"><a href="ParamFamily-class.html">plot,ParamFamily,missing-method</a></td>
 <td>Parametric family of probability measures.</td></tr>
+<tr><td width="25%"><a href="L2ParamFamily-class.html">plot-methods</a></td>
+<td>L2 differentiable parametric family</td></tr>
 <tr><td width="25%"><a href="PoisFamily.html">PoisFamily</a></td>
 <td>Generating function for Poisson families</td></tr>
 <tr><td width="25%"><a href="PosDefSymmMatrix.html">PosDefSymmMatrix</a></td>

Modified: pkg/distrMod/chm/L2ParamFamily-class.html
===================================================================
--- pkg/distrMod/chm/L2ParamFamily-class.html	2009-03-23 14:31:10 UTC (rev 433)
+++ pkg/distrMod/chm/L2ParamFamily-class.html	2009-03-23 20:16:31 UTC (rev 434)
@@ -5,6 +5,8 @@
 <body>
 
 <table width="100%"><tr><td>L2ParamFamily-class(distrMod)</td><td align="right">R Documentation</td></tr></table><object type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
+<param name="keyword" value="R:   plot">
+<param name="keyword" value="R:   plot-methods">
 <param name="keyword" value="R:   L2ParamFamily-class">
 <param name="keyword" value="R:   FisherInfo">
 <param name="keyword" value="R:   FisherInfo,L2ParamFamily,missing-method">

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

Modified: pkg/distrMod/chm/distrMod.toc
===================================================================
--- pkg/distrMod/chm/distrMod.toc	2009-03-23 14:31:10 UTC (rev 433)
+++ pkg/distrMod/chm/distrMod.toc	2009-03-23 20:16:31 UTC (rev 434)
@@ -974,6 +974,10 @@
 <param name="Local" value="ParamFamParameter-class.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="plot">
+<param name="Local" value="L2ParamFamily-class.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="plot,L2ParamFamily,missing-method">
 <param name="Local" value="L2ParamFamily-class.html">
 </OBJECT>
@@ -982,6 +986,10 @@
 <param name="Local" value="ParamFamily-class.html">
 </OBJECT>
 <LI> <OBJECT type="text/sitemap">
+<param name="Name" value="plot-methods">
+<param name="Local" value="L2ParamFamily-class.html">
+</OBJECT>
+<LI> <OBJECT type="text/sitemap">
 <param name="Name" value="PoisFamily">
 <param name="Local" value="PoisFamily.html">
 </OBJECT>

Modified: pkg/distrMod/man/L2ParamFamily-class.Rd
===================================================================
--- pkg/distrMod/man/L2ParamFamily-class.Rd	2009-03-23 14:31:10 UTC (rev 433)
+++ pkg/distrMod/man/L2ParamFamily-class.Rd	2009-03-23 20:16:31 UTC (rev 434)
@@ -1,5 +1,7 @@
 \name{L2ParamFamily-class}
 \docType{class}
+\alias{plot}
+\alias{plot-methods}
 \alias{L2ParamFamily-class}
 \alias{FisherInfo}
 \alias{FisherInfo,L2ParamFamily,missing-method}



More information about the Distr-commits mailing list