[Distr-commits] r491 - in branches/distr-2.2/pkg: distr/R distr/chm distr/man distrEllipse distrEllipse/R distrEllipse/chm distrEllipse/man distrSim/man distrTEst/man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Jun 30 12:38:00 CEST 2009


Author: ruckdeschel
Date: 2009-06-30 12:37:56 +0200 (Tue, 30 Jun 2009)
New Revision: 491

Modified:
   branches/distr-2.2/pkg/distr/R/AllClasses.R
   branches/distr-2.2/pkg/distr/R/DistrList.R
   branches/distr-2.2/pkg/distr/chm/Distr.chm
   branches/distr-2.2/pkg/distr/chm/DistrList.html
   branches/distr-2.2/pkg/distr/chm/UnivarDistrList.html
   branches/distr-2.2/pkg/distr/man/DistrList.Rd
   branches/distr-2.2/pkg/distr/man/UnivarDistrList.Rd
   branches/distr-2.2/pkg/distrEllipse/NAMESPACE
   branches/distr-2.2/pkg/distrEllipse/R/01.R
   branches/distr-2.2/pkg/distrEllipse/R/AllClasses.R
   branches/distr-2.2/pkg/distrEllipse/R/EllipticalDistribution.R
   branches/distr-2.2/pkg/distrEllipse/R/MVMixingDistribution.R
   branches/distr-2.2/pkg/distrEllipse/R/MultivariateDistrList.R
   branches/distr-2.2/pkg/distrEllipse/R/SphericalDistribution.R
   branches/distr-2.2/pkg/distrEllipse/chm/00Index.html
   branches/distr-2.2/pkg/distrEllipse/chm/0distrEllipse-package.html
   branches/distr-2.2/pkg/distrEllipse/chm/EllipticalDistribution-class.html
   branches/distr-2.2/pkg/distrEllipse/chm/MultivarDistrList-class.html
   branches/distr-2.2/pkg/distrEllipse/chm/MultivarDistrList.html
   branches/distr-2.2/pkg/distrEllipse/chm/MultivarMixingDistribution-class.html
   branches/distr-2.2/pkg/distrEllipse/chm/MultivarMixingDistribution.html
   branches/distr-2.2/pkg/distrEllipse/chm/MvnormDistribution.html
   branches/distr-2.2/pkg/distrEllipse/chm/MvnormParameter-class.html
   branches/distr-2.2/pkg/distrEllipse/chm/MvtDistribution.html
   branches/distr-2.2/pkg/distrEllipse/chm/MvtParameter-class.html
   branches/distr-2.2/pkg/distrEllipse/chm/SphericalDistribution-class.html
   branches/distr-2.2/pkg/distrEllipse/chm/SphericalDistribution.html
   branches/distr-2.2/pkg/distrEllipse/chm/distrEllipse.chm
   branches/distr-2.2/pkg/distrEllipse/chm/distrEllipse.toc
   branches/distr-2.2/pkg/distrEllipse/chm/distrEllipseoptions.html
   branches/distr-2.2/pkg/distrEllipse/chm/plot-methods.html
   branches/distr-2.2/pkg/distrEllipse/man/0distrEllipse-package.Rd
   branches/distr-2.2/pkg/distrEllipse/man/EllipticalDistribution-class.Rd
   branches/distr-2.2/pkg/distrEllipse/man/MultivarDistrList-class.Rd
   branches/distr-2.2/pkg/distrEllipse/man/MultivarDistrList.Rd
   branches/distr-2.2/pkg/distrEllipse/man/MultivarMixingDistribution-class.Rd
   branches/distr-2.2/pkg/distrEllipse/man/MultivarMixingDistribution.Rd
   branches/distr-2.2/pkg/distrEllipse/man/MvnormDistribution.Rd
   branches/distr-2.2/pkg/distrEllipse/man/MvnormParameter-class.Rd
   branches/distr-2.2/pkg/distrEllipse/man/MvtDistribution.Rd
   branches/distr-2.2/pkg/distrEllipse/man/MvtParameter-class.Rd
   branches/distr-2.2/pkg/distrEllipse/man/SphericalDistribution-class.Rd
   branches/distr-2.2/pkg/distrEllipse/man/SphericalDistribution.Rd
   branches/distr-2.2/pkg/distrEllipse/man/distrEllipseoptions.Rd
   branches/distr-2.2/pkg/distrEllipse/man/plot-methods.Rd
   branches/distr-2.2/pkg/distrSim/man/0distrSim-package.Rd
   branches/distr-2.2/pkg/distrTEst/man/0distrTEst-package.Rd
Log:
+ in distr generating functions [Univar]DistrList() gain Dlist argument
+ distrEllipse checks error-free (uff!) 

Modified: branches/distr-2.2/pkg/distr/R/AllClasses.R
===================================================================
--- branches/distr-2.2/pkg/distr/R/AllClasses.R	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distr/R/AllClasses.R	2009-06-30 10:37:56 UTC (rev 491)
@@ -1069,7 +1069,7 @@
                 nrvalues <- length(object)
                 for(i in 1:nrvalues)
                     if(!is(object[[i]], "UnivariateDistribution"))
