uniformDensity {RVCompare} | R Documentation |
The probability density function of the uniform distribution
Description
Returns the density function of the uniform distribution in the interval (xlims[[1]], xlims[[2]]). The returned function is a single parameter function that returns the probability of the uniform distribution in that point. It is just a convinient wrapper of dunif from the package 'stat' with some parameter checks.
Usage
uniformDensity(xlims)
Arguments
xlims |
a tuple representing the interval of nonzero probability of the distribution. |
Value
Returns a callable function with a single parameter that rerturns the probability of the uniform distribution in each point.
See Also
Other probability density distributions:
normalDensity()
Examples
dist <- uniformDensity(c(-2,2))
dist(-3)
dist(0)
dist(1)
[Package RVCompare version 0.1.8 Index]