Demo with Python NoteBook


Coloring random graphs
We wish to estimate the number of  J-colorings of a given graph of size  K. This example is explained in the introduction of the book.

To see the screenshot, follow the link ColoringRandomGraphs.html
To run the code, download the Python NoteBook ColoringRandomGraphs.ipynb

Gibbs Gaussian sampling
Gibbs sampling consists in replacing a simulation of  d-dimensional random variables with d independent 1-dimensional random variables. This requires the knowledge of the marginal distributions of each component given all the others, which isn't necessarily easy. Here, we illustrate the principle in the (easy) case of Gaussian distributions.

To see the screenshot, follow the link Gibbs_GaussianSampling.html
To run the code, download the Python NoteBook Gibbs_GaussianSampling.ipynb

Metropolis-Hastings Gaussian sampling
We present here a generic Metropolis-Hasting algorithm. The algorithm has the interesting feature of not needing the value of the normalization constant in the probability density function. We use a instrumental distribution and accept the proposition randomly with some state-dependent rate. Here, the algorithm is illustrated in the case of Gaussian distributions.

To see the screenshot, follow the link MetropolisHastings_GaussianSampling.html
To run the code, download the Python NoteBook MetropolisHastings_GaussianSampling.ipynb

Hit-and-Run Gaussian sampling
In the algorithm devoted to Gaussian sampling, we assume that the covariance matrix is not easy to invert numerically, so that we may not be able to run a Metropolis-Hastings or Gibbs sampler. The Hit-and-Run algorithm consists in picking direction randomly according the columns of the covariance matrix. The algorithm is illustrated in the case where each coordinate is centered with unit variance.

To see the screenshot, follow the link HitAndRun_GaussianSampling.html
To run the code, download the Python NoteBook HitAndRun_GaussianSampling.ipynb

No comments:

Post a Comment