SAMPLING LIPSCHITZ CONTINUOUS DENSITIES. 1. Introduction

Similar documents
Monte Carlo Integration

Direction: This test is worth 250 points. You are required to complete this test within 50 minutes.

Chapter 2 The Monte Carlo Method

6. Uniform distribution mod 1

Introducing a Novel Bivariate Generalized Skew-Symmetric Normal Distribution

REAL ANALYSIS II: PROBLEM SET 1 - SOLUTIONS

Fall 2013 MTH431/531 Real analysis Section Notes

Sequences and Series of Functions

62. Power series Definition 16. (Power series) Given a sequence {c n }, the series. c n x n = c 0 + c 1 x + c 2 x 2 + c 3 x 3 +

Element sampling: Part 2

IIT JAM Mathematical Statistics (MS) 2006 SECTION A

Topic 9: Sampling Distributions of Estimators

Let us give one more example of MLE. Example 3. The uniform distribution U[0, θ] on the interval [0, θ] has p.d.f.


Random assignment with integer costs

It is often useful to approximate complicated functions using simpler ones. We consider the task of approximating a function by a polynomial.

A widely used display of protein shapes is based on the coordinates of the alpha carbons - - C α

TR/46 OCTOBER THE ZEROS OF PARTIAL SUMS OF A MACLAURIN EXPANSION A. TALBOT

Solution. 1 Solutions of Homework 1. Sangchul Lee. October 27, Problem 1.1

Chapter 6 Infinite Series

MATH301 Real Analysis (2008 Fall) Tutorial Note #7. k=1 f k (x) converges pointwise to S(x) on E if and

Random Variables, Sampling and Estimation

Comparison Study of Series Approximation. and Convergence between Chebyshev. and Legendre Series

A RANK STATISTIC FOR NON-PARAMETRIC K-SAMPLE AND CHANGE POINT PROBLEMS

Expectation and Variance of a random variable

Find quadratic function which pass through the following points (0,1),(1,1),(2, 3)... 11

A collocation method for singular integral equations with cosecant kernel via Semi-trigonometric interpolation

INEQUALITIES BJORN POONEN

Regression with quadratic loss

Topic 9: Sampling Distributions of Estimators

EE 4TM4: Digital Communications II Probability Theory

Confidence interval for the two-parameter exponentiated Gumbel distribution based on record values

The Method of Least Squares. To understand least squares fitting of data.

Lecture 19: Convergence

