0
$\begingroup$

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]$?

$\endgroup$
  • 5
    $\begingroup$ It's not true. Let $a_1=a_2=b_1=b_2=1$. $\endgroup$ – user856 Jan 11 '18 at 7:29
  • 1
    $\begingroup$ what is true is that $\sum_i |a_ib_i|\ge\sqrt{\sum_i|a_ib_i|^2}$ $\endgroup$ – Masacroso Jan 11 '18 at 7:32
  • 1
    $\begingroup$ You 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: math.stackexchange.com/questions/1129300/… $\endgroup$ – Jean-Claude Arbaut Jan 11 '18 at 7:33
  • $\begingroup$ 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. $\endgroup$ – Finley Jan 11 '18 at 7:34
  • $\begingroup$ 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. $\endgroup$ – edm Jan 11 '18 at 7:59
0
$\begingroup$

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$

$\endgroup$
0
$\begingroup$

You can not because it's wrong.

Try $n=2$, $a_1=a_2=b_1=b_2=1$.

We obtain $$2\leq\sqrt2.$$

$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.