Returns the variance of a normal distribution (with mean mu and standard
deviation sigma) with the lower tail censored at 'a'
(defn censored-variance-lower
" Returns the variance of a normal distribution (with mean mu and standard
deviation sigma) with the lower tail censored at 'a'
"
([a mu sigma]
(let [a-std (psi a mu sigma)
cdf-a (cdf-normal a-std)
sigma-sq (* sigma sigma)
Ey (censored-mean-lower a mu sigma)]
(+ (* cdf-a (* a a))
(* (- 1 cdf-a)
(+ sigma-sq (* mu mu) (* 2 mu sigma (lambda-lower a-std))))
(* sigma-sq a-std (pdf-normal a-std))
(- (* Ey Ey))))))
Comments top
No comments for censored-variance-lower. Log in to add a comment.