Click or drag to resize

SystemPerformanceOptimizationContextSmoothParameter Method

Provides the smoothing of the updated sampling parameter of a SystemPerformanceOptimizer executing in this context.

Namespace:  Novacta.Analytics.Advanced
Assembly:  Novacta.Analytics (in Novacta.Analytics.dll) Version: 2.0.0
Syntax
protected virtual void SmoothParameter(
	LinkedList<DoubleMatrix> parameters
)

Parameters

parameters
Type: System.Collections.GenericLinkedListDoubleMatrix
The sampling parameters applied in previous iterations by a SystemPerformanceOptimizer executing in this context.
Exceptions
ExceptionCondition
ArgumentNullExceptionparameters is null.
Remarks

Especially when a sampling parameter consists of probabilities, a SystemPerformanceOptimizer could converge to a wrong solution if such parameter is updated without applying a smoothing scheme, so preventing the probabilities to reach LaTeX equation or LaTeX equation values too quickly, in the early iterations of the program.

Let LaTeX equation the reference parameter exploited in the last iteration, and let LaTeX equation the previous one. By default, this method applies the following smoothing scheme:

LaTeX equation

where LaTeX equation.

Method SmoothParameter is called by OnExecutedIteration(Int32, DoubleMatrix, LinkedListDouble, LinkedListDoubleMatrix).

Examples

In the following example, a new context class is derived from SystemPerformanceOptimizationContext that needs to override method SmoothParameter(LinkedListDoubleMatrix).

Overriding method SmoothParameter
class DerivedContext : SystemPerformanceOptimizationContext
{
    public override void SmoothParameter(
        LinkedList<DoubleMatrix> parameters)
    {
        Console.WriteLine("In SmoothParameter.");

        double alpha = .7;

        if (parameters.Count > 1)
        {
            DoubleMatrix currentParameter = parameters.Last.Value;
            DoubleMatrix previousParameter = parameters.Last.Previous.Value;

            parameters.RemoveLast();
            parameters.AddLast(
                alpha * currentParameter + (1.0 - alpha) * previousParameter);
        }
    }

    // Additional code here. 
}
See Also