Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

dist_uniform

The Uniform distribution


Description

[Stable]

Usage

dist_uniform(min, max)

Arguments

min

lower and upper limits of the distribution. Must be finite.

max

lower and upper limits of the distribution. Must be finite.

Details

A distribution with constant density on an interval.

We recommend reading this documentation on https://pkg.mitchelloharawild.com/distributional/, where the math will render nicely.

In the following, let X be a Poisson random variable with parameter lambda = λ.

Support: [a,b]

Mean: \frac{1}{2}(a+b)

Variance: \frac{1}{12}(b-a)^2

Probability mass function (p.m.f):

f(x) = \frac{1}{b-a} for x in [a,b]

f(x) = 0 otherwise

Cumulative distribution function (c.d.f):

F(x) = 0 for x < a

F(x) = \frac{x - a}{b-a} for x in [a,b]

F(x) = 1 for x > b

Moment generating function (m.g.f):

E(e^(tX)) = \frac{e^{tb} - e^{ta}}{t(b-a)} for t \neq 0

E(e^(tX)) = 1 for t = 0

See Also

Examples

dist <- dist_uniform(min = c(3, -2), max = c(5, 4))

dist
mean(dist)
variance(dist)
skewness(dist)
kurtosis(dist)

generate(dist, 10)

density(dist, 2)
density(dist, 2, log = TRUE)

cdf(dist, 4)

quantile(dist, 0.7)

distributional

Vectorised Probability Distributions

v0.2.2
GPL-3
Authors
Mitchell O'Hara-Wild [aut, cre] (<https://orcid.org/0000-0001-6729-7695>), Earo Wang [ctb] (<https://orcid.org/0000-0001-6448-5260>), Matthew Kay [ctb] (<https://orcid.org/0000-0001-9446-0419>), Alex Hayes [aut] (<https://orcid.org/0000-0002-4985-5160>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.