model
Class DifferentiableCorrelationFunction

java.lang.Object
  extended by model.BasicCorrelationFunction
      extended by model.DifferentiableCorrelationFunction
All Implemented Interfaces:
VariableInputDimension
Direct Known Subclasses:
SECorrelationFunction

public abstract class DifferentiableCorrelationFunction
extends BasicCorrelationFunction

A correlation function which is differentiable w.r.t its length-scale parameters. There are as many length-scale parameters as the dimensionality of the underlying space.

Author:
dgorur

Nested Class Summary
 
Nested classes/interfaces inherited from class model.BasicCorrelationFunction
BasicCorrelationFunction.TYPE
 
Field Summary
protected  double[] gradient
           
 
Fields inherited from class model.BasicCorrelationFunction
tauVec
 
Constructor Summary
DifferentiableCorrelationFunction()
           
 
Method Summary
static DifferentiableCorrelationFunction getInstance(BasicCorrelationFunction.TYPE type, int inputDimension)
          Returns a instance of a DifferentiableCorrelationFunction of the given type, in the given number of dimensions.
 double[] gradient(cern.colt.matrix.DoubleMatrix1D x1, cern.colt.matrix.DoubleMatrix1D x2)
          Computes the gradient of the correlation between the outputs at x1, x2, at the current value of the length-scale parameters.
abstract  void gradient(cern.colt.matrix.DoubleMatrix1D x1, cern.colt.matrix.DoubleMatrix1D x2, double[] g)
          The same as gradient(DoubleMatrix1D, DoubleMatrix1D), but places the result in the supplied array.
 cern.colt.matrix.DoubleMatrix1D gradient(cern.colt.matrix.DoubleMatrix1D x1, cern.colt.matrix.DoubleMatrix1D x2, cern.colt.matrix.DoubleMatrix1D gVec)
          The same as gradient(DoubleMatrix1D, DoubleMatrix1D), but places the result in the supplied vector.
 cern.colt.matrix.DoubleMatrix2D gradient(cern.colt.matrix.DoubleMatrix1D x1, cern.colt.matrix.DoubleMatrix2D x2, cern.colt.matrix.DoubleMatrix2D gMat)
          Computes the gradient of correlations between output at x1 and those at the matrix x2, at the current value of length-scale parameters, and places the result in the supplied matrix.
 cern.colt.matrix.DoubleMatrix3D gradient(cern.colt.matrix.DoubleMatrix2D x1, cern.colt.matrix.DoubleMatrix2D x2, cern.colt.matrix.DoubleMatrix3D gMat)
          Similar to gradient(DoubleMatrix1D, DoubleMatrix2D, DoubleMatrix2D), but between two sets of points.
 void setInputDimension(int inputDimension)
          Sets the input dimension.
 
Methods inherited from class model.BasicCorrelationFunction
apply, apply, apply, apply, apply, getInputDimension, getInstance, getTau, setTau
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gradient

protected double[] gradient
Constructor Detail

DifferentiableCorrelationFunction

public DifferentiableCorrelationFunction()
Method Detail

getInstance

public static DifferentiableCorrelationFunction getInstance(BasicCorrelationFunction.TYPE type,
                                                            int inputDimension)
Returns a instance of a DifferentiableCorrelationFunction of the given type, in the given number of dimensions.

Add types other than SE!

Parameters:
type - the given BasicCorrelationFunction.TYPE of correlation function.
inputDimension - the number of dimensions of the underlying x-space.
Returns:
an instance of the given type of correlation function.

gradient

public double[] gradient(cern.colt.matrix.DoubleMatrix1D x1,
                         cern.colt.matrix.DoubleMatrix1D x2)
Computes the gradient of the correlation between the outputs at x1, x2, at the current value of the length-scale parameters.

Parameters:
x1 - the first point.
x2 - the second point.
Returns:
the gradient of corr(x1, x2) at the current value of length-scale parameters.

gradient

public abstract void gradient(cern.colt.matrix.DoubleMatrix1D x1,
                              cern.colt.matrix.DoubleMatrix1D x2,
                              double[] g)
The same as gradient(DoubleMatrix1D, DoubleMatrix1D), but places the result in the supplied array.

Parameters:
x1 - the first point.
x2 - the second point.
g - array to hold the result.

gradient

public cern.colt.matrix.DoubleMatrix1D gradient(cern.colt.matrix.DoubleMatrix1D x1,
                                                cern.colt.matrix.DoubleMatrix1D x2,
                                                cern.colt.matrix.DoubleMatrix1D gVec)
The same as gradient(DoubleMatrix1D, DoubleMatrix1D), but places the result in the supplied vector.

Parameters:
x1 - the first point.
x2 - the second point.
gVec - vector to hold the result.
Returns:
the result vector, for convenience.

gradient

public cern.colt.matrix.DoubleMatrix2D gradient(cern.colt.matrix.DoubleMatrix1D x1,
                                                cern.colt.matrix.DoubleMatrix2D x2,
                                                cern.colt.matrix.DoubleMatrix2D gMat)
Computes the gradient of correlations between output at x1 and those at the matrix x2, at the current value of length-scale parameters, and places the result in the supplied matrix. Results are row-wise: each row is a gradient.

Parameters:
x1 - a point.
x2 - matrix containing a set of points.
gMat - matrix to hold the gradient of corr(x1, x2).
Returns:
the result matrix for convenience.

gradient

public cern.colt.matrix.DoubleMatrix3D gradient(cern.colt.matrix.DoubleMatrix2D x1,
                                                cern.colt.matrix.DoubleMatrix2D x2,
                                                cern.colt.matrix.DoubleMatrix3D gMat)
Similar to gradient(DoubleMatrix1D, DoubleMatrix2D, DoubleMatrix2D), but between two sets of points. Results are slice-wise: each slice (dimension 3) of the 3-D array is a gradient.

Parameters:
x1 - a set of points.
x2 - another set of points.
gMat - a DoubleMatrix3D to hold the gradient results.
Returns:
the result matrix for convenience.

setInputDimension

public void setInputDimension(int inputDimension)
Description copied from class: BasicCorrelationFunction
Sets the input dimension.

Specified by:
setInputDimension in interface VariableInputDimension
Overrides:
setInputDimension in class BasicCorrelationFunction
Parameters:
inputDimension - the given input dimension.