-                        stop("element ", i, " is no 'UniveriateDistribution'")
+                        stop("element ", i, " is no 'UnivariateDistribution'")
                 return(TRUE) 
             })
 

Modified: branches/distr-2.2/pkg/distr/R/DistrList.R
===================================================================
--- branches/distr-2.2/pkg/distr/R/DistrList.R	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distr/R/DistrList.R	2009-06-30 10:37:56 UTC (rev 491)
@@ -1,18 +1,40 @@
 # generating function for class 'DistrList'
-DistrList <- function(...){ 
-    new("DistrList", list(...)) 
+
+
+DistrList <- function(..., Dlist){
+    ldots <- list(...)
+    if(!missing(Dlist)){
+        Dlist.L <- as(Dlist, "list")
+        if(!is(try(do.call(DistrList,args=Dlist.L),silent=TRUE),"try-error"))
+            ldots <- c(ldots, Dlist.L)
+       }
+    l <- length(ldots)
+    if(l==0) return(NULL) else{
+       do.call(new, args=list("DistrList", c(ldots)))
+    }
 }
 
+
 # coerce to "DistrList"
 setAs(from = "Distribution", to = "DistrList", 
     def = function(from){ new("DistrList", list(from)) })
 
 
 # generating function for class 'UnivarDistrList'
-UnivarDistrList <- function(...){ 
-    new("UnivarDistrList", list(...)) 
+UnivarDistrList <- function(..., Dlist){
+    ldots <- list(...)
+    if(!missing(Dlist)){
+        Dlist.L <- as(Dlist, "list")
+        if(!is(try(do.call(UnivarDistrList,args=Dlist.L),silent=TRUE),"try-error"))
+            ldots <- c(ldots, Dlist.L)
+       }
+    l <- length(ldots)
+    if(l==0) return(NULL) else{
+       do.call(new, args=list("UnivarDistrList", c(ldots)))
+    }
 }
 
+
 # coerce to "UnivarDistrList"
 setAs(from = "UnivariateDistribution", to = "UnivarDistrList", 
     def = function(from){ new("UnivarDistrList", list(from)) })

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

Modified: branches/distr-2.2/pkg/distr/chm/DistrList.html
===================================================================
--- branches/distr-2.2/pkg/distr/chm/DistrList.html	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distr/chm/DistrList.html	2009-06-30 10:37:56 UTC (rev 491)
@@ -22,7 +22,7 @@
 
 <h3>Usage</h3>
 
-<pre>DistrList(...)</pre>
+<pre>DistrList(..., Dlist)</pre>
 
 
 <h3>Arguments</h3>
@@ -30,8 +30,14 @@
 <table summary="R argblock">
 <tr valign="top"><td><code>...</code></td>
 <td>
-Objects of class <code>"Distribution"</code> which
-shall form the list of distributions.</td></tr>
+Objects of class <code>"Distribution"</code> (or subclasses)</td></tr>
+<tr valign="top"><td><code>Dlist</code></td>
+<td>
+an optional list or object of class <code>"DistrList"</code>;
+if not missing it is appended to argument <code>...</code>; this way
+<code>DistrList</code> may also be called with a list (or
+<code>"DistrList"</code>-object) as argument as suggested in an e-mail
+by Krunoslav Sever (thank you!)</td></tr>
 </table>
 
 <h3>Value</h3>

Modified: branches/distr-2.2/pkg/distr/chm/UnivarDistrList.html
===================================================================
--- branches/distr-2.2/pkg/distr/chm/UnivarDistrList.html	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distr/chm/UnivarDistrList.html	2009-06-30 10:37:56 UTC (rev 491)
@@ -22,7 +22,7 @@
 
 <h3>Usage</h3>
 
-<pre>UnivarDistrList(...)</pre>
+<pre>UnivarDistrList(..., Dlist)</pre>
 
 
 <h3>Arguments</h3>
@@ -30,8 +30,14 @@
 <table summary="R argblock">
 <tr valign="top"><td><code>...</code></td>
 <td>
-Objects of class <code>"UnivariateDistribution"</code> which
-shall form the list of univariate distributions.</td></tr>
+Objects of class <code>"UnivariateDistribution"</code> (or subclasses)</td></tr>
+<tr valign="top"><td><code>Dlist</code></td>
+<td>
+an optional list or object of class <code>"UnivarDistrList"</code>;
+if not missing it is appended to argument <code>...</code>; this way
+<code>UnivarMixingDistribution</code> may also be called with a list (or
+<code>"UnivarDistrList"</code>-object) as argument as suggested in an e-mail
+by Krunoslav Sever (thank you!)</td></tr>
 </table>
 
 <h3>Value</h3>

Modified: branches/distr-2.2/pkg/distr/man/DistrList.Rd
===================================================================
--- branches/distr-2.2/pkg/distr/man/DistrList.Rd	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distr/man/DistrList.Rd	2009-06-30 10:37:56 UTC (rev 491)
@@ -3,11 +3,16 @@
 
 \title{Generating function for DistrList-class}
 \description{Generates an object of class \code{"DistrList"}.}
-\usage{DistrList(...)}
+\usage{DistrList(..., Dlist)}
 \arguments{
-  \item{\dots}{Objects of class \code{"Distribution"} which
-    shall form the list of distributions.}
+  \item{\dots}{Objects of class \code{"Distribution"} (or subclasses)}
+  \item{Dlist}{an optional list or object of class \code{"DistrList"};
+  if not missing it is appended to argument \code{\dots}; this way
+  \code{DistrList} may also be called with a list (or
+  \code{"DistrList"}-object) as argument as suggested in an e-mail
+  by Krunoslav Sever (thank you!)}
 }
+
 %\details{}
 \value{Object of class \code{"DistrList"}}
 %\references{}

Modified: branches/distr-2.2/pkg/distr/man/UnivarDistrList.Rd
===================================================================
--- branches/distr-2.2/pkg/distr/man/UnivarDistrList.Rd	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distr/man/UnivarDistrList.Rd	2009-06-30 10:37:56 UTC (rev 491)
@@ -3,10 +3,14 @@
 
 \title{Generating function for UnivarDistrList-class}
 \description{Generates an object of class \code{"UnivarDistrList"}.}
-\usage{UnivarDistrList(...)}
+\usage{UnivarDistrList(..., Dlist)}
 \arguments{
-  \item{\dots}{Objects of class \code{"UnivariateDistribution"} which
-    shall form the list of univariate distributions.}
+  \item{\dots}{Objects of class \code{"UnivariateDistribution"} (or subclasses)}
+  \item{Dlist}{an optional list or object of class \code{"UnivarDistrList"};
+  if not missing it is appended to argument \code{\dots}; this way
+  \code{UnivarMixingDistribution} may also be called with a list (or
+  \code{"UnivarDistrList"}-object) as argument as suggested in an e-mail
+  by Krunoslav Sever (thank you!)}
 }
 %\details{}
 \value{Object of class \code{"UnivarDistrList"}}

Modified: branches/distr-2.2/pkg/distrEllipse/NAMESPACE
===================================================================
--- branches/distr-2.2/pkg/distrEllipse/NAMESPACE	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distrEllipse/NAMESPACE	2009-06-30 10:37:56 UTC (rev 491)
@@ -15,9 +15,9 @@
 exportClasses("EllipticalParameter",
               "MVNormParameter", "MVtParameter",
               "SphericalDistribution", "EllipticalDistribution", 
-              "MVNormDistribution", "MVtDistribution",
+              "MVNormDistribution", "MVtDistribution", "MVDistrList",
               "MultivarDistrList","MultivarMixingDistribution")
-exportMethods("dimension", "radDistr", "scale", "location",
+exportMethods("dimension", "radDistr", "scale", "location", "dim",
               "radDistr<-", "scale<-", "location<-",
               "plot.rd", "r.rd", "d.rd", "p.rd", "q.rd",
               "E", "var", "mean", "sigma","mixCoeff", "mixDistr")

Modified: branches/distr-2.2/pkg/distrEllipse/R/01.R
===================================================================
--- branches/distr-2.2/pkg/distrEllipse/R/01.R	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distrEllipse/R/01.R	2009-06-30 10:37:56 UTC (rev 491)
@@ -7,7 +7,14 @@
 
 
 .distrEllipseoptions <- list(
-                ## nothing up to now...
+                Nsim = 2000,
+                withED = TRUE,
+                lwd.Ed = 2,
+                col.Ed = c(3,4),
+                withMean = TRUE,
+                cex.mean = 2,
+                pch.mean = 20,
+                col.mean = 2
                       )
   
 

Modified: branches/distr-2.2/pkg/distrEllipse/R/AllClasses.R
===================================================================
--- branches/distr-2.2/pkg/distrEllipse/R/AllClasses.R	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distrEllipse/R/AllClasses.R	2009-06-30 10:37:56 UTC (rev 491)
@@ -113,12 +113,13 @@
 ##
 ################################
 
-setClass("MultivarDistrList", 
+setClass("MVDistrList",
             prototype = prototype(list(new("MVNormDistribution"))),
             contains = "DistrList", 
             validity = function(object){
                 nrvalues <- length(object)
                 dim0 <- object[[1]]@img at dimension
+            #    if (dim0 == 1) return(getValidity(getClass("UnivarDistrList"))(object))
                 for(i in 1:nrvalues){
                     if(!is(object[[i]], "MultivariateDistribution"))
                         stop("Element ", i, " is no 'MultivariateDistribution'")
@@ -128,6 +129,7 @@
                 return(TRUE) 
             })
 
+setClassUnion("MultivarDistrList", c("MVDistrList","UnivarDistrList"))
 
 ################################
 ##
@@ -145,7 +147,7 @@
                              .lowerExact = "logical"
                              ),
             prototype = prototype(mixCoeff = 1, 
-                                  mixDistr = new("MultivarDistrList"),
+                                  mixDistr = new("MVDistrList"),
                                   Symmetry = new("NoSymmetry"),
                                  .withArith = FALSE,
                                  .withSim = FALSE,

Modified: branches/distr-2.2/pkg/distrEllipse/R/EllipticalDistribution.R
===================================================================
--- branches/distr-2.2/pkg/distrEllipse/R/EllipticalDistribution.R	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distrEllipse/R/EllipticalDistribution.R	2009-06-30 10:37:56 UTC (rev 491)
@@ -157,30 +157,3 @@
                             scale(y) <- x %*% scale(y)
                             return(y)})
 
-setMethod("+", c("numeric", "EllipticalDistribution"),
-          function(e1, e2){
-            e2 + e1
-          })
-
-
-setMethod("*", c("numeric", "EllipticalDistribution"),
-          function(e1, e2){
-            e2 * e1
-          })
-
-setMethod("-", c("EllipticalDistribution", "missing"),
-          function(e1){
-            e1*(-1)
-          })
-
-
-setMethod("-", c("EllipticalDistribution", "numeric"),
-          function(e1, e2){
-            return(e1 + (-e2))
-          })
-
-setMethod("-", c("numeric", "EllipticalDistribution"),
-          function(e1, e2){
-            -1*e2 + e1
-          })
-

Modified: branches/distr-2.2/pkg/distrEllipse/R/MVMixingDistribution.R
===================================================================
--- branches/distr-2.2/pkg/distrEllipse/R/MVMixingDistribution.R	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distrEllipse/R/MVMixingDistribution.R	2009-06-30 10:37:56 UTC (rev 491)
@@ -1,6 +1,8 @@
 .isEqual <- distr:::.isEqual
-MultivarMixingDistribution <- function(..., Dlist, mixCoeff,
-                                     withSimplify = getdistrOption("simplifyD"))
+
+MultivarMixingDistribution <- function(..., Dlist, mixCoeff #,
+#                                     withSimplify = getdistrOption("simplifyD")
+                                     )
    {
     ldots <- list(...)
     if(!missing(Dlist)){
@@ -9,7 +11,11 @@
             ldots <- c(ldots, Dlist.L)
        }
     l <- length(ldots)
+    print(ldots)
+    print(ldots[[2]])
     mixDistr <- do.call(MultivarDistrList,args=ldots)
+    if(is(mixDistr,"UnivarDistrList"))
+       return(UnivarMixingDistribution(Dlist = mixDistr, mixCoeff = mixCoeff))
     ep <- .Machine$double.eps
     if(missing(mixCoeff))
        mixCoeff <- rep(1,l)/l
@@ -26,7 +32,8 @@
               if(is.null(slot(Dlist[[i]], slotname))) ret <- FALSE
           return(ret)       
     }
-    if(.check(Dlist,"p"))
+    pnew <- NULL
+    if(.check(mixDistr,"p"))
        pnew <- .pMVmixfun(mixDistr = mixDistr, mixCoeff = mixCoeff)
 
 
@@ -36,7 +43,8 @@
 
     if (all( as.logical(lapply(mixDistr, function(x) is(x,"AbscontDistribution")))) ||
         all( as.logical(lapply(mixDistr, function(x) is(x,"DiscreteDistribution")))))
-    if(.check(Dlist,"p"))
+    dnew <- NULL
+    if(.check(mixDistr,"d"))
         dnew <- .dMVmixfun(mixDistr = mixDistr, mixCoeff = mixCoeff)
 
     
@@ -44,8 +52,7 @@
 
     obj <- new("MultivarMixingDistribution", p = pnew, r = rnew, d = NULL, q = qnew,
          mixCoeff = mixCoeff, mixDistr = mixDistr, .withSim = .withSim,
-         .withArith = .withArith,.lowerExact =.lowerExact, gaps = gaps, 
-         support = support)
+         .withArith = .withArith,.lowerExact =.lowerExact)
 
     if (all( as.logical(lapply(mixDistr, function(x) is(x at Symmetry,"SphericalSymmetry"))))){
        sc <- SymmCenter(mixDistr[[1]]@Symmetry) 
@@ -54,13 +61,16 @@
     }
     
     
-    if (withSimplify)
-        obj <- simplifyD(obj)
+#    if (withSimplify)
+#        obj <- simplifyD(obj)
 
     return(obj)
 }
+#mylist2 <- MultivarMixingDistribution(Binom(3,.3), mylist,
+#          mixCoeff=c(.3,.7))
 
-setMethod("dim", "MultivarMixingDistribution", function(x)x at mixDistr[[1]]@img at dim)
+setMethod("dim", "MultivarMixingDistribution", function(x)x at mixDistr[[1]]@img at dimension)
+setMethod("dimension", "MultivarMixingDistribution", function(object)object at mixDistr[[1]]@img at dimension)
 
 setMethod("mixCoeff", "MultivarMixingDistribution", function(object)object at mixCoeff)
 setReplaceMethod("mixCoeff", "MultivarMixingDistribution", function(object,value){
@@ -147,3 +157,59 @@
                 return(apply(res,ldi,sum))
              else return(sum(res))
            })
+
+setMethod("plot", signature(x = "MultivarMixingDistribution", y = "missing"),
+      function(x, Nsim = getdistrEllipseOption("Nsim"), ...,
+               withED = getdistrEllipseOption("withED"),
+               lwd.Ed = getdistrEllipseOption("lwd.Ed"),
+               col.Ed = getdistrEllipseOption("col.Ed"),
+               withMean = getdistrEllipseOption("withMean"),
+               cex.mean = getdistrEllipseOption("cex.mean"),
+               pch.mean = getdistrEllipseOption("pch.mean"),
+               col.mean = getdistrEllipseOption("col.mean")){
+      mc <- as.list(match.call(call = sys.call(sys.parent(1)),
+                         expand.dots = FALSE))[-1]
+      do.call(getMethod("plot", signature(x = "SphericalDistribution", y = "missing")),
+              args = mc)
+      } )
+
+setMethod("show", "MultivarMixingDistribution",
+          function(object){
+            cls <- class(object)[1]
+            cat(showobj(object, className = cls))
+            ws <- distr:::.IssueWarn(object at .withArith, object at .withSim)
+            if(!is.null(ws$msgA)) warning(ws$msgA)
+            if(!is.null(ws$msgS)) warning(ws$msgS)
+          }
+         )
+
+
+setMethod("showobj", "MultivarMixingDistribution",
+          function(object, className = class(object)[1]){
+              txt <- gettextf("An object of class \"%s\"\n", className)
+              l <- length(mixCoeff(object))
+              txt <- c(txt,
+                     "---------------------------------------------\n")
+              txt <- c(txt,
+                  gettextf("It consists of  %i components \n", l))
+              txt <- c(txt,
+                     gettextf("Components: \n"))
+
+              for(i in 1:l){
+                 s <- showobj(mixDistr(object)[[i]])
+                 les <- length(s)
+                 st <- if (les>1)
+                     c(gettextf("[[%i]]", i), rep("      :",les-1))
+                 else  gettextf("[[%i]]", i)
+                 txt <- c(txt,
+                          paste(st, gettextf("%s",s),sep=""))}
+              txt <- c(txt,
+                     "---------------------------------------------\n")
+              txt <- c(txt,
+                          gettextf("Weights: \n"))
+              txt <- c(txt, gettextf("%f",
+                          round(mixCoeff(object),3)))
+            txt<-c(txt,"\n ---------------------------------------------\n")
+            return(txt)
+            }
+          )

Modified: branches/distr-2.2/pkg/distrEllipse/R/MultivariateDistrList.R
===================================================================
--- branches/distr-2.2/pkg/distrEllipse/R/MultivariateDistrList.R	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distrEllipse/R/MultivariateDistrList.R	2009-06-30 10:37:56 UTC (rev 491)
@@ -1,16 +1,29 @@
 
 # coerce to "DistrList"
-setAs(from = "MultivariateDistribution", to = "MultivarDistrList",
-    def = function(from){ new("MultivarDistrList", list(from)) })
+setAs(from = "MultivariateDistribution", to = "MVDistrList",
+    def = function(from){ do.call("MultivarDistrList", args = list(from)) })
 
-
 # generating function for class 'MultivarDistrList'
-MultivarDistrList <- function(...){ 
-    new("MultivarDistrList", list(...)) 
+MultivarDistrList <- function(..., Dlist){
+    ldots <- list(...)
+    if(!missing(Dlist)){
+        Dlist.L <- as(Dlist, "list")
+        if(!is(try(do.call(MultivarDistrList,args=Dlist.L),silent=TRUE),"try-error"))
+            ldots <- c(ldots, Dlist.L)
+       }
+    l <- length(ldots)
+    if(l==0) return(NULL) else{
+   #    print(dim(ldots[[1]]))
+       if(dim(ldots[[1]])==1) return(do.call(UnivarDistrList, args = ldots))
+       else do.call(new, args=list("MVDistrList", c(ldots)))
+    }
 }
 
+
 # coerce to "MultivarDistrList"
 setAs(from = "MultivariateDistribution", to = "MultivarDistrList",
-    def = function(from){ new("MultivarDistrList", list(from)) })
+    def = function(from){ do.call("MultivarDistrList", args = list(from)) })
 
 setMethod("dim", "MultivarDistrList", function(x) x[[1]]@img at dimension)
+setMethod("dimension", "MultivarDistrList", function(object) object[[1]]@img at dimension)
+

Modified: branches/distr-2.2/pkg/distrEllipse/R/SphericalDistribution.R
===================================================================
--- branches/distr-2.2/pkg/distrEllipse/R/SphericalDistribution.R	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distrEllipse/R/SphericalDistribution.R	2009-06-30 10:37:56 UTC (rev 491)
@@ -13,6 +13,8 @@
 
 setMethod("dimension", "SphericalDistribution",
            function(object) dimension(object at img))
+setMethod("dim", "SphericalDistribution",
+           function(x) dimension(x at img))
 
 setMethod("radDistr", "SphericalDistribution",
            function(object) object at radDistr)
@@ -55,7 +57,7 @@
 
 setMethod("var", signature(x = "SphericalDistribution"),
            function(x,...) diag(dimension(x)) *
-                    E(radDistr(x),fun=function(y)y^2,...)/dimension(x)
+                    E(radDistr(x), fun = function(y)y^2,...)/dimension(x)
            )
 
 
@@ -77,8 +79,14 @@
                
 
 setMethod("plot", signature(x = "SphericalDistribution", y = "missing"),
-      function(x, Nsim = 2000, ..., withED = TRUE, lwd.Ed = 2, col.Ed = c(3,4),
-               withMean = TRUE, cex.mean = 2, pch.mean = 20, col.mean = 2){
+      function(x, Nsim = getdistrEllipseOption("Nsim"), ...,
+               withED = getdistrEllipseOption("withED"),
+               lwd.Ed = getdistrEllipseOption("lwd.Ed"),
+               col.Ed = getdistrEllipseOption("col.Ed"),
+               withMean = getdistrEllipseOption("withMean"),
+               cex.mean = getdistrEllipseOption("cex.mean"),
+               pch.mean = getdistrEllipseOption("pch.mean"),
+               col.mean = getdistrEllipseOption("col.mean")){
       dots <- match.call(call = sys.call(sys.parent(1)),
                          expand.dots = FALSE)$"..."
       cex <- 0.5
@@ -119,4 +127,38 @@
                   } )
       return(invisible(NULL))
       } )
