{ "info": { "author": "Allen B. Downey", "author_email": "downey@allendowney.com", "bugtrack_url": null, "classifiers": [], "description": "# ThinkBayes2\n\n*Think Bayes* is an introduction to Bayesian statistics using computational methods. This is the repository for the second edition.\n\nThe premise of this book, and the other books in the *Think X* series, is that if you know how to program, you can use that skill to learn other topics.\n\nMost books on Bayesian statistics use mathematical notation and present ideas in terms of mathematical concepts like calculus. This book uses Python code instead of math, and discrete approximations instead of continuous mathematics. As a result, what would be an integral in a math book becomes a summation, and most operations on probability distributions are simple loops.\n\nI think this presentation is easier to understand, at least for people with programming skills. It is also more general, because when we make modeling decisions, we can choose the most appropriate model without worrying too much about whether the model lends itself to conventional analysis. Also, it provides a smooth development path from simple examples to real-world problems.\n\n*Think Bayes* is a Free Book. It is available under the [Creative Commons Attribution-NonCommercial 3.0 Unported License](https://creativecommons.org/licenses/by-nc/3.0/), which means that you are free to copy, distribute, and modify it, as long as you attribute the work and don\u2019t use it for commercial purposes.\n\nOther Free Books by Allen Downey are available from [Green Tea Press](https://greenteapress.com/wp/).\n\nNote: The code is a version ahead of the book. I have not started revising the book yet.\n\n## Getting started\n\nTo run the examples and work on the exercises in this book, you have to:\n\n1. Copy my files onto your computer.\n\n2. Install Python on your computer, along with the libraries we will\n use.\n\n3. Run Jupyter, which is a tool for running and writing programs, and\n load a **notebook**, which is a file that contains code and text.\n\nThe next three sections provide details for these steps. \n\n### Copying my files\n\nThe code for this book is available from\nthis **Git repository**. Git is a software tool that helps you keep track of the\nprograms and other files that make up a project. A collection of files\nunder Git's control is called a repository (the cool kids call it a\n\"repo\"). GitHub is a hosting service that provides storage for Git\nrepositories and a convenient web interface.\n\nBefore you download these files, I suggest you copy my repository on\nGitHub, which is called **forking**. If you don't already have a GitHub\naccount, you'll need to create one.\n\nOn this home page you should see a gray button\nin the upper right that says Fork. If you press it, GitHub will create a\ncopy of my repository that belongs to you.\n\nNow, the best way to download the files is to use a **Git client**,\nwhich is a program that manages Git repositories. [Here are installation instructions for Windows, macOS, and Linux](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).\n\nIn Windows, I suggest you accept the options recommended by the\ninstaller, with two exceptions:\n\n* As the default editor, choose instead of .\n\n* For \"Configuring line ending conversions\", select \"Check out as is, commit as is\".\n\nFor macOS and Linux, I suggest you accept the recommended options.\n\nOnce the installation is complete, open a command window. On Windows,\nopen Git Bash, which should be in your Start menu. On macOS or Linux,\nyou can use Terminal.\n\nTo find out what directory you are in, type `pwd`, which stands for \"print\nworking directory\". On Windows, most likely you are in `Users\\yourusername`. On MacOS or\nLinux, you are probably in your home directory, `/home/yourusername`.\n\nThe next step is to copy files from your repository on GitHub to your\ncomputer; in Git vocabulary, this process is called **cloning**. Run\nthis command:\n\n```\ngit clone https://github.com/YourGitHubUserName/ThinkBayes2\n```\n\nOf course, you should replace `YourGitHubUserName` with your GitHub user name. After cloning,\nyou should have a new directory called `ThinkBayes2`.\n\nIf you don't want to use Git, you can [download my files in a Zip archive](https://github.com/AllenDowney/ThinkBayes2/archive/master.zip). You will need a program like `WinZip` or\n`gzip` to unpack the Zip file. Make a note of the location of the files\nyou download.\n\n### Installing Anaconda\n\nYou might already have Python installed on your computer, but you might\nnot have the latest version. To use the code in this book, I recommend\nPython 3.6 or later. Even if you have the latest version, you probably\ndon\u2019t have all of the libraries we need.\n\nYou could update Python and install these libraries, but I strongly\nrecommend that you don\u2019t go down that road. I think you will find it\neasier to use **Anaconda**, which is a free Python distribution that\nincludes all the libraries you need for this book (and more).\n\nAnaconda is available for Linux, macOS, and Windows. By default, it puts\nall files in your home directory, so you don\u2019t need administrator (root)\npermission to install it, and if you have a version of Python already,\nAnaconda will not remove or modify it.\n\nStart at [the Anaconda installation page](https://conda.io/docs/user-guide/install/index.html).\nDownload the installer for\nyour system and run it. You don\u2019t need administrative privileges to\ninstall Anaconda, so I recommend you run the installer as a normal user,\nnot as administrator or root.\n\nI suggest you accept the recommended options. On Windows you have the\noption to install Visual Studio Code, which is an interactive\nenvironment for writing programs. You won\u2019t need it for this book, but\nyou might want it for other projects.\n\nBy default, Anaconda installs most of the packages you need, but there\nare a few more you might have to add. \n\nIf you know about Conda environments, you can create a new environment and get the packages you need using the `environment.yml` file in the `ThinkBayes2` directory.\n\nOtherwise, open a command window and run the following command:\n\n```\nconda install jupyterlab pandas seaborn\n```\n\nFinally, we'll use `pip` to install the `thinkbayes2` libraries. Open a command window and make sure you are in the directory that contains the `ThinkBayes2` directory. Then run the following command:\n\n```\npip install ./ThinkBayes2\n```\n\n*Coming soon, a script to test your installation.*\n\n\n### Running Jupyter\n\nThe code for each chapter, and starter code for the exercises, is in\nJupyter notebooks. If you have not used Jupyter before, you can [read about it here](https://jupyter.org).\n\nTo start Jupyter on macOS or Linux, open a Terminal; on Windows, open\nGit Bash. Use `cd` to \"change directory\" into `ThinkBayes2` and launch the Jupyter server:\n\n```\ncd ThinkBayes2\njupyter notebook\n```\n\nJupyter should open a window in a browser, and you should see a list of directories.\nClick on `notebooks` to open the directory containing the notebooks. Then click on the first notebook; it should\nopen in a new tab.\n\nIn the notebook, press Shift-Enter to run the first few \"cells\". The first time you run a\nnotebook, it might take several seconds to start, while some Python\nfiles get initialized. After that, it should run faster.\n\nYou can also launch Jupyter from the Start menu on Windows, from the Dock on\nmacOS, or from the Anaconda Navigator on any system. If you do that, Jupyter\nmight start in your home directory or somewhere else in your file\nsystem, so you might have to navigate to find the `ThinkBayes2` directory.\n\nI hope these instructions help you get started easily. Please let me know if there is anything I can do to improve them.\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/AllenDowney/ThinkBayes2", "keywords": "", "license": "LICENSE.txt", "maintainer": "", "maintainer_email": "", "name": "ThinkBayes2", "package_url": "https://pypi.org/project/ThinkBayes2/", "platform": "", "project_url": "https://pypi.org/project/ThinkBayes2/", "project_urls": { "Homepage": "http://github.com/AllenDowney/ThinkBayes2" }, "release_url": "https://pypi.org/project/ThinkBayes2/2.0.0/", "requires_dist": null, "requires_python": "", "summary": "Supporting code for the book Think Bayes 2e.", "version": "2.0.0" }, "last_serial": 4211975, "releases": { "2.0.0": [ { "comment_text": "", "digests": { "md5": "e99b56a26bd085a0becd47e6ee933453", "sha256": "279edfb33477ac9a5562918b0d5c5f9780f271e28ffe4df7e0998d8d76b35b15" }, "downloads": -1, "filename": "ThinkBayes2-2.0.0.tar.gz", "has_sig": false, "md5_digest": "e99b56a26bd085a0becd47e6ee933453", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26212, "upload_time": "2018-08-27T18:29:55", "url": "https://files.pythonhosted.org/packages/98/04/57aa8b39fd012fa4571a3f5daf17e068b8d7d7e21dcb93da314a07f346c6/ThinkBayes2-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e99b56a26bd085a0becd47e6ee933453", "sha256": "279edfb33477ac9a5562918b0d5c5f9780f271e28ffe4df7e0998d8d76b35b15" }, "downloads": -1, "filename": "ThinkBayes2-2.0.0.tar.gz", "has_sig": false, "md5_digest": "e99b56a26bd085a0becd47e6ee933453", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26212, "upload_time": "2018-08-27T18:29:55", "url": "https://files.pythonhosted.org/packages/98/04/57aa8b39fd012fa4571a3f5daf17e068b8d7d7e21dcb93da314a07f346c6/ThinkBayes2-2.0.0.tar.gz" } ] }