1.2.3-SNAPSHOT Arrow_down_16x16
  • (cdf-f x & options)
Returns the F-distribution cdf of the given value, x. It will return a sequence
of values, if x is a sequence. This is equivalent to R's pf function.

Options:
:df1 (default 1)
:df2 (default 1)

See also:
pdf-f and quantile-f

References:
http://en.wikipedia.org/wiki/F_distribution
http://mathworld.wolfram.com/F-Distribution.html
http://en.wikipedia.org/wiki/Cumulative_distribution_function

Example:
(cdf-f 1.0 :df1 5 :df2 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:118 top

(defn cdf-f
" Returns the F-distribution cdf of the given value, x. It will return a sequence
  of values, if x is a sequence. This is equivalent to R's pf function.

  Options:
    :df1 (default 1)
    :df2 (default 1)

  See also:
      pdf-f and quantile-f

  References:
      http://en.wikipedia.org/wiki/F_distribution
      http://mathworld.wolfram.com/F-Distribution.html
      http://en.wikipedia.org/wiki/Cumulative_distribution_function

  Example:
      (cdf-f 1.0 :df1 5 :df2 2)
"
  ([x & options]
    (let [opts (when options (apply assoc {} options))
          lower-tail? (if (false? (:lower-tail opts)) false true)
          df1 (or (:df1 opts) 1)
          df2 (or (:df2 opts) 1)
          cdf-fx (if lower-tail?
                   (fn [x1] (regularized-beta
                              (/ (* df1 x1) (+ df2 (* df1 x1)))
                              (/ df1 2)
                              (/ df2 2)))
                   (fn [x1] (- 1 (regularized-beta
                                   (/ (* df1 x1) (+ df2 (* df1 x1)))
                                   (/ df1 2)
                                   (/ df2 2)))))
         ]
      (if (coll? x)
        (map cdf-fx x)
        (cdf-fx x)))))
Vars in incanter.stats/cdf-f: coll? defn let map
Used in 0 other vars

Comments top

No comments for cdf-f. Log in to add a comment.