How to create a custom "probability distribution object" in MATLAB

I would like to include in MATLAB (using the Statistics toolbox) several simple ways to create new probability distributions from existing ones. For example: final mixtures or compound distributions. My goal is to provide seamless integration with existing probability distributions and the environment around them. Are there any documentation or examples of how this should be done?

The documentation contains only descriptions of the predefined distributions. I could not find anything about the class structure of the "probability distribution object" or how to write the user-defined function "makedist".

+4
source share
1 answer

Note . As pointed out by Mathworks, the superclass of the ProbDist class seems to be on its way and will be fully processed through makedist in the future

I know this is an old question, but I needed to implement some distributions that were not in the statistics toolbar and worked out my way to a solution that worked for my purposes and decided to share it here.

What works:

You can define a class that inherits from ProbDist or TruncatableDistribution and implement the methods that they require.

, , Skew Normal , , matlab, probDist

pd=SkewNormal('xi',0,'omega',1.0,'alpha',4)
pdf(pd,linspace(0,2,20))
cdf(pd,1)

, truncate()

truncate(pd,[0,2])

- makedist, , probDist

makedist -reset

, , . , fit, .

+1

All Articles