1.2.3-SNAPSHOT permalink Arrow_down_16x16

cdf-normal

incanter.stats

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

Options:
:mean (default 0)
:sd (default 1)

See also:
pdf-normal, quantile-normal, sample-normal

References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/Normal.html
http://en.wikipedia.org/wiki/Normal_distribution
http://en.wikipedia.org/wiki/Cumulative_distribution_function

Example:
(cdf-normal 1.96 :mean -2 :sd (sqrt 0.5))

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:192 top

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

  Options:
    :mean (default 0)
    :sd (default 1)

  See also:
      pdf-normal, quantile-normal, sample-normal

  References:
      http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/Normal.html
      http://en.wikipedia.org/wiki/Normal_distribution
      http://en.wikipedia.org/wiki/Cumulative_distribution_function

  Example:
      (cdf-normal 1.96 :mean -2 :sd (sqrt 0.5))
"
  ([x & options]
    (let [opts (when options (apply assoc {} options))
          mean (or (:mean opts) 0)
          sd (or (:sd opts) 1)
          dist (Normal. mean sd (DoubleMersenneTwister.))]
      (if (coll? x)
        (map #(.cdf dist %) x)
        (.cdf dist x)))))
Vars in incanter.stats/cdf-normal: coll? defn let map
Used in 0 other vars

Comments top

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