Created
April 20, 2009 19:13
-
-
Save liebke/98686 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
;; Examples of plots from the Gamma Distribution page at | |
;; Wikipedia (http://en.wikipedia.org/wiki/Gamma_distribution) | |
(use '(incanter stats charts io)) | |
(def x (range 0 20 0.1)) | |
(def gamma-plot (xy-plot x (pdf-gamma x :shape 1 :rate 2) | |
:legend true | |
:title "Gamma PDF" | |
:y-label "Density")) | |
(view gamma-plot) | |
(add-lines gamma-plot x (pdf-gamma x :shape 2 :rate 2)) | |
(add-lines gamma-plot x (pdf-gamma x :shape 3 :rate 2)) | |
(add-lines gamma-plot x (pdf-gamma x :shape 5 :rate 1)) | |
(add-lines gamma-plot x (pdf-gamma x :shape 9 :rate 0.5)) | |
(clear-background gamma-plot) | |
(save gamma-plot "/tmp/gamma_pdf.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment