Created
November 7, 2013 23:52
-
-
Save danking/7363937 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang typed/racket | |
| (require math) | |
| (define-type w-space [Vector Real | |
| Real Real Real | |
| Real Real Real | |
| Real Real Real]) | |
| (: ten-dim-normal-pdf : (case-> (w-space -> Flonum) | |
| (w-space Any -> Flonum))) | |
| (define (ten-dim-normal-pdf w [log? #f]) | |
| (if log? | |
| (for/sum: : Flonum ([element : Real w]) | |
| (pdf (normal-dist 0 1) element #t)) | |
| (for/product: : Flonum ([element w]) | |
| (pdf (normal-dist 0 1) element)))) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Type Checker: Expected Flonum, but got One in: (for/product: : Flonum ((element w)) (pdf (normal-dist 0 1) element))
Type Checker: Expected Flonum, but got Zero in: (for/sum: : Flonum ((element : Real w)) (pdf (normal-dist 0 1) element #t))
Type Checker: Expected Flonum, but got One in: (for/product: : Flonum ((element w)) (pdf (normal-dist 0 1) element))