• incanter

# quantile-normal

## incanter.stats

• (quantile-normal probability & options)
Returns the inverse of the Normal CDF for the given probability.
It will return a sequence of values, if given a sequence of
probabilities. This is equivalent to R's qnorm function.

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

Returns:
a value x, where (cdf-normal x) = probability

pdf-normal, cdf-normal, and sample-normal

References:
http://incanter.org/docs/parallelcolt/api/cern/jet/stat/tdouble/Probability.html
http://en.wikipedia.org/wiki/Normal_distribution
http://en.wikipedia.org/wiki/Quantile

Example:
(quantile-normal 0.975)
(quantile-normal [0.025 0.975] :mean -2 :sd (sqrt 0.5))

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

(defn quantile-normal
" Returns the inverse of the Normal CDF for the given probability.
It will return a sequence of values, if given a sequence of
probabilities. This is equivalent to R's qnorm function.

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

Returns:
a value x, where (cdf-normal x) = probability

pdf-normal, cdf-normal, and sample-normal

References:
http://incanter.org/docs/parallelcolt/api/cern/jet/stat/tdouble/Probability.html
http://en.wikipedia.org/wiki/Normal_distribution
http://en.wikipedia.org/wiki/Quantile

Example:
(quantile-normal 0.975)
(quantile-normal [0.025 0.975] :mean -2 :sd (sqrt 0.5))
"
([probability & options]
(let [opts (when options (apply assoc {} options))
mean (or (:mean opts) 0)
sd (or (:sd opts) 1)
x (if (coll? probability)
(map #(Probability/normalInverse %) probability)
(Probability/normalInverse probability))]
(plus mean (mult sd x)))))
Vars in incanter.stats/quantile-normal: defn let
Used in 0 other vars