[Distr-commits] r927 - branches/distr-2.6/pkg branches/distr-2.6/pkg/SweaveListingUtils branches/distr-2.6/pkg/SweaveListingUtils/man branches/distr-2.6/pkg/distrDoc branches/distr-2.6/pkg/distrDoc/man branches/distr-2.6/pkg/distrDoc/vignettes branches/distr-2.6/pkg/distrEllipse branches/distr-2.6/pkg/distrEllipse/man branches/distr-2.6/pkg/distrEx branches/distr-2.6/pkg/distrEx/man branches/distr-2.6/pkg/distrRmetrics branches/distr-2.6/pkg/distrRmetrics/man branches/distr-2.6/pkg/distrTEst branches/distr-2.6/pkg/distrTEst/man branches/distr-2.6/pkg/distrTeach branches/distr-2.6/pkg/distrTeach/man branches/distr-2.6/pkg/startupmsg branches/distr-2.6/pkg/utils pkg/utils
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Wed Sep 18 12:53:13 CEST 2013
Author: ruckdeschel
Date: 2013-09-18 12:53:13 +0200 (Wed, 18 Sep 2013)
New Revision: 927
Added:
branches/distr-2.6/pkg/Mail/
branches/distr-2.6/pkg/SweaveListingUtils/
branches/distr-2.6/pkg/distrDoc/
branches/distr-2.6/pkg/distrDoc/vignettes/distr.Rnw
branches/distr-2.6/pkg/distrEllipse/
branches/distr-2.6/pkg/distrEx/
branches/distr-2.6/pkg/distrRmetrics/
branches/distr-2.6/pkg/distrTEst/
branches/distr-2.6/pkg/distrTeach/
branches/distr-2.6/pkg/startupmsg/
branches/distr-2.6/pkg/utils/
Removed:
branches/distr-2.6/pkg/distrDoc/vignettes/distr.Rnw
Modified:
branches/distr-2.6/pkg/SweaveListingUtils/DESCRIPTION
branches/distr-2.6/pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd
branches/distr-2.6/pkg/distrDoc/DESCRIPTION
branches/distr-2.6/pkg/distrDoc/man/0distrDoc-package.Rd
branches/distr-2.6/pkg/distrEllipse/DESCRIPTION
branches/distr-2.6/pkg/distrEllipse/man/0distrEllipse-package.Rd
branches/distr-2.6/pkg/distrEx/DESCRIPTION
branches/distr-2.6/pkg/distrEx/man/0distrEx-package.Rd
branches/distr-2.6/pkg/distrRmetrics/DESCRIPTION
branches/distr-2.6/pkg/distrRmetrics/man/0distrRmetrics-package.Rd
branches/distr-2.6/pkg/distrTEst/DESCRIPTION
branches/distr-2.6/pkg/distrTEst/man/0distrTEst-package.Rd
branches/distr-2.6/pkg/distrTeach/DESCRIPTION
branches/distr-2.6/pkg/distrTeach/man/0distrTeach-package.Rd
branches/distr-2.6/pkg/startupmsg/DESCRIPTION
branches/distr-2.6/pkg/utils/DESCRIPTIONutils.R
branches/distr-2.6/pkg/utils/DESCRIPTIONutilsExamples.R
pkg/utils/DESCRIPTIONutils.R
Log:
completed branches/distr-2.6
Modified: branches/distr-2.6/pkg/SweaveListingUtils/DESCRIPTION
===================================================================
--- pkg/SweaveListingUtils/DESCRIPTION 2013-09-13 11:37:32 UTC (rev 923)
+++ branches/distr-2.6/pkg/SweaveListingUtils/DESCRIPTION 2013-09-18 10:53:13 UTC (rev 927)
@@ -12,7 +12,7 @@
source code
Maintainer: Peter Ruckdeschel <Peter.Ruckdeschel at itwm.fraunhofer.de>
License: LGPL-3
-Date: 2013-09-12
+Date: 2013-09-18
LastChangedDate: {$LastChangedDate$}
LastChangedRevision: {$LastChangedRevision$}
-SVNRevision: 913
+SVNRevision: 926
Modified: branches/distr-2.6/pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd
===================================================================
--- pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd 2013-09-13 11:37:32 UTC (rev 923)
+++ branches/distr-2.6/pkg/SweaveListingUtils/man/0SweaveListingUtils-package.Rd 2013-09-18 10:53:13 UTC (rev 927)
@@ -16,11 +16,11 @@
\tabular{ll}{
Package: \tab SweaveListingUtils \cr
Version: \tab 0.7 \cr
-Date: \tab 2013-09-12 \cr
+Date: \tab 2013-09-18 \cr
Depends: \tab R(>= 2.14.0), startupmsg \cr
LazyLoad: \tab yes \cr
License: \tab LGPL-3 \cr
-SVNRevision: \tab 913 \cr
+SVNRevision: \tab 926 \cr
}
TeX-package \file{listings}, confer \url{http://www.ctan.org/tex-archive/macros/latex/contrib/listings/},
Modified: branches/distr-2.6/pkg/distrDoc/DESCRIPTION
===================================================================
--- pkg/distrDoc/DESCRIPTION 2013-09-13 15:29:52 UTC (rev 925)
+++ branches/distr-2.6/pkg/distrDoc/DESCRIPTION 2013-09-18 10:53:13 UTC (rev 927)
@@ -1,6 +1,6 @@
Package: distrDoc
-Version: 2.5
-Date: 2013-09-12
+Version: 2.6
+Date: 2013-09-18
Title: Documentation for packages distr, distrEx, distrSim, distrTEst, distrTeach, distrMod,
and distrEllipse
Description: provides documentation in form of a common vignette to packages distr, distrEx,
@@ -18,4 +18,4 @@
URL: http://distr.r-forge.r-project.org/
LastChangedDate: {$LastChangedDate$}
LastChangedRevision: {$LastChangedRevision$}
-SVNRevision: 913
+SVNRevision: 926
Modified: branches/distr-2.6/pkg/distrDoc/man/0distrDoc-package.Rd
===================================================================
--- pkg/distrDoc/man/0distrDoc-package.Rd 2013-09-13 15:29:52 UTC (rev 925)
+++ branches/distr-2.6/pkg/distrDoc/man/0distrDoc-package.Rd 2013-09-18 10:53:13 UTC (rev 927)
@@ -14,14 +14,14 @@
\details{
\tabular{ll}{
Package: \tab distrDoc \cr
-Version: \tab 2.5 \cr
-Date: \tab 2013-09-12 \cr
+Version: \tab 2.6 \cr
+Date: \tab 2013-09-18 \cr
Depends: \tab R(>= 2.6.0), tools, distr(>= 2.2.0), startupmsg, distrEx(>= 2.2.0), distrSim(>= 2.2.0), distrTEst(>= 2.2.0), distrTeach(>=
2.2.0), RandVar(>= 0.7), distrMod(>= 2.2.0), MASS, methods \cr
LazyLoad: \tab yes \cr
License: \tab LGPL-3 \cr
URL: \tab http://distr.r-forge.r-project.org/\cr
-SVNRevision: \tab 913 \cr
+SVNRevision: \tab 926 \cr
}}
Deleted: branches/distr-2.6/pkg/distrDoc/vignettes/distr.Rnw
===================================================================
--- pkg/distrDoc/vignettes/distr.Rnw 2013-09-13 15:29:52 UTC (rev 925)
+++ branches/distr-2.6/pkg/distrDoc/vignettes/distr.Rnw 2013-09-18 10:53:13 UTC (rev 927)
@@ -1,3621 +0,0 @@
-%\VignetteIndexEntry{distr - manual}
-%\VignetteDepends{distr}
-%\VignetteKeyword{probability distribution,simulation,estimation}
-%\VignettePackage{distr}
-%
-\documentclass[11pt]{article}
-%
-\usepackage{svn-multi}
-% Version control information:
-\svnidlong
-{$HeadURL: svn+ssh://ruckdeschel@svn.r-forge.r-project.org/svnroot/distr/branches/distr-2.4/pkg/distrDoc/vignettes/distr.Rnw $}
-{$LastChangedDate: 2012-05-22 14:40:14 +0200 (Di, 22 Mai 2012) $}
-{$LastChangedRevision: 816 $}
-{$LastChangedBy: ruckdeschel $}
-%\svnid{$Id: example_main.tex 146 2008-12-03 13:29:19Z martin $}
-% Don't forget to set the svn property 'svn:keywords' to
-% 'HeadURL LastChangedDate LastChangedRevision LastChangedBy' or
-% 'Id' or both depending if you use \svnidlong and/or \svnid
-%
-\newcommand{\svnfooter}{Last Changed Rev: \svnkw{LastChangedRevision}}
-\svnRegisterAuthor{ruckdeschel}{Peter Ruckdeschel}
-\svnRegisterAuthor{stamats}{Matthias Kohl}
-\svnRegisterAuthor{florian}{Florian Camphausen}
-\svnRegisterAuthor{stabla}{Thomas Stabla}
-\svnRegisterAuthor{anhuel}{Anja H{\"u}ller}
-\svnRegisterAuthor{ifrin}{Eleonara Feist}
-\svnRegisterAuthor{jdospina}{Juan David Ospina}
-\svnRegisterAuthor{kowzar}{Kouros Owzar}
-%
-%borrowed from doc/manual/refman.top
-%
-%% Set PDF 1.5 and compression, including object compression
-%% Needed for MiKTeX -- most other distributions default to this
-\ifx\pdfoutput\undefined
-\else
- \ifx\pdfoutput\relax
- \else
- \ifnum\pdfoutput>0
- % PDF output
- \pdfminorversion=5
- \pdfcompresslevel=9
- \pdfobjcompresslevel=2
- \fi
- \fi
-\fi
-%
-%
-\usepackage{geometry}
-\usepackage{ifpdf}
-\usepackage{color}
-\definecolor{darkblue}{rgb}{0.0,0.0,0.75}
-\definecolor{Rcolor}{rgb}{0,0.5,0.5}
-\definecolor{Rout}{rgb}{0.461,0.039,0.102}
-\definecolor{Rcomment}{rgb}{0.101,0.043,0.432}
-\usepackage{amssymb}
-\usepackage{url}
-\usepackage[%
-baseurl={http://www.bioconductor.org},%
-pdftitle={S4 Classes for Distributions---a manual for packages distr, distrSim, distrTEst, distrEx,
-distrMod, and distrTeach},%
-pdfauthor={Peter Ruckdeschel, Matthias Kohl, Thomas Stabla, Florian Camphausen},%
-pdfsubject={distr},%
-pdfkeywords={probability distribution,simulation,estimation},%
-pagebackref,bookmarks,colorlinks,linkcolor=darkblue,citecolor=darkblue,%
-pagecolor=darkblue,raiselinks,plainpages,pdftex]{hyperref}
-%
-% -------------------------------------------------------------------------------
-\RequirePackage{fancyvrb}
-\RequirePackage{listings}
-%\usepackage{Sweave} no longer needed
-% -------------------------------------------------------------------------------
-\SweaveOpts{keep.source=TRUE}
-% -------------------------------------------------------------------------------
-\definecolor{distrCol}{rgb}{0.0,0.4,0.4}
-<<SweaveListingsPreparations, results=tex, echo=FALSE>>=
-require(SweaveListingUtils)
-SweaveListingPreparations()
-setToBeDefinedPkgs(pkgs = c("distr","distrEx","distrTEst","distrSim",
- "distrDoc","distrTeach","distrMod","RandVar"),
- keywordstyles = "\\bf\\color{distrCol}")
-@
-%
-% -------------------------------------------------------------------------------
-\renewcommand{\pkgversion}{{\tt 2.5}}
-\newcommand{\pkgExversion}{{\tt 2.5}}
-\newcommand{\Reals}{\mathbb{R}}
-\newcommand{\R}{\mathbb{R}}
-\newcommand{\N}{\mathbb{N}}
-% -------------------------------------------------------------------------------
-%
-\markboth{\sl Packages ``{\tt distr}'', ``{\tt distrSim}'', ``{\tt distrTEst}'',
-``{\tt distrEx}'', ``{\tt distrEllipse}'', ``{\tt distrTeach}'', ``{\tt distrMod}''}%
-{\sl Packages ``{\tt distr}'', ``{\tt distrSim}'', ``{\tt distrTEst}'',
-``{\tt distrEx}'', ``{\tt distrEllipse}'', ``{\tt distrTeach}'', ``{\tt distrMod}''}
-%
-% -------------------------------------------------------------------------------
-%
-% -------------------------------------------------------------------------------
-\begin{document}
-% -------------------------------------------------------------------------------
-\title{{\tt S4} Classes for Distributions---a manual for packages \pkg{distr},
- \pkg{distrEx}, \pkg{distrEllipse}, \pkg{distrMod}, \pkg{distrSim},
- \pkg{distrTEst}, \pkg{distrTeach},
- version \pkgversion}
-%,version \pkgExversion}
-\author{\small Peter Ruckdeschel\thanks{Fraunhofer ITWM, Kaiserslautern}
-\\[-.5ex]
-\small Matthias Kohl\thanks{FH Furtwangen}
-\\[-.5ex]
-\small Thomas Stabla\thanks{Graf-M\"unster-Gymnasium, Bayreuth}
-\\[-.5ex]
-\small Florian Camphausen\thanks{West-LB, London}
-\smallskip\\
-\small Fraunhofer ITWM\\[-.5ex]
-\small Fraunhofer Platz 1\\[-.5ex]
-\small 67663 Kaiserslautern\\[-.5ex]
-\small Germany\\
-\small e-Mail: {\small \tt Peter.Ruckdeschel at itwm.fraunhofer.de}\medskip\\
-\parbox[t]{5cm}{
-\footnotesize\sffamily
- Version control information:
-\begin{tabbing}
-\footnotesize\sffamily
- Last changes revision: \= \kill
- Head URL: \> \parbox[t]{6cm}{\url{\svnkw{HeadURL}}}\\[1.2ex]
- Last changed date: \> \svndate\\
- Last changes revision: \> \svnrev\\
- Version: \> \svnFullRevision*{\svnrev}\\
- Last changed by: \> \svnFullAuthor*{\svnauthor}\\
-\end{tabbing}
-}
-}
-\maketitle
-% -------------------------------------------------------------------------------
-\begin{abstract}
-% -------------------------------------------------------------------------------
-\pkg{distr} is a package for {\sf R} from version {\tt 1.8.1} onwards that is
-distributed under {\tt LGPL-3}. Its own current version is \pkgversion.
-%
-The aim of this package is to provide a conceptual treatment of random variables
-(r.v.'s) by means of {\tt S4}--classes. A mother class \code{Distribution} is
-introduced with slots for a parameter and for functions {\tt r}, {\tt d},
-{\tt p}, and {\tt q} for simulation, respectively for evaluation of density /
-c.d.f.\ and quantile function of the corresponding distribution. All
-distributions of the \pkg{stats} package are implemented as subclasses of either
-\code{AbscontDistribution} or \code{DiscreteDistribution},
-which themselves are again subclasses of \code{UnivariateDistribution}. %\\
-%
-By means of these classes, we may automatically generate new objects of these
-classes for the laws of r.v.'s under standard mathematical univariate
-transformations and under standard bivariate arithmetical operations acting
-on independent r.v.'s.
-%
-%From version 1.6 on, \pkg{distr} has been split up into the smaller packages
-%\pkg{distr} (only distribution-classes and -methods), \pkg{distrSim}
-%(standardized treatment of simulations, also under contaminations)
-%and \pkg{distrTEst} \newline(classes and methods for evaluations of statistical
-%procedures on such simulations).
-Package \pkg{distr} in this setting works as basic package for further extensions.
-These start with package \pkg{distrEx}, covering statistical functionals like
-expectation, variance and the median evaluated at distributions, as well as
-distances between distributions and basic support for multivariate and
-conditional distributions. Next, from version 2.0 on, comes package \pkg{distrMod}
-which uses these concepts to provide an object orientated competitor to
-\code{fitdistr} from package \pkg{MASS} in covering estimation in statistical
-models. Further on there are packages \pkg{distrSim} for the standardized
-treatment of simulations, also under contaminations and package
-\pkg{distrTEst} with classes and methods for evaluations of statistical
-procedures on such simulations. Finally, from version 2.0 on, there is package
-\pkg{distrTeach} to embody illustrations for basic stats courses using
-our distribution classes.
-
-From version 2.4 on, we have moved support for extreme value distributions,
-as well as for certain scale-shape distributions to the new package
-\pkg{RobExtremes}. This concerns the Gumbel, Weibull, Pareto distributions.
-%\noindent The latter two of them require package \pkg{setRNG} by
-%\href{mailto:pgilbert at bank-banque-canada.ca}{Paul Gilbert}
-%to be installed from \href{http://cran.r-project.org/mirrors.html}{\tt CRAN}.
-% \\
-
-%\noindent Additionally, mainly contributed by \cite{MK:05}, in \pkg{distrEx} we
-%extend the functionality of \pkg{distr}, providing functionals like expectation
-%or variance and distances for distributions. Also, this package contains some
-%first steps to multivariate distributions, providing classes for discrete
-%multivariate distributions and for factorized, conditional
-%distributions.
-% -------------------------------------------------------------------------------
-\end{abstract}
-% -------------------------------------------------------------------------------
-\tableofcontents
-\noindent
-{\small Parts of this document appeared in an earlier and much shorter form in
-{\em R-News\/}, {\bf 6}(2) as {\sf ``S4 Classes for Distributions''},
-c.f.\ \cite{R:K:S:C:04}, which in its
-published form refers to package versions 1.6, resp.\ 0.4-2. This present document
-takes into account the subsequent revisions and versions.}\medskip
-% -------------------------------------------------------------------------------
-\addtocounter{section}{-1}
-\section{Motivation}
-% -------------------------------------------------------------------------------
-{\sf R} up to now contains powerful techniques for virtually
-any useful distribution using the suggestive naming convention
-{\tt [prefix]<name>} as functions where {\tt [prefix]} stands for
- {\tt r}, {\tt d}, {\tt p}, or {\tt q}
- and {\tt <name>} is the name of the distribution.\\
-There are limitations of this concept, however:
-You can only use distributions which are implemented in some library
-already or for which you yourself have provided an implementation.
-In many natural settings you want to formulate algorithms once for
-all distributions, so you should be able to treat the actual distribution
-{\tt <name>} as sort of a variable.\\
-You may of course paste together prefix and the value of {\tt <name>} as a
-string and then use \code{eval(parse(....))}. This is neither very elegant nor
-flexible, however.\\
-%
-Instead, we would rather like to implement the algorithm by passing an object of
-some distribution class as argument to the function. Even better though, we
-would use a generic function and let the {\tt S4}-dispatching mechanism decide
-what to do at run-time. In particular, we would like to automatically generate
-the corresponding functions {\tt r}, {\tt d}, {\tt p}, and {\tt q} for the law
-of expressions like \code{X+3Y} for objects \code{X} and \code{Y} of class
-\code{Distribution}, or, more general, of a transformation of $X$, $Y$ under a
-function $f\colon \Reals^2 \to \Reals$ which is already realized as a function
-in {\sf R}.\\
-This is possible with package \pkg{distr}. As an example, try
-<<echo=false,results=hide>>=
-## preparation: set option withSweave to true
-require(distrTEst)
-require(distrEx)
-require(distrTeach)
-require(distrMod)
-distroptions(withSweave = TRUE)
-options("newDevice" = TRUE)
-@
-<<exam1, eval = TRUE, fig = TRUE>>=
-require(distr)
-N <- Norm(mean = 2, sd = 1.3)
-P <- Pois(lambda = 1.2)
-Z <- 2*N + 3 + P
-Z
-plot(Z)
-p(Z)(0.4)
-q(Z)(0.3)
-Zs <- r(Z)(50)
-Zs
-@
-\par
-\begin{small}
-\noindent{\bf Comment:}\\
-Let \code{N} an object of class \code{"Norm"} with parameters \code{mean=2},
-\code{sd=1.3} and let \code{P} an object of class \code{"Pois"} with parameter
-\code{lambda=1.2}. Assigning to \code{Z} the expression \code{2*N+3+P}, a
-new distribution object is generated ---of class \code{"AbscontDistribution"} in
-our case--- so that identifying \code{N}, \code{P}, \code{Z} with random
-variables distributed according to {\tt N}, {\tt P}, {\tt Z},
-${\cal L}({\tt Z})={\cal L}(2*{\tt N}+3+{\tt P})$, and writing \code{p(Z)(0.4)}
-we get $P(Z\leq 0.4)$, \code{ q(Z)(0.3)} the $30\%$-quantile of {\tt Z},
-and with \code{r(Z)(50)} we generate $50$ pseudo random numbers distributed
-according to {\tt Z}, while the \code{plot} command generates the above figure.
-\end{small}
-% -------------------------------------------------------------------------------
-\section{Concept}
-% -------------------------------------------------------------------------------
-In developing our packages, we had the following principles in mind:
-We wanted to be open in our design so that our classes could easily be extended
-by any volunteer in the {\sf R} community to provide more complex classes of
-distributions as multivariate distributions, times series distributions,
-conditional distributions. As an exercise, the reader is encouraged to implement
-extrem value distributions from the package \pkg{evd}\footnote{a solution to
-this ``homework'' may be found in the sources to \pkg{distrEx},
-resp.\ from version 2.4 on, in the sources to \pkg{RobExtremes}}. The largest
-effort will in fact be the documentation\ldots\\
-We also wanted to preserve naming and notation from {\sf R}-\pkg{stats}
-as far as possible so that any programmer used to {\tt S} could quickly
-use our package. Even more so, as the distributions already implemented to
-{\sf R} are all well tested and programmed with skills we lack, we use the
-existing {\tt r}, {\tt d}, {\tt p}, and {\tt q}-functions wherever possible,
-only wrapping them by small code sniplets to our class hierarchy.\\
-Third we wanted to use a suggestive notation for our automatically generated
-methods \code{r}, \code{d}, \code{p}, and \code{q}, which we think is now
-largely achieved. All this should make intensive use of object orientation in
-order to be able to use inheritance and method overloading.
-Let us briefly explain why we decided to realize \code{r}, \code{d},
-\code{p}, and \code{q} as part of our class definitions:
-Doing so, we place ourselves somewhere between
-pure object orientation where methods would be {\it slots\/} ---in the language
-of the {\tt S4}-concept, confer \cite{Cham:98}--- and the {\tt S4} paradigm
-where methods ``live their own life'' apart from the classes, or, to \code{q},
-which should be regarded use \cite{Beng:03}'s terminology, we use
-COOP\footnote{class-object-orientated
-programming, as e.g.\ in {\tt C++}}-style for \code{r}, \code{d}, \code{p}, and
-\code{q} methods, and FOOP\footnote{function-object-orientated programming,
-as in the {\tt S4}-concept} -style for "normal" methods.\\
-The {\tt S4}-paradigm with methods which are not attached to an object but
-rather behave differently according to the classes of their arguments is fine
-if there are particular user-written methods for only some few general
-distribution classes like \code{AbscontDistribution}, as in the case for
-\code{plot} or \code{"+"} (c.f.\ \cite{K:R:S:04}, Section 2.2).
-During a typical {\sf R} session with \pkg{distr}, however, there will be a lot
-of, mostly automatically generated objects of our distribution classes, each
-with its own \code{r}, \code{d}, \code{p}, and \code{q}; this even applies to
-intermediate expressions like \code{2*N}, \code{2*N+3} to eventually produce
-\code{Z} in the example in the motivation. Treating \code{r}, \code{d},
-\code{p}, and \code{q} as generic functions, we would need to generate new
-classes for each expression \code{2*N}, \code{2*N+3}, \code{Z} and,
-correspondingly, particular {\tt S4}-methods for \code{r}, \code{d}, \code{p},
-and \code{q} for each of these new classes; apparently, this would produce
-overly many classes for an effective inheritance structure. \\
-In providing arithmetics for distributions, we have to deviate a little from
-the paradigm of {\tt S} as a functional language: For operators like ``$+$'',
-additional parameters controlling the precision of the results cannot be handily
-passed as arguments. For this purpose we provide global options which may be
-inspected and modified by \code{distroptions},
-\code{getdistrOption}\footnote{Upto version 0.4-4, we used a different mechanism
-to inspect/modify global options of \pkg{distrEx} (see
-section~\ref{distrExoptions}); corresponding functions \code{distrExoptions},
-\code{getdistrExOption} for package \pkg{distrEx} are available from version
-1.9 on.} in complete analogy to \code{options}, \code{getOption}.
-%
-Finally our concept as to parameters: Contrary to the standard {\sf R}-functions
-like \code{rnorm} we only permit length $1$ for parameters like \code{mean},
-because we see the objects as implementations of univariate random variables,
-for which vector-valued parameters make no sense; rather one could gather
-several objects with possibly different parameters to a vector/list of
-distributions. Of course, the original functions \code{rnorm} etc.\ remain
-unchanged and still allow for vector-valued parameters.
-Kouros Owzar in an off-list mail raised the point, that in case of multiple
-parameters as in case of the normal or the $\Gamma$-distribution, it might be
-useful to be able to pass these multiple parameters in vectorized form to the
-generating function. We, too, think that this is a good idea, but have
-shifted this question to the new extension package \pkg{distrMod} which covers
-more general treatment of statistical models, see section~\ref{distrMod}.
-% -------------------------------------------------------------------------------
-\section{Organization in classes}
-% -------------------------------------------------------------------------------
-Loosely speaking we have three large groups of classes: distribution classes (in
-\pkg{distr}), simulation classes (in \pkg{distrSim}) and an evaluation class (in
-\pkg{distrTEst}), where the latter two are to be considered only as tools which
-allow a unified treatment of simulations and evaluation of statistical estimation
-(perhaps also tests and predictions later) under varying simulation situations.
-Additionally, package \pkg{distrEx} provides classes for discrete multivariate
-distributions and for factorized, conditional distributions, as well as a bundle
-of functionals and distances (see below).
-% -------------------------------------------------------------------------------
-\subsection{Distribution classes}
-% -------------------------------------------------------------------------------
-The purpose of the classes derived from the class \code{Distribution} is to
-implement the concept of a r.v./distribution as such in {\sf R}.\\
-All classes derived from \code{Distribution} have a slot \code{param} for a
-parameter, a slot \code{img} for the range and the constitutive slots \code{r},
-\code{d}, \code{p}, and \code{q}.\\
-From version 1.9 on, up to arguments referring to a parameter of the
-distribution (like \code{mean} for the normal distribution), these function
-slots have the same arguments as those of package \pkg{stats}, i.e.; for a
-distribution object \code{X} we may call these functions as
-
-\begin{itemize}
-\item \code{r(X)(n)} $\qquad$ ---except for objects of class \code{Hyper},
-where there is a slot \code{n} already, so here the argument name
-to \code{r} is \code{nn}.
-\item \code{d(X)(x, log = FALSE)}
-\item \code{p(X)(q, lower.tail = TRUE, log.p = FALSE)}
-\item \code{q(X)(p, lower.tail = TRUE, log.p = FALSE)}
-\end{itemize}
-
-For the arguments of these function slots see e.g.\ \code{rnorm}
-from package \pkg{stats}.
-Note that, as usual, slots \code{d}, \code{p}, and \code{q} are vectorized
-in their first argument, but are not on the subsequent ones.
-The idea is to gain higher precision for the upper tails or when multiplying
-probabilities.
-% -------------------------------------------------------------------------------
-\subsubsection{Subclasses}
-% -------------------------------------------------------------------------------
-To begin with, we have considered univariate distributions giving the
-{\tt S4}-class \code{UnivariateDistribution}, and as typical subclasses, we
-have introduced classes for absolutely continuous and discrete distributions
----\code{AbscontDistribution} and \code{DiscreteDistribution}.\\
-
-The former, from version 1.9 on, has a slot \code{gaps} of class
-\code{OptionalMatrix}, i.e.; an object which may either be \code{NULL} or
-a \code{matrix}. This slot, if non-\code{NULL}, contains left and right
-endpoints of intervals where the density of the object is $0$. This slot
-may be inspected by the accessor \code{gaps()} and modified by a corresponding
-replacement method. It may also be filled automatically by
-\code{setgaps(object, exactq = 6, ngrid = 50000)}, where upon evaluation of
-the \code{d}-slot on a grid of length \code{ngrid}, all regions in the
-range\footnote{more precisely: between lower and upper \code{TruncQuantile};
- \code{TruncQuantile} is a global option of \pkg{distr} described in
- section~\ref{options}} of the distribution where the density is smaller than
- $10^{\scriptscriptstyle - {\rm exactq}}$ are set to gaps.
- Internally, we have helper functions \code{.consolidategaps} to merge adjacent
- intervals and \code{mergegaps} to merge \code{slots} of different objects.
- \\ For saved objects
- from earlier versions, we provide the functions \code{isOldVersion} and
- \linebreak[4]\code{conv2NewVersion} to check whether the
-object was generated by an older version of this package and
-to convert such an object to the new format, respectively.\\
-
-Class \code{DiscreteDistribution} has a slot \code{support}, a vector containing
-the support of the distribution, which is truncated to the lower/upper
-\code{TruncQuantile} in case of an infinite support. \code{TruncQuantile} is a
-global option of \pkg{distr} described in section~{\ref{options}}.
-
-
-Also from version 1.9 on, class \code{DiscreteDistribution} has a subclass
-\code{LatticeDistribution} for supports consisting of\footnote{or at least
-if filled with points carrying no mass have a representation as an affine linear
-lattice} an affine linear lattice of form $p+iw$ for $p\in\R$, $w\in\R$,
-$w\not=0$ and $i=0,1,\ldots,L$,
-$L\in\N \cup\infty$. This class gains a slot \code{lattice} of
-class \code{Lattice} (see below). The purpose of this class is mainly its use
-in DFT/FFT methods for convolution. Slot \code{lattice} may be
-inspected by the usual accessor function \code{lattice()}.
-As by inheritance, all subclasses of \code{LatticeDistribution} which prior to
-version 1.9 were direct subclasses of \code{DiscreteDistribution} gain a
-slot \code{lattice}, too, we provide again \code{isOldVersion} and
-\code{conv2NewVersion} methods to check whether the object was generated by an
-older version of this package and to convert such an object to the new
-format, respectively. Also note that internally, we suppress lattice points from
-the support where the probability is $0$.\\
-
-
-Objects of classes \code{LatticeDistribution} resp.\
-\code{DiscreteDistribution}, and from version 2.0 on, also
-\code{AbscontDistribution}, may be generated using the generating functions
-\code{LatticeDistribution()} resp.\ \code{DiscreteDistribution()}
-resp.\ \code{AbscontDistribution()}; see also
-the corresponding help. E.g., to produce a discrete distribution with
-support $(1,5,7,21)$ with corresponding probabilities $(0.1,0.1,0.6,0.2)$
-we may write
-<<DiscrDist, eval = TRUE, fig = TRUE>>=
-D <- DiscreteDistribution(supp = c(1,5,7,21), prob = c(0.1,0.1,0.6,0.2))
-D
-plot(D)
-@
-\newline
-and to generate an absolutely continuos distribution with density proportional
-to $e^{-|x|^3}$, we write
-<<AbscDist, eval = TRUE, fig = TRUE>>=
-AC <- AbscontDistribution(d = function(x) exp(-abs(x)^3), withStand = TRUE)
-AC
-plot(AC)
-@
-\newline
-As subclasses of these absolutely continuous and discrete classes, we have
-implemented all parametric families which already exist in the \pkg{stats}
-package of {\sf R} in form of
-{\tt [prefix]<name>} functions ---by just providing wrappers to the original
-{\sf R}-functions.\\
-%
-Schematically, the inheritance relations as well as the slots
-of the corresponding classes may be read off from Figure~\ref{fig1c}.
-Class \code{LatticeDistribution} and slot \code{gaps}, as well as
-additional classes \code{AffLinAbscontDistribution},
-\code{AffLinDiscreteDistribution}, \code{AffLinLatticeDistribution}
-(c.f.\ section~\ref{afflin}) are still lacking in this graphic so far, however,
-as well as the classes introduced in version 2.0.
-\\
-
-\ifpdf
-\begin{figure}[!ht]\label{fig1}
-\vspace{2ex}
- \begin{center}
-% \includegraphics[viewport=0 0 500 700,width=9cm]{distribution.pdf}%
- \includegraphics[viewport=130 150 500 750,width=9cm]{distribution.pdf}%
- \caption{\label{fig1c}{\footnotesize Inheritance relations and slots of the
- corresponding \mbox{(sub-)}classes for \code{Distribution} where we do not
- repeat inherited slots
- }}
- \end{center}
-\vspace{-4ex}
-\end{figure}
-\else
-\begin{figure}[htb]\label{fig1}
- \begin{center}
- \includegraphics[viewport=130 150 500 730,width=7.5cm]{distribution.ps}%
- \caption{\label{fig1c}{\footnotesize Inheritance relations and slots of the
- corresponding \mbox{(sub-)}classes for \code{Distribution} where we do not
- repeat inherited slots
- }}
- \end{center}
-\vspace{-1ex}
-\end{figure}
-\fi
-
-The most powerful use of our package probably consists in operations to
-automatically generate new slots \code{r}, \code{d}, \code{p}, and \code{q}
----induced by mathematical transformations. This is discussed in some detail in
-subsection~{\ref{methods}}.
-
-\subsubsection{Classes for Mixture Distributions}
-
-\paragraph{Lists of distributions}
-
-As a first step, we allow distributions to be gathered in lists, giving
-classes \code{DistrList} and \code{UnivarDistrList}, where in case of the latter,
-all elements must be univariate distributions. For these, the usual indexing
-operations with \code{[[.]]} are available. As we will use these lists to
-construct more general mixture distributions in some subsequent versions, we
-have moved these routines to package \pkg{distr} from version 1.9 on.
-
-
-\paragraph{Mixing distributions}
-
-To be able to work with distributions which are neither purely absolutely continuous
-nor purely discrete, like e.g.\ the distribution of $\min(X,1)$ for
-$X\sim{\cal N}(0,1)$, from package version 2.0 on, we support mixtures of
-distributions. These are realized as subclasses of class \code{UnivariateDistribution}.
-To begin with, we introduce a class \code{UnivarMixingDistribution} as subclass of
-class \code{UnivariateDistribution} which additionally has two slots \code{MixCoeff}
-and \code{MixDistr}. While the former is a numeric vector taking up the mixture
-coefficients of the distribution, the latter is an object of class
-\code{UnivarDistrList} as described below, taking up the distributions of the
-mixture components; as usual, these slots have their respective accessor and
-replacement functions. Usually, this mixing distribution will neither have
-a Lebesgue density nor be purely discrete, having a counting density. So slot
-\code{d} as a rule will be empty. Objects of this class may be generated by
-the generating function \code{UnivarMixingDistribution()}, see also
-the corresponding help. In addition there is the function \code{flat.mix}
-to simplify such an object converting it to an object of class
-\code{UnivarLebDecDistribution}; confer subsection~\ref{flat}.
-Note that these mixing distributions may be recursive, i.e.\ compoments of
-slot \code{MixDistr} may again
-be of class \code{UnivarMixingDistribution}.
-<<examLis, eval = TRUE>>=
-library(distr)
-M1 <- UnivarMixingDistribution(Norm(), Pois(lambda=1), Norm(),
- withSimplify = FALSE)
-M2 <- UnivarMixingDistribution(M1, Norm(), M1, Norm(), withSimplify = FALSE)
-M2
-@
-
-\paragraph{Lebesgue Decomposed distributions}
-
-As seen in the above example of $\min(X,1)$, classes \code{DiscreteDistribution}
-and \code{Abscontdistribution} are not closed under arithmetic operations. To
-have such a closure, from version 2.0 on, we introduce class
-\code{UnivarLebDecDistribution}, which realizes a Lebesgue decomposition of a
-univariate distribution into a discrete and an absolutely continuous distribution.
-Of course, we still cannot cover distributions having a non-trivial continuous
-but not absolutely continuous part like the Cantor distribution, but class
-\code{UnivarLebDecDistribution} provides a sufficiently general compromise.
-Class \code{UnivarLebDecDistribution} is a subclass of class
-\code{UnivarMixingDistribution}, where in addition we assume that both slots
-\code{MixCoeff} and \code{MixDistr} are of length 2, and that the first component
-of slot \code{MixDistr} is of class \code{AbscontDistribution} while the second
-is of class \code{DiscreteDistribution}. For this class there are particular
-accessors \code{acWeight}, \code{discreteWeight} for the respective weights and
-\code{acPart}, \code{discretePart} for the respective distributions. Again there
-is a generating function \code{UnivarMixingDistribution()}.
-In addition there is the function \code{flat.LCD}
-to simplify such an object converting it to an object of class
-\code{UnivarLebDecDistribution}; confer subsection~\ref{flat}.%
-Classes \code{AbscontDistribution}, \code{DiscreteDistribution} and
-\code{UnivarLebDecDistribution} are grouped to a virtual class
-(more specifically a class union)
-\code{AcDcLcDistribution}.
-
-\paragraph{Compound distributions}
-From version 2.1 on, we also support compound distributions, i.e. the distributions
-$D$ of form $D={\cal L}(\sum_{i=1}^N X_i)$, $X_i\stackrel{\rm\scriptsize i.i.d.}{\sim} F$,
-a distribution on $\R$, and, independent of the $X_i$, $N\sim Q$ a distribution on $\N_0$.
-These distributions are implemented as class \code{CompoundDistribution} which is a subclass
-of class \code{UnivarMixingDistribution}; in addition this class has
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/distr -r 927
More information about the Distr-commits
mailing list