statistics

Markov Chain Monte Carlo

One of the goal of the current my study about statistics is understanding Markov Chain Monte Carlo(MCMC). I would like to write about one of the popular algorithms of MCMC, Metropolis–Hastings algorithm. It’s a kind of rejection sampling a…

Markov Chain Properties

In the previous post, I gave the definition of Markov chain and as you can see in the page that I introduced in the previous post, a Markov chain can be represented by a directed graph. Each node represents a state and each edge of the gra…

Markov Chain

Markov Chain is a sequence of random variables () which has a property that the probability of moving to the next step depends only on the current state not on the previous states. The probability of moving to the next step which is define…

Bayes' theorem

When I learned Bayesian Inference, it recalls me the proof of Bayes' theorem. It’s one of the simplest proof which derives an important theorem. Let be an event. The following formula are the definition of conditional probability. Do a sim…

Bayesian Inference

Bayesian Inference is a method for estimating a true probability distribution from samples of the distribution. When I read the article in the wikipedia, I didn’t get the point. But I found a better article that gives me more intuitive und…

Implementing Box-Muller Transform

After writing [the previous post, I think I understand Box-Muller transform. I’m implementing it in this post. Original form of Box-Muller transform is as follows: : random variables from uniform distribution (0,1) However it includes squa…

Box Muller Transformation

When I read the post, I got an intuitive understanding of Box Muller Transformation because it has a lot of images. However I didn’t think I fully understand Box-Muller transformation and I didn’t understand the reason why we need to draw …

Draw a sample from a normal distribution with mean 0 and variance 1

In the previous post, it’s easy to transform it to a sample from a normal distribution with mean and variance by calculating if we can draw a sample x from a normal distribution with mean 0 and variance 1. Then I started googling how to dr…

Sample(Generate random variables) from normal distribution

In the following previous posts, I mentioned about rejection sampling. nakaly.hatenablog.com nakaly.hatenablog.com But I was a little confused when I learn rejection sampling. Because we need a known distribution which we already know how …

Plotting in python

Before going to MCMC, I would like to implement a test code by using rejection sampling. Since I am a little bit familiar with python, I’m choosing python(python3). And I would like to plot the result that I draw from a distribution to see…

Proof of Rejection Sampling

In previous post, I introduced the simple idea of rejection sampling algorithm. But the step 2 (Accept the sample with a probability ()) should be elaborated when you actually use it. Draw a sample from G (which is a known distribution tha…

Rejection Sampling

In previous post, I mentioned about the naive sampling method. I would like to mention about rejection sampling which is more efficient than the naive method. You have the target distribution(F) which you would like to draw samples from. A…

Sampling

When I learned about machine learning (especially deep learning), I sometimes see the word “sampling” such as gibbs sampling, MCMC. However I don’t think I fully understand sampling. I start learning it. When I think sampling, the first th…