[Distr-commits] r128 - in pkg: distr/R distr/man distrMod/chm

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue May 6 14:17:10 CEST 2008


Author: ruckdeschel
Date: 2008-05-06 14:17:10 +0200 (Tue, 06 May 2008)
New Revision: 128

Modified:
   pkg/distr/R/BetaDistribution.R
   pkg/distr/man/Beta-class.Rd
   pkg/distr/man/operators-methods.Rd
   pkg/distrMod/chm/distrMod.chm
Log:
----------
pkg distr 
----------
new exact method for Beta distribution:
if ncp == 0, 1-Beta(sh1,sh2) ~ Beta(sh2,sh1)

Modified: pkg/distr/R/BetaDistribution.R
===================================================================
--- pkg/distr/R/BetaDistribution.R	2008-05-03 14:31:28 UTC (rev 127)
+++ pkg/distr/R/BetaDistribution.R	2008-05-06 12:17:10 UTC (rev 128)
@@ -62,3 +62,9 @@
 setMethod("ncp<-", "Beta", 
            function(object, value) new("Beta", shape1 = shape1(object), 
                                         shape2 = shape2(object), ncp = value))
+
+setMethod("-", c("numeric","Beta"),
+           function(e1, e2) {if(isTRUE(all.equal(e1,1))&&
+                                isTRUE(all.equal(ncp(e2),0)))
+                             return(Beta(shape1=shape2(e2),shape2=shape1(e2)))
+                             else e1-as(e2,"AbscontDistribution")})

Modified: pkg/distr/man/Beta-class.Rd
===================================================================
--- pkg/distr/man/Beta-class.Rd	2008-05-03 14:31:28 UTC (rev 127)
+++ pkg/distr/man/Beta-class.Rd	2008-05-06 12:17:10 UTC (rev 128)
@@ -62,6 +62,9 @@
       returns the slot shape2 of the parameter of the distribution}
     \item{shape2<-}{\code{signature(object = "Beta")}:
       modifies the slot shape2 of the parameter of the distribution}
+    \item{\code{-}}{\code{signature(e1 = "numeric", e2 = "Beta")} if \code{ncp(e2)==0} and \code{e1 == 1},
+     an exact (central) \code{Beta(shape1 = shape2(e2), shape2 = shape1(e2))} is returned, else
+     the default method is used; exact}
   }
 }
 

Modified: pkg/distr/man/operators-methods.Rd
===================================================================
--- pkg/distr/man/operators-methods.Rd	2008-05-03 14:31:28 UTC (rev 127)
+++ pkg/distr/man/operators-methods.Rd	2008-05-06 12:17:10 UTC (rev 128)
@@ -63,6 +63,7 @@
 \alias{+,Logis,numeric-method}
 \alias{+,Dirac,UnivariateDistribution-method}
 \alias{+,UnivariateDistribution,Dirac-method}
+\alias{-,numeric,Beta-method}
 \alias{-,Dirac,Dirac-method}
 \alias{*,Dirac,Dirac-method}
 \alias{*,Dirac,UnivariateDistribution-method}
@@ -119,6 +120,9 @@
 \item{\code{-}}{\code{signature(e1 = "UnivariateDistribution", e2 = "numeric")} is translated to 
  \code{e1 + (-e2)}; exact}
 \item{\code{-}}{\code{signature(e1 = "numeric", e2 = "UnivariateDistribution")} is translated to \code{(-e1) + e2}; exact}
+\item{\code{-}}{\code{signature(e1 = "numeric", e2 = "Beta")} if \code{ncp(e2)==0} and \code{e1 == 1},
+an exact (central) \code{Beta(shape1 = shape2(e2), shape2 = shape1(e2))} is returned, else
+the default method is used; exact}
 \item{\code{*}}{\code{signature(e1 = "UnivariateDistribution", e2 = "numeric")} result again of class \code{"UnivariateDistribution"}; exact}
 \item{\code{*}}{\code{signature(e1 = "AbscontDistribution", e2 = "numeric")} result of 
  class \code{"AffLinAbscontDistribution"}; exact}

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



More information about the Distr-commits mailing list