org.simulator.math
Class QualityMeasure

java.lang.Object
  extended by org.simulator.math.QualityMeasure
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
N_Metric, PearsonCorrelation, Relative_N_Metric

public abstract class QualityMeasure
extends Object
implements Serializable

This class is the basis of various implementations of distance functions.

Since:
1.0
Version:
$Rev: 391 $
Author:
Roland Keller, Andreas Dräger
See Also:
Serialized Form

Field Summary
protected  double defaultValue
          The return value of the distance function in cases where the distance cannot be computed.
protected  MeanFunction meanFunction
           
 
Constructor Summary
QualityMeasure()
          Default constructor.
QualityMeasure(double defaultValue)
          Constructor, which allows setting the parameter value for default value.
QualityMeasure(double defaultValue, MeanFunction meanFunction)
          Constructor, which allows setting the parameter values for meanFunction and defaultValue.
 
Method Summary
 double distance(MultiTable.Block.Column x, MultiTable.Block.Column y)
          Returns the distance of the two vectors x and y where the currently set root is used.
abstract  double distance(MultiTable.Block.Column x, MultiTable.Block.Column y, double defaultValue)
          Returns the distance of the two vectors x and y with the given root.
 double distance(MultiTable.Block x, MultiTable.Block expected)
           
 double distance(MultiTable x, MultiTable expected)
           
 ArrayList<Double> getColumnDistances(MultiTable.Block x, MultiTable.Block expected)
          Computes the distance of two matrices as the sum of the distances of each row.
 double getDefaultValue()
          Returns the default value that is returned by the distance function in cases in which the computation of the distance is not possible.
 MeanFunction getMeanFunction()
           
 void setDefaultValue(double defaultValue)
          Set the value to be returned by the distance function in cases, in which no distance can be computed.
 void setMeanFunction(MeanFunction meanFunction)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultValue

protected double defaultValue
The return value of the distance function in cases where the distance cannot be computed.


meanFunction

protected MeanFunction meanFunction
Constructor Detail

QualityMeasure

public QualityMeasure()
Default constructor. This sets the standard value for the parameter as given by the getStandardParameter() method. The default value is set to NaN.


QualityMeasure

public QualityMeasure(double defaultValue)
Constructor, which allows setting the parameter value for default value.

Parameters:
defaultValue -

QualityMeasure

public QualityMeasure(double defaultValue,
                      MeanFunction meanFunction)
Constructor, which allows setting the parameter values for meanFunction and defaultValue.

Parameters:
defaultValue -
meanFunction -
Method Detail

distance

public double distance(MultiTable.Block.Column x,
                       MultiTable.Block.Column y)
Returns the distance of the two vectors x and y where the currently set root is used. It is possible that one matrix contains more columns than the other one. If so, the additional values in the bigger matrix are ignored and do not contribute to the distance. NaN values do also not contribute to the distance.

Parameters:
x -
y -
Returns:
distance the distance between the two vectors
Throws:
IllegalArgumentException

distance

public abstract double distance(MultiTable.Block.Column x,
                                MultiTable.Block.Column y,
                                double defaultValue)
Returns the distance of the two vectors x and y with the given root. This may be the root in a formal way or a default value to be returned if the distance uses a non defined operation. If one array is longer than the other one additional values do not contribute to the distance. Double.NaN values are also ignored.

Parameters:
x - an array
y - another array
defaultValue - The value to be returned in cases in which no distance computation is possible.
Returns:
The distance between the two arrays x and y.
Throws:
IllegalArgumentException

distance

public double distance(MultiTable x,
                       MultiTable expected)
Parameters:
x -
expected -
Returns:
distance the distance between the two tables

distance

public double distance(MultiTable.Block x,
                       MultiTable.Block expected)
Parameters:
x -
expected -
Returns:
distance the distance between the two blocks

getColumnDistances

public ArrayList<Double> getColumnDistances(MultiTable.Block x,
                                            MultiTable.Block expected)
Computes the distance of two matrices as the sum of the distances of each row. It is possible that one matrix contains more columns than the other one. If so, the additional values in the bigger matrix are ignored and do not contribute to the distance. Double.NaN values do also not contribute to the distance. Only columns with matching identifiers are considered for the distance computation.

Parameters:
x -
expected -
Returns:
columnDistances the list of distances for the columns in the blocks

getDefaultValue

public double getDefaultValue()
Returns the default value that is returned by the distance function in cases in which the computation of the distance is not possible.

Returns:
defaultValue

getMeanFunction

public final MeanFunction getMeanFunction()
Returns:
the meanFunction

setDefaultValue

public void setDefaultValue(double defaultValue)
Set the value to be returned by the distance function in cases, in which no distance can be computed.

Parameters:
defaultValue -

setMeanFunction

public final void setMeanFunction(MeanFunction meanFunction)
Parameters:
meanFunction - the meanFunction to set

Generated at April 19 2013
Version 1.3 Revision 424