Skip to main content

%DeepSee.extensions.stat.MixedDistribution

Class %DeepSee.extensions.stat.MixedDistribution Extends (%RegisteredObject, AbstractContinuousDistribution) [ System = 4 ]

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, !

Properties

N

Property N As %Integer [ InitialExpression = 0 ];

w

Property w As %Double [ MultiDimensional ];

P

Property P As AbstractContinuousDistribution [ MultiDimensional ];

Methods

AddComponent

Method AddComponent(p As AbstractContinuousDistribution, weight As %Double) As %Status

Add a component p to the distribution with the given weight. After all components are added application must call balance

balance

Method balance() As %Status

The method to call after all components of the distribution are specified.

cdf

Method cdf(x1 As %Double, x2 As %Double = "") As %Double

pdf

Method pdf(x As %Double) As %Double