1.2.3-SNAPSHOT permalink Arrow_down_16x16

pdf-beta

incanter.stats

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

Options:
:alpha (default 1)
:beta (default 1)

See also:
cdf-beta and sample-beta

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

Example:
(pdf-beta 0.5 :alpha 1 :beta 2)

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:447 top

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

  Options:
    :alpha (default 1)
    :beta (default 1)

  See also:
      cdf-beta and sample-beta

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

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

Comments top

No comments for pdf-beta. Log in to add a comment.