-      
\ No newline at end of file
+
+
+setMethod("+", c("SphericalDistribution","numeric"),
+           function(e1,e2) as(e1, "EllipticalDistribution")+e2)
+setMethod("*", c("SphericalDistribution","numeric"),
+           function(e1,e2)as(e1, "EllipticalDistribution")*e2)
+setMethod("%*%", signature(x="matrix",y="SphericalDistribution"),
+           function(x,y) x %*% as(y, "EllipticalDistribution"))
+
+setMethod("+", c("numeric", "SphericalDistribution"),
+          function(e1, e2){
+            e2 + e1
+          })
+
+
+setMethod("*", c("numeric", "SphericalDistribution"),
+          function(e1, e2){
+            e2 * e1
+          })
+
+setMethod("-", c("SphericalDistribution", "missing"),
+          function(e1){
+            e1*(-1)
+          })
+
+
+setMethod("-", c("SphericalDistribution", "numeric"),
+          function(e1, e2){
+            return(e1 + (-e2))
+          })
+
+setMethod("-", c("numeric", "SphericalDistribution"),
+          function(e1, e2){
+            -1*e2 + e1
+          })

Modified: branches/distr-2.2/pkg/distrEllipse/chm/00Index.html
===================================================================
--- branches/distr-2.2/pkg/distrEllipse/chm/00Index.html	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distrEllipse/chm/00Index.html	2009-06-30 10:37:56 UTC (rev 491)
@@ -27,14 +27,15 @@
 <a href="#R">R</a>
 <a href="#S">S</a>
 <a href="#V">V</a>
