I am having trouble understanding probability density functions. What exactly is a probability density function? Does it give you the probability of a value occurring?
See my MATLAB code below:
x = randn(1000,1); % generates 1000 numbers from the standard normal distribution
y = normpdf(x,0,1);
So what y tells me is basically what is the probability of an element in X occurring right? No, it is basically the f(x) value for x, for the Gaussian Density function right?
In this link (wikipedia), it says:
In probability theory, a probability density function (PDF), or density of a continuous random variable, is a function that describes the relative likelihood for this random variable to take on a given value. The probability of the random variable falling within a particular range of values is given by the integral of this variable’s density over that range—that is, it is given by the area under the density function but above the horizontal axis and between the lowest and greatest values of the range.
So what is the difference of the relative likelihood vs probability?
Also if somebody wants to accurately calculate the probability of a random variable, then he can just take a really small integral area right (close to zero)?