1.2.3-SNAPSHOT permalink Arrow_down_16x16

cdf-poisson

incanter.stats

  • (cdf-poisson x & options)
Returns the Poisson cdf of the given value of x. It will return a sequence
of values, if x is a sequence. Same as R's ppois

Options:
:lambda (default 1)
:lower-tail (default true)

See also:
cdf-poisson and sample-poisson

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

Example:
(cdf-poisson 5 :lambda 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:1244 top

(defn cdf-poisson
" Returns the Poisson cdf of the given value of x. It will return a sequence
  of values, if x is a sequence. Same as R's ppois

  Options:
    :lambda (default 1)
    :lower-tail (default true)

  See also:
      cdf-poisson and sample-poisson

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

  Example:
      (cdf-poisson 5 :lambda 10)
"
  ([x & options]
    (let [opts (when options (apply assoc {} options))
          lambda (or (:lambda opts) 1)
          lower-tail? (if (false? (:lower-tail opts)) false true)
          cdf-fx (if lower-tail?
                  (fn [x1] (Probability/poisson x1 lambda))
                  (fn [x1] (Probability/poissonComplemented x1 lambda)))]
      (if (coll? x)
        (map cdf-fx x)
        (cdf-fx x)))))
Vars in incanter.stats/cdf-poisson: coll? defn let map
Used in 0 other vars

Comments top

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