ssd(p, q) Sum of squared difference for N dimensions. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Measure of distance that calculates the squared euclidean distance.
euclidean(p, q) Euclidean distance for N dimensions. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Measure of distance that calculates the straight-line (or Euclidean).
manhattan(p, q) Manhattan distance for N dimensions. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Measure of absolute differences between both points.
minkowski(p, q, p_value) Minkowsky Distance for N dimensions. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. p_value (float): `float` P value, default=1.0(1: manhatan, 2: euclidean), does not support chebychev. Returns: Measure of similarity in the normed vector space.
chebyshev(p, q) Chebyshev distance for N dimensions. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Measure of maximum absolute difference.
correlation(p, q) Correlation distance for N dimensions. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Measure of maximum absolute difference.
cosine(p, q) Cosine distance between provided vectors. Parameters: p (float[]): `array<float>` 1D Vector. q (float[]): `array<float>` 1D Vector. Returns: The Cosine distance between vectors `p` and `q`.
camberra(p, q) Camberra distance for N dimensions. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Weighted measure of absolute differences between both points.
mae(p, q) Mean absolute error is a normalized version of the sum of absolute difference (manhattan). Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Mean absolute error of vectors `p` and `q`.
mse(p, q) Mean squared error is a normalized version of the sum of squared difference. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Mean squared error of vectors `p` and `q`.
lorentzian(p, q) Lorentzian distance between provided vectors. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Lorentzian distance of vectors `p` and `q`.
intersection(p, q) Intersection distance between provided vectors. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Intersection distance of vectors `p` and `q`.
penrose(p, q) Penrose Shape distance between provided vectors. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Penrose shape distance of vectors `p` and `q`.
meehl(p, q) Meehl distance between provided vectors. Parameters: p (float[]): `array<float>` Vector with first numeric distribution. q (float[]): `array<float>` Vector with second numeric distribution. Returns: Meehl distance of vectors `p` and `q`.
edit(x, y) Edit (aka Levenshtein) distance for indexed strings. Parameters: x (int[]): `array<int>` Indexed array. y (int[]): `array<int>` Indexed array. Returns: Number of deletions, insertions, or substitutions required to transform source string into target string.
--- generated description: The Edit distance is a measure of similarity used to compare two strings. It is defined as the minimum number of operations (insertions, deletions, or substitutions) required to transform one string into another. The operations are performed on the characters of the strings, and the cost of each operation depends on the specific algorithm used. The Edit distance is widely used in various applications such as spell checking, text similarity, and machine translation. It can also be used for other purposes like finding the closest match between two strings or identifying the common prefixes or suffixes between them.
lee(x, y, dsize) Distance between two indexed strings of equal length. Parameters: x (int[]): `array<int>` Indexed array. y (int[]): `array<int>` Indexed array. dsize (int): `int` Dictionary size. Returns: Distance between two strings by accounting for dictionary size.
hamming(x, y) Distance between two indexed strings of equal length. Parameters: x (int[]): `array<int>` Indexed array. y (int[]): `array<int>` Indexed array. Returns: Length of different components on both sequences.
jaro(x, y) Distance between two indexed strings. Parameters: x (int[]): `array<int>` Indexed array. y (int[]): `array<int>` Indexed array. Returns: Measure of two strings' similarity: the higher the value, the more similar the strings are. The score is normalized such that `0` equates to no similarities and `1` is an exact match.
mahalanobis(p, q, VI) Mahalanobis distance between two vectors with population inverse covariance matrix. Parameters: p (float[]): `array<float>` 1D Vector. q (float[]): `array<float>` 1D Vector. VI (matrix<float>): `matrix<float>` Inverse of the covariance matrix. Returns: The mahalanobis distance between vectors `p` and `q`.
chi_square(p, q, eps) Chi Square distance between provided vectors. Parameters: p (float[]): `array<float>` 1D Vector. q (float[]): `array<float>` 1D Vector. eps (float) Returns: The Chi Square distance between vectors `p` and `q`.
kulczynsky(p, q, eps) Kulczynsky distance between provided vectors. Parameters: p (float[]): `array<float>` 1D Vector. q (float[]): `array<float>` 1D Vector. eps (float) Returns: The Kulczynsky distance between vectors `p` and `q`.
De acordo com o verdadeiro espírito do TradingView, o autor publicou esse código Pine como uma biblioteca de código aberto para que outros programadores Pine de nossa comunidade possam reutilizá-lo. Parabéns ao autor! Você pode usar essa biblioteca de forma privada ou em outras publicações de código aberto, mas a reutilização desse código em uma publicação é regida pelas Regras da Casa.
As informações e publicações não devem ser e não constituem conselhos ou recomendações financeiras, de investimento, de negociação ou de qualquer outro tipo, fornecidas ou endossadas pela TradingView. Leia mais em Termos de uso.