Class "LatticeDistribution"
The LatticeDistribution-class is the mother-class of the
classes Binom, Dirac, Geom, Hyper, Nbinom and
Poisson. It formalizes a distribution on a regular affine
linear lattice.
The usual way to generate objects of class LatticeDistribution is to call
the generating function LatticeDistribution.
Somewhat more flexible, but also proner to inconsistencies is a call to
new("LatticeDistribution"), where you may explicitly specify random
number generator, (counting) density, cumulative distribution and quantile
functions. For conveniance, in this call to new("LatticeDistribution"),
an additional possibility is to only specify the random number generator. The
function RtoDPQ.d then approximates the three remaining slots d,
p and q by random sampling.
imgObject of class "Reals": the space of the image
of this distribution which has dimension 1 and the name "Real Space"
paramObject of class "Parameter": the parameter of
this distribution, having only the slot name
"Parameter of a discrete distribution"
rObject of class "function":
generates random numbers
dObject of class "function":
(counting) density/probability function
pObject of class "function":
cumulative distribution function
qObject of class "function":
quantile function
supportObject of class "numeric": a (sorted) vector
containing the support of the discrete
density function
latticeObject of class "Lattice": the lattice
generating the support.
.withArithlogical: used internally to issue warnings as to interpretation of arithmetics
.withSimlogical: used internally to issue warnings as to accuracy
.logExactlogical: used internally to flag the case where there are explicit formulae for the log version of density, cdf, and quantile function
.lowerExactlogical: used internally to flag the case where there are explicit formulae for the lower tail version of cdf and quantile function
Symmetryobject of class "DistributionSymmetry";
used internally to avoid unnecessary calculations.
Class "UnivariateDistribution", directly.
Class "Distribution", by class "UnivariateDistribution".
initializesignature(.Object = "LatticeDistribution"):
initialize method
signature(e1 = "LatticeDistribution"):
application of ‘-’ to this lattice distribution
signature(e1 = "LatticeDistribution", e2 = "numeric"):
multiplication of this lattice distribution
by an object of class ‘numeric’
signature(e1 = "LatticeDistribution", e2 = "numeric"):
division of this lattice distribution by an object of class ‘numeric’
signature(e1 = "LatticeDistribution", e2 = "numeric"):
addition of this lattice distribution to an object of class ‘numeric’
signature(e1 = "LatticeDistribution", e2 = "numeric"):
subtraction of an object of class ‘numeric’ from this lattice
distribution
signature(e1 = "numeric", e2 = "LatticeDistribution"):
multiplication of this lattice distribution by an object of class ‘numeric’
signature(e1 = "numeric", e2 = "LatticeDistribution"):
addition of this lattice distribution to an object of class ‘numeric’
signature(e1 = "numeric", e2 = "LatticeDistribution"):
subtraction of this lattice distribution from an object of class ‘numeric’
signature(e1 = "LatticeDistribution",
e2 = "LatticeDistribution"): Convolution of two lattice distributions.
Slots p, d and q are approximated by grids.
signature(e1 = "LatticeDistribution",
e2 = "LatticeDistribution"): Convolution of two lattice
distributions. The slots p, d and q are approximated by grids.
sqrtsignature(x = "LatticeDistribution"): exact
image distribution of sqrt(x).
latticeaccessor method to the corresponding slot.
coercesignature(from = "LatticeDistribution",
to = "DiscreteDistribution"): coerces an object from
"LatticeDistribution" to "DiscreteDistribution"
thereby cancelling out support points with probability 0.
To enhance accuracy of several functionals on distributions,
mainly from package distrEx, there is an internally used
(but exported) subclass "AffLinLatticeDistribution" which has extra slots
a, b (both of class "numeric"), and X0
(of class "LatticeDistribution"), to capture the fact
that the object has the same distribution as a * X0 + b. This is
the class of the return value of methods
signature(e1 = "LatticeDistribution")
signature(e1 = "LatticeDistribution", e2 = "numeric")
signature(e1 = "LatticeDistribution", e2 = "numeric")
signature(e1 = "LatticeDistribution", e2 = "numeric")
signature(e1 = "LatticeDistribution", e2 = "numeric")
signature(e1 = "numeric", e2 = "LatticeDistribution")
signature(e1 = "numeric", e2 = "LatticeDistribution")
signature(e1 = "numeric", e2 = "LatticeDistribution")
signature(e1 = "AffLinLatticeDistribution")
signature(e1 = "AffLinLatticeDistribution", e2 = "numeric")
signature(e1 = "AffLinLatticeDistribution", e2 = "numeric")
signature(e1 = "AffLinLatticeDistribution", e2 = "numeric")
signature(e1 = "AffLinLatticeDistribution", e2 = "numeric")
signature(e1 = "numeric", e2 = "AffLinLatticeDistribution")
signature(e1 = "numeric", e2 = "AffLinLatticeDistribution")
signature(e1 = "numeric", e2 = "AffLinLatticeDistribution")
There is also an explicit coerce-method from class
"AffLinLatticeDistribution" to class "AffLinDiscreteDistribution"
which cancels out support points with probability 0.
Working with a computer, we use a finite interval as support which
carries at least mass 1-getdistrOption("TruncQuantile").
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de
B <- Binom(prob = 0.1,size = 10) # B is a Binomial distribution w/ prob=0.1 and size=10. P <- Pois(lambda = 1) # P is a Poisson distribution with lambda = 1. D1 <- B+1 # a new Lattice distributions with exact slots d, p, q D2 <- D1*3 # a new Lattice distributions with exact slots d, p, q D3 <- B+P # a new Lattice distributions with approximated slots d, p, q D4 <- D1+P # a new Lattice distributions with approximated slots d, p, q support(D4) # the (approximated) support of this distribution is 1, 2, ..., 21 r(D4)(1) # one random number generated from this distribution, e.g. 4 d(D4)(1) # The (approximated) density for x=1 is 0.1282716. p(D4)(1) # The (approximated) probability that x<=1 is 0.1282716. q(D4)(.5) # The (approximated) 50 percent quantile is 3. ## in RStudio or Jupyter IRKernel, use q.l(.)(.) instead of q(.)(.)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.