1.2.3-SNAPSHOT Arrow_down_16x16

sample-chisq

incanter.stats

  • (sample-chisq size & options)
Returns a sample of the given size from a Chi Square distribution
Same as R's rchisq function.

Options:
:df (default 1)

See also:
pdf-chisq and cdf-chisq

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

Example:
(sample-chisq 1000 :df 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:704 top

(defn sample-chisq
" Returns a sample of the given size from a Chi Square distribution
  Same as R's rchisq function.

  Options:
    :df (default 1)

  See also:
      pdf-chisq and cdf-chisq

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

  Example:
      (sample-chisq 1000 :df 2)
"
([^Integer size & options]
    (let [opts (when options (apply assoc {} options))
          df (or (:df opts) 1)]
      (if (= size 1)
        (ChiSquare/staticNextDouble df)
        (for [_ (range size)] (ChiSquare/staticNextDouble df))))))
Vars in incanter.stats/sample-chisq: = defn for let
Used in 0 other vars

Comments top

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