1.2.3-SNAPSHOT Arrow_down_16x16

cdf-uniform

incanter.stats

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

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

See also:
pdf-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/Cumulative_distribution_function

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

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/stats.clj:378 top

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

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

  See also:
      pdf-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/Cumulative_distribution_function

  Example:
      (cdf-uniform 5)
      (cdf-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 #(.cdf dist %) x)
        (.cdf dist x)))))
Vars in incanter.stats/cdf-uniform: coll? defn let map
Used in 0 other vars

Comments top

No comments for cdf-uniform. Log in to add a comment.