model
Class PenaltyFunctionModel

java.lang.Object
  extended by function.BasicScalarFunction
      extended by function.VariableDomainScalarFunction
          extended by model.BasicApproxModel
              extended by model.PenaltyFunctionModel
All Implemented Interfaces:
DataListener, Computable, ScalarFunction, VariableBounds, VariableInputDimension, ApproxModel, DataFit

public class PenaltyFunctionModel
extends BasicApproxModel

Computes mean and variance for an external penalty function augmented Lagrangian. Computes first and second moments of the distributions for the constraint violations, then uses those values as the values of a Gaussian. This is basically to find the closest Gaussian to these non-Gaussian posterior distributions over constraint violations. Note: although the posterior over constraint values is Gaussian, the posterior over violations is not Gaussian. Even so, the approximation above is made, then mean and variance for L = f + \rho^T max(0, g) are easy to compute. Read my thesis for the details.

Author:
dgorur

Field Summary
 
Fields inherited from class function.BasicScalarFunction
DEFAULT_BOUNDS, DEFAULT_DIM, VALUE_OUTSIDE_BOUNDS
 
Constructor Summary
PenaltyFunctionModel()
           
 
Method Summary
 void calibrate()
          Calibrates this DataFit.
 void calibrateOptional()
          Optional calibration, based on some measure of calibration being required.
 void clear()
          Notification that all data has been removed.
 int dataAdded(DataBlock block)
          Notification that a DataBlock has been added.
 boolean dataAdded(DataPoint dataPoint)
          Notification that a single DataPoint has been added.
 int dataRemoved(DataBlock dataBlock)
          Notification that a DataBlock has been removed.
 boolean dataRemoved(DataPoint dataPoint)
          Notification that a single DataPoint has been removed.
 VectorFunction getCheapConstraints()
           
 java.util.ArrayList<ApproxModel> getConstraintModels()
           
 cern.colt.matrix.DoubleMatrix1D getConstraintTargets()
          Returns the constraintTargets.
 double getMaxUncertainty()
           
 ApproxModel getObjectiveModel()
           
 cern.colt.matrix.DoubleMatrix1D getPenaltyVector()
           
 void init()
          Initialization method.
protected  ScalarFunction makeUncertaintyEstimator()
           
 double quickCompute(double[] x)
          Compute method without dimension checking.
 void setCheapConstraints(VectorFunction cheapConstraints)
           
 void setConstraintModels(java.util.ArrayList<ApproxModel> constraintModels)
           
 void setConstraintTargets(cern.colt.matrix.DoubleMatrix1D constraintTargets)
          Sets the constraintTargets.
 void setObjectiveModel(ApproxModel objectiveModel)
           
 void setPenaltyVector(cern.colt.matrix.DoubleMatrix1D penaltyVector)
           
 
Methods inherited from class model.BasicApproxModel
getOutputNumber, getUncertaintyEstimator, setOutputNumber, setUncertaintyEstimator
 
Methods inherited from class function.VariableDomainScalarFunction
getBounds, getInputDimension, setBounds, setInputDimension
 
Methods inherited from class function.BasicScalarFunction
checkDimensions, compute, compute, compute, compute, compute, compute, getOutputDimension, isWithinBounds, makeBounds, quickCompute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface function.ScalarFunction
compute, compute, compute, compute, quickCompute
 
Methods inherited from interface function.Computable
compute, compute, getBounds, getInputDimension, getOutputDimension, isWithinBounds
 
Methods inherited from interface function.VariableInputDimension
setInputDimension
 

Constructor Detail

PenaltyFunctionModel

public PenaltyFunctionModel()
Method Detail

calibrate

public void calibrate()
Description copied from interface: DataFit
Calibrates this DataFit.


calibrateOptional

public void calibrateOptional()
Description copied from interface: DataFit
Optional calibration, based on some measure of calibration being required.


clear

public void clear()
Description copied from interface: DataListener
Notification that all data has been removed.


dataAdded

public int dataAdded(DataBlock block)
Description copied from interface: DataListener
Notification that a DataBlock has been added.

Parameters:
block - the DataBlock added.
Returns:
number of points successfully added.

dataAdded

public boolean dataAdded(DataPoint dataPoint)
Description copied from interface: DataListener
Notification that a single DataPoint has been added.

Parameters:
dataPoint - the DataPoint added.
Returns:
true if the DataPoint was successfully added.

dataRemoved

public int dataRemoved(DataBlock dataBlock)
Description copied from interface: DataListener
Notification that a DataBlock has been removed.

Parameters:
dataBlock - the DataBlock removed.
Returns:
the number of DataPoints successfully removed.

dataRemoved

public boolean dataRemoved(DataPoint dataPoint)
Description copied from interface: DataListener
Notification that a single DataPoint has been removed.

Parameters:
dataPoint - the DataPointremoved.
Returns:
true if the DataPoint was successfully removed.

getCheapConstraints

public VectorFunction getCheapConstraints()
Returns:

getConstraintModels

public java.util.ArrayList<ApproxModel> getConstraintModels()
Returns:

getConstraintTargets

public cern.colt.matrix.DoubleMatrix1D getConstraintTargets()
Returns the constraintTargets.

Returns:
the constraintTargets.

getMaxUncertainty

public double getMaxUncertainty()

getObjectiveModel

public ApproxModel getObjectiveModel()
Returns:

getPenaltyVector

public cern.colt.matrix.DoubleMatrix1D getPenaltyVector()
Returns:

init

public void init()
Description copied from class: BasicScalarFunction
Initialization method.

Specified by:
init in interface ScalarFunction
Specified by:
init in interface DataFit
Overrides:
init in class BasicApproxModel

quickCompute

public double quickCompute(double[] x)
Description copied from class: BasicScalarFunction
Compute method without dimension checking. All subclasses must implement this method: it is the core method that defines the function.

Specified by:
quickCompute in interface ScalarFunction
Specified by:
quickCompute in class BasicScalarFunction
Parameters:
x - the given input.
Returns:
the output corresponding to the given input.

setCheapConstraints

public void setCheapConstraints(VectorFunction cheapConstraints)
Parameters:
cheapConstraints -

setConstraintModels

public void setConstraintModels(java.util.ArrayList<ApproxModel> constraintModels)
Parameters:
constraintModels -

setConstraintTargets

public void setConstraintTargets(cern.colt.matrix.DoubleMatrix1D constraintTargets)
Sets the constraintTargets.

Parameters:
constraintTargets - the given constraintTargets.

setObjectiveModel

public void setObjectiveModel(ApproxModel objectiveModel)
Parameters:
objectiveModel -

setPenaltyVector

public void setPenaltyVector(cern.colt.matrix.DoubleMatrix1D penaltyVector)
Parameters:
penaltyVector -

makeUncertaintyEstimator

protected ScalarFunction makeUncertaintyEstimator()
Specified by:
makeUncertaintyEstimator in class BasicApproxModel