Resampling Methods. X (1/2), i.e., Pr (X i m) = 1/2. We order the data: X (1) X (2) X (n). Define the sample median: ( n.

PRELIM PROBLEM SOLUTIONS

REGRESSION WITH QUADRATIC LOSS

Convergence of random variables. (telegram style notes) P.J.C. Spreij

32 estimating the cumulative distribution function

Chapter 3. Strong convergence. 3.1 Definition of almost sure convergence

Journal of Multivariate Analysis. Superefficient estimation of the marginals by exploiting knowledge on the copula

Notes 27 : Brownian motion: path properties

Lecture 2: Monte Carlo Simulation

Infinite Sequences and Series

An Introduction to Randomized Algorithms

Chapter 6 Principles of Data Reduction

Lecture 33: Bootstrap

Topic 9: Sampling Distributions of Estimators

1 The Haar functions and the Brownian motion

Chapter 2 The Solution of Numerical Algebraic and Transcendental Equations

Local Approximation Properties for certain King type Operators

17. Joint distributions of extreme order statistics Lehmann 5.1; Ferguson 15

Appendix to: Hypothesis Testing for Multiple Mean and Correlation Curves with Functional Data

The picture in figure 1.1 helps us to see that the area represents the distance traveled. Figure 1: Area represents distance travelled

Kolmogorov-Smirnov type Tests for Local Gaussianity in High-Frequency Data

MASSACHUSETTS INSTITUTE OF TECHNOLOGY 6.436J/15.085J Fall 2008 Lecture 19 11/17/2008 LAWS OF LARGE NUMBERS II THE STRONG LAW OF LARGE NUMBERS

Functions of Bounded Variation and Rectifiable Curves

Math 341 Lecture #31 6.5: Power Series

1 Approximating Integrals using Taylor Polynomials

Stochastic Simulation

1 Introduction to reducing variance in Monte Carlo simulations

Singular Continuous Measures by Michael Pejic 5/14/10

University of Colorado Denver Dept. Math. & Stat. Sciences Applied Analysis Preliminary Exam 13 January 2012, 10:00 am 2:00 pm. Good luck!

Discrete Mathematics for CS Spring 2008 David Wagner Note 22

Approximation by Superpositions of a Sigmoidal Function

Clases 7-8: Métodos de reducción de varianza en Monte Carlo *

Properties and Hypothesis Testing

McGill University Math 354: Honors Analysis 3 Fall 2012 Solutions to selected problems

Chimica Inorganica 3

Approximations and more PMFs and PDFs

Double Stage Shrinkage Estimator of Two Parameters. Generalized Exponential Distribution

Introduction to Extreme Value Theory Laurens de Haan, ISM Japan, Erasmus University Rotterdam, NL University of Lisbon, PT

Section 5.5. Infinite Series: The Ratio Test

Law of the sum of Bernoulli random variables

Machine Learning Brett Bernstein

The Random Walk For Dummies

The Choquet Integral with Respect to Fuzzy-Valued Set Functions

ECE 8527: Introduction to Machine Learning and Pattern Recognition Midterm # 1. Vaishali Amin Fall, 2015

6 Integers Modulo n. integer k can be written as k = qn + r, with q,r, 0 r b. So any integer.

Section 11.8: Power Series

Confidence Interval for Standard Deviation of Normal Distribution with Known Coefficients of Variation

A statistical method to determine sample size to estimate characteristic value of soil parameters

Empirical Processes: Glivenko Cantelli Theorems

Frequentist Inference

Riemann Sums y = f (x)

Stat 319 Theory of Statistics (2) Exercises

BIOSTATISTICS. Lecture 5 Interval Estimations for Mean and Proportion. dr. Petr Nazarov

Estimation for Complete Data

Lecture 6 Chi Square Distribution (χ 2 ) and Least Squares Fitting

Random Walks on Discrete and Continuous Circles. by Jeffrey S. Rosenthal School of Mathematics, University of Minnesota, Minneapolis, MN, U.S.A.

A multivariate rational interpolation with no poles in R m

Lesson 10: Limits and Continuity

MAT1026 Calculus II Basic Convergence Tests for Series

Since X n /n P p, we know that X n (n. Xn (n X n ) Using the asymptotic result above to obtain an approximation for fixed n, we obtain

1. (25 points) Use the limit definition of the definite integral and the sum formulas 1 to compute

Exponential Functions and Taylor Series

Lecture 7: Properties of Random Samples

DECOMPOSITION METHOD FOR SOLVING A SYSTEM OF THIRD-ORDER BOUNDARY VALUE PROBLEMS. Park Road, Islamabad, Pakistan

Math 61CM - Solutions to homework 3

Lecture 6 Chi Square Distribution (χ 2 ) and Least Squares Fitting

Transcription:

SAMPLING LIPSCHITZ CONTINUOUS DENSITIES OLIVIER BINETTE Abstract. A simple ad efficiet algorithm for geeratig radom variates from the class of Lipschitz cotiuous desities is described. A MatLab implemetatio is freely available o GitHub (repository olivierbiette/lipsample). 1. Itroductio Let f be a measurable o-egative fuctio o the iterval [0, 1]. Give a upper boud M o f, the followig acceptace-rejectio algorithm geerates a radom variate followig the desity proportioal to f. Algorithm 0. 1. Geerate (x, y) uiformly distributed o the cube [0, 1] [0, M]. 2. If y > f(x), the go to 1; otherwise retur x. This is the simplest example of a uiversal or black box geerator. It requires a fuctio f, which may be evaluated at arbitrary poits ad a kow upper boud M o f, but otherwise is ot tailored to ay particular fuctioal form. Here we refie Algorithm 0 i the case where f is Lipschitz cotiuous of a kow order (e.g. whe a upper boud o the secod derivative of f is kow). The idea is to use the kow Lipschitz order ad the evaluatio of f o a grid of poits to costruct a first-degree splie evelope which is the applied to acceptace-rejectio samplig. Classes of desities with kow Lipschitz cotiuity order iclude polyomial ad trigoometric polyomial desities, log-polyomial desities such as the Vo Mises distributio ad Gaussia distributios, etc. This work was motivated by poor simulatio algorithms proposed i the litterature for particular classes of desities. For istace, Feradez-Dura (2014) proposed the use of Algorithm 0 to simulate from the class of trigoometric polyomial desities. Sice the first derivate of such desities is easily bouded, our method is a immediate (ad rather sigificative) improvemet. 1.1. Short litterature review. Hörma et al. (2004) describe uiversal geerators for differet classes of desities excludig Lipschitz cotiuous desities. Beliakov (2005) implemets a uiversal geerator for multivariate Lipschitz cotiuous desities based o zeroth degree splie approximate evelopes. Date: November 5, 2017. 1

2 OLIVIER BINETTE 1.2. Structure of the paper. The rather simple method, which we refer to as the LipSample algorithm, is preseted i sectio 2. Sectio 3 presets a efficiet vectorized implemetatio i MatLab. 2. The LipSample algorithm Recall that a fuctio f defied o the iterval [0, 1] is said to be of Lipschitz f(x) f(y) order M, deoted f Lip(M), if sup x,y [0,1] x y M. If f is cotiuously differetiable, the f Lip(sup f ). The followig algorithm geerates radom variables followig the desity proportioal to f Lip(M). Algorithm 1 (LipSample). 1. Costruct a splie evelope S of f. 2. Geerate x followig the desity proportioal to S ad geerate y uiformly o [0, S(x)]. 3. If y > f(x), the go to 2; otherwise retur x. We may also costruct a lower splie evelope of f i order to accelerate step 3. Next we describe how to perform steps 1 ad 2. 2.1. The splie evelope. For simplicity ad computatioal efficiecy, we use the first order splie evelope S = S give by ( (1) S = f( i ) + h i,) Pi,, i=1 where h i, R is to be determied, P i, (x) = c i, max{0, 1 i x }, c i, = 2 if i = 0 or i =, c i, = 1 otherwise. Hece S liearly iterpolates betwee the poits (i/, f(i/) + h i, ), i = 0, 1,...,. Figure 1 The costats hi, must ow be chose as to esure S f. The simplest choice would be hi, = L/(2), but we ca do better. Give two sample poits A = ( i 1 i 1, f( )) ad B = ( i, f( i )), the Lipschitz coditio o f yields a triagle ABC such that if x [ i 1, i ] ad f(x) is greater tha the value of the liear

SAMPLING LIPSCHITZ CONTINUOUS DENSITIES 3 iterpolat of A ad B at x, the (x, f(x)) is iside of ABC. Precisely, the slope of the lie AC is arcta(m) ad the slope of BC is arcta(m). If say C = (z, f(z)) the we deote the differece betwee f(z) ad the value of the liear iterpolat at z by l i, (see Figure 1). It ca be show by elemetary geometry that (2) l i, = r(m (f( i i 1 ) f( ) ), where r = 1 2 Hece takig A B si(π α β) si(α) (3) h i, = max{l i,, l i+1, }, α = arcta(m) ad β = arcta( (f( i i 1 ) f( ) ). esures that S f ad furthermore this boud is sharp over Lip(M). Note also that at ay poit x [0, 1], oly two terms of the sum S (x) are o-zero. I fact, lettig i = ( + 1)x, we fid S (x) = (x i)f( i i+1 ) + (i + 1 x)f( ). It is also quite easy to sample from the desity proportioal to S as it is a mixture of triagular desities. Lemma 1. Let p i = f( i )+h i, if i = 1, 2,..., 1, p i = (f( i )+h i,)/2 if i = 0,. Suppose I is distributed as P (I = i) p i ad that U 1, U 2 id. uif([0, 1]). Let Z = (U 1 + U 2 + I 1)/ ad X = Z + 2(1 Z) I Z>1. The X is distributed proportioally to S. Proof. Write S = i=0 p P i i,, where P i, = P i, if i = 1, 2,..., 1 ad P i, = 2P i, if i = 1, 2. Fially, remark that P [0,1] i, does ot deped o i ad that coditioally o I = i, X is distributed proportioally to P i. 3. Implemetatio Let the fuctio f defied o [0, 1] be give together with its Lipschitz costat M. The followig MatLab code produces radom variates followig the desity proportioal to f. Step 1. Costructig the splie evelope. 1 % Number of compoets for the splie. 2 = ceil(40*sqrt(m)); 3 4 % Evaluate f at +1 equidistat poits ad add the costats h_{i,} = M / (2) 5 x = lispace(0,1, +1); 6 y = arrayfu(f, x) + M/(2*); Step 2. Geerate radom variates from the evelope.

4 OLIVIER BINETTE 1 % Assume Prop is give. 2 U1 = rad(1, Prop); 3 U2 = rad(1, Prop); 4 5 % Simulate from the discrete distributio specified by the weights y. 6 y(1) = y(1)/2; 7 y(ed) = y(ed)/2; 8 I = discretesample(y, Prop); % Fuctio available o github.com/olivierbiette/libsample. 9 y(1) = 2*y(1); 10 y(ed) = 2*y(ed); 11 12 % The radom variates are give by U. 13 U = abs((u1 + U2 + I - 2)/); 14 U(U > 1) = 2 - U(U > 1); Step 3. Acceptace-rejectio. 1 V = rad(1, Prop); 2 sample = U(lt(V.* iterp1(x,y,u), B)); The precedig steps may be repeated if the size of the sample is smaller tha eeded. 3.1. Improvemets. The followig calculates the costats h i, as i sectio 2 ad may be used to replace Step 1. 1 x = lispace(0,1,+1); 2 y = arrayfu(f, x); 3 4 % Use the Lipschitz costat to locally adjust the splie. 5 alpha = ata(l); 6 d = diff(y); 7 beta = abs(ata(*d)); 8 r = 0.5*sqrt(^2 + d.^2).*si(pi-alpha-beta)./si(alpha); 9 ell = r.*(l - abs(*d)); 10 11 y(1) = y(1) + ell(1); 12 y(+1) = y(+1) + ell(); 13 for i = 2: 14 y(i) = y(i) + max(ell(i-1), ell(i)); 15 ed We also use a lower splie evelope to accelerate Step 3. A proper iterface to this algorithm is available o GitHub (repository olivierbiette/libsample). 3.2. Performace. For the geeratio of a large umber of ormal variates restricted to [ 5, 5], the LipSample procedure is oly about 50 times slower tha

SAMPLING LIPSCHITZ CONTINUOUS DENSITIES 5 2.5 2 1.5 1 0.5 0 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Figure 2. The desity f(x) = 1 + cos(2πx) (blue), a splie evelope S (orage), ad 100 000 radom variates obtaied usig the LipSample algorithm (grey histogram). MatLab s ow rad. We cosider this to be quite fast: rad has bee iterally optimized whereas our LipSample code is iterpreted by MatLab ad completely geeral. Refereces [1] Beliakov, G. (2005). Class library ralip for multivariate ouiform radom variate geeratio. Computer Physics Commuicatios, Volume 170, Issue 1. [2] Devroye, L. (1988). No-Uiform Radom Variate Geeratio. Spriger-Verlag. [3] Ferádez-Durá, J. ad Gregorio-Domíguez, M. (2014). Modelig agles i proteis ad circular geomes usig multivariate agular distributios based o multiple oegative trigoometric sums. Statistical Applicatios i Geetics ad Molecular Biology, 13(1), pp. 1-18. [4] Hörma, W., J. Leydold, J. ad Derfliger, G. (2004). Automatic Nouiform Radom Variate Geeratio. Spriger. [5] Robert, C. et Casella, G. (2004). Mote Carlo Statistical Methods. Spriger-Verlag.