+<a href="#W">W</a>
 </p>
 
 
 <h2><a name=" ">--   --</a></h2>
 
 <table width="100%">
-<tr><td width="25%"><a href="0distrEllipse-package.html">distrSim-package</a></td>
-<td>distrSim - (S4-) classes for simulations based on package distr</td></tr>
+<tr><td width="25%"><a href="0distrEllipse-package.html">distrEllipse-package</a></td>
+<td>distrEllipse - S4 classes for elliptically contoured distributions</td></tr>
 </table>
 
 <h2><a name="">--  --</a></h2>
@@ -42,20 +43,26 @@
 <table width="100%">
 <tr><td width="25%"><a href="EllipticalDistribution-class.html">%*%,matrix,EllipticalDistribution-method</a></td>
 <td>Elliptical distribution class</td></tr>
+<tr><td width="25%"><a href="SphericalDistribution-class.html">%*%,matrix,SphericalDistribution-method</a></td>
+<td>Spherical distribution class</td></tr>
 <tr><td width="25%"><a href="EllipticalDistribution-class.html">*,EllipticalDistribution,numeric-method</a></td>
 <td>Elliptical distribution class</td></tr>
-<tr><td width="25%"><a href="EllipticalDistribution-class.html">*,numeric,EllipticalDistribution-method</a></td>
-<td>Elliptical distribution class</td></tr>
+<tr><td width="25%"><a href="SphericalDistribution-class.html">*,numeric,SphericalDistribution-method</a></td>
+<td>Spherical distribution class</td></tr>
+<tr><td width="25%"><a href="SphericalDistribution-class.html">*,SphericalDistribution,numeric-method</a></td>
+<td>Spherical distribution class</td></tr>
 <tr><td width="25%"><a href="EllipticalDistribution-class.html">+,EllipticalDistribution,numeric-method</a></td>
 <td>Elliptical distribution class</td></tr>
