{"id":77,"date":"2024-12-17T18:17:51","date_gmt":"2024-12-17T18:17:51","guid":{"rendered":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/malcolm-connolly\/?p=77"},"modified":"2026-03-22T17:35:27","modified_gmt":"2026-03-22T17:35:27","slug":"a-multi-modal-distribution","status":"publish","type":"post","link":"https:\/\/www.lancaster.ac.uk\/stor-i-student-sites\/malcolm-connolly\/2024\/12\/17\/a-multi-modal-distribution\/","title":{"rendered":"A multi-modal distribution."},"content":{"rendered":"\n

I created a simple bivariate distribution which I will describe in this post. This is a toy example of a multi-modal distribution which I used to test different MCMC methods including parallel tempering and HMC for one of the first reports I wrote for the MRes. <\/p>\n\n\n\n

The distribution is a mixture of bivariate normal distributions, with means at the vertices of a regular polygon in the plane.<\/p>\n\n\n\n

That is for some n<\/span>-gon, we place our modes \\mu_k<\/span> the vertices are at the points<\/p>\n\n\n\\mu_k = R ( \\cos \\left( \\frac{2\\pi k}{n}\\right), \\sin\\left( \\frac{2\\pi k}{n}\\right))^t, \\ \\text{ for } k = 1,2,\\ldots, n. <\/span>\n\n\n\n

The mixture target distribution is a weighted sum of multivariate normal distributions,<\/p>\n\n\n\\pi(x) = \\sum_{k=1}^n w_k N(\\mu_k,\\Sigma_k).<\/span>\n\n\n\n

The weights are such that \\sum_{k=1}^n w_k =1<\/span>. For example, one can take w_k = \\frac{1}{n}<\/span>. Now I would like each of the covariance matrices to be oriented such that the principal eigenvector points towards the origin. We can achieve this by means of a change of basis,<\/p>\n\n\n\\Sigma_k = \\begin{pmatrix}\\cos \\left( \\frac{2\\pi k}{n}\\right) & -\\sin \\left( \\frac{2\\pi k}{n}\\right) \\\\ \\sin \\left( \\frac{2\\pi k}{n}\\right) & \\cos \\left( \\frac{2\\pi k}{n}\\right)\\end{pmatrix}\\begin{pmatrix} \\sigma_1^2 & 0 \\\\ 0 & \\sigma_2^2 \\end{pmatrix}\\begin{pmatrix}\\cos \\left( \\frac{2\\pi k}{n}\\right) & -\\sin \\left( \\frac{2\\pi k}{n}\\right) \\\\ \\sin \\left( \\frac{2\\pi k}{n}\\right) & \\cos \\left( \\frac{2\\pi k}{n}\\right)\\end{pmatrix}^{-1}.<\/span>\n\n\n\n

Here’s an example:<\/p>\n\n\n\n

\"\"<\/figure>\n\n\n\n

I used this distribution to study the effectiveness of different MCMC tempering methods with multi-modal target distributions, which I wrote up as a short report in my first term at STOR-i. See below for the report, and I hope you find it as interesting as I did exploring these methods. <\/p>\n\n\n\n