Represents multicomponent continues distribution. For example let the user to create a distribution consisting of mixed Gaussian components or a mixed Normal/Exponential distribution.
Here is an example of it's usage:
set ndist = ##class(%DeepSee.extensions.stat.NormalDistribution).create(m, (sigma * sigma)) set edist = ##class(%DeepSee.extensions.stat.ExpDistribution).create(lambda) set mdist = ##class(%DeepSee.extensions.stat.MixedDistribution).%New() set sc = mdist.AddComponent(ndist, w) Quit:$$$ISERR(sc) set sc = mdist.AddComponent(edist, (1-w)) Quit:$$$ISERR(sc) set sc = mdist.balance() Quit:$$$ISERR(sc) w "Mean = "_mdist.Mean w "; Var = "_mdist.Variance w "; Entropy = "_mdist.Entropy, !
Add a component p to the distribution with the given weight. After all components are added application must call
The method to call after all components of the distribution are specified.
An interface method for cumulative distribution function (CDF). Optionally provides a cumulative probability of a value being between two values x1 and x2.
If called with 1 argument(x1) or if the value of second argument is empty string then returns CDF value for x1. If called with two arguments, x1 and x2 then returns a probability of a value being between x1 and x2.
An interface method for probability distribution function (PDF). Returns PDF value for x.