public abstract class NvmmLikelihoodAscentEM(T) : MixtureOptimizer!T, LikelihoodAscent!T
if(isFloatingPoint!T)

Normal variance-mean mixture optimizer

public this(
    in T[] _grid, 
    size_t maxLength)

Constructor

Contracts

in
{
    assert (_grid.length);
    assert (maxLength);
}

Parameters

_grid

Array of parameters u. [u_1, ..., u_k]

maxLength

maximal length of sample

public final void optimize(
    scope bool delegate(
        T betaPrev, 
        T beta, 
        T likelihoodValuePrev, 
        T likelihoodValue, 
        in T[] weightsPrev, 
        in T[] weights
        ) tolerance, 
    scope bool delegate(
        T a, 
        T b
        ) @nogc nothrow findRootTolerance = null)

Performs optimization.

Parameters

tolerance

Defines an early termination condition. Receives the current and previous versions of various parameters. The delegate must return true when parameters are acceptable.

findRootTolerance

Tolerance for inner optimization.

public final void optimize(
    scope bool delegate(
        T betaPrev, 
        T beta, 
        T likelihoodValuePrev, 
        T likelihoodValue
        ) tolerance, 
    scope bool delegate(
        T a, 
        T b
        ) @nogc nothrow findRootTolerance = null)

Performs optimization.

Parameters

tolerance

Defines an early termination condition. Receives the current and previous versions of various parameters. The delegate must return true when parameters are acceptable.

findRootTolerance

Tolerance for inner optimization.

public final void optimize(
    scope bool delegate(
        T betaPrev, 
        T beta, 
        in T[] weightsPrev, 
        in T[] weights
        ) tolerance, 
    scope bool delegate(
        T a, 
        T b
        ) @nogc nothrow findRootTolerance = null)

Performs optimization.

Parameters

tolerance

Defines an early termination condition. Receives the current and previous versions of various parameters. The delegate must return true when parameters are acceptable.

findRootTolerance

Tolerance for inner optimization.

public final void sample(in T[] _sample) @property

Sets sample and recalculates beta and mixture.

Contracts

in
{
    assert (_sample.length <= this._sample.length);
    
    foreach (s; _sample)
    {
        assert (std.math.isFinite(s));
    }
    assert (_featuresT.matrix.shift >= _sample.length);
}

Parameters

_sample

new sample with length less or equal maxLength

public final const(T)[] sample() @property const

Returns

Const slice of the internal sample representation.

public final T mean() @property const

Returns

sample mean

public final T beta() @property const

Returns

beta

public final const(T)[] grid() @property const

Returns

Const slice of the internal grid representation.

Functions

this

Constructor

optimize

Performs optimization.

optimize

Performs optimization.

optimize

Performs optimization.

sample@property

Sets sample and recalculates beta and mixture.

sample@property, constReturns:

Const slice of the internal sample representation.

mean@property, constReturns:

sample mean

beta@property, constReturns:

beta

grid@property, constReturns:

Const slice of the internal grid representation.

Structs

CorePDF