model
Class GPRegression

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

public class GPRegression
extends BasicApproxModel

Creation process: Set tau (compulsory), set prior mean and covariance, set bounds, init().

Author:
dgorur

Nested Class Summary
static class GPRegression.STATE
          Encodes the state of the GP.
 
Field Summary
static double STD_DEVS_OUT
           
 
Fields inherited from class function.BasicScalarFunction
DEFAULT_BOUNDS, DEFAULT_DIM, VALUE_OUTSIDE_BOUNDS
 
Constructor Summary
GPRegression()
           
 
Method Summary
 void calibrate()
          Maximizes log marginal likelihood of the data.
 void calibrateOptional()
          Optional calibration, based on some measure of calibration being required.
 void clear()
          Notification that all data has been removed.
 double computeLOOError()
          Computes the RMS Leave-One-Out error.
 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.
 double getCalibrationThreshold()
          Returns the calibrationThreshold.
 double getConsistencyThreshold()
          Returns the threshold at which points are considered inconsistent.
 DifferentiableCorrelationFunction getCorrelationFunction()
          Returns the correlation function.
 BasicCorrelationFunction.TYPE getCorrelationFunctionType()
          Returns the correlation function type.
 java.util.HashSet<DataPoint> getInconsistentData()
          Returns the set of inconsistent data.
 CholeskyFactor getL()
          Returns the l.
 double getMaxUncertainty()
           
 double getPriorMean()
          Returns the prior mean.
 double getPriorVariance()
          Returns the prior variance.
 java.util.HashSet<DataPoint> getRedundantData()
          Returns the set of redundant data.
 GPRegression.STATE getState()
          Returns the state.
 double[] getTau()
          Returns the length-scale parameters, tau.
 double[] getTauMax()
          Returns the upper bound on length-scale parameters.
 double[] getTauMin()
          Returns the lower bound on length-scale parameters.
 cern.colt.matrix.DoubleMatrix2D getX()
          Returns the x.
 void init()
          Initialization method.
 boolean isCalibrated()
          Returns true if calibrated.
 boolean isInitialized()
          Returns true if init() routine has been invoked.
static void main(java.lang.String[] args)
           
protected  ScalarFunction makeUncertaintyEstimator()
           
 double quickCompute(double[] x)
          Compute method without dimension checking.
 void quickCompute(cern.colt.matrix.DoubleMatrix2D mat, cern.colt.matrix.DoubleMatrix1D outputs)
          Compute method without dimension checking, operating on DoubleMatrix2D and exploiting optimized operations therein.
 void setBounds(Hypercube bounds)
          Sets the bounds for this ScalarFunction.
 void setCalibrationThreshold(double calibrationThreshold)
          Sets the calibrationThreshold.
 void setConsistencyThreshold(double consistencyThreshold)
          Sets the consistency threshold.
 void setCorrelationFunctionType(BasicCorrelationFunction.TYPE correlationFunctionType)
          Sets the correlation function type.
 void setPriorMean(double priorMean)
          Sets the prior mean.
 void setPriorVariance(double priorVariance)
          Sets the prior variance.
 void setTau(double[] tau)
          Sets the length-scale parameters.
 void setTauMax(double[] tauMax)
          Sets the upper bound on length-scale parameters..
 void setTauMin(double[] tauMin)
          Sets the lower bound on length-scale parameters.
 
Methods inherited from class model.BasicApproxModel
getOutputNumber, getUncertaintyEstimator, setOutputNumber, setUncertaintyEstimator
 
Methods inherited from class function.VariableDomainScalarFunction
getBounds, getInputDimension, setInputDimension
 
Methods inherited from class function.BasicScalarFunction
checkDimensions, compute, compute, compute, compute, compute, compute, getOutputDimension, isWithinBounds, makeBounds
 
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
 
Methods inherited from interface function.Computable
compute, compute, getBounds, getInputDimension, getOutputDimension, isWithinBounds
 
Methods inherited from interface function.VariableInputDimension
setInputDimension
 

Field Detail

STD_DEVS_OUT

public static final double STD_DEVS_OUT
Constructor Detail

GPRegression

public GPRegression()
Method Detail

main

public static void main(java.lang.String[] args)

calibrate

public void calibrate()
Maximizes log marginal likelihood of the data. See Rasmussen and Williams, Ch. 5.


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.