-<tr><td width="25%"><a href="EllipticalDistribution-class.html">+,numeric,EllipticalDistribution-method</a></td>
-<td>Elliptical distribution class</td></tr>
-<tr><td width="25%"><a href="EllipticalDistribution-class.html">-,EllipticalDistribution,missing-method</a></td>
-<td>Elliptical distribution class</td></tr>
-<tr><td width="25%"><a href="EllipticalDistribution-class.html">-,EllipticalDistribution,numeric-method</a></td>
-<td>Elliptical distribution class</td></tr>
-<tr><td width="25%"><a href="EllipticalDistribution-class.html">-,numeric,EllipticalDistribution-method</a></td>
-<td>Elliptical distribution class</td></tr>
+<tr><td width="25%"><a href="SphericalDistribution-class.html">+,numeric,SphericalDistribution-method</a></td>
+<td>Spherical distribution class</td></tr>
+<tr><td width="25%"><a href="SphericalDistribution-class.html">+,SphericalDistribution,numeric-method</a></td>
+<td>Spherical distribution class</td></tr>
+<tr><td width="25%"><a href="SphericalDistribution-class.html">-,numeric,SphericalDistribution-method</a></td>
+<td>Spherical distribution class</td></tr>
+<tr><td width="25%"><a href="SphericalDistribution-class.html">-,SphericalDistribution,missing-method</a></td>
+<td>Spherical distribution class</td></tr>
+<tr><td width="25%"><a href="SphericalDistribution-class.html">-,SphericalDistribution,numeric-method</a></td>
+<td>Spherical distribution class</td></tr>
 <tr><td width="25%"><a href="MultivarMixingDistribution-class.html">.logExact,MultivarMixingDistribution-method</a></td>
 <td>Class "MultivarMixingDistribution"</td></tr>
 <tr><td width="25%"><a href="MultivarMixingDistribution-class.html">.lowerExact,MultivarMixingDistribution-method</a></td>
