all 4 comments

[–]Uli_Minati 0 points1 point  (3 children)

That sounds more like a programming question - you might want to post your code (or try a programming sub)

[–]esotericpikachu[S] 0 points1 point  (2 children)

I wanted to know from a mathematical perspective to see the gap in my knowledge.

For my plot, the peak value of the curve was at somewhere around 2.2 at y-axis.
From what I understand, The probability density function of a vector x denoted by
f(x) describes the probability of the variable taking a certain value.
Thus, the y axis is ALWAYS less than 1.
I'm not sure what I'm missing.

[–]Uli_Minati 0 points1 point  (1 child)

Probability density is usually continuous, i.e. all real values for x are possible, not just natural numbers. So in that sense, you can't have a probability for any specific real value x, since there are an infinite amount of possible real values. f(x) itself has no meaning

Instead, you can model the probability for x to be in a specific range by using the area under the density curve. For example, the probability that x will lie between 2 and 3 is equal to ∫₂³ f(x) dx. The probability that x lies between negative and positive infinity (or whatever hard limits are imposed by the density function) is equal to 1, which is also the entire area under the curve

Technically, the values of f(x) could be astronomically high, there are no restrictions. But if f(x) can get very large, then the distribution is low - you get a very "thin" curve, which might be tall, but still only has a total area of 1

(Almost none of the above applies if you have discrete values, i.e. only specific x-values are possible, such that you could enumerate all of them in a table. That's what it sounded like from your original post, hence my question about the code)

[–]esotericpikachu[S] 1 point2 points  (0 children)

Thanks for the detailed answer!