Provided two real number sequences: $a_1,a_2,...,a_n$;$b_1,b_2,...,b_n$, define their means respectively: $$\bar a=\frac{1}{n}\sum_{i=1}^n a_i,\bar b=\frac{1}{n}\sum_{i=1}^n b_i$$ and define their variances and covariance respectively: $$var(a)=\frac{1}{n}\sum_{i=1}^n (a_i-\bar a)^2,var(b)=\frac{1}{n}\sum_{i=1}^n (b_i-\bar b)^2,cov(a,b)=\frac{1}{n}\sum_{i=1}^n (a_i-\bar a)(b_i-\bar b)$$ naturally leads to the definition of normalized cross correlation: $$NCC=\frac{cov(a,b)}{\sqrt{var(a)var(b)}}=\frac{\sum_{i=1}^n(a_i-\bar a)(b_i-\bar b)}{\sqrt{\sum_{i=1}^n (b_i-\bar b)^2 \sum_{i=1}^n (a_i-\bar a)^2}}$$ Now how to show that $NCC$ lies in $[-1,1]$?
Asked
Active
Viewed 105 times
0
-
5It's not true. Let $a_1=a_2=b_1=b_2=1$. – Jan 11 '18 at 07:29
-
1what is true is that $\sum_i |a_ib_i|\ge\sqrt{\sum_i|a_ib_i|^2}$ – Masacroso Jan 11 '18 at 07:32
-
1You can replace $a_ib_i$ with simply $x_i$ as they appear only as a product. Then the statement is wrong, but see here a correct one related to yours: https://math.stackexchange.com/questions/1129300/arithmetic-mean-quadratic-mean-proof – Jean-Claude Arbaut Jan 11 '18 at 07:33
-
Sorry for my curtness, I tried to simplify the proof of normalized cross correlation lying in $[-1,1]$, but it is wrong, I need to edit my post. – Finley Jan 11 '18 at 07:34
-
Why is this question edited to be almost not related to the original question? You should ask another question instead. Editing the question to become unrelated to the original question is unfair to the people who answered earlier. – edm Jan 11 '18 at 07:59
-
Sorry, I intended to simplify it, but I mistook. – Finley Jan 11 '18 at 08:03
-
Your modified question is solved using the Cauchy-Schwarz inequality. You can find proofs here: https://en.wikipedia.org/wiki/Cauchy%E2%80%93Schwarz_inequality, but see also this https://en.wikipedia.org/wiki/Pearson_correlation_coefficient Also, what you are calling normalized cross correlation is usually simply called Pearson correlation, but maybe the terminology depends on context. – Jean-Claude Arbaut Jan 11 '18 at 15:03
2 Answers
0
You can not because it's wrong.
Try $n=2$, $a_1=a_2=b_1=b_2=1$.
We obtain $$2\leq\sqrt2.$$

Michael Rozenberg
- 194,933
0
Assume two vectors $a=(a_1,...,a_n)$ and $b=(b_1,...,b_n)$. Their inner product could be defined as $$a.b=a_1b_1+...+a_nb_n$$ or equivalently $$a.b=|a||b|cos\theta$$ where $|a|$ denotes norm of a vector as $|a|=\sqrt{a_1^2+...+a_n^2}$ and $\theta$ is the angle between two vectors. We also know $$a.b\le|a||b|$$ with equality iff $\theta=0$ therefore by substitution we obtain: $$a_1b_1+...+a_nb_n\le \sqrt{a_1^2+...+a_n^2}\sqrt{b_1^2+...+b_n^2}$$
This is also referred to as Cauchy-Schwarz inequality. A general form can be written as: $$a_1b_1+...+a_nb_n\le {(a_1^2+...+a_n^2)^{p}}{(b_1^2+...+b_n^2)^{q}}$$ when $p+q=1$ and $p,q\ge0$

Mostafa Ayaz
- 31,924
-
1Your "We also know" is not correct: this is actually a statement of the Cauchy-Schwarz inequality (see https://en.wikipedia.org/wiki/Cauchy%E2%80%93Schwarz_inequality), and you are using it to prove... the Cauchy-Schwarz inequality. – Jean-Claude Arbaut Jan 11 '18 at 15:00