Home > Class Reference > %SYS namespace > %DeepSee.extensions.stat.MixedDistribution
Private  

%DeepSee.extensions.stat.MixedDistribution

class %DeepSee.extensions.stat.MixedDistribution extends %RegisteredObject, AbstractContinuousDistribution

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

Inventory

Parameters Properties Methods Queries Indices ForeignKeys Triggers
3 4

Summary

Properties
Entropy Mean N P Variance
w
Methods
%AddToSaveSet %ClassIsLatestVersion %ClassName %ConstructClone
%DispatchClassMethod %DispatchGetModified %DispatchGetProperty %DispatchMethod
%DispatchSetModified %DispatchSetMultidimProperty %DispatchSetProperty %Extends
%GetParameter %IsA %IsContinuous %IsModified
%New %NormalizeObject %ObjectModified %OriginalNamespace
%PackageName %RemoveFromSaveSet %SerializeObject %SetModified
%ValidateObject AddComponent GetDiscreteDistribution GetKullbackLeiblerDivergence
GetLogLikelihood balance cdf pdf

Properties

property N as %Integer [ InitialExpression = 0 ];
property P as AbstractContinuousDistribution [ MultiDimensional ];
property w as %Double [ MultiDimensional ];

Methods

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
method balance() as %Status
The method to call after all components of the distribution are specified.
method cdf(x1 As %Double, x2 As %Double = "") as %Double
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.

method pdf(x As %Double) as %Double
An interface method for probability distribution function (PDF). Returns PDF value for x.