1.2.3-SNAPSHOT Arrow_down_16x16

cdf-chisq

incanter.stats

  • (cdf-chisq x & options)
Returns the Chi Square cdf of the given value of x. It will return a sequence
of values, if x is a sequence. Same as R's pchisq function.

Options:
:df (default 1)
:lower-tail (default true)

See also:
pdf-chisq and sample-chisq

References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/ChiSquare.html
http://en.wikipedia.org/wiki/Chi_square_distribution
http://en.wikipedia.org/wiki/Cumulative_distribution_function

Example:
(cdf-chisq 5.0 :df 2)
(cdf-chisq 5.0 :df 2 :lower-tail false)

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

(defn cdf-chisq
" Returns the Chi Square cdf of the given value of x. It will return a sequence
  of values, if x is a sequence. Same as R's pchisq function.

  Options:
    :df (default 1)
    :lower-tail (default true)

  See also:
      pdf-chisq and sample-chisq

  References:
      http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/ChiSquare.html
      http://en.wikipedia.org/wiki/Chi_square_distribution
      http://en.wikipedia.org/wiki/Cumulative_distribution_function

  Example:
      (cdf-chisq 5.0 :df 2)
      (cdf-chisq 5.0 :df 2 :lower-tail false)
"
  ([x & options]
    (let [opts (when options (apply assoc {} options))
          df (or (:df opts) 1)
          lower-tail? (if (false? (:lower-tail opts)) false true)
          cdf-fx (if lower-tail?
                  (fn [x1] (Probability/chiSquare df x1))
                  (fn [x1] (Probability/chiSquareComplemented df x1)))]
      (if (coll? x)
        (map cdf-fx x)
        (cdf-fx x)))))
Vars in incanter.stats/cdf-chisq: coll? defn let map
Used in 0 other vars

Comments top

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