@@ -65,6 +72,8 @@
 <h2><a name="C">-- C --</a></h2>
 
 <table width="100%">
+<tr><td width="25%"><a href="distrEllipseoptions.html">cex.mean</a></td>
+<td>functions to change the global variables of the package 'distrEllipse'</td></tr>
 <tr><td width="25%"><a href="EllipticalDistribution-class.html">coerce,EllipticalDistribution,UnivariateDistribution-method</a></td>
 <td>Elliptical distribution class</td></tr>
 <tr><td width="25%"><a href="MultivarDistrList-class.html">coerce,MultivariateDistribution,MultivarDistrList-method</a></td>
@@ -73,6 +82,10 @@
 <td>Spherical distribution class</td></tr>
 <tr><td width="25%"><a href="EllipticalDistribution-class.html">coerce,UnivariateDistribution,EllipticalDistribution-method</a></td>
 <td>Elliptical distribution class</td></tr>
+<tr><td width="25%"><a href="distrEllipseoptions.html">col.Ed</a></td>
+<td>functions to change the global variables of the package 'distrEllipse'</td></tr>
+<tr><td width="25%"><a href="distrEllipseoptions.html">col.mean</a></td>
+<td>functions to change the global variables of the package 'distrEllipse'</td></tr>
 </table>
 
 <h2><a name="D">-- D --</a></h2>
