WebCab Optimization
v2.6
(J2EE Edition)

com.webcab.ejb.math.optimization.sensitivityanalysis
Interface SensitivityAnalysis

All Superinterfaces:
EJBObject, Remote

public interface SensitivityAnalysis
extends EJBObject

Within this Enterprise JavaBean we implement methods by which the Sensitivity Grid of an optimization problem can be evaluated. A Sensitivity Grid's purpose is to show how the extremum found by a given optimization procedure for a given problem varies under changes of the object function, the domain over which the solution is sort and any additional optimization algorithm parameters such as tolerance and number of iterations.

That is, this Enterprise JavaBean constructs the sensitivity grid for the (solution valued) function defined with respect to an optimization problem and the associated optimization solution procedure. Generally speaking this (solution valued) function f will have n variables relating to the optimization problem and the solution procedure used. For a given set of parameters the (solution valued) function will return the solution found by the given optimization algorithm and optimization problem defined by the given parameter values. The sensitivity grid itself contains the evaluation of the (solution valued) function at an initial point and at other points where at most two of the parameters are shifted by a given amount. Such analysis allows us to build up a picture of how sensitive the optimization problem's solution is to changes of the problem itself and/or the algorithm used to solve this problem.

The solution valued function

The solution valued function by definition is the value of the extremum of the given optimization problem found by the chosen algorithm. This function has another condition that it depends on n variables, that is, rather than just an arbitrary abstract function which maps one set onto another, the function is `constructed' from a process which is determined from the given variables. It is the constructive nature of the function which allows us to analyze its sensitivity with regard to shifts of these parameters.

For example, we could consider the sensitivity grid of a linear programming problem which is solved using the Simplex algorithm. In particular, we could consider the sensitivity grid in this instance where we vary two of the coefficients of the linear object function in order to study the sensitivity of the value of the extremum with regard to these input values. In this case we would need to pass the (solution valued) function which would have the following parameters:

The value at a given point (i.e. for a given object function and systems of equalities and inequalities) is just the value of the extreme found by the Simplex algorithm for this particular linear optimization problem. We would then shift (or perturb) these two coefficients of the linear object function by a given amount in order to populate the sensitivity grid.


Method Summary
 double[][] evaluateGrid(FunctionDelivery deliveryOfSensitivityAnalysisFunction, int noShiftsOfFirst, int noShiftsOfSecond, int middleIndexOfFirst, int middleIndexOfSecond, int firstSelectedIndex, int secondSelectedIndex, double percentageShiftOfFirst, double percentageShiftOfSecond, double[] initialParameters)
          This method returns a double array which corresponds to the entries within the sensitivity grid of the given optimization problem as describe by the (solution valued) function (see SensitivityAnalysis for further explanation of the definition and use of the (solution values) function).
 double scenarioAnalysis(FunctionDelivery deliveryOfSensitivityAnalysisFunction, double[] percentageShifts, double[] initialParameters)
          Here you are able to perform sensitivity analysis of the given optimization problem which is described by the (solution valued) function (see SensitivityAnalysis for further explanation of the notion of the (solution valued) function).
 
Methods inherited from interface javax.ejb.EJBObject
getEJBHome, getHandle, getPrimaryKey, isIdentical, remove
 

Method Detail

evaluateGrid

public double[][] evaluateGrid(FunctionDelivery deliveryOfSensitivityAnalysisFunction,
                               int noShiftsOfFirst,
                               int noShiftsOfSecond,
                               int middleIndexOfFirst,
                               int middleIndexOfSecond,
                               int firstSelectedIndex,
                               int secondSelectedIndex,
                               double percentageShiftOfFirst,
                               double percentageShiftOfSecond,
                               double[] initialParameters)
                        throws FunctionDeliveryException,
                               RemoteException
This method returns a double array which corresponds to the entries within the sensitivity grid of the given optimization problem as describe by the (solution valued) function (see SensitivityAnalysis for further explanation of the definition and use of the (solution values) function). Recall, that the sensitivity grid includes re-evaluations of the (solution valued) function with one or two of the parameters which describe the optimization problem and the associated algorithm shifted. For further details concerning the motivation and use of the sensitivity grid we refer the reader to the accompanying PDF documentation of this product.

Using this method

Say we wish to consider the sensitivity grid of the (solution valued) function of a given optimization problem (for example, linear programming) which is solved using a given optimization algorithm (for example, Simplex algorithm). To perform sensitivity analysis using the sensitivity grid approach we will need to perform the following:

  1. Passing the (solution valued) function: From our choice of optimization algorithm the (solution valued) function will be determined since the optimization problem has already been set. This (solution valued) function will need to be passed to the Sensitivity Grid Enterprise JavaBean.
  2. Selecting the parameters to shift: The sensitivity grid will shift two of the underlying parameters which the (solution valued) function depends. Therefore, you will need to select which two underlying variables you wish to shift.
  3. Size and number of shifts: Once you have selected which particular parameters you wish to shift you will next need to decide the number of shifts considered and the size of each shift. A popular choice could be shifting each of the variables up and down by 1 and 2 percent. This would result in each parameter taking one of five values and the total number of re-evaluations of the (solution valued) function being twenty-five. Therefore, the computational demands in this case of evaluating the sensitivity grid is precisely twenty-five times the demands of solving the optimization problem using the given algorithm once (or equivalently evaluating the (solution valued) function once).

Remark: The selection of the particular parameters to shift and the size and number of these shifts should be made with the particular business problem in mind. For example, your application may suggest certain appropriate combinations of parameters and shift sizes for which the (solution valued) functions sensitivity grid will display valuable qualitative information. On the other hand you may wish to investigate a particular phenomenon which has been hypothesized, in which case your choices will be reflected by the given problem at hand. Even if you do not have any a-priori idea as to what particular shifts to consider, by repeatedly applying the sensitivity grid approach you will be able to build up an intuition as to what shifts are most appropriate for which optimization problems and for which particular issues you are addressing.

Description of the Parameters and other practical issues

The dimensions of the sensitivity grid is noShiftsOfFirst by noShiftsOfSecond, where the noShiftsOfFirst is the number of shifts of the first selected variable and noShiftsOfSecond is the number of shifts of the second selected variable. The variables of the given (solution valued) function which are shifted are selected by the integer parameters firstSelectedIndex, secondSelectedIndex which correspond to the index of the parameters of the (solution valued) function. Please note that the indexing of these parameters starts from 0.

Note that the noShiftsOfFirst represents the `height' of the sensitivity grid and noShiftsOfSecond represents the `width' of the sensitivity grid, with respect to the returned 2 dimensional double array (or grid). When constructing the sensitivity grid it is necessary to assign a `middle cell' which corresponds to the initialPoint, for which the function under consideration takes some default parameter values. At the initialPoint the function is evaluated before the parameters are shifted from these given default values after which the function is re-evaluated is order to populate the rest of the sensitivity grid.

The returned sensitivity grid has the property that for a given `row' only the second selected variable is varied, where as for a given `column' of the sensitivity grid only the first selected variable is varied. Since we are using percentages to describe to size of the shifts of a selected variables these shifts are proportional to the absolute values of the two selected parameters at the initialPoint. That is, the size of each of the shifts in the first selected variable is firstSelectedShift := percentageShiftOfFirst * abs(initialPoint[firstSelectedIndex]), and correspondingly the size of each of the shifts in the second selected variable is secondSelectedShift := percentageShiftOfSecond * abs(initialPoint[secondSelectedIndex]), where abs is the absolute value. Therefore, if the function under consideration is denoted by f, and x0 denotes the initial `middle' point, denoted by initialPoint, then the `(i,j)th' cell of the sensitivity grid is given by:

