|
| 1 | +{ |
| 2 | + "cells": [ |
| 3 | + { |
| 4 | + "cell_type": "markdown", |
| 5 | + "id": "86920570-6be2-4aee-b24d-7d82cc923b5a", |
| 6 | + "metadata": {}, |
| 7 | + "source": [ |
| 8 | + "# Pearson Correlation Vs. Z-normalized Euclidean Distance\n", |
| 9 | + "\n", |
| 10 | + "It is [well understood](https://arxiv.org/pdf/1601.02213.pdf) that the z-normalized Euclidean distance, $ED_{z-norm}$, and the Pearson correlation, $PC$, between any two subsequences with length $m$ share the following relationship:\n", |
| 11 | + "\n", |
| 12 | + "$ED_{z-norm} = \\sqrt {2 * m * (1 - PC)}$\n", |
| 13 | + "\n", |
| 14 | + "Naturally, when the two subsequences are perfectly correlated (i.e., $PC = 1$), then we get:\n", |
| 15 | + "\n", |
| 16 | + "\\begin{align}\n", |
| 17 | + " ED_{z-norm} ={}&\n", |
| 18 | + " \\sqrt {2 * m * (1 - PC)}\n", |
| 19 | + " \\\\\n", |
| 20 | + " ={}&\n", |
| 21 | + " \\sqrt {2 * m * (1 - 1)}\n", |
| 22 | + " \\\\\n", |
| 23 | + " ={}&\n", |
| 24 | + " \\sqrt {2 * m * 0}\n", |
| 25 | + " \\\\\n", |
| 26 | + " ={}&\n", |
| 27 | + " \\sqrt {0}\n", |
| 28 | + " \\\\\n", |
| 29 | + " ={}&\n", |
| 30 | + " 0\n", |
| 31 | + " \\\\\n", |
| 32 | + "\\end{align}\n", |
| 33 | + "\n", |
| 34 | + "Similarly, when the two subsequences are completely uncorrelated (i.e., $PC = 0$), then we get:\n", |
| 35 | + "\n", |
| 36 | + "\\begin{align}\n", |
| 37 | + " ED_{z-norm} ={}&\n", |
| 38 | + " \\sqrt {2 * m * (1 - PC)}\n", |
| 39 | + " \\\\\n", |
| 40 | + " ={}&\n", |
| 41 | + " \\sqrt {2 * m * (1 - 0)}\n", |
| 42 | + " \\\\\n", |
| 43 | + " ={}&\n", |
| 44 | + " \\sqrt {2 * m * 1}\n", |
| 45 | + " \\\\\n", |
| 46 | + " ={}&\n", |
| 47 | + " \\sqrt {2 * m}\n", |
| 48 | + " \\\\\n", |
| 49 | + "\\end{align}\n", |
| 50 | + "\n", |
| 51 | + "In other words, the largest possible z-normalized distance between any pair of subsequences with length $m$ is $\\sqrt{2 * m}$. The maximum distance can never be bigger!\n", |
| 52 | + "\n", |
| 53 | + "Finally, when two subsequences are anti-correlated (i.e., $PC = -1$), then we get:\n", |
| 54 | + "\n", |
| 55 | + "\\begin{align}\n", |
| 56 | + " ED_{z-norm} ={}&\n", |
| 57 | + " \\sqrt {2 * m * (1 - PC)}\n", |
| 58 | + " \\\\\n", |
| 59 | + " ={}&\n", |
| 60 | + " \\sqrt {2 * m * (1 - (-1))}\n", |
| 61 | + " \\\\\n", |
| 62 | + " ={}&\n", |
| 63 | + " \\sqrt {2 * m * 2}\n", |
| 64 | + " \\\\\n", |
| 65 | + " ={}&\n", |
| 66 | + " \\sqrt {4 * m}\n", |
| 67 | + " \\\\\n", |
| 68 | + " ={}&\n", |
| 69 | + " 2 * \\sqrt {m}\n", |
| 70 | + " \\\\\n", |
| 71 | + "\\end{align}" |
| 72 | + ] |
| 73 | + }, |
| 74 | + { |
| 75 | + "cell_type": "code", |
| 76 | + "execution_count": null, |
| 77 | + "id": "b5a437dc-8c9c-4075-9548-87e97676630e", |
| 78 | + "metadata": {}, |
| 79 | + "outputs": [], |
| 80 | + "source": [] |
| 81 | + } |
| 82 | + ], |
| 83 | + "metadata": { |
| 84 | + "kernelspec": { |
| 85 | + "display_name": "Python 3 (ipykernel)", |
| 86 | + "language": "python", |
| 87 | + "name": "python3" |
| 88 | + }, |
| 89 | + "language_info": { |
| 90 | + "codemirror_mode": { |
| 91 | + "name": "ipython", |
| 92 | + "version": 3 |
| 93 | + }, |
| 94 | + "file_extension": ".py", |
| 95 | + "mimetype": "text/x-python", |
| 96 | + "name": "python", |
| 97 | + "nbconvert_exporter": "python", |
| 98 | + "pygments_lexer": "ipython3", |
| 99 | + "version": "3.9.6" |
| 100 | + } |
| 101 | + }, |
| 102 | + "nbformat": 4, |
| 103 | + "nbformat_minor": 5 |
| 104 | +} |
0 commit comments