An Introduction to Probabilistic Programming Arxiv:1809.10756V1
Total Page:16
File Type:pdf, Size:1020Kb
Load more
Recommended publications
-
Chapter 7 Assessing and Improving Convergence of the Markov Chain
Chapter 7 Assessing and improving convergence of the Markov chain Questions: . Are we getting the right answer? . Can we get the answer quicker? Bayesian Biostatistics - Piracicaba 2014 376 7.1 Introduction • MCMC sampling is powerful, but comes with a cost: dependent sampling + checking convergence is not easy: ◦ Convergence theorems do not tell us when convergence will occur ◦ In this chapter: graphical + formal diagnostics to assess convergence • Acceleration techniques to speed up MCMC sampling procedure • Data augmentation as Bayesian generalization of EM algorithm Bayesian Biostatistics - Piracicaba 2014 377 7.2 Assessing convergence of a Markov chain Bayesian Biostatistics - Piracicaba 2014 378 7.2.1 Definition of convergence for a Markov chain Loose definition: With increasing number of iterations (k −! 1), the distribution of k θ , pk(θ), converges to the target distribution p(θ j y). In practice, convergence means: • Histogram of θk remains the same along the chain • Summary statistics of θk remain the same along the chain Bayesian Biostatistics - Piracicaba 2014 379 Approaches • Theoretical research ◦ Establish conditions that ensure convergence, but in general these theoretical results cannot be used in practice • Two types of practical procedures to check convergence: ◦ Checking stationarity: from which iteration (k0) is the chain sampling from the posterior distribution (assessing burn-in part of the Markov chain). ◦ Checking accuracy: verify that the posterior summary measures are computed with the desired accuracy • Most -
Getting Started in Openbugs / Winbugs
Practical 1: Getting started in OpenBUGS Slide 1 An Introduction to Using WinBUGS for Cost-Effectiveness Analyses in Health Economics Dr. Christian Asseburg Centre for Health Economics University of York, UK [email protected] Practical 1 Getting started in OpenBUGS / WinB UGS 2007-03-12, Linköping Dr Christian Asseburg University of York, UK [email protected] Practical 1: Getting started in OpenBUGS Slide 2 ● Brief comparison WinBUGS / OpenBUGS ● Practical – Opening OpenBUGS – Entering a model and data – Some error messages – Starting the sampler – Checking sampling performance – Retrieving the posterior summaries 2007-03-12, Linköping Dr Christian Asseburg University of York, UK [email protected] Practical 1: Getting started in OpenBUGS Slide 3 WinBUGS / OpenBUGS ● WinBUGS was developed at the MRC Biostatistics unit in Cambridge. Free download, but registration required for a licence. No fee and no warranty. ● OpenBUGS is the current development of WinBUGS after its source code was released to the public. Download is free, no registration, GNU GPL licence. 2007-03-12, Linköping Dr Christian Asseburg University of York, UK [email protected] Practical 1: Getting started in OpenBUGS Slide 4 WinBUGS / OpenBUGS ● There are no major differences between the latest WinBUGS (1.4.1) and OpenBUGS (2.2.0) releases. ● Minor differences include: – OpenBUGS is occasionally a bit slower – WinBUGS requires Microsoft Windows OS – OpenBUGS error messages are sometimes more informative ● The examples in these slides use OpenBUGS. 2007-03-12, Linköping Dr Christian Asseburg University of York, UK [email protected] Practical 1: Getting started in OpenBUGS Slide 5 Practical 1: Target ● Start OpenBUGS ● Code the example from health economics from the earlier presentation ● Run the sampler and obtain posterior summaries 2007-03-12, Linköping Dr Christian Asseburg University of York, UK [email protected] Practical 1: Getting started in OpenBUGS Slide 6 Starting OpenBUGS ● You can download OpenBUGS from http://mathstat.helsinki.fi/openbugs/ ● Start the program. -
BUGS Code for Item Response Theory
JSS Journal of Statistical Software August 2010, Volume 36, Code Snippet 1. http://www.jstatsoft.org/ BUGS Code for Item Response Theory S. McKay Curtis University of Washington Abstract I present BUGS code to fit common models from item response theory (IRT), such as the two parameter logistic model, three parameter logisitic model, graded response model, generalized partial credit model, testlet model, and generalized testlet models. I demonstrate how the code in this article can easily be extended to fit more complicated IRT models, when the data at hand require a more sophisticated approach. Specifically, I describe modifications to the BUGS code that accommodate longitudinal item response data. Keywords: education, psychometrics, latent variable model, measurement model, Bayesian inference, Markov chain Monte Carlo, longitudinal data. 1. Introduction In this paper, I present BUGS (Gilks, Thomas, and Spiegelhalter 1994) code to fit several models from item response theory (IRT). Several different software packages are available for fitting IRT models. These programs include packages from Scientific Software International (du Toit 2003), such as PARSCALE (Muraki and Bock 2005), BILOG-MG (Zimowski, Mu- raki, Mislevy, and Bock 2005), MULTILOG (Thissen, Chen, and Bock 2003), and TESTFACT (Wood, Wilson, Gibbons, Schilling, Muraki, and Bock 2003). The Comprehensive R Archive Network (CRAN) task view \Psychometric Models and Methods" (Mair and Hatzinger 2010) contains a description of many different R packages that can be used to fit IRT models in the R computing environment (R Development Core Team 2010). Among these R packages are ltm (Rizopoulos 2006) and gpcm (Johnson 2007), which contain several functions to fit IRT models using marginal maximum likelihood methods, and eRm (Mair and Hatzinger 2007), which contains functions to fit several variations of the Rasch model (Fischer and Molenaar 1995). -
Stan: a Probabilistic Programming Language
JSS Journal of Statistical Software MMMMMM YYYY, Volume VV, Issue II. http://www.jstatsoft.org/ Stan: A Probabilistic Programming Language Bob Carpenter Andrew Gelman Matt Hoffman Columbia University Columbia University Adobe Research Daniel Lee Ben Goodrich Michael Betancourt Columbia University Columbia University University of Warwick Marcus A. Brubaker Jiqiang Guo Peter Li University of Toronto, NPD Group Columbia University Scarborough Allen Riddell Dartmouth College Abstract Stan is a probabilistic programming language for specifying statistical models. A Stan program imperatively defines a log probability function over parameters conditioned on specified data and constants. As of version 2.2.0, Stan provides full Bayesian inference for continuous-variable models through Markov chain Monte Carlo methods such as the No-U-Turn sampler, an adaptive form of Hamiltonian Monte Carlo sampling. Penalized maximum likelihood estimates are calculated using optimization methods such as the Broyden-Fletcher-Goldfarb-Shanno algorithm. Stan is also a platform for computing log densities and their gradients and Hessians, which can be used in alternative algorithms such as variational Bayes, expectation propa- gation, and marginal inference using approximate integration. To this end, Stan is set up so that the densities, gradients, and Hessians, along with intermediate quantities of the algorithm such as acceptance probabilities, are easily accessible. Stan can be called from the command line, through R using the RStan package, or through Python using the PyStan package. All three interfaces support sampling and optimization-based inference. RStan and PyStan also provide access to log probabilities, gradients, Hessians, and data I/O. Keywords: probabilistic program, Bayesian inference, algorithmic differentiation, Stan. -
Installing BUGS and the R to BUGS Interface 1. Brief Overview
File = E:\bugs\installing.bugs.jags.docm 1 John Miyamoto (email: [email protected]) Installing BUGS and the R to BUGS Interface Caveat: I am a Windows user so these notes are focused on Windows 7 installations. I will include what I know about the Mac and Linux versions of these programs but I cannot swear to the accuracy of my comments. Contents (Cntrl-left click on a link to jump to the corresponding section) Section Topic 1 Brief Overview 2 Installing OpenBUGS 3 Installing WinBUGs (Windows only) 4 OpenBUGS versus WinBUGS 5 Installing JAGS 6 Installing R packages that are used with OpenBUGS, WinBUGS, and JAGS 7 Running BRugs on a 32-bit or 64-bit Windows computer 8 Hints for Mac and Linux Users 9 References # End of Contents Table 1. Brief Overview TOC BUGS stands for Bayesian Inference Under Gibbs Sampling1. The BUGS program serves two critical functions in Bayesian statistics. First, given appropriate inputs, it computes the posterior distribution over model parameters - this is critical in any Bayesian statistical analysis. Second, it allows the user to compute a Bayesian analysis without requiring extensive knowledge of the mathematical analysis and computer programming required for the analysis. The user does need to understand the statistical model or models that are being analyzed, the assumptions that are made about model parameters including their prior distributions, and the structure of the data, but the BUGS program relieves the user of the necessity of creating an algorithm to sample from the posterior distribution and the necessity of writing the computer program that computes this algorithm. -
Winbugs Lectures X4.Pdf
Introduction to Bayesian Analysis and WinBUGS Summary 1. Probability as a means of representing uncertainty 2. Bayesian direct probability statements about parameters Lecture 1. 3. Probability distributions Introduction to Bayesian Monte Carlo 4. Monte Carlo simulation methods in WINBUGS 5. Implementation in WinBUGS (and DoodleBUGS) - Demo 6. Directed graphs for representing probability models 7. Examples 1-1 1-2 Introduction to Bayesian Analysis and WinBUGS Introduction to Bayesian Analysis and WinBUGS How did it all start? Basic idea: Direct expression of uncertainty about In 1763, Reverend Thomas Bayes of Tunbridge Wells wrote unknown parameters eg ”There is an 89% probability that the absolute increase in major bleeds is less than 10 percent with low-dose PLT transfusions” (Tinmouth et al, Transfusion, 2004) !50 !40 !30 !20 !10 0 10 20 30 % absolute increase in major bleeds In modern language, given r Binomial(θ,n), what is Pr(θ1 < θ < θ2 r, n)? ∼ | 1-3 1-4 Introduction to Bayesian Analysis and WinBUGS Introduction to Bayesian Analysis and WinBUGS Why a direct probability distribution? Inference on proportions 1. Tells us what we want: what are plausible values for the parameter of interest? What is a reasonable form for a prior distribution for a proportion? θ Beta[a, b] represents a beta distribution with properties: 2. No P-values: just calculate relevant tail areas ∼ Γ(a + b) a 1 b 1 p(θ a, b)= θ − (1 θ) − ; θ (0, 1) 3. No (difficult to interpret) confidence intervals: just report, say, central area | Γ(a)Γ(b) − ∈ a that contains 95% of distribution E(θ a, b)= | a + b ab 4. -
Comparative Studies of Programming Languages; Course Lecture Notes
Comparative Studies of Programming Languages, COMP6411 Lecture Notes, Revision 1.9 Joey Paquet Serguei A. Mokhov (Eds.) August 5, 2010 arXiv:1007.2123v6 [cs.PL] 4 Aug 2010 2 Preface Lecture notes for the Comparative Studies of Programming Languages course, COMP6411, taught at the Department of Computer Science and Software Engineering, Faculty of Engineering and Computer Science, Concordia University, Montreal, QC, Canada. These notes include a compiled book of primarily related articles from the Wikipedia, the Free Encyclopedia [24], as well as Comparative Programming Languages book [7] and other resources, including our own. The original notes were compiled by Dr. Paquet [14] 3 4 Contents 1 Brief History and Genealogy of Programming Languages 7 1.1 Introduction . 7 1.1.1 Subreferences . 7 1.2 History . 7 1.2.1 Pre-computer era . 7 1.2.2 Subreferences . 8 1.2.3 Early computer era . 8 1.2.4 Subreferences . 8 1.2.5 Modern/Structured programming languages . 9 1.3 References . 19 2 Programming Paradigms 21 2.1 Introduction . 21 2.2 History . 21 2.2.1 Low-level: binary, assembly . 21 2.2.2 Procedural programming . 22 2.2.3 Object-oriented programming . 23 2.2.4 Declarative programming . 27 3 Program Evaluation 33 3.1 Program analysis and translation phases . 33 3.1.1 Front end . 33 3.1.2 Back end . 34 3.2 Compilation vs. interpretation . 34 3.2.1 Compilation . 34 3.2.2 Interpretation . 36 3.2.3 Subreferences . 37 3.3 Type System . 38 3.3.1 Type checking . 38 3.4 Memory management . -
Application and Interpretation
Programming Languages: Application and Interpretation Shriram Krishnamurthi Brown University Copyright c 2003, Shriram Krishnamurthi This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 United States License. If you create a derivative work, please include the version information below in your attribution. This book is available free-of-cost from the author’s Web site. This version was generated on 2007-04-26. ii Preface The book is the textbook for the programming languages course at Brown University, which is taken pri- marily by third and fourth year undergraduates and beginning graduate (both MS and PhD) students. It seems very accessible to smart second year students too, and indeed those are some of my most successful students. The book has been used at over a dozen other universities as a primary or secondary text. The book’s material is worth one undergraduate course worth of credit. This book is the fruit of a vision for teaching programming languages by integrating the “two cultures” that have evolved in its pedagogy. One culture is based on interpreters, while the other emphasizes a survey of languages. Each approach has significant advantages but also huge drawbacks. The interpreter method writes programs to learn concepts, and has its heart the fundamental belief that by teaching the computer to execute a concept we more thoroughly learn it ourselves. While this reasoning is internally consistent, it fails to recognize that understanding definitions does not imply we understand consequences of those definitions. For instance, the difference between strict and lazy evaluation, or between static and dynamic scope, is only a few lines of interpreter code, but the consequences of these choices is enormous. -
Do Mlabs Still Make a Difference? a Second Assessment Public Disclosure Authorized Public Disclosure Authorized
Public Disclosure Authorized Do mLabs Still Make a Difference? A Second Assessment Public Disclosure Authorized Public Disclosure Authorized Public Disclosure Authorized infoDv INNOVATION & ENTREPRENEURSHIP Do mLabs Still Make a b Difference? A Second Assessment © 2017 The World Bank Group 1818 H Street NW Washington, DC 20433 Website: www.infodev.org Email: [email protected] Twitter: @infoDev Facebook: /infoDevWBG For more resources and information about mLabs, visit: https://www.infodev.org/report/do-mlabs-still-make- difference-second-assessment This work is a product of the staff of infoDev/World Bank Group. The findings, interpretations, and conclusions expressed in this work do not necessarily reflect the views of the donors of infoDev, the World Bank Group, its Board of Directors, or the governments they represent. The World Bank Group does not guarantee the accuracy of the data included in this work. The boundaries, colors, denominations, and other information shown on any map in this work do not imply any judgment on the part of the World Bank Group concerning the legal status of any territory or the endorsement or acceptance of such boundaries. Rights and Permissions: This work is available under the Creative Commons Attribution 3.0 Unported license (CC BY 3.0) http://creativecommons.org/licenses/ by/3.0. Under the Creative Commons Attribution license, you are free to copy, distribute, transmit, and adapt this work, including for commercial purposes, under the following conditions: Attribution: Please cite the work as follows: “Do mLabs Still Make a Difference? A Second Assessment” 2017. Washington, DC: The World Bank Group. License: Creative Commons Attribution CC BY 3.0 Photo Credits: Cover Photo: Shutterstock 2017 c ACKNOWLEDGEMENTS This assessment would not have been possible This assessment was produced by Sonjara, without the valuable contribution of all mLab Inc. -
Introduction to MLAB the Royal Road to Dynamical Simulations
Introduction to MLAB The Royal Road to Dynamical Simulations Revision Date: September 24, 2015 Foster Morrison, author Turtle Hollow Associates, Inc. P.O. Box 3639 Gaithersburg, MD 20885 USA Daniel Kerner, editor Civilized Software, Inc. 12109 Heritage Park Circle Silver Spring, MD 20906 USA Email: [email protected] Web-site: http://www.civilized.com (301) 962-3711 c 1992-2014 Turtle Hollow Associates, Inc. Contents Preface ii 1 BASIC MATHEMATICS AND ITS IMPLEMENTATION IN MLAB 1 1.1 What You Need to Know ................................ 1 1.2 Getting Started with MLAB ............................... 2 1.3 Foundations of Mathematics ............................... 2 1.4 Sets ............................................ 3 1.5 Numbers, Prime, Rational, and Real .......................... 4 1.6 Try Out MLAB ...................................... 6 2 PROGRAMMING IN MLAB 10 2.1 More Numerical Analysis vs. Analysis ......................... 10 2.2 Legendre Polynomials .................................. 11 3 VECTORS AND MATRICES 13 3.1 Vectors .......................................... 13 3.2 Matrices, Linear Algebra, and Modern Algebra .................... 14 3.3 Arrays ........................................... 16 3.4 Functional Analysis .................................... 16 i 4 LINEAR DYNAMIC SYSTEMS AND MODELS 19 4.1 Difference Equations ................................... 19 4.2 Differential Equations .................................. 21 4.3 Generalizations ...................................... 23 5 LINEAR DYNAMIC SYSTEMS WITH INPUTS -
Sr. Software Engineer @ Mlab
Sr. Software Engineer @ mLab About mLab: mLab is a fully managed cloud database service featuring highly available MongoDB databases, automated backups, web- based tools, 24/7 monitoring, and expert support. Developers absolutely love us because our Database-as-a-Service (DBaaS) allows them to focus their attention on product development instead of operations. mLab is one of the fastest-growing companies in the cloud infrastructure space. We're headquartered in the Mission/Potrero area of San Francisco and are well-funded by premier venture and angel investors including Foundry Group, Baseline Ventures, Upfront Ventures, Freestyle Capital and David Cohen of TechStars. What makes us happiest? Innovating, automating, helping other software developers, and giving back to our community. In addition to checking out our website at http://mlab.com and our blog at http://blog.mlab.com. Who we’re looking for: We are looking for a Sr. Software Engineer who will join us in scaling mLab from managing >100,000 databases to managing millions of databases at ever-increasing levels of complexity. In the process, you’ll be exposed to every major cloud provider and infrastructure technology. We currently run on AWS, Google Cloud Platform, and Windows Azure and have integrated with all of the major Platform-as-a-Service providers (Heroku et al.). You'll become an expert in MongoDB, cloud automation, and mLab’s suite of automation tools (some of which we open-source). You’ll work on things like: n Node.js and Python tools/services for automating the entire -
Getting Started First Steps with Mevislab
Getting Started First Steps with MeVisLab 1 Getting Started Getting Started Copyright © 2003-2021 MeVis Medical Solutions Published 2021-05-11 2 Table of Contents 1. Before We Start ................................................................................................................... 10 1.1. Welcome to MeVisLab ............................................................................................... 10 1.2. Coverage of the Document ........................................................................................ 10 1.3. Intended Audience ..................................................................................................... 11 1.4. Conventions Used in This Document .......................................................................... 11 1.4.1. Activities ......................................................................................................... 11 1.4.2. Formatting ...................................................................................................... 11 1.5. How to Read This Document ..................................................................................... 12 1.6. Related MeVisLab Documents ................................................................................... 12 1.7. Glossary (abbreviated) ............................................................................................... 13 2. The Nuts and Bolts of MeVisLab ........................................................................................... 15 2.1. MeVisLab Basics ......................................................................................................