# Unif-class

From distr v2.3.1
by Peter Ruckdeschel

##### Class "Unif"

The uniform distribution has density
$$d(x) = \frac{1}{max-min}$$
for $min$, by default $=0$, $\le x \le max$, by default $=1$.
C.f. `runif`

- Keywords
- distribution

##### Objects from the Class

Objects can be created by calls of the form `Unif(Min, Max)`

.
This object is a uniform distribution.

##### Extends

Class `"AbscontDistribution"`

, directly.
Class `"UnivariateDistribution"`

, by class `"AbscontDistribution"`

.
Class `"Distribution"`

, by class `"AbscontDistribution"`

.

##### Is-Relations

By means of `setIs`

, R ``knows'' that a distribution object `obj`

of class `"Unif"`

with Min 0 and Max 1 also is
a Beta distribution with parameters `shape1 = 1, shape2 = 1, ncp = 0`

.

##### concept

- absolutely continuous distribution
- Uniform distribution
- S4 distribution class
- generating function

##### See Also

`UnifParameter-class`

`AbscontDistribution-class`

`Reals-class`

`runif`

##### Examples

```
U <- Unif(Min=0,Max=2) # U is a uniform distribution with Min=0 and Max=2.
r(U)(1) # one random number generated from this distribution, e.g. 1.984357
d(U)(1) # Density of this distribution is 0.5 for x=1.
p(U)(1) # Probability that x<1 is 0.5.
q(U)(.1) # Probability that x<0.2 is 0.1.
Min(U) # Min of this distribution is 0.
Min(U) <- 1 # Min of this distribution is now 1.
Min(U) # Min of this distribution is 1.
Min(U) <- 0
is(U/2,"Beta") # yes
V <- U/2; as(V,"Beta")
```

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

### Community examples

Looks like there are no examples yet.