# What this blog is about

Here I write and brainstorm about some subjects that interest me. The goal is to share what I like and explore ideas that are tangential to my work as a student.

Almost everything on this site was written while I was a senior undergraduate student at Université du Québec à Montréal. Nowadays I’m busy with other projects and I don’t expect to continue to post as often.

# Prettier base plots in R

R’s base graphics system is notable for the minimal design of its plots. Basic usage is very simple, although more complex customization capabilities are not user friendly. Hence I wrapped the plot and hist functions to improve their default behavior.

Any argument usually passed to plot or hist can also be passed to the two wrapper functions pretty_plot and pretty_hist. A comparison is shown below; “prettified” functions are on the right (obviously!).

par(mfcol=c(1,2)) plot(cars); pretty_plot(cars)

# Bayesian numerical analysis

Distributing points $\{x_i\}_{i=1}^n$ on the sphere as to minimize the mean square error

$\mathbb{E}\left[\left(q_n(f) - \int_{\mathbb{S}^2}f(s)\,ds\right)^2\right]$

of the quadrature formula $q_n(f) =\frac{1}{n}\sum_{i=1}^n f(x_i)$, where $f$ is a centered Gaussian process with covariance function $C(x,y) = \exp(\langle x, y \rangle)$. Shown is $n=6, 12, 23$.

# Sampling Lipschitz Continuous Densities

A simple and efficient algorithm for generating random variates from the class of Lipschitz continuous densities is described. A MatLab implementation is freely available on GitHub.

PDF note.

# Introduction

Le problème est de calculer $I(f) = \int f d\lambda,$$\mu$ est une mesure de probabilité sur un espace $X$ et $f : X \rightarrow \mathbb{R}$ est intégrable. Si $\{X_n\}$ est une suite de variables aléatoires indépendantes et distribuées selon $\mu$, alors on peut approximer $I(f)$ par

$I_n(f) = \frac{1}{n}\sum_{i=1}^n f(X_i),$

qui est dit un estimateur de Monte-Carlo.
En pratique, il peut être difficile de générer $X_n \sim \lambda$. On préférera alors introduire une mesure $\mu$, avec $\lambda$ absolument continue par rapport à $\mu$, de sorte que

$I_n(f;\mu) = \frac{1}{n}\sum_{i=1}^n f(Y_i) \tfrac{d\lambda}{d\mu}(Y_i), \quad Y_i \sim^{ind.} \mu,$

soit une estimée de $I(f)$ plus commode à calculer. Cette technique, dite de l’échantillonnage préférentiel, peut aussi servir à améliorer la qualité de l’estimateur $I_n$ par exemple en réduisant sa variance.Read More »

# Bayesian binary classification using partitions of unity

Sunday afternoon project. I think it is possible to get topological garanties for the reconstruction of the classification boundary using the Nash-Tognoli theorem.

# 1. The problem

Points $x_i$, $i=1\dots, N$ are distributed on some space $\mathbb{M}$ and associated a label $\ell_i\in \{0,1\}$. It is assumed that

$\ell_i \sim \text{Ber}(p(x_i)), \qquad (1)$

where $p: \mathbb{M} \rightarrow [0,1]$ is some unknown integrable function. Estimating $p$ from the data $\{(x_i,\ell_i)\,|\, i=1,2,\dots, N\}$ allows us to predict $\ell_{n+1}$ given $x_{n+1}$.Read More »

# Bayesian learning

Friday july 28 at 17:00
Rutherford Physics Building, Room 118, McGill

Next week, I’ll be talking about Bayesian learning at the Mathematical congress of the americas and at the Canadian undergraduate mathematics conference. These are somewhat challenging talks: I need to sell the idea of Bayesian statistics to a general mathematical audience (which knows nothing about it), interest them in some though problems of Bayesian nonparametrics, and then present some of our research results. This must be done in under 20 minutes.

To make the presentation more intuitive and accessible, I borrowed some language from machine learning. I’m talking about learning rather than inference, uncertain knowledge rather than subjective belief, and “asymptotic correctness” rather than consistency. These are essentially synonymous, although some authors might use them in different ways. This should not cause problems for this introductory talk.Read More »

# A limit

Félix Locas presented me this problem.

Let $r(n) = \lfloor \log_2 \frac{n}{\log_2 n} \rfloor$. Show that

$\lim_{n \rightarrow \infty} \left( \log 2+\sum_{k=1}^{r(n)} \frac{1}{k(k+1) 2^k} \right)^n = 1.$

## My solution

The series $\sum_{k=1}^{\infty} \frac{1}{k(k+1) 2^k}$ is easy to calculate. It is, for instance, the difference between the integrals of geometric series:

$\sum_{k=1}^\infty \frac{1}{k(k+1) 2^k} = \sum_{k=1}^\infty \frac{1}{k 2^k} - \sum_{k=1}^\infty \frac{1}{(k+1) 2^k} = 1-\log 2.$Read More »

# The discretization trick

I explain the discretization trick that I mentioned in my previous post (Posterior consistency under possible misspecification). I think it was introduced by Walker (New approaches to Bayesian consistency (2004)).

Let $\mathbb{F}$ be a set of densities and let $\Pi$ be a prior on $\mathbb{F}$. If $x_1, x_2, x_3, \dots$ follows some distribution $P_0$ having density $f_0$, then the posterior distribution of $\Pi$ can be written as

$\Pi(A | x_1, \dots, x_n) \propto \int_A \prod_{i=1}^n f(x_i) \Pi(df).$

The discretization trick is to find densities $f_{1}, f_2, f_3, \dots$ in the convex hull of $A$ (taken in the space of all densities) such that

$\int_A \prod_{i=1}^n f(x_i) = \prod_{i=1}^n f_i(x_i) \Pi(A).$Read More »