@@ -90,14 +103,20 @@
 <td>List of multivariate distributions</td></tr>
 <tr><td width="25%"><a href="MultivarMixingDistribution-class.html">dim,MultivarMixingDistribution-method</a></td>
 <td>Class "MultivarMixingDistribution"</td></tr>
+<tr><td width="25%"><a href="SphericalDistribution-class.html">dim,SphericalDistribution-method</a></td>
+<td>Spherical distribution class</td></tr>
+<tr><td width="25%"><a href="MultivarDistrList-class.html">dimension,MultivarDistrList-method</a></td>
+<td>List of multivariate distributions</td></tr>
+<tr><td width="25%"><a href="MultivarMixingDistribution-class.html">dimension,MultivarMixingDistribution-method</a></td>
+<td>Class "MultivarMixingDistribution"</td></tr>
 <tr><td width="25%"><a href="SphericalDistribution-class.html">dimension,SphericalDistribution-method</a></td>
 <td>Spherical distribution class</td></tr>
+<tr><td width="25%"><a href="0distrEllipse-package.html">distrEllipse</a></td>
+<td>distrEllipse - S4 classes for elliptically contoured distributions</td></tr>
 <tr><td width="25%"><a href="distrEllipseMASK.html">distrEllipseMASK</a></td>
 <td>Masking of/by other functions in package "distrEllipse"</td></tr>
 <tr><td width="25%"><a href="distrEllipseoptions.html">distrEllipseoptions</a></td>
 <td>functions to change the global variables of the package 'distrEllipse'</td></tr>
-<tr><td width="25%"><a href="0distrEllipse-package.html">distrSim</a></td>
-<td>distrSim - (S4-) classes for simulations based on package distr</td></tr>
 </table>
 
 <h2><a name="E">-- E --</a></h2>
@@ -143,6 +162,8 @@
 <td>Elliptical distribution class</td></tr>
 <tr><td width="25%"><a href="EllipticalParameter-class.html">location&lt;-,EllipticalParameter-method</a></td>
 <td>Paramter of an Elliptical distributions</td></tr>
+<tr><td width="25%"><a href="distrEllipseoptions.html">lwd.Ed</a></td>
+<td>functions to change the global variables of the package 'distrEllipse'</td></tr>
 </table>
 
 <h2><a name="M">-- M --</a></h2>
@@ -188,6 +209,8 @@
 <td>Generating function for Class "MultivarMixingDistribution"</td></tr>
 <tr><td width="25%"><a href="MultivarMixingDistribution-class.html">MultivarMixingDistribution-class</a></td>
 <td>Class "MultivarMixingDistribution"</td></tr>
