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
img
Object of class
"Naturals"
: The space of the image of this distribution has got dimension 1 and the name "Real Space".param
Object of class
"DiracParameter"
: the parameter of this distribution (location), declared at its instantiationr
Object of class
"function"
: generates random numbersd
Object of class
"function"
: density functionp
Object of class
"function"
: cumulative functionq
Object of class
"function"
: inverse of the cumulative functionsupport
Object of class
"numeric"
: a (sorted) vector containing the support of the discrete density function.withArith
logical: used internally to issue warnings as to interpretation of arithmetics
.withSim
logical: used internally to issue warnings as to accuracy
.logExact
logical: used internally to flag the case where there are explicit formulae for the log version of density, cdf, and quantile function
.lowerExact
logical: used internally to flag the case where there are explicit formulae for the lower tail version of cdf and quantile function
Symmetry
object 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 slotlocation
of the parameter of the distribution- location<-
signature(object = "Dirac")
: modifies the slotlocation
of the parameter of the distribution- log
signature(object = "Dirac")
: returns an object of class"Dirac"
distribution with log-transformedlocation
parameter.- Math
signature(object = "Dirac")
: given a"Math"
group genericfun
an object of class"Dirac"
distribution withfun
-transformedlocation
parameter 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.