Distribution
is introduced with slots for a parameter and ---most important---
for the four constitutive methods r
, d
, p
, and q
for simulation respectively for evaluation of
density / c.d.f. and quantile function of the corresponding distribution.
Most distributions of package AbscontDistribution
or DiscreteDistribution
,
which themselves are again subclasses of Distribution
.
Arithmetics and unary mathematical transformations for distributions are available:
For Distribution
objects X
and Y
expressions like
3*X+sin(exp(-Y/4+3))
have their natural interpretation as corresponding image distributions.param
the class of which
is is specialized for the particualar distributions. The parameter
classes for the particular distributions have slots with names
according to the corresponding [rdpq]support
. For all particular distributions,
generating functions are provided, e.g. X <- Norm(mean = 3, sd = 2)
.
All slots should be inspected / modified by means of corresponding
accessor- /replacement functions; e.g. mean(X) <- 3
(see Parameter classes).
Distribution classes
slots: [Math
of unary (see Math) as well as
convolution are made available for distributions, see operators-methods.
Besides, there are plot
and print
-methods for distributions.
For the space classes, we have liesIn
. The "history" of distributions
obtained by chaining operations may be shortened using simplifyr
.options("StartupBanner"="off")
somewhere before loading this package by library
or require
in your R-code / R-session.
If option "StartupBanner"
is not defined (default) or setting
options("StartupBanner"=NULL)
or options("StartupBanner"="complete")
the complete start-up banner is displayed.
For any other value of option "StartupBanner"
(i.e., not in c(NULL,"off","complete")
)
only the version information is displayed.
The same can be achieved by wrapping the library
or require
call into
either suppressStartupMessages()
or onlytypeStartupMessages(.,atypes="version")
.demo(package="distr")
X <- Unif(2,3)
Y <- Pois(lambda = 3)
Z <- X+Y # generates Law of corresponding independent variables
p(Z)(0.2)
r(Z)(1000)
plot(Z+sin(Norm()))
Run the code above in your browser using DataCamp Workspace