Hey I was reading about Gaussian EM algorithm in which you first calculate the likelihood of data points being sampled from a Gaussian and then adjust your mean and variance to maximize it. To calculate the probability of a point being sampled from a distribution we do $$ P(x_i\mid\theta) = \frac{1}{\sqrt{2\pi\sigma^2}}\exp\left(\frac{-(x_i-\mu)^2}{2\sigma^2}\right) $$ But how can you sample a point from a continuous distribution? Shouldn't this be zero? Moreover I read many times about sampling a point/data from some continuous distribution but I can't understand how could you do that as for continuous random variable X the $P(X=x_1) = 0 $, so how could yo sample data point(s) from a continuous distribution? Or does this sampling have some other meaning. I've seen many questions on this platform but I couldn't get my answer.
Shouldn't the probability of sampling a point from a continuous distribution be 0?
196 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail AtThere are 2 best solutions below
On
On digital computers, it is certainly impossible to sample from a truly continuous distribution; i.e. a distribution that contains infinite possible "discrete" outcomes. One would have to wait an infinite amount of time to compute every one of the infinite decimals. In practice, we chop up the continuous distribution into a discrete number of possibilities and sample from those, and make a case that the discrete distribution adequately represents the continuous distribution.
The simplest example might be a random sampling from a continuous, uniform distribution between values 0 and 1. If we split the interval (0,1) uniformly (chunks of dx) into the infinite number of possibilities, the probability of picking a particular $X$ from $X \in (0,1)$ is
$P(X) = \lim_{dx \to 0} dx=0$
But there's an integral hidden in the denominator:
$\int_{0}^{1}dx = 1$
The integral adds up an infinite number of $dx \to 0$ to get probability 1 of picking any number between 0 and 1.
Same thing happens in the numerator for the infinite number of $dx \to 0$ in a finite subinterval, resulting in a non-zero probability for finite subintervals.
Decide on the level of accuracy you are working to. For example, if you are modelling masses, you might have the masses being measured to the nearest 5g. That means a measured value of say 45g would in fact be a value between 42.5g and 47.5g. You can then work out the probability that a value is between 42.5g and 47.5g.