Skip to contents

Functions to compute the probability density function, cumulative distribution function, and quantile function for the Uniform distribution.

Usage

uniform_pdf(x, lower = 0, upper = 1)

uniform_lpdf(x, lower = 0, upper = 1)

uniform_cdf(x, lower = 0, upper = 1)

uniform_lcdf(x, lower = 0, upper = 1)

uniform_quantile(p, lower = 0, upper = 1)

Arguments

x

quantile

lower

lower bound of the distribution (default is 0)

upper

upper bound of the distribution (default is 1)

p

probability (0 <= p <= 1)

Value

A single numeric value with the computed probability density, log-probability density, cumulative distribution, log-cumulative distribution, or quantile depending on the function called.

See also

Boost Documentation for more details on the mathematical background.

Examples

# Uniform distribution with lower = 0, upper = 1
uniform_pdf(0.5)
#> [1] 1
uniform_lpdf(0.5)
#> [1] 0
uniform_cdf(0.5)
#> [1] 0.5
uniform_lcdf(0.5)
#> [1] -0.6931472
uniform_quantile(0.5)
#> [1] 0.5