# DiscreteDistribution-class

##### Class "DiscreteDistribution"

The `DiscreteDistribution`

-class is the mother-class of the class `LatticeDistribution`

.

- Keywords
- distribution

##### Note

Working with a computer, we use a finite interval as support which carries at least mass `1-getdistrOption("TruncQuantile")`

.

##### Objects from the Class

Objects can be created by calls to `new("DiscreteDistribution", ...)`

, but more
easily is the use of the generating function `"DiscreteDistribution"`

.
This generating function, from version 1.9 on, has been moved to this package from package

##### Extends

Class `"UnivariateDistribution"`

, directly.
Class `"Distribution"`

, by class `"UnivariateDistribution"`

.

##### Internal subclass "AffLinDiscreteDistribution"

To enhance accuracy of several functionals on distributions,
mainly from package `"AffLinDiscreteDistribution"`

which has extra slots
`a`

, `b`

(both of class `"numeric"`

), and `X0`

(of class `"DiscreteDistribution"`

), 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 = "DiscreteDistribution")`

}
`signature(e1 = "DiscreteDistribution", e2 = "numeric")`

}
`signature(e1 = "DiscreteDistribution", e2 = "numeric")`

}
`signature(e1 = "DiscreteDistribution", e2 = "numeric")`

}
`signature(e1 = "DiscreteDistribution", e2 = "numeric")`

}
`signature(e1 = "numeric", e2 = "DiscreteDistribution")`

}
`signature(e1 = "numeric", e2 = "DiscreteDistribution")`

}
`signature(e1 = "numeric", e2 = "DiscreteDistribution")`

}
`signature(e1 = "AffLinDiscreteDistribution")`

}
`signature(e1 = "AffLinDiscreteDistribution", e2 = "numeric")`

}
`signature(e1 = "AffLinDiscreteDistribution", e2 = "numeric")`

}
`signature(e1 = "AffLinDiscreteDistribution", e2 = "numeric")`

}
`signature(e1 = "AffLinDiscreteDistribution", e2 = "numeric")`

}
`signature(e1 = "numeric", e2 = "AffLinDiscreteDistribution")`

}
`signature(e1 = "numeric", e2 = "AffLinDiscreteDistribution")`

}
`signature(e1 = "numeric", e2 = "AffLinDiscreteDistribution")`

}
##### code

`"AffLinDistribution"`

##### Internal virtual superclass "AcDcLcDistribution"

As many operations should be valid no matter whether the operands
are of class `"AbscontDistribution"`

,
`"DiscreteDistribution"`

, or `"UnivarLebDecDistribution"`

,
there is a class union of these classes called `"AcDcLcDistribution"`

;
in partiucalar methods for `"*"`

, `"/"`

,
`"^"`

(see operators-methods) and methods
`Minimum`

, `Maximum`

, `Truncate`

, and
`Huberize`

, and `convpow`

are defined for this
class union.

##### concept

- discrete distribution
- lattice distribution
- support of a distribution
- S4 distribution class

##### See Also

`Parameter-class`

`UnivariateDistribution-class`

`LatticeDistribution-class`

`AbscontDistribution-class`

`Reals-class`

`RtoDPQ.d`

##### Examples

```
# Dirac-measure at 0
D1 <- DiscreteDistribution(supp = 0)
support(D1)
# simple discrete distribution
D2 <- DiscreteDistribution(supp = c(1:5), prob = c(0.1, 0.2, 0.3, 0.2, 0.2))
plot(D2)
(pp <- p(D2)(support(D2)))
p(D2)(support(D2)-1e-5)
p(D2)(support(D2)+1e-5)
p.l(D2)(support(D2))
p.l(D2)(support(D2)-1e-5)
p.l(D2)(support(D2)+1e-5)
q(D2)(pp)
q(D2)(pp-1e-5)
q(D2)(pp+1e-5)
q.r(D2)(pp)
q.r(D2)(pp-1e-5)
q.r(D2)(pp+1e-5)
```

*Documentation reproduced from package distr, version 2.0.2, License: LGPL-3*