Densities of Almost Surely Terminating Probabilistic Programs are Differentiable Almost Everywhere
Preprint
Abstract
We study the differential properties of higher-order statistical probabilistic programs with recursion and conditioning. Our starting point is an open problem posed by Hongseok Yang: what class of statistical probabilistic programs have densities that are differentiable almost everywhere? To formalise the problem, we consider Statistical PCF (SPCF), an extension of call-by-value PCF with real numbers, and constructs for sampling and conditioning. We give SPCF a sampling-style operational semantics a la Borgstrom et al., and study the associated weight (commonly referred to as the density) function and value function on the set of possible execution traces. Our main result is that almost-surely terminating SPCF programs, generated from a set of primitive functions (e.g. the set of analytic functions) satisfying mild closure properties, have weight and value functions that are almost-everywhere differentiable. We use a stochastic form of symbolic execution to reason about almost-everywhere differentiability. A by-product of this work is that almost-surely terminating deterministic (S)PCF programs with real parameters denote functions that are almost-everywhere differentiable. Our result is of practical interest, as almost-everywhere differentiability of the density function is required to hold for the correctness of major gradient-based inference algorithms.Keywords
All Related Versions
This publication has 13 references indexed in Scilit:
- Densities of Almost Surely Terminating Probabilistic Programs are Differentiable Almost Everywhere2021
- Discontinuous Hamiltonian Monte Carlo for discrete parameters and discontinuous likelihoodsBiometrika, 2020
- Towards verified stochastic variational inference for probabilistic programsProceedings of the ACM on Programming Languages, 2019
- A domain theory for statistical probabilistic programmingProceedings of the ACM on Programming Languages, 2019
- Contextual equivalence for a probabilistic language with continuous random variables and recursionProceedings of the ACM on Programming Languages, 2018
- Denotational validation of higher-order Bayesian inferenceProceedings of the ACM on Programming Languages, 2017
- Measurable cones and stable, measurable functions: a model for probabilistic higher-order programmingProceedings of the ACM on Programming Languages, 2017
- Deriving Probability Density Functions from Probabilistic Functional Programs2013
- A type-theoretical alternative to ISWIM, CUCH, OWHYTheoretical Computer Science, 1993
- A System to Generate Test Data and Symbolically Execute ProgramsIEEE Transactions on Software Engineering, 1976