1.2.3-SNAPSHOT permalink Arrow_down_16x16

censored-variance-two-sided

incanter.censored

  • (censored-variance-two-sided a b mu sigma)
Returns the variance of a normal distribution (with mean mu and standard
deviation sigma) with the lower tail censored at 'a' and the upper
tail censored at 'b'

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/censored.clj:36 top

(defn censored-variance-two-sided
" Returns the variance of a normal distribution (with mean mu and standard
  deviation sigma) with the lower tail censored at 'a' and the upper
  tail censored at 'b'
"
  ([a b mu sigma]
   (let [a-std (psi a mu sigma)
         b-std (psi b mu sigma)
         sigma-sq (* sigma sigma)
         Ey (censored-mean-two-sided a b mu sigma)
         cdf-a (cdf-normal a-std)
         cdf-b (cdf-normal b-std)]
     (+ (* cdf-a (* a a))
        (* (- cdf-b cdf-a)
           (+ sigma-sq (* mu mu) (* 2 mu sigma (lambda-two-sided a-std b-std))))
        (* sigma-sq (- (* a-std (pdf-normal a-std)) (* b-std (pdf-normal b-std))))
        (- (* (- 1 cdf-b) (* b b)) (* Ey Ey))))))
Vars in incanter.censored/censored-variance-two-sided: * + - defn let
Used in 0 other vars

Comments top

No comments for censored-variance-two-sided. Log in to add a comment.