Determining probability mass function of random variable

后端 未结 6 646
一整个雨季
一整个雨季 2021-01-13 04:01

If we have a discrete random variable x and the data pertaining to it in X(n), how in matlab can we determine the probability mass function pmf(X)?

6条回答
  •  被撕碎了的回忆
    2021-01-13 04:37

    If I understood correctly what you need to do is to estimate the pdf, except it is not continuous but discrete values.

    Calculate the occurrences of different values in X(n) and divide by n. To illustrate what I am saying, please allow me to give an example. Assume that you have 10 observations:

    X = [1 1 2 3 1 9 12 3 1 2]
    

    then your pmf would look like this:

    pmf(X) = [0.4 0.2 0.2 0 0 0 0 0 0.1 0 0 0.1]
    

    edit: this is in principle a frequency histogram, as @zellus has also pointed out

提交回复
热议问题