Peter Ruckdeschel
2004-Jan-30 19:14 UTC
[Rd] request for comments --- package "distr" --- S4 Classes for Distributions
Hello, after some discussions with Martin Maechler and Josef Leydold (WU Wien), we have felt the need for some package that should allow for an object-orientated approach to distributions. Our small group at Bayreuth now has developed a package "distr" which tries to fill this gap, implementing distributions by means of S4--classes. A mother class "Distribution" is introduced with slots for a parameter and - most important - for the four constitutive methods "r", "d", "p", and "q" (alluding to the corresponding naming already used for these functions in S). All distributions of the " base" package for which such "r", "d", "p", and "q" functions exist are implemented (essentially by wrappers of the origininal code) as subclasses of either of the two the subclasses "AbscontDistribution" or " DiscreteDistribution". This approach seems very appealing to us from a conceptual viewpoint: Just pass an object of some derived distribution class to a generic function as argument and let the dispatching mechanism decide what to do on run-time. As an example, we may automatically generate new objects of these classes with corresponding "r", "d", "p", and "q"-slots for the laws of r.v.'s under standard mathematical univariate transformations and under convolution of independent r.v.'s.: For "Distribution" objects X and Y expressions like 3*X+sin(exp(-Y/4+3)) have their natural interpretation as corresponding image distributions. To get an impression of what is possible confer the demos on the cited http-reference below. Additionally, we also provide classes for a standardized treatment of simulations (also under contaminations) and evaluations of statistical procedures on such simulations. For details we invite the interested R-user /R-developer to http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/ -- or more directly to a detailed manual http://www.uni-bayreuth.de/departments/math/org/mathe7/DISTR/distr.pdf Before announcing this package to a broader audience, however, we would be glad to receive some feed-back from a competent audience, i.e. you :-) as to comments and improvements. In particular, the package is intended to be open for extensions for which we definitely lack the know-how to do it "right", like implementation of multivariate distributions, conditional distributions and formula for copula. So anyone who likes to join us in further development is welcome. In order to at l(e)ast send a running package, we stopped the development for "release 1" at a certain stage, well having in mind some improvements/ extensions -- c.f. section "Odds and ends" in the manual. Thank you already for your attention. -- Peter Ruckdeschel Matthias Kohl Thomas Stabla Florian Camphausen
Warnes, Gregory R
2004-Feb-02 22:22 UTC
[Rd] request for comments --- package "distr" --- S4 Classes for Distributions
> -----Original Message----- > From: Peter Ruckdeschel [mailto:Peter.Ruckdeschel@uni-bayreuth.de] > Sent: Friday, January 30, 2004 1:12 PM > To: r-devel@stat.math.ethz.ch > Cc: Florian Camphausen; Josef Leydold; Thomas Stabla > Subject: [Rd] request for comments --- package "distr" --- S4 Classes > for Distributions > > > Hello, > > after some discussions with Martin Maechler and Josef Leydold > (WU Wien), > we have felt the need for some package that should allow for an > object-orientated > approach to distributions.Great!> > Our small group at Bayreuth now has developed a package "distr" which > tries to fill this gap, implementing distributions by means of > S4--classes.You may find some value in looking at the Java distribution library that I created a couple of years ago by porting the R distribution functions: http://statdistlib.sourceforge.net/ A separate java implementation of the basic distribution classes is included as part of the Hydra package for MCMC, http://hydra-mcmc.sf.net> > A mother class "Distribution" is introduced with slots for a > parameter > and - > most important - for the four constitutive methods "r", "d", > "p", and "q" > (alluding to the corresponding naming already used for these > functions > in S). > > All distributions of the " base" package for which such "r", > "d", "p", > and "q" > functions exist are implemented (essentially by wrappers of the > origininal code)I would recommend giving more descriptive names to the methods. In particular would recommend 'pdf', 'cdf', 'quantile', and 'random' instead of simply 'p', 'd', 'q', 'r' so that the expressions are very clear.> as subclasses of either of the two the subclasses > "AbscontDistribution" or > " DiscreteDistribution".It is not at all clear to me what an 'AbscontDistribution' is. Perhaps you are referring to a continuous distribution? You may also want to consider how to deal with multivariate distributions.> > This approach seems very appealing to us from a conceptual viewpoint: >Yes this is very interesting, particularly if you extend it to handle multivariate distributions. Good luck! -Greg LEGAL NOTICE\ Unless expressly stated otherwise, this messag...{{dropped}}
Peter Ruckdeschel
2004-Feb-03 15:50 UTC
[Rd] request for comments --- package "distr" --- S4 Classes for Distributions
On Tue, 3 Feb 2004, Prof Brian D Ripley wrote:> On Tue, 3 Feb 2004, Duncan Murdoch wrote: > >>On Tue, 03 Feb 2004 09:45:52 +0000, Matthias Kohl >><Matthias.Kohl@uni-bayreuth.de> wrote: >> >> >> >>>I think the most common example is the Cantor distribution. >>> >>> >>That's the most common 1-dimensional singular distribution, but higher >>dimensional distributions are much more commonly singular. For >>example, mixed continuous-discrete distributions, and other >>distributions whose support is of lower dimension than the sample >>space, e.g. X ~ N(0,1), Y=X. >> >> > >The most common 1d singular distribution is probably a lifetime with an >atom at zero. > >I think the question was about a continuous but not absolutely continuous >distribution, and indeed the Cantor distribution is the standard example >in theory courses. > >I do not mean to give statistical advice to any of the cited contributors, who will all be familiar with this, but I might add that by iterated use of the Lebesgue decomposition, cf http://mathworld.wolfram.com/LebesgueDecomposition.html you may decompose any measure on the 1d Borel sets uniquely into a discrete, an absolutely coninuous and a singular part. Using this nomenclatura, Prof. Ripley's lifetime example would have non-trivial discrete and absolutely continuous parts but only a trivial singular part. In dimension d>1 things may become more complicated, though, as you might want to distinguish the dimensions of sets on which [ Lebesgue^d and discrete] - singular parts throw their mass....
Seemingly Similar Threads
- after package reorganization: version 1.6 of package "distr" available; new packages "distrEx", "distrSim", "distrTEst", "RandVar"
- after package reorganization: version 1.6 of package "distr" available; new packages "distrEx", "distrSim", "distrTEst", "RandVar"
- version 1.5 of package "distr" available
- version 1.5 of package "distr" available
- New package: distr