Determining probability mass function of random variable

后端 未结 6 807
一整个雨季
一整个雨季 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:44

    How about this function?

    function Y = pmf(X)
    A=tabulate(X)
    A(:,3)=A(:,3)/100
    Y=A(:,3)'
    

    Is this correct in your opinion?

提交回复
热议问题