1.2.3-SNAPSHOT permalink Arrow_down_16x16
  • (cdf-t x & options)
Returns the Student's t cdf for the given value of x. It will return a sequence
of values, if x is a sequence. Same as R's pt function.

Options:
:df (default 1)

See also:
pdf-t, quantile-t, and sample-t

References:
http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/StudentT.html
http://en.wikipedia.org/wiki/Student-t_distribution
http://en.wikipedia.org/wiki/Cumulative_distribution_function

Example:
(cdf-t 1.2 :df 10)

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

(defn cdf-t
" Returns the Student's t cdf for the given value of x. It will return a sequence
  of values, if x is a sequence. Same as R's pt function.

  Options:
    :df (default 1)

  See also:
      pdf-t, quantile-t, and sample-t

  References:
      http://incanter.org/docs/parallelcolt/api/cern/jet/random/tdouble/StudentT.html
      http://en.wikipedia.org/wiki/Student-t_distribution
      http://en.wikipedia.org/wiki/Cumulative_distribution_function

  Example:
      (cdf-t 1.2 :df 10)
"
  ([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/studentT df x1))
                  (fn [x1] (- 1 (Probability/studentT df x1))))]
      (if (coll? x)
        (map cdf-fx x)
        (cdf-fx x)))))
Vars in incanter.stats/cdf-t: coll? defn let map
Used in 0 other vars

Comments top

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