+<tr><td width="25%"><a href="MultivarDistrList-class.html">MVDistrList-class</a></td>
+<td>List of multivariate distributions</td></tr>
 <tr><td width="25%"><a href="MvnormDistribution.html">MVNorm</a></td>
 <td>Generating function for MVNormDistribution-class</td></tr>
 <tr><td width="25%"><a href="MvnormDistribution.html">MVNormDistribution</a></td>
@@ -213,6 +236,8 @@
 <td>MVt distribution class</td></tr>
 <tr><td width="25%"><a href="MvtParameter-class.html">ncp,MVtParameter-method</a></td>
 <td>Paramter of a multivariate t distribution</td></tr>
+<tr><td width="25%"><a href="distrEllipseoptions.html">Nsim</a></td>
+<td>functions to change the global variables of the package 'distrEllipse'</td></tr>
 </table>
 
 <h2><a name="P">-- P --</a></h2>
@@ -222,8 +247,12 @@
 <td>Spherical distribution class</td></tr>
 <tr><td width="25%"><a href="SphericalDistribution-class.html">p.rd,SphericalDistribution-method</a></td>
 <td>Spherical distribution class</td></tr>
+<tr><td width="25%"><a href="distrEllipseoptions.html">pch.mean</a></td>
+<td>functions to change the global variables of the package 'distrEllipse'</td></tr>
 <tr><td width="25%"><a href="plot-methods.html">plot</a></td>
 <td>Methods for Function plot in Package 'distrEllipse'</td></tr>
+<tr><td width="25%"><a href="plot-methods.html">plot,MultivarMixingDistribution,missing-method</a></td>
+<td>Methods for Function plot in Package 'distrEllipse'</td></tr>
 <tr><td width="25%"><a href="plot-methods.html">plot,SphericalDistribution,missing-method</a></td>
 <td>Methods for Function plot in Package 'distrEllipse'</td></tr>
 <tr><td width="25%"><a href="plot-methods.html">plot-methods</a></td>
@@ -277,8 +306,12 @@
 <td>Elliptical distribution class</td></tr>
 <tr><td width="25%"><a href="EllipticalParameter-class.html">scale&lt;-,EllipticalParameter-method</a></td>
 <td>Paramter of an Elliptical distributions</td></tr>
+<tr><td width="25%"><a href="MultivarMixingDistribution-class.html">show,MultivarMixingDistribution-method</a></td>
+<td>Class "MultivarMixingDistribution"</td></tr>
 <tr><td width="25%"><a href="SphericalDistribution-class.html">show,SphericalDistribution-method</a></td>
 <td>Spherical distribution class</td></tr>
+<tr><td width="25%"><a href="MultivarMixingDistribution-class.html">showobj,MultivarMixingDistribution-method</a></td>
+<td>Class "MultivarMixingDistribution"</td></tr>
 <tr><td width="25%"><a href="SphericalDistribution-class.html">showobj,SphericalDistribution-method</a></td>
 <td>Spherical distribution class</td></tr>
 <tr><td width="25%"><a href="MvnormParameter-class.html">sigma</a></td>
@@ -309,4 +342,13 @@
 <tr><td width="25%"><a href="SphericalDistribution-class.html">var,SphericalDistribution-method</a></td>
 <td>Spherical distribution class</td></tr>
 </table>
+
+<h2><a name="W">-- W --</a></h2>
+
+<table width="100%">
+<tr><td width="25%"><a href="distrEllipseoptions.html">withED</a></td>
+<td>functions to change the global variables of the package 'distrEllipse'</td></tr>
+<tr><td width="25%"><a href="distrEllipseoptions.html">withMean</a></td>
+<td>functions to change the global variables of the package 'distrEllipse'</td></tr>
+</table>
 </body></html>

Modified: branches/distr-2.2/pkg/distrEllipse/chm/0distrEllipse-package.html
===================================================================
--- branches/distr-2.2/pkg/distrEllipse/chm/0distrEllipse-package.html	2009-06-30 05:06:36 UTC (rev 490)
+++ branches/distr-2.2/pkg/distrEllipse/chm/0distrEllipse-package.html	2009-06-30 10:37:56 UTC (rev 491)
@@ -1,25 +1,24 @@
-<html><head><title>distrSim &ndash; (S4-) classes for simulations based on package distr</title>
+<html><head><title>distrEllipse &ndash; S4 classes for elliptically contoured distributions</title>
 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
 <link rel="stylesheet" type="text/css" href="Rchm.css">
 </head>
 <body>
 
-<table width="100%"><tr><td>distrSim-package(distrEllipse)</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:   distrSim-package">
-<param name="keyword" value="R:   distrSim">
-<param name="keyword" value=" distrSim &ndash; (S4-) classes for simulations based on package distr">
+<table width="100%"><tr><td>distrEllipse-package(distrEllipse)</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:   distrEllipse-package">
+<param name="keyword" value="R:   distrEllipse">
+<param name="keyword" value=" distrEllipse &ndash; S4 classes for elliptically contoured distributions">
 </object>
 
 
-<h2>distrSim &ndash; (S4-) classes for simulations based on package distr</h2>
+<h2>distrEllipse &ndash; S4 classes for elliptically contoured distributions</h2>
 
 
 <h3>Description</h3>
 
 <p>
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/distr -r 491


More information about the Distr-commits mailing list