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