[Stable]

The degenerate distribution takes a single value which is certain to be observed. It takes a single parameter, which is the value that is observed by the distribution.

dist_degenerate(x)

Arguments

x

The value of the distribution (location parameter). Can be any real number.

Details

We recommend reading this documentation on pkgdown which renders math nicely. https://pkg.mitchelloharawild.com/distributional/reference/dist_degenerate.html

In the following, let \(X\) be a degenerate random variable with value x = \(k_0\).

Support: \(\{k_0\}\), a single point

Mean: \(\mu = k_0\)

Variance: \(\sigma^2 = 0\)

Probability density function (p.d.f):

$$ f(x) = 1 \textrm{ for } x = k_0 $$ $$ f(x) = 0 \textrm{ for } x \neq k_0 $$

Cumulative distribution function (c.d.f):

$$ F(t) = 0 \textrm{ for } t < k_0 $$ $$ F(t) = 1 \textrm{ for } t \ge k_0 $$

Moment generating function (m.g.f):

$$ E(e^{tX}) = e^{k_0 t} $$

Skewness: Undefined (NA)

Excess Kurtosis: Undefined (NA)

Examples

dist <- dist_degenerate(x = 1:5)

dist
#> <distribution[5]>
#> [1] 1 2 3 4 5
mean(dist)
#> [1] 1 2 3 4 5
variance(dist)
#> [1] 0 0 0 0 0
skewness(dist)
#> [1] NA NA NA NA NA
kurtosis(dist)
#> [1] NA NA NA NA NA

generate(dist, 10)
#> [[1]]
#>  [1] 1 1 1 1 1 1 1 1 1 1
#> 
#> [[2]]
#>  [1] 2 2 2 2 2 2 2 2 2 2
#> 
#> [[3]]
#>  [1] 3 3 3 3 3 3 3 3 3 3
#> 
#> [[4]]
#>  [1] 4 4 4 4 4 4 4 4 4 4
#> 
#> [[5]]
#>  [1] 5 5 5 5 5 5 5 5 5 5
#> 

density(dist, 2)
#> [1] 0 1 0 0 0
density(dist, 2, log = TRUE)
#> [1] -Inf    0 -Inf -Inf -Inf

cdf(dist, 4)
#> [1] 1 1 1 1 0

quantile(dist, 0.7)
#> [1] 1 2 3 4 5