| Dirac-class {distr} | R Documentation |
Class "Dirac"
Description
The Dirac distribution with location l, by default =0, has density
d(x) = 1 for x = l, 0 else.
Objects from the Class
Objects can be created by calls of the form Dirac(location).
This object is a Dirac distribution.
Slots
imgObject of class
"Naturals": The space of the image of this distribution has got dimension 1 and the name "Real Space".paramObject of class
"DiracParameter": the parameter of this distribution (location), declared at its instantiationrObject of class
"function": generates random numbersdObject of class
"function": density functionpObject of class
"function": cumulative functionqObject of class
"function": inverse of the cumulative functionsupportObject of class
"numeric": a (sorted) vector containing the support of the discrete density function.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.
Extends
Class "DiscreteDistribution", directly.
Class "UnivariateDistribution", by class "DiscreteDistribution".
Class "Distribution", by class "DiscreteDistribution".
Methods
- -
signature(e1 = "Dirac", e2 = "Dirac")- +
signature(e1 = "Dirac", e2 = "Dirac")- *
signature(e1 = "Dirac", e2 = "Dirac")- /
signature(e1 = "Dirac", e2 = "Dirac"): For the Dirac distribution these operations are trivial.- initialize
signature(.Object = "Dirac"): initialize method- location
signature(object = "Dirac"): returns the slotlocationof the parameter of the distribution- location<-
signature(object = "Dirac"): modifies the slotlocationof the parameter of the distribution- log
signature(object = "Dirac"): returns an object of class"Dirac"distribution with log-transformedlocationparameter.- Math
signature(object = "Dirac"): given a"Math"group genericfunan object of class"Dirac"distribution withfun-transformedlocationparameter is returned.
further arithmetic methods see operators-methods
Author(s)
Thomas Stabla statho3@web.de,
Florian Camphausen fcampi@gmx.de,
Peter Ruckdeschel peter.ruckdeschel@uni-oldenburg.de,
Matthias Kohl Matthias.Kohl@stamats.de
See Also
DiracParameter-class
DiscreteDistribution-class
Naturals-class
Examples
D <- Dirac(location = 0) # D is a Dirac distribution with location=0.
r(D)(1)
# r(D)(1) generates a pseudo-random-number according to a Dirac
# distribution with location = 0,
# which of course will take 0 as value almost surely.
d(D)(0) # Density of this distribution is 1 for x = 0.
p(D)(1) # Probability that x < 1 is 1.
q(D)(.1) # q(D)(x) is always 0 (= location).
## in RStudio or Jupyter IRKernel, use q.l(.)(.) instead of q(.)(.)
location(D) # location of this distribution is 0.
location(D) <- 2 # location of this distribution is now 2.