computeLOOError

public double computeLOOError()
Computes the RMS Leave-One-Out error.

Returns:
RMS LOO error.

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.

getCalibrationThreshold

public double getCalibrationThreshold()
Returns the calibrationThreshold.

Returns:
the calibrationThreshold.

getConsistencyThreshold

public double getConsistencyThreshold()
Returns the threshold at which points are considered inconsistent.

Returns:
the consistencyThreshold.

getCorrelationFunction

public DifferentiableCorrelationFunction getCorrelationFunction()
Returns the correlation function.

Returns:
the correlation function.

getCorrelationFunctionType

public BasicCorrelationFunction.TYPE getCorrelationFunctionType()
Returns the correlation function type.

Returns:
the correlation function type.

getInconsistentData

public java.util.HashSet<DataPoint> getInconsistentData()
Returns the set of inconsistent data.

Returns:
the set of inconsistent data.

getL

public CholeskyFactor getL()
Returns the l.

Returns:
the l.

getMaxUncertainty

public double getMaxUncertainty()

getPriorMean

public double getPriorMean()
Returns the prior mean.

Returns:
the prior mean.

getPriorVariance

public double getPriorVariance()
Returns the prior variance.

Returns:
the prior variance.

getRedundantData

public java.util.HashSet<DataPoint> getRedundantData()
Returns the set of redundant data.

Returns:
the set of redundant data.

getState

public GPRegression.STATE getState()
Returns the state.

Returns:
the state.

getTau

public double[] getTau()
Returns the length-scale parameters, tau.

Returns:
the tau.

getTauMax

public double[] getTauMax()
Returns the upper bound on length-scale parameters.

Returns:
the upper bound on length-scale parameters.

getTauMin

public double[] getTauMin()
Returns the lower bound on length-scale parameters.

Returns:
the lower bound on length-scale parameters.

getX

public cern.colt.matrix.DoubleMatrix2D getX()
Returns the x.

Returns:
the x.

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

isCalibrated

public boolean isCalibrated()
Returns true if calibrated.

Returns:
true if calibrated.

isInitialized

public boolean isInitialized()
Returns true if init() routine has been invoked.

Returns:
true if initialized.

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.

quickCompute

public void quickCompute(cern.colt.matrix.DoubleMatrix2D mat,
                         cern.colt.matrix.DoubleMatrix1D outputs)
Description copied from class: BasicScalarFunction
Compute method without dimension checking, operating on DoubleMatrix2D and exploiting optimized operations therein.

Specified by:
quickCompute in interface ScalarFunction
Overrides:
quickCompute in class BasicScalarFunction
Parameters:
mat - given matrix of inputs.
outputs - vector to store the result.

setBounds

public void setBounds(Hypercube bounds)
Description copied from interface: VariableBounds
Sets the bounds for this ScalarFunction.

Specified by:
setBounds in interface VariableBounds
Overrides:
setBounds in class VariableDomainScalarFunction
Parameters:
bounds - the given bounds.

setCalibrationThreshold

public void setCalibrationThreshold(double calibrationThreshold)
Sets the calibrationThreshold.

Parameters:
calibrationThreshold - the given calibrationThreshold.

setConsistencyThreshold

public void setConsistencyThreshold(double consistencyThreshold)
Sets the consistency threshold.

Parameters:
consistencyThreshold - the given consistency threshold.

setCorrelationFunctionType

public void setCorrelationFunctionType(BasicCorrelationFunction.TYPE correlationFunctionType)
Sets the correlation function type.

Parameters:
correlationFunctionType - the given correlation function type.

setPriorMean

public void setPriorMean(double priorMean)
Sets the prior mean.

Parameters:
priorMean - the given prior mean.

setPriorVariance

public void setPriorVariance(double priorVariance)
Sets the prior variance.

Parameters:
priorVariance - the given prior variance.

setTau

public void setTau(double[] tau)
Sets the length-scale parameters.

Parameters:
tau - the given length-scale parameters.

setTauMax

public void setTauMax(double[] tauMax)
Sets the upper bound on length-scale parameters..

Parameters:
tauMax - the given upper bound on length-scale parameters.

setTauMin

public void setTauMin(double[] tauMin)
Sets the lower bound on length-scale parameters.

Parameters:
tauMin - the given lower bound on length-scale parameters.

makeUncertaintyEstimator

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