Creating Distribution by Specifying Densities
1 view (last 30 days)
Show older comments
Hi,
I would like to fit a distribution to a vector that contains the probability mass/densities of the desired distribution.
For example, assume my vector of probability masses is [0.02 0.1 0.015] with the corresponding x-coordinates being [-1 0 1.2].
(So I have a probability mass of 0.02 at x = -1, a probability mass of 0.1 at x = 0 and so on).
Is there any function in MATLAB that would allow me to fit say, a normal distribution to a distribution with the probability masses at the specified coordinates? I understand that options such as fitdist are available if I am dealing with a histogram/dataset but here I would like to fit a distribution given the probability masses/densities at certain points.
Any help would be much appreciated and thank you in advance.
0 Comments
Answers (1)
Torsten
on 27 Apr 2023
Edited: Torsten
on 27 Apr 2023
If the masses add to 1, your x-coordinates together with the probability masses already define the distribution. There is no reason for fitting here.
If the masses don't add to 1, you can arbitrarily distribute (1-sum of masses) on the x-axis. So there is not senseful way of fitting and obtaining a distribution in this case.
2 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!