f(x0[0], x0[1], ... ,x0[firstSelectedIndex] + (i - middleIndexOfFirst) firstSelectedShift, ... ,x0[secondSelectedIndex] + (j - middleIndexOfSecond) * secondSelectedShift, ..., x0[n]).

Parameters:
noShiftsOfFirst - The number of shifts (or perturbations) of the first variable selected which are considered within the sensitivity grid. This parameter also corresponds to the `height' of the sensitivity grid given by the returned 2 dimensional double array.
noShiftsOfSecond - The number of shifts (or perturbations) of the second variable selected which are considered within the sensitivity grid. This parameter also corresponds to the `width' of the sensitivity grid given by the returned 2 dimensional double array.
middleIndexOfFirst - The first coordinate of the grid cell which will contain the evaluation at the initialPoint. Note that the indexing begins with 0.
middleIndexOfSecond - The second coordinate of the grid cell which will contain the evaluation at the initialPoint. Note that the indexing begins with 0.
firstSelectedIndex - The index (beginning with 0) of the first variable selected of the given function which will be shifted.
secondSelectedIndex - The index (beginning with 0) of the second variable selected of the given function which will be shifted.
percentageShiftOfFirst - the amount as a percentage (i.e. 1 = 1 percent) of the initial given value of the first selected parameter (that is, the value of the first selected parameter at the point initialPoint) which is shifted between each `column' of the sensitivity grid. The size of each of these shifts in absolute terms is given by percentageShiftOfFirst * abs(initialPoint[firstSelectedIndex]) / 100.
percentageShiftOfSecond - the amount as a percentage (i.e. 1 = 1 percent) of the initial given value of the second selected parameter (that is, the value of the second selected parameter at the point initialPoint) which is shifted between each `row' of the sensitivity grid. The size of each of these shifts in absolute terms is given by percentageShiftOfSecond * abs(initialPoint[secondSelectedIndex]) / 100.
initialParameters - an array which provides the initial given values of the parameters which the evaluation procedure of the optimization problem and the problem itself are determined. These parameters will depends in the construction of the optimization procedure,t he object function and the boundary conditions. Please note that depending on the definition of the (solution valued) function the parameters of this function could in principle be the parameters of the procedure by which the object function or boundaries are constructed.
Returns:
a 2 dimensional double array representing the sensitivity grid of dimensions noShiftsOfFirst by noShiftsOfSecond.
FunctionDeliveryException
RemoteException

scenarioAnalysis

public double scenarioAnalysis(FunctionDelivery deliveryOfSensitivityAnalysisFunction,
                               double[] percentageShifts,
                               double[] initialParameters)
                        throws FunctionDeliveryException,
                               RemoteException
Here you are able to perform sensitivity analysis of the given optimization problem which is described by the (solution valued) function (see SensitivityAnalysis for further explanation of the notion of the (solution valued) function). For further details concerning the motivation for using the sensitivity analysis we refer the reader to the accompanying PDF documentation of this product.

Using this method

Say we wish to perform scenario analysis using the (solution valued) function of a given optimization problem (for example, linear programming) which is solved using a given optimization algorithm (for example, Simplex algorithm). To perform scenario analysis using the sensitivity grid approach we will need to perform the following:

  1. Passing the (solution valued) function: From our choice of optimization algorithm the (solution valued) function will be determined since the optimization problem has already been set. This (solution valued) function will need to be passed to the Sensitivity Grid Enterprise JavaBean.
  2. Selecting the size of the parameter shifts: Scenario analysis involves shifting possibly all of the parameters of the (solution values) function in order to investigate how the solution is effected by such shifts. Therefore, we will need to decide which parameters to shift and the size (as a percentage of the initial value) of these shifts.

Remark: The selection of the particular parameters to shift and the size these shifts should be made with the particular business problem in mind. For example, your application may suggest certain appropriate combinations of parameters and shift sizes for which the (solution valued) functions will display valuable qualitative information. On the other hand you may wish to investigate a particular phenomenon which has been hypothesized, in which case your choices will be reflected by the given problem at hand. Even if you do not have any a-priori idea as to what particular shifts to consider, by repeatedly applying the scenario analysis approach you will be able to build up an intuition as to what shifts are most appropriate for which optimization problems and for which particular issues you are addressing.

Parameters:
percentageShifts - the array representing the percentage changes of the parameters. The first value of the array is the percentage change of the first parameter from its initial value, the second term is the percentage changes of the second term and so on. Please note that here we use the convention that 1 percent = 1.
initialParameters - an array which provides the initial given values of the parameters which the evaluation procedure of the optimization problem and the problem itself are determined. These parameters will depends in the construction of the optimization procedure,t he object function and the boundary conditions. Please note that depending on the definition of the (solution valued) function the parameters of this function could in principle be the parameters of the procedure by which the object function or boundaries are constructed.
FunctionDeliveryException
RemoteException

WebCab Optimization
v2.6
(J2EE Edition)