SystemPerformanceOptimizationContextSmoothParameter Method |
Namespace: Novacta.Analytics.Advanced
Exception | Condition |
---|---|
ArgumentNullException | parameters is null. |
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 or values too quickly, in the early iterations of the program.
Let the reference parameter
exploited in the last iteration,
and let the previous one.
By default, this method
applies the following smoothing scheme:
where .
Method SmoothParameter is called by OnExecutedIteration(Int32, DoubleMatrix, LinkedListDouble, LinkedListDoubleMatrix).
In the following example, a new context class is derived from SystemPerformanceOptimizationContext that needs to override method SmoothParameter(LinkedListDoubleMatrix).
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. }