• incanter

1.2.3-SNAPSHOT

# pdf-gamma

## incanter.stats

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

Options:
:shape (default 1)
:rate (default 1)

cdf-gamma and sample-gamma

References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/Gamma.html
http://en.wikipedia.org/wiki/Gamma_distribution
http://en.wikipedia.org/wiki/Probability_density_function

Example:
(pdf-gamma 10 :shape 1 :rate 2)

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

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

Options:
:shape (default 1)
:rate (default 1)

cdf-gamma and sample-gamma

References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/Gamma.html
http://en.wikipedia.org/wiki/Gamma_distribution
http://en.wikipedia.org/wiki/Probability_density_function

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