• incanter

1.2.3-SNAPSHOT

pdf-poisson

incanter.stats

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

Options:
:lambda (default 1)

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/Probability_density_function

Example:
(pdf-poisson 5 :lambda 10)

1 Example top

• ```;In Clojure
(pdf-poisson 57 :lambda 50)
;0.03302345879160118

;In R
;> dpois(57, 50, log=FALSE)
;[1] 0.03302346         ```

Source incanter/stats.clj:1216 top

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

Options:
:lambda (default 1)

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/Probability_density_function

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