• incanter

1.2.3-SNAPSHOT

# pdf-normal

## incanter.stats

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

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

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

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

### Source incanter/stats.clj:162 top

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

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

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

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