Basic Elements of Bayesian Analysis

Total Page:16

File Type:pdf, Size:1020Kb

Basic Elements of Bayesian Analysis 1 Basic Elements of Bayesian Analysis In a frequentist analysis, one chooses a model (likelihood function) for the available data, and then either calculates a p-value (which tells you how un- usual your data would be, assuming your null hypothesis is exactly true), or calculates a confidence interval. We have already seen the many deficiencies of p-values, and confidence intervals, while more useful, have a somewhat unnat- ural interpretation, and ignore any prior information that may be available. Alternatively, Bayesian inferences can be calculated, which provide direct probability statements about parameters of interest, at the expense of hav- ing to first summarize prior information about the parameters of interest. In a nutshell, the choice between frequentist and Bayesian inferences can be seen as a choice between being “backwards” (frequentists calculate P (data|H0), rather than P (H0|data)) or being “subjective” (Bayesian analyses require prior information, which must be elicited subjectively). 2 The basic elements in a “full” Bayesian analysis are: 1. The parameter of interest, say θ. Note that this is completely general, since θ may be vector valued. So θ might be a binomial parameter, or the mean and variance from a Normal distribution, or an odds ratio, or a set of regression coefficients, etc. The parameter of interest is sometimes usefully thought of as the “true state of nature”. 2. The prior distribution of θ, f(θ). This prior distribution summarizes what is known about θ before the experiment is carried out. It is “sub- jective”, so may vary from investigator to investigator. 3. The likelihood function, f(x|θ). The likelihood function provides the distribution of the data, x, given the parameter value θ. So it may be the binomial likelihood, a normal likelihood, a likelihood from a regression equation with associated normal residual variance, logistic regression model, etc. 4. The posterior distribution, f(θ|x). The posterior distribution summa- rizes the information in the data, x, together with the information in the prior distribution, f(θ). Thus, it summarizes what is known about the parameter of interest θ after the data are collected. 5. Bayes Theorem. This theorem relates the above quantities: likelihood of the data × prior distribution posterior distribution = , a normalizing constant or f(x|θ) × f(θ) f(θ|x) = R f(x|θ) × f(θ)dθ, or, forgetting about the normalizing constant, f(θ|x) ∝ f(x|θ) × f(θ). Thus we “update” the prior distribution to a posterior distribution after seeing the data via Bayes Theorem. 3 6. The action, a. The action is the decision or action that is taken after the analysis is completed. For example, one may decide to treat a patient with Drug 1 or Drug 2, depending on the data collected in a clinical trial. Thus our action will either be to use Drug 1 (so that a = 1) or Drug 2 (so that a = 2). 7. The loss function, L(θ, a). Each time we choose an action, there is some loss we incur, which depends on what the true state of nature is, and what action we decide to take. For example, if the true state of nature is that Drug 1 is in fact superior to Drug 2, then choosing action a = 1 will incur a smaller loss than choosing a = 2. Now, the usual problem is that we do not know the true state of nature, we only have data that lets us make probabilistic statements about it (ie, we have a posterior distribution for θ, but do not usually know the exact value of θ). Also, we rarely make decisions before seeing the data, so that in general, a = a(x) is a function of the data. Note that while we will refer to these as “losses”, we could equally well use “gains”. 8. Expected Bayes Loss (Bayes Risk): We do not know the true value of θ, but we do have a posterior distribution once the data are known, f(θ|x). Hence, to make a “coherent” Bayesian decision, we minimize the Expected Bayesian Loss, defined by: Z EBL = L(θ, a(x))f(θ|x)dθ In other words, we choose the action a(x) such that the EBL is mini- mized. The first five elements in the above list comprise a non-decision theoretic Bayesian approach to statistical inference. This type of analysis (ie, non- decision theoretic) is what most of us are used to seeing in the medical lit- erature. However, many Bayesians argue that the main reason we carry out any statistical analyses is to help in making decisions, so that elements 6, 7, and 8 are crucial. There is little doubt that we will see more such analyses in the near future, but it remains to be seen how popular the decision theoretic framework will become in medicine. The main problem is to specify the loss functions, since there are so many possible consequences (main outcomes, side- effects, costs, etc.) to medical decisions, and it is difficult to combine these into a single loss function. My guess is that much work will have to be done on developing loss functions before the decision theoretic approach becomes mainstream. This course, therefore, will focus on elements 1 through 5. 4 Simple Univariate Inference for Common Situ- ations As you may have seen in your previous classes and in your experience, many data analyses begin with very simple univariate analyses, using models such as the normal (for continuous data), the binomial (for dichotomous data), the Poisson (for count data) and the multinomial (for multicategorical data). Here we will see how analyses typically proceed for these simple models from a Bayesian viewpoint. As described above, in Bayesian analyses, aside from a data model (by which I mean the likelihood function), we need a prior distribution over all unknown parameters in the model. Thus, here we consider “standard” likelihood-prior combinations for these simple situations. To begin, here is a summary chart of what we will see: Data Type (summary) Model (likelihood function) Conjugate Prior Posterior Density ! θ + x −1 2 2 τ2 σ2/n h 1 n i Continuous (x, n) normal(µ, σ ) normal(θ, τ ) normal 1 + 1 , τ 2 + σ2 τ2 σ2/n Dichotomous (x, n) binomial(θ, n) beta(α, β) beta(α + x, β + (n − x)) Count (x) Poisson(λ) gamma(α, β) gamma(α + x, β + 1) Multicat (x1, x2, . , xm) multinom(p1, p2, . , pm) dirich(α1, α2, . , αm) dirich(α1 + x1, α2 + x2, . , αp + xm) 5 6 We will now look at each of these four cases in detail. Bayesian Inference For A Single Normal Mean Example: Consider the situation where we are trying to estimate the mean diastolic blood pressure of Americans living in the United States from a sample of 27 patients. The data are: 76, 71, 82, 63, 76, 64, 64, 74, 70, 64, 75, 81, 75, 78, 66, 62, 79, 82, 78, 62, 72, 83, 79, 41, 80, 77, 67. [Note: These are in fact real data obtained from an experiment designed to es- timate the effects of calcium supplementation on blood pressure. These are the baseline data for 27 subjects from the study, whose reference is: Lyle, R.M., Melby, C.L., Hyner, G.C., Edmonson, J.W., Miller, J.Z., and Weinberger, M.H. (1987). Blood pressure and metabolic effects of calcium supplementa- tion in normotensive white and black men. Journal of the American Medical Association, 257, 1772–1776.] √ From this data, we find x = 71.89, and s2 = 85.18, so that s = 85.18 = 9.22 Let us assume the following: 1. The standard deviation is known a priori to be 9 mm Hg. 2. The observations come from a Normal distribution, i.e., 2 2 xi ∼ N(µ, σ = 9 ), for i = 1, 2,..., 27. We will follow the three usual steps used in Bayesian analyses: 1. Write down the likelihood function for the data. 2. Write down the prior distribution for the unknown parameter, in this case µ. 3. Use Bayes theorem to derive the posterior distribution. Use this posterior distribution, or summaries of it like 95% credible intervals for statistical inferences. 7 Step 1: The likelihood function for the data is based on the Normal distribu- tion, i.e., n 1 (x − µ)2 1 !n Pn (x − µ)2 f(x , x , . , x |µ) = Y √ exp(− i ) = √ exp(− i=1 i ). 1 2 n 2 2 2 i=1 2πσ 2σ 2πσ 2σ Step 2: Suppose that we have a priori information that the random parameter µ is likely to be in the interval (60,80). That is, we think that the mean diastolic blood pressure should be about 70, but would not be too surprised if it were as low as perhaps 60, or as high as about 80. We will represent this prior distribution as a second Normal distribution (not to be confused with the fact that the data are also assumed to follow a Normal density). The Normal prior density is chosen here for the same reason as the Beta distribution is chosen when we looked at the binomial distribution: it makes the solution of Bayes Theorem very easy. We can therefore approximate our prior knowledge as: µ ∼ N(θ, τ 2) = N(70, 52 = 25). (1) In general, this choice for a prior is based on any information that may be available at the time of the experiment. In this case, the prior distribution was chosen to have a somewhat large standard deviation (τ = 5) to reflect that we have very little expertise in blood pressures of average Americans.
Recommended publications
  • 2 Probability Theory and Classical Statistics
    2 Probability Theory and Classical Statistics Statistical inference rests on probability theory, and so an in-depth under- standing of the basics of probability theory is necessary for acquiring a con- ceptual foundation for mathematical statistics. First courses in statistics for social scientists, however, often divorce statistics and probability early with the emphasis placed on basic statistical modeling (e.g., linear regression) in the absence of a grounding of these models in probability theory and prob- ability distributions. Thus, in the first part of this chapter, I review some basic concepts and build statistical modeling from probability theory. In the second part of the chapter, I review the classical approach to statistics as it is commonly applied in social science research. 2.1 Rules of probability Defining “probability” is a difficult challenge, and there are several approaches for doing so. One approach to defining probability concerns itself with the frequency of events in a long, perhaps infinite, series of trials. From that per- spective, the reason that the probability of achieving a heads on a coin flip is 1/2 is that, in an infinite series of trials, we would see heads 50% of the time. This perspective grounds the classical approach to statistical theory and mod- eling. Another perspective on probability defines probability as a subjective representation of uncertainty about events. When we say that the probability of observing heads on a single coin flip is 1 /2, we are really making a series of assumptions, including that the coin is fair (i.e., heads and tails are in fact equally likely), and that in prior experience or learning we recognize that heads occurs 50% of the time.
    [Show full text]
  • Importance Sampling
    Chapter 6 Importance sampling 6.1 The basics To movtivate our discussion consider the following situation. We want to use Monte Carlo to compute µ = E[X]. There is an event E such that P (E) is small but X is small outside of E. When we run the usual Monte Carlo algorithm the vast majority of our samples of X will be outside E. But outside of E, X is close to zero. Only rarely will we get a sample in E where X is not small. Most of the time we think of our problem as trying to compute the mean of some random variable X. For importance sampling we need a little more structure. We assume that the random variable we want to compute the mean of is of the form f(X~ ) where X~ is a random vector. We will assume that the joint distribution of X~ is absolutely continous and let p(~x) be the density. (Everything we will do also works for the case where the random vector X~ is discrete.) So we focus on computing Ef(X~ )= f(~x)p(~x)dx (6.1) Z Sometimes people restrict the region of integration to some subset D of Rd. (Owen does this.) We can (and will) instead just take p(x) = 0 outside of D and take the region of integration to be Rd. The idea of importance sampling is to rewrite the mean as follows. Let q(x) be another probability density on Rd such that q(x) = 0 implies f(x)p(x) = 0.
    [Show full text]
  • Probability Distributions and Related Mathematical Constructs
    Appendix B More probability distributions and related mathematical constructs This chapter covers probability distributions and related mathematical constructs that are referenced elsewhere in the book but aren’t covered in detail. One of the best places for more detailed information about these and many other important probability distributions is Wikipedia. B.1 The gamma and beta functions The gamma function Γ(x), defined for x> 0, can be thought of as a generalization of the factorial x!. It is defined as ∞ x 1 u Γ(x)= u − e− du Z0 and is available as a function in most statistical software packages such as R. The behavior of the gamma function is simpler than its form may suggest: Γ(1) = 1, and if x > 1, Γ(x)=(x 1)Γ(x 1). This means that if x is a positive integer, then Γ(x)=(x 1)!. − − − The beta function B(α1,α2) is defined as a combination of gamma functions: Γ(α1)Γ(α2) B(α ,α ) def= 1 2 Γ(α1+ α2) The beta function comes up as a normalizing constant for beta distributions (Section 4.4.2). It’s often useful to recognize the following identity: 1 α1 1 α2 1 B(α ,α )= x − (1 x) − dx 1 2 − Z0 239 B.2 The Poisson distribution The Poisson distribution is a generalization of the binomial distribution in which the number of trials n grows arbitrarily large while the mean number of successes πn is held constant. It is traditional to write the mean number of successes as λ; the Poisson probability density function is λy P (y; λ)= eλ (y =0, 1,..
    [Show full text]
  • Lecture 17: Bivariate Normal Distribution F (X, Y) Is Given By
    Section 5.3 Bivariate Unit Normal Bivariate Unit Normal If X and Y have independent unit normal distributions then their joint Lecture 17: Bivariate Normal distribution f (x; y) is given by 2 − 1 (x2+y 2) f (x; y) = φ(x)φ(y) = c e 2 Sta230 / Mth230 Colin Rundel April 2, 2014 Sta230 / Mth230 (Colin Rundel) Lecture 17 April 2, 2014 1 / 20 Section 5.3 Bivariate Unit Normal Section 5.3 Bivariate Unit Normal Bivariate Unit Normal, cont. Bivariate Unit Normal - Normalizing Constant We can rewrite the joint distribution in terms of the distance r from the First, rewriting the joint distribution in this way also makes it possible to origin evaluate the constant of integration, c. From our previous discussions of the normal distribution we know that p 2 2 r = x + y c = p1 , but we never saw how to derive it explicitly. 2π 2 − 1 (x2+y 2) 2 − 1 r 2 f (x; y) = c e 2 = c e 2 This tells us something useful about this special case of the bivariate normal distributions: it is rotationally symmetric about the origin. r r + eps This particular fact is incredibly powerful and helps us solve a variety of Y problems. Sta230 / Mth230 (Colin Rundel) Lecture 17 April 2, 2014 2 / 20 Sta230 / Mth230 (Colin Rundel)X Lecture 17 April 2, 2014 3 / 20 Section 5.3 Bivariate Unit Normal Section 5.3 Bivariate Unit Normal Bivariate Unit Normal - Normalizing Constant Rayleigh Distribution The distance from the origin of a point (x; y) derived from X ; Y ∼ N (0; 1) is called the Rayleigh distribution.
    [Show full text]
  • Bridgesampling: an R Package for Estimating Normalizing Constants
    bridgesampling: An R Package for Estimating Normalizing Constants Quentin F. Gronau Henrik Singmann Eric-Jan Wagenmakers University of Amsterdam University of Zurich University of Amsterdam Abstract Statistical procedures such as Bayes factor model selection and Bayesian model averaging require the computation of normalizing constants (e.g., marginal likelihoods). These normalizing constants are notoriously difficult to obtain, as they usually involve high- dimensional integrals that cannot be solved analytically. Here we introduce an R package that uses bridge sampling (Meng and Wong 1996; Meng and Schilling 2002) to estimate normalizing constants in a generic and easy-to-use fashion. For models implemented in Stan, the estimation procedure is automatic. We illustrate the functionality of the package with three examples. Keywords: bridge sampling, marginal likelihood, model selection, Bayes factor, Warp-III. 1. Introduction In many statistical applications, it is essential to obtain normalizing constants of the form Z Z = q(θ) dθ; (1) Θ where p(θ) = q(θ)=Z denotes a probability density function (pdf) defined on the domain p Θ ⊆ R . For instance, the estimation of normalizing constants plays a crucial role in free energy estimation in physics, missing data analyses in likelihood-based approaches, Bayes factor model comparisons, and Bayesian model averaging (e.g., Gelman and Meng 1998). In this article, we focus on the role of the normalizing constant in Bayesian inference; however, the bridgesampling package can be used in any context where
    [Show full text]
  • Bayesian Inference
    Chapter 12 Bayesian Inference This chapter covers the following topics: Concepts and methods of Bayesian inference. • Bayesian hypothesis testing and model comparison. • Derivation of the Bayesian information criterion (BIC). • Simulation methods and Markov chain Monte Carlo (MCMC). • Bayesian computation via variational inference. • Some subtle issues related to Bayesian inference. • 12.1 What is Bayesian Inference? There are two main approaches to statistical machine learning: frequentist (or classical) methods and Bayesian methods. Most of the methods we have discussed so far are fre- quentist. It is important to understand both approaches. At the risk of oversimplifying, the difference is this: Frequentist versus Bayesian Methods In frequentist inference, probabilities are interpreted as long run frequencies. • The goal is to create procedures with long run frequency guarantees. In Bayesian inference, probabilities are interpreted as subjective degrees of be- • lief. The goal is to state and analyze your beliefs. 299 Statistical Machine Learning CHAPTER 12. BAYESIAN INFERENCE Some differences between the frequentist and Bayesian approaches are as follows: Frequentist Bayesian Probability is: limiting relative frequency degree of belief Parameter ✓ is a: fixed constant random variable Probability statements are about: procedures parameters Frequency guarantees? yes no To illustrate the difference, consider the following example. Suppose that X1,...,Xn N(✓, 1). We want to provide some sort of interval estimate C for ✓. ⇠ Frequentist Approach. Construct the confidence interval 1.96 1.96 C = X , X + . n − pn n pn Then P✓(✓ C)=0.95 for all ✓ R. 2 2 The probability statement is about the random interval C. The interval is random because it is a function of the data.
    [Show full text]
  • 9 Importance Sampling 3 9.1 Basic Importance Sampling
    Contents 9 Importance sampling 3 9.1 Basic importance sampling . 4 9.2 Self-normalized importance sampling . 8 9.3 Importance sampling diagnostics . 11 9.4 Example: PERT . 13 9.5 Importance sampling versus acceptance-rejection . 17 9.6 Exponential tilting . 18 9.7 Modes and Hessians . 19 9.8 General variables and stochastic processes . 21 9.9 Example: exit probabilities . 23 9.10 Control variates in importance sampling . 25 9.11 Mixture importance sampling . 27 9.12 Multiple importance sampling . 31 9.13 Positivisation . 33 9.14 What-if simulations . 35 End notes . 37 Exercises . 40 1 2 Contents © Art Owen 2009{2013,2018 do not distribute or post electronically without author's permission 9 Importance sampling In many applications we want to compute µ = E(f(X)) where f(x) is nearly zero outside a region A for which P(X 2 A) is small. The set A may have small volume, or it may be in the tail of the X distribution. A plain Monte Carlo sample from the distribution of X could fail to have even one point inside the region A. Problems of this type arise in high energy physics, Bayesian inference, rare event simulation for finance and insurance, and rendering in computer graphics among other areas. It is clear intuitively that we must get some samples from the interesting or important region. We do this by sampling from a distribution that over- weights the important region, hence the name importance sampling. Having oversampled the important region, we have to adjust our estimate somehow to account for having sampled from this other distribution.
    [Show full text]
  • Derivations of the Univariate and Multivariate Normal Density
    Derivations of the Univariate and Multivariate Normal Density Alex Francis & Noah Golmant Berkeley, California, United States Contents 1 The Univariate Normal Distribution 1 1.1 The Continuous Approximation of the Binomial Distribution . .1 1.2 The Central Limit Theorem . .4 1.3 The Noisy Process . .8 2 The Multivariate Normal Distribution 11 2.1 The Basic Case: Independent Univariate Normals . 11 2.2 Affine Transformations of a Random Vector . 11 2.3 PDF of a Transformed Random Vector . 12 2.4 The Multivariate Normal PDF . 12 1. The Univariate Normal Distribution It is first useful to visit the single variable case; that is, the well-known continuous proba- bility distribution that depends only on a single random variable X. The normal distribution formula is a function of the mean µ and variance σ2 of the random variable, and is shown below. ! 1 1 x − µ2 f(x) = p exp − σ 2π 2 σ This model is ubiquitous in applications ranging from Biology, Chemistry, Physics, Computer Science, and the Social Sciences. It's discovery is dated as early as 1738 (perhaps ironically, the name of the distribution is not attributed to it's founder; that is credited, instead, to Abraham de Moivre). But why is this model still so popular, and why has it seemed to gain relevance over time? Why do we use it as a paradigm for cat images and email data? The next section addresses three applications of the normal distribution, and in the process, derives it's formula using elementary techniques. 1.1. The Continuous Approximation of the Binomial Distribution Any introductory course in probability introduces counting arguments as a way to discuss probability; fundamentally, probability deals in subsets of larger supersets, so being able to count the cardinality of the subset and superset allows us to build a framework for think- ing about probability.
    [Show full text]
  • Exact Formulas for the Normalizing Constants of Wishart Distributions for Graphical Models
    EXACT FORMULAS FOR THE NORMALIZING CONSTANTS OF WISHART DISTRIBUTIONS FOR GRAPHICAL MODELS By Caroline Uhler∗, Alex Lenkoskiy, and Donald Richardsz Massachusetts Institute of Technology∗, Norwegian Computing Centery, and Penn State Universityz Gaussian graphical models have received considerable attention during the past four decades from the statistical and machine learning communities. In Bayesian treatments of this model, the G-Wishart distribution serves as the conjugate prior for inverse covariance ma- trices satisfying graphical constraints. While it is straightforward to posit the unnormalized densities, the normalizing constants of these distributions have been known only for graphs that are chordal, or decomposable. Up until now, it was unknown whether the normaliz- ing constant for a general graph could be represented explicitly, and a considerable body of computational literature emerged that at- tempted to avoid this apparent intractability. We close this question by providing an explicit representation of the G-Wishart normalizing constant for general graphs. 1. Introduction. Let G = (V; E) be an undirected graph with vertex p set V = f1; : : : ; pg and edge set E. Let S be the set of symmetric p × p p p matrices and S0 the cone of positive definite matrices in S . Let p p (1.1) S0(G) = fM = (Mij) 2 S0 j Mij = 0 for all (i; j) 2= Eg p denote the cone in S of positive definite matrices with zeros in all entries not corresponding to edges in the graph. Note that the positivity of all diagonal entries Mii follows from the positive-definiteness of the matrices M. p A random vector X 2 R is said to satisfy the Gaussian graphical model (GGM) with graph G if X has a multivariate normal distribution with mean −1 p µ and covariance matrix Σ, denoted X ∼ Np(µ, Σ), where Σ 2 S0(G).
    [Show full text]
  • Orthogonal Polynomials in Stein's Method
    Orthogonal Polynomials in Steins Metho d Wim Schoutens KatholiekeUniversiteit Leuven Department of Mathematics Celestijnenlaan B B Leuven Belgium Abstract We discuss Steins metho d for Pearsons and Ords family of distributions We giveasys tematic treatment including the Stein equation its solution and smo othness conditions Akey role in the analysis is played by the classical orthogonal p olynomials AMS Subject Classication J H Keywords Steins Method Orthogonal Polynomials Pearsons Class Ords Class Approximation Distributions Markov Processes Postdo ctoral Researcher of the Fund for Scientic Research Flanders Belgium Running Head Steins Method Orthogonal Polynomials Mailing Address Wim Schoutens Katholieke Universiteit Leuven Department of Math ematics Celestijnenlaan B B Leuven Belgium Email WimSchoutenswiskuleuvenacbe Intro duction Steins Metho d provides a way of nding approximations to the distribution say of a random variable which at the same time gives estimates of the approximation error involved The strenghts of the metho d are that it can b e applied in many circumstances in which dep endence plays a part In essence the metho d is based on a dening equation or equivalently an op erator of the distribution and a related Stein equation Up to now is was not clear which equation to take One could think at a lot of equations We show how for a broad class of distributions there is one equation who has a sp ecial role We give a systematic treatment including the Stein equation its solution and smo othness conditions A
    [Show full text]
  • Beta Distribution
    Beta Distribution Paul Johnson <[email protected]> and Matt Beverlin <[email protected]> June 10, 2013 1 Description How likely is it that the Communist Party will win the next elections in Russia? In my view, the probability is 0.33. You may think the chance is 0.22. Your brother thinks the chances are 0.6 and his sister-in-law thinks the chances are 0.1. People disagree and we would like a way to summarize the chances that a person will say 0.4 or 0.5 or whatnot. The Beta density function is a very versatile way to represent outcomes like proportions or probabilities. It is defined on the continuum between 0 and 1. There are two parameters which work together to determine if the distribution has a mode in the interior of the unit interval and whether it is symmetrical. The Beta can be used to describe not only the variety observed across people, but it can also describe your subjective degree of belief (in a Bayesian sense). If you are not entirely sure that the probability is 0.22, but rather you think that is the most likely value but that there is some chance that the value is higher or lower, then maybe your personal beliefs can be described as a Beta distribution. 2 Mathematical Definition The standard Beta distribution gives the probability density of a value x on the interval (0,1): xα−1(1 − x)β−1 Beta(α,β): prob(x|α,β) = (1) B(α,β) where B is the beta function Z 1 B(α,β) = tα−1(1 − t)β−1dt 0 2.1 Don’t let all of those betas confuse you.
    [Show full text]
  • The Continuous Bernoulli: Fixing a Pervasive Error in Variational
    The continuous Bernoulli: fixing a pervasive error in variational autoencoders Gabriel Loaiza-Ganem John P. Cunningham Department of Statistics Department of Statistics Columbia University Columbia University [email protected] [email protected] Abstract Variational autoencoders (VAE) have quickly become a central tool in machine learning, applicable to a broad range of data types and latent variable models. By far the most common first step, taken by seminal papers and by core software libraries alike, is to model MNIST data using a deep network parameterizing a Bernoulli likelihood. This practice contains what appears to be and what is often set aside as a minor inconvenience: the pixel data is [0; 1] valued, not f0; 1g as supported by the Bernoulli likelihood. Here we show that, far from being a triviality or nuisance that is convenient to ignore, this error has profound importance to VAE, both qualitative and quantitative. We introduce and fully characterize a new [0; 1]-supported, single parameter distribution: the continuous Bernoulli, which patches this pervasive bug in VAE. This distribution is not nitpicking; it produces meaningful performance improvements across a range of metrics and datasets, including sharper image samples, and suggests a broader class of performant VAE.1 1 Introduction Variational autoencoders (VAE) have become a central tool for probabilistic modeling of complex, high dimensional data, and have been applied across image generation [10], text generation [14], neuroscience [8], chemistry [9], and more. One critical choice in the design of any VAE is the choice of likelihood (decoder) distribution, which stipulates the stochastic relationship between latents and observables.
    [Show full text]