Click or drag to resize

CrossEntropyProgram Class

Provides the abstract base class for algorithms implementing the Cross-Entropy method.
Inheritance Hierarchy

Namespace:  Novacta.Analytics.Advanced
Assembly:  Novacta.Analytics (in Novacta.Analytics.dll) Version: 2.0.0
Syntax
public abstract class CrossEntropyProgram

The CrossEntropyProgram type exposes the following members.

Constructors
  NameDescription
Protected methodCrossEntropyProgram
Initializes a new instance of the CrossEntropyProgram class
Top
Properties
  NameDescription
Public propertyPerformanceEvaluationParallelOptions
Gets or sets options that configure the operation of the Parallel class while computing performance evaluations.
Public propertySampleGenerationParallelOptions
Gets or sets options that configure the operation of the Parallel class while generating sample points.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodEvaluatePerformances
Evaluates the performance of the points in the sample drawn in the current iteration.
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodRun
Runs this Cross-Entropy program in the specified context.
Protected methodSample
Draws a sample having the specified size from a distribution defined in the given context and characterized by the designated parameter.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks

Instances of the CrossEntropyProgram class represents algorithms based upon the Cross-Entropy method[1] , useful to analyze the performance of complex systems under extreme conditions. For example, a Cross-Entropy program can be implemented to estimate the probability that the system will perform extremely well, or to determine what state of the system corresponds to a minimal performance.

The Cross-Entropy method raises in the context of rare event probability estimation, but it is also closely related to the optimization of continuous or discrete functions. In fact, optimizing a function can be seen as the problem of estimating the probability of the event represented by the function assuming a value over a given extreme level, an event that can be typically interpreted as rare. A CrossEntropyProgram can thus be designed to solve optimization or estimation problems, provided that such problems can be defined in terms of performance excesses over an exceptionally high or low level.

The Cross-Entropy method

The Cross-Entropy method iteratively executes two main steps.

Sampling step

The first one, the sampling step, is responsible for generating diverse candidate states of the system. In this step, states are interpreted as points of a sample drawn from a parametric statistical distribution, whose definition depends upon the problem under study.

Updating step

The updating step aims to modify the distribution from which the samples will be obtained in the next iteration, in order to improve the probability of sampling relevant states, i.e. those states corresponding to the performance excesses of interest. Let us represent the sampled states in the current iteration as LaTeX equation, where LaTeX equation is the sample size. The corresponding performances, LaTeX equation, are computed and sorted in increasing order, say obtaining the following ordering:

LaTeX equation

In this way, the states which guarantee the highest performances can be identified as those whose performances occupy the last positions in the ordering.

The updating step relies on the concept of elite sample points. Depending on the excesses being defined over a high or a low level, they can be outlined differently as follows. If the problem under study is defined in terms of performance excesses over an exceptionally high level, the Cross-Entropy method refers to the sample points whose performances occupy the last positions in the ordering as the elite sample points; otherwise, the elite points will be those whose performances occupy the first positions.

A way to define them exactly is as follows. Let LaTeX equation be the sampled state such that LaTeX equation, LaTeX equation, and consider a constant, referred to as the rarity of the program, say LaTeX equation, usually set to a value in the interval LaTeX equation.

If the elite points refer to the highest performances, then the points LaTeX equation occupying a position greater than or equal to LaTeX equation are defined as elite ones, with LaTeX equation being the ceiling function. In this case, the current iteration is said to reach a performance level equal to LaTeX equation.

If the elite points refer to the lowest performances, then they can be defined as those points occupying a position less than or equal to LaTeX equation, where LaTeX equation is the floor function. Such points are thus LaTeX equation, and the current iteration will reach a performance level equal to LaTeX equation.

Once that the elite states have been identified, the joint distribution from which the states will be sampled in the next iteration is updated by estimating its parameters using the elite states only. Since they correspond to the performance excesses of interest, this updating mechanism guarantees that states having relevant performances will be included in subsequent samples with greater probabilities.

Executing a Cross-Entropy program

Class CrossEntropyProgram follows the Template Method pattern[2] by defining in an operation the structure of a Cross-Entropy algorithm. Run is the template method, in which the invariant parts of a Cross-Entropy program are implemented once. The behaviors that can vary are deferred to a CrossEntropyContext object, which is passed as a parameter to the template method.

Methods EvaluatePerformances and Sample can execute their tasks both sequentially and concurrently. You can control their activities by setting properties PerformanceEvaluationParallelOptions and SampleGenerationParallelOptions, respectively. By default, the number of concurrently running operations is unlimited.

Specialized Cross-Entropy programs

It is possible to apply the Cross-Entropy method by exploiting a CrossEntropyProgram instance and deriving directly from class CrossEntropyContext to define the context of interest. However, it is recommended to execute the specialized programs represented by SystemPerformanceOptimizer instances when addressing combinatorial and multi-extremal optimization problems, or by RareEventProbabilityEstimator ones if the estimation of rare event probabilities is required. These programs have corresponding specialized contexts, SystemPerformanceOptimizationContext and RareEventProbabilityEstimationContext respectively, from which one can derive to define the problem under study.

Bibliography
[1] Rubinstein, R.Y. and Kroese, D.P., The Cross-Entropy Method, A unified Approach to Combinatorial Optimization, Monte-Carlo Simulation, and Machine Learning, Springer, New York. (2004)
[2] Gamma, E., Helm, R., Johnson, R. and Vlissides, J., Design Patterns, Elements of Reusable Object-Oriented Software, Addison-Wesley, Reading, MA. (1995)
See Also