{"id":1187,"date":"2014-04-02T16:06:22","date_gmt":"2014-04-02T15:06:22","guid":{"rendered":"http:\/\/all-geo.org\/volcan01010\/?p=1187"},"modified":"2014-04-02T16:08:06","modified_gmt":"2014-04-02T15:08:06","slug":"fitting-probability-distributions-from-binned-quantile-data","status":"publish","type":"post","link":"https:\/\/all-geo.org\/volcan01010\/2014\/04\/fitting-probability-distributions-from-binned-quantile-data\/","title":{"rendered":"Fitting probability distributions from binned \/ quantile data in Python"},"content":{"rendered":"<p>I\u2019ve made an <a href=\"http:\/\/ipython.org\/index.html\" target=\"_blank\">iPython<\/a> Notebook that explains how to fit probability distributions to data when only binned values, or quantiles, or perhaps a cumulative distribution are available.\u00a0 It uses a least squares fit approach.\u00a0 View it by clicking the picture below:<\/p>\n<p><a href=\"http:\/\/nbviewer.ipython.org\/url\/xweb.geos.ed.ac.uk\/~jsteven5\/blog\/fitting_distributions_from_percentiles.ipynb\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-1188\" alt=\"fitting_distributions\" src=\"http:\/\/all-geo.org\/volcan01010\/wp-content\/uploads\/2014\/04\/fitting_distributions.png\" width=\"600\" height=\"479\" srcset=\"https:\/\/all-geo.org\/volcan01010\/wp-content\/uploads\/2014\/04\/fitting_distributions.png 600w, https:\/\/all-geo.org\/volcan01010\/wp-content\/uploads\/2014\/04\/fitting_distributions-300x239.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/a><\/p>\n<p>The page includes a button to download the notebook so that you can play around with it yourself.<\/p>\n<p>Python is a <a href=\"http:\/\/en.wikipedia.org\/wiki\/Free_and_open-source_software\" target=\"_blank\">free and open source<\/a> programming language that is becoming increasingly popular with scientists as a replacement for Matlab or IDL.\u00a0 I hope that the notebook will be helpful to anyone who works with grainsize data e.g. volcanologists, sedimentologists, atmospheric scientists.<\/p>\n<p><a href=\"http:\/\/ipython.org\/notebook.html\" target=\"_blank\">iPython notebooks<\/a> are amazing; if you use Python for science and haven\u2019t tried them yet, then I urge you to have a look.\u00a0 They let you run Python code in little chunks, displaying the results immediately and interspersed with comments and LaTeX-rendered equations.\u00a0 You can also render publicly-available notebooks using the <a href=\"http:\/\/nbviewer.ipython.org\/\" target=\"_blank\">iPython Notebook Viewer<\/a> website, as I have done here.\u00a0 I think that they are The Future.<\/p>\n<p>iPython notebooks come nicely packaged for Windows and Mac in the <a href=\"https:\/\/store.continuum.io\/cshop\/anaconda\/\" target=\"_blank\">Anaconda<\/a> Python distribution (and probably others such as <a href=\"https:\/\/www.enthought.com\/products\/epd\/free\/\" target=\"_blank\">Enthought<\/a>, too).\u00a0 You can install the ipython-notebook package on Ubuntu-like Linux distributions with a single command (<em>sudo apt-get install ipython-notebook<\/em>), but to get the most up-to-date versions it is better to use <a href=\"https:\/\/pypi.python.org\/pypi\" target=\"_blank\"><em>pip<\/em><\/a>:<\/p>\n<pre># Depending on what is already installed, \r\n# you may also need to add some dependencies.\r\nsudo apt-get install pandoc python-zmq python-tornado\r\n\r\n# Install pip, then use pip to install ipython\r\nsudo apt-get install python-pip\r\nsudo pip install ipython<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I\u2019ve made an iPython Notebook that explains how to fit probability distributions to data when only binned values, or quantiles, or perhaps a cumulative distribution are available.\u00a0 It uses a least squares fit approach.\u00a0 View it by clicking the picture &hellip; <a href=\"https:\/\/all-geo.org\/volcan01010\/2014\/04\/fitting-probability-distributions-from-binned-quantile-data\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1187","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/all-geo.org\/volcan01010\/wp-json\/wp\/v2\/posts\/1187","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/all-geo.org\/volcan01010\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/all-geo.org\/volcan01010\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/all-geo.org\/volcan01010\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/all-geo.org\/volcan01010\/wp-json\/wp\/v2\/comments?post=1187"}],"version-history":[{"count":3,"href":"https:\/\/all-geo.org\/volcan01010\/wp-json\/wp\/v2\/posts\/1187\/revisions"}],"predecessor-version":[{"id":1190,"href":"https:\/\/all-geo.org\/volcan01010\/wp-json\/wp\/v2\/posts\/1187\/revisions\/1190"}],"wp:attachment":[{"href":"https:\/\/all-geo.org\/volcan01010\/wp-json\/wp\/v2\/media?parent=1187"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/all-geo.org\/volcan01010\/wp-json\/wp\/v2\/categories?post=1187"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/all-geo.org\/volcan01010\/wp-json\/wp\/v2\/tags?post=1187"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}