de.lmu.ifi.dbs.elki.distance.distancefunction.timeseries

## Class ERPDistanceFunction

• All Implemented Interfaces:
DistanceFunction<NumberVector>, NumberVectorDistanceFunction<NumberVector>, PrimitiveDistanceFunction<NumberVector>

@Title(value="Edit Distance with Real Penalty")
@Reference(authors="L. Chen, R. Ng",
title="On the marriage of Lp-norms and edit distance",
booktitle="Proc. 13th Int. Conf. on Very Large Data Bases (VLDB \'04)",
url="http://www.vldb.org/conf/2004/RS21P2.PDF",
bibkey="DBLP:conf/vldb/ChenN04")
public class ERPDistanceFunction
extends DTWDistanceFunction
Edit Distance With Real Penalty distance for numerical vectors.

Reference:

L. Chen and R. Ng
On the marriage of Lp-norms and edit distance
Proc. 13th Int. Conf. on Very Large Data Bases (VLDB '04)

Since:
0.2
Author:
Thomas Bernecker
• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
static class  ERPDistanceFunction.Parameterizer
Parameterization class.
• ### Field Summary

Fields
Modifier and Type Field and Description
private double g
Gap value.
• ### Fields inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.timeseries.AbstractEditDistanceFunction

bandSize
• ### Constructor Summary

Constructors
Constructor and Description
ERPDistanceFunction(double bandSize, double g)
Constructor.
• ### Method Summary

All Methods
Modifier and Type Method and Description
protected double delta(double val1, double val2)
Compute the delta of two values.
double distance(NumberVector v1, NumberVector v2)
Computes the distance between two given vectors according to this distance function.
boolean equals(java.lang.Object obj)
protected void firstRow(double[] buf, int band, NumberVector v1, NumberVector v2, int dim2)
Fill the first row.
int hashCode()
• ### Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.timeseries.AbstractEditDistanceFunction

effectiveBandSize, getInputTypeRestriction
• ### Methods inherited from class de.lmu.ifi.dbs.elki.distance.distancefunction.AbstractNumberVectorDistanceFunction

dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality, dimensionality
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
• ### Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.PrimitiveDistanceFunction

instantiate
• ### Methods inherited from interface de.lmu.ifi.dbs.elki.distance.distancefunction.DistanceFunction

isMetric, isSquared, isSymmetric
• ### Field Detail

• #### g

private final double g
Gap value.
• ### Constructor Detail

• #### ERPDistanceFunction

public ERPDistanceFunction(double bandSize,
double g)
Constructor.
Parameters:
bandSize - Band size
g - G parameter
• ### Method Detail

• #### distance

public double distance(NumberVector v1,
NumberVector v2)
Description copied from interface: NumberVectorDistanceFunction
Computes the distance between two given vectors according to this distance function.
Specified by:
distance in interface NumberVectorDistanceFunction<NumberVector>
Specified by:
distance in interface PrimitiveDistanceFunction<NumberVector>
Overrides:
distance in class DTWDistanceFunction
Parameters:
v1 - first vector
v2 - second vector
Returns:
the distance between two given vectors according to this distance function
• #### firstRow

protected void firstRow(double[] buf,
int band,
NumberVector v1,
NumberVector v2,
int dim2)
Description copied from class: DTWDistanceFunction
Fill the first row.
Overrides:
firstRow in class DTWDistanceFunction
Parameters:
buf - Buffer
band - Bandwidth
v1 - First vector
v2 - Second vector
dim2 - Dimensionality of second
• #### delta

protected double delta(double val1,
double val2)
Description copied from class: DTWDistanceFunction
Compute the delta of two values.

TODO: support Euclidean, Manhattan, others?

Overrides:
delta in class DTWDistanceFunction
Parameters:
val1 - First value
val2 - Second value
Returns:
Difference
• #### equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class AbstractEditDistanceFunction
• #### hashCode

public int hashCode()
Overrides:
hashCode in class AbstractEditDistanceFunction