• incanter

1.2.3-SNAPSHOT

pdf-uniform

incanter.stats

• (pdf-uniform x & options)
Returns the Uniform pdf of the given value of x. It will return a sequence
of values, if x is a sequence. This is equivalent to R's dunif function.

Options:
:min (default 0)
:max (default 1)

cdf-uniform and sample-uniform

References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/DoubleUniform.html
http://en.wikipedia.org/wiki/Uniform_distribution
http://en.wikipedia.org/wiki/Probability_density_function

Example:
(pdf-uniform 5)
(pdf-uniform 5 :min 1 :max 10)

Source incanter/stats.clj:348 top

```(defn pdf-uniform
" Returns the Uniform pdf of the given value of x. It will return a sequence
of values, if x is a sequence. This is equivalent to R's dunif function.

Options:
:min (default 0)
:max (default 1)

cdf-uniform and sample-uniform

References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/DoubleUniform.html
http://en.wikipedia.org/wiki/Uniform_distribution
http://en.wikipedia.org/wiki/Probability_density_function

Example:
(pdf-uniform 5)
(pdf-uniform 5 :min 1 :max 10)
"
([x & options]
(let [opts (when options (apply assoc {} options))
min (double (or (:min opts) 0.0))
max (double (or (:max opts) 1.0))
dist (DoubleUniform. min max (DoubleMersenneTwister.))]
(if (coll? x)
(map #(.pdf dist %) x)
(.pdf dist x)))))```
Vars in incanter.stats/pdf-uniform: coll? defn let map
Used in 0 other vars