More changes per Atri's suggestions

This commit is contained in:
Aaron Huber 2019-07-09 12:52:54 -04:00
parent 49f4560e81
commit e8285a353f
2 changed files with 105 additions and 47 deletions

View file

@ -36,14 +36,14 @@ Due to the uniformity of $\sketchPolar$, we have
thus verifying \eqref{eq:single-est}.
We can now take \eqref{eq:single-est}, substitute it in for \eqref{eq:allWorlds-est} and show by linearity of expectation that \eqref{eq:allWorlds-est} holds.
\begin{align*}
&\expect{\sum_{\wVec \in \pw} \sketchJParam{\sketchHashParam{\wVec}} \cdot \sketchPolarParam{\wVec}} \\
\begin{align}
&\expect{\sum_{\wVec \in \pw} \sketchJParam{\sketchHashParam{\wVec}} \cdot \sketchPolarParam{\wVec}} \nonumber\\
&= \expect{\sum_{\wVecPrime \in \pw}\kMapParam{\wVecPrime} \cdot \sketchPolarParam{\wVecPrime} \cdot \sum_{\substack{\wVec \in \pw \st \\
\sketchHashParam{\wVecPrime} = \sketchHashParam{\wVec}}}\sketchPolarParam{\wVec}}\\
\sketchHashParam{\wVecPrime} = \sketchHashParam{\wVec}}}\sketchPolarParam{\wVec}}\nonumber\\
&= \sum_{\wVec \in \pw} \expect{\left( \sum_{\substack{\wVecPrime \in \pw \st \\
\sketchHashParam{\wVecPrime} = \sketchHashParam{\wVec}}}\kMapParam{\wVecPrime}\cdot\sketchPolarParam{\wVecPrime}\right) \cdot \sketchPolarParam{\wVec}}\\
&= \sum_{\wVec \in \pw}\kMapParam{\wVec}.
\end{align*}
\sketchHashParam{\wVecPrime} = \sketchHashParam{\wVec}}}\kMapParam{\wVecPrime}\cdot\sketchPolarParam{\wVecPrime}\right) \cdot \sketchPolarParam{\wVec}}\nonumber\\
&= \sum_{\wVec \in \pw}\kMapParam{\wVec}\label{eq:estExpect}.
\end{align}
%\begin{align}
%&\expect{\estimate}\\
@ -69,79 +69,131 @@ We can now take \eqref{eq:single-est}, substitute it in for \eqref{eq:allWorlds-
\AR{A general comment: The last display equation should have a period at the end. The idea is that display equations are considered part of a sentence and every sentence should end with a period.}
\AH{Thank you for clarifying this, as I have always wondered what the convention was for display equations. Hopefully, I haven't missed any end display equations, and have them all fixed properly.}
For the next step, we show that the variance of an estimate is small.$$\varParam{\estimate}$$
For the next step, we show that the variance of an estimate is small.%$$\varParam{\estimate}$$
\begin{align}
&=\varParam{\estExpOne}\\
&= \expect{\big(\estTwo\big)^2}\\
&=\expect{\sum_{\substack{
&\varParam{\sum_{\wVec \in \pw}\sketchJParam{\sketchHashParam{\wVec}} \cdot \sketchPolarParam{\wVec}}\nonumber\\
=~&\varParam{\sum_{\wVec \in \pw}\kMapParam{\wVec} \cdot \sketchPolarParam{\wVec} \sum_{\substack{\wVecPrime \in \pw \st\\ \sketchHashParam{\wVec} = \sketchHashParam{\wVecPrime}}}\sketchPolarParam{\wVecPrime}}\nonumber\\%\estExpOne}\\
=~& \expect{\big(\sum_{\substack{ \wVec, \wVecPrime \in \pw \st \\
\sketchHashParam{\wVec} = \sketchHashParam{\wVecPrime}}} \kMapParam{\wVec} \cdot \sketchPolarParam{\wVec} \cdot \sketchPolarParam{\wVecPrime} - \expect{\sum_{\wVec \in \pw} \sketchJParam{\sketchHashParam{\wVec}} \cdot \sketchPolarParam{\wVec}}\big)^2}\nonumber\\
=~&\mathbb{E}\big[\sum_{\substack{
\wVec_1, \wVec_2,\\
\wVecPrime_1, \wVecPrime_2 \in \pw,\\
\sketchHashParam{\wVec_1} = \sketchHashParam{\wVecPrime_1},\\
\sketchHashParam{\wVec_2} = \sketchHashParam{\wVecPrime_2}
}}\kMapParam{\wVec_1} \cdot \kMapParam{\wVec_2}\cdot\sketchPolarParam{\wVec_1}\cdot\sketchPolarParam{\wVec_2}\cdot\sketchPolarParam{\wVecPrime_1}\cdot\sketchPolarParam{\wVecPrime_2} }\label{eq:var-sum-w}
}}\kMapParam{\wVec_1} \cdot \kMapParam{\wVec_2}\cdot\sketchPolarParam{\wVec_1}\cdot\sketchPolarParam{\wVec_2}\cdot\sketchPolarParam{\wVecPrime_1}\cdot\sketchPolarParam{\wVecPrime_2}\big]\nonumber\\
& - \left(\sum_{\wVec \in \pw}\kMapParam{\wVec}\right)^2 \label{eq:var-sum-w}
\end{align}
\AR{The $-\mu^2$ term is missing in the above.}
\AH{$\mu^2$ added.}
Note that four-wise independence is assumed across all four random variables of \eqref{eq:var-sum-w}. Zooming in on the inner products of the $\sketchPolar$ functions,
\begin{equation}
\polarProdEq \label{eq:polar-product}
\end{equation}
it can be seen that for $\wOne, \wOneP \in \pw$ and $\wTwo, \wTwoP \in \pw'$, all four random variables in \eqref{eq:polar-product} take their values from $\pw$, although we have iteration over two separate sets $\pw$.\AR{I do not know what you mean by ``iteration"} Thus, there are four possible sets of $\wVec$ variable combinations, namely:
we make some key observations.%it can be seen that for $\wOne, \wOneP \in \pw$ and $\wTwo, \wTwoP \in \pw'$, all four random variables in \eqref{eq:polar-product} take their values from $\pw$, although we have iteration over two separate sets $\pw$.
\AR{I do not know what you mean by ``iteration"} \AH{I don't know how to word what I am saying any better...by iteration I mean if you pictured the summation as nested for loops, one could have one level of nesting, where the outer loop would be iterating over the set $\pw$ and the inner loop would be iterating over a separate set of $\pw$. However, maybe this is unnecessary to point out, and for now I have commented this out.}
Thus, there are five possible sets of $\wVec$ variable combinations, namely for $a, b, c, d \in \{1, 1', 2, 2'\} \st a \neq b \neq c \neq d$:
\begin{align*}
&\distPattern{1}:&\forElems{\cOne}&\\
&\distPattern{2}:&\forElems{\cTwo}& \textit{*} \\
&\distPattern{3}:&\forElems{\cThree}& \textit{*} \\
&\distPattern{4}:&\forElems{\cFour}& \textit{*}\\
&\distPattern{5}:&\forElems{\cFive}&
&\distPattern{1}:&\forElems{\cOne}\\
&\distPattern{2}:&\forElems{\cTwo}\\
&\distPattern{3}:&\forElems{\cThree}\\
&\distPattern{4}:&\forElems{\cFour}\\
&\distPattern{5}:&\forElems{\cFive}
\end{align*}
$$\text{ }^*\textit{(and all variants of the respective pattern)}$$
Note that each $\wVec$ is the preimage of the same $\sketchPolar$ function, meaning, that equal worlds produce the same element in the image of $\sketchPolar$.
%In $\distPattern{1}$, it is the case that if all $\wVec$ variables are equal, that we have only one possible combination of the four $\wVec$ vectors. For $\distPattern{2}$ and $\distPattern{3}$, there are $\binom{4}{2} = 6$ possible inequalities. However, note that no matter which world vectors are equal (unequal), we still end up with a positive polarity for $\distPattern{2}$ since, for each group of equal worlds, we have the same image of $\sketchPolar$ multiplied together, resulting in a product of 1 for each group, multiplied together.
\AR{Two comments on the notation above. You should define the sets exactly-- i.e. you should not put a $*$ on some of the definitions. Second, it is not immediately clear why the above cover all the cases, so you should argue that is the case. I think it is easier to argue this is you argue in terms of number of inequalities in the possible $\binom{4}{2}=6$ comparisons-- note you probably should not write down all the 6 comparisons since that would be cumbersome: just use it in your argument.}
\AH{I have defined the sets exactly. For the second comment, I argue later on the fact that all cases are covered. This second comment was a tough one for me to understand clearly, but I think I got it. Please let me know if I didn't}
We are interested in those particular cases whose expectation does not equal zero, since an expectation of zero will not add to the summation of \eqref{eq:var-sum-w}. In expectation we have that
\begin{align}
\forAllW{\distPattern{1}}&\rightarrow\expect{%\sum_{\substack{\elems \\
%\st \cOne}}
\polarProdEq} = 1 \label{eq:polar-prod-all}\\
\polarProdEq} = 1 \label{eq:polar-prod-all}
\end{align}
since we have the same element of the image of $\sketchPolar$ being multiplied to itself an even number of times. Similarly,
\begin{align}
\forAllW{\distPattern{2}}&\rightarrow\expect{%\sum_{\substack{\elems \\
%\st \cTwo}}
\polarProdEq} = 1 \label{eq:polar-prod-two-and-two}\\
\polarProdEq} = 1 \label{eq:polar-prod-two-and-two}
\end{align}
because the same element of the image of $\sketchPolar$ is being multiplied to itself for each equality, producing a polarity of 1 for each equality, and then a final product of 1. For $\distPattern{3}, \distPattern{4}, \distPattern{5}$, we have a final product of two, three or four independent variables $\in \{-1, 1\}$, thus producing the following results:
\begin{align}
\forAllW{\distPattern{3}}&\rightarrow\expect{%\sum_{\substack{\elems \\
%\st \cThree}}
\polarProdEq} = 0 \nonumber \\
\forAllW{\distPattern{4}}&\rightarrow\expect{%\sum_{\substack{\elems \\
%\st \cFour}}
\polarProdEq} = 0 \nonumber \\
\forAllW{\distPattern{5}}&\rightarrow\expect{%\sum_{\substack{\elems \\
%\st \cFive}}
\polarProdEq} = 0 \nonumber
\end{align}
\begin{align}
\forAllW{\distPattern{4}}&\rightarrow\expect{%\sum_{\substack{\elems \\
%\st \cFour}}
\polarProdEq} = 0 \nonumber
\end{align}
\begin{align}
\forAllW{\distPattern{5}}&\rightarrow\expect{%\sum_{\substack{\elems \\
%\st \cFive}}
\polarProdEq} = 0. \nonumber
\end{align}
\AR{You should argue why each of the equalities above. While we might decide to drop the arguments in the submitted paper when we are working things out, it is better to write down all the arguments. This is the best way to spot bugs in a proof. Otherwise, it is easy to introduce bugs by not checking for things that are ``obvious."}
\AH{Thank you for explaining the process to me. It makes sense to include 'obvious' arguments to me now. I have argued the above points, but mostly in plain English. Is this acceptable, or do I need to use formal notation?}
Only equations \eqref{eq:polar-prod-all} and \eqref{eq:polar-prod-two-and-two} influence the $\var$ computation.
Considering $\distPattern{1}$ the variance results in
\begin{equation}
\distPatOne\label{eq:distPatOne}
\distPatOne\label{eq:distPatOne}.
\end{equation}
For the distribution pattern $\cTwo$, we have three variants to consider.
This is the case because we have that
\begin{align*}
&\vCase{1}:&\cTwo \\
&\vCase{2}:&\cTwoV{\wOne}{\wTwo}{\wOneP}{\wTwoP}\\
&\vCase{3}:&\cTwoV{\wOne}{\wTwoP}{\wOneP}{\wTwo}
&\sum_{\substack{\wOne, \wOneP, \wTwo, \wTwoP \in \pw \st \\
\wOne = \wTwo = \wOneP = \wTwoP = \wVec}}
\kMapParam{\wVec} \cdot \kMapParam{\wVec} \cdot \sketchPolarParam{\wVec} \cdot \sketchPolarParam{\wVec} \cdot \sketchPolarParam{\wVec} \cdot \sketchPolarParam{\wVec}\\
= &\sum_{\substack{\wOne, \wTwo \in \pw \st \\
\wOne = \wTwo}} \kMapParam{\wVec}\cdot \kMapParam{\wVec}\\
= &\sum_{\wVec \in \pw} \kMapParam{\wVec}^2.
\end{align*}
For the distribution pattern $\cTwo$, we have three subsets $\distPattern{21}, \distPattern{22}, \distPattern{23} \subseteq \distPattern{2}$ to consider.
\begin{align*}
&\distPattern{21}:&\cTwoV{\wOne}{\wOneP}{\wTwo}{\wTwoP} \\
&\distPattern{22}:&\cTwoV{\wOne}{\wTwo}{\wOneP}{\wTwoP}\\
&\distPattern{23}:&\cTwoV{\wOne}{\wTwoP}{\wOneP}{\wTwo}
\end{align*}
\AR{Again you should be defining sets and not variants. E.g. you could have defined the subsets $S_{21},S_{22},S_{23}$.}
When considered separately, the variants have the following $\var$.
\AH{Thank you for the great suggestion. Is it a problem that I have waited to define these subsets explicitly until here?}
Considered separately, the subsets result in the following $\var$.
\begin{align}
\cTwo&= \variantOne \label{eq:variantOne}\\
\cTwoV{\wOne}{\wTwo}{\wOneP}{\wTwoP}&=\variantTwo \label{eq:variantTwo}\\
\cTwoV{\wOne}{\wTwoP}{\wOneP}{\wTwo}&=\variantThree\label{eq:variantThree}
&\wOne = \wOneP \neq \wTwo =\wTwoP \rightarrow\nonumber\\
&\qquad = \sum_{\substack{\wOne, \wOneP, \wTwo, \wTwoP \in \pw \st \\
\wOne = \wOneP = \wVec \neq\\
\wTwo = \wTwoP = \wVecPrime}}\kMapParam{\wVec}\kMapParam{\wVecPrime}\sketchPolarParam{\wVec}\sketchPolarParam{\wVec}\sketchPolarParam{\wVecPrime}\sketchPolarParam{\wVecPrime} \label{eq:variantOne}\nonumber\\
&\qquad = \sum_{\wVec, \wVecPrime \in \pw \st \wVec \neq \wVecPrime}\kMapParam{\wVec}\kMapParam{\wVecPrime}\\
&\wOne = \wTwo \neq \wOneP = \wTwoP \rightarrow\nonumber\\
&\qquad = \sum_{\substack{\wOne, \wOneP, \wTwo, \wTwoP \in \pw \st \\
\wOne = \wTwo = \wVec \neq\\
\wOneP = \wTwoP = \wVecPrime,\\
\sketchHashParam{\wVec} = \sketchHashParam{\wVecPrime}}} \kMapParam{\wVec}\kMapParam{\wVec}\sketchPolarParam{\wVec}\sketchPolarParam{\wVecPrime}\sketchPolarParam{\wVec}\sketchPolarParam{\wVecPrime}\nonumber \\
&\qquad = \sum_{\wVec, \wVecPrime \in \pw \st \wVec \neq \wVecPrime}| \{\wVecPrime \st \sketchHashParam{\wVec} = \sketchHashParam{\wVecPrime}\} | \cdot \kMapParam{\wVec}^2\label{eq:variantTwo} \\
&\wOne = \wTwoP \neq \wOneP =\wTwo \rightarrow \nonumber \\
&\qquad = \sum_{\substack{\wOne, \wOneP, \wTwo, \wTwoP \in \pw \st \\
\wOne = \wTwoP = \wVec \neq \\
\wOneP = \wTwo = \wVecPrime,\\
\sketchHashParam{\wVec} = \sketchHashParam{\wVecPrime}}} \kMapParam{\wVec} \kMapParam{\wVecPrime}\sketchPolarParam{\wVec}\sketchPolarParam{\wVecPrime}\sketchPolarParam{\wVecPrime}\sketchPolarParam{\wVec} \nonumber \\
&\qquad = \sum_{\substack{\wVec, \wVecPrime \in \pw \st \\
\wVec \neq \wVecPrime,\\
\sketchHashParam{\wVec} = \sketchHashParam{\wVecPrime}}}\kMapParam{\wVec}\cdot\kMapParam{\wVecPrime}\label{eq:variantThree}
\end{align}
Note that for $\distPattern{22}$, we have the cardinality of a bucket as a multiplicative factor for each squared annotation. This is because of the constraint that $\wOne \neq \wOneP$ coupled with the additional constraint that $\sketchHashParam{\wOne} = \sketchHashParam{\wOneP}$. Since $\wOneP$ must belong to the same bucket as $\wOne$, yet not equal to $\wOne$, we have that each operand of the sum must be the annotation squared for each $\wOneP$ that belongs to the same bucket but is not equal to $\wOne$.
Looking at $\distPattern{23}$, we have a similar case as $\distPattern{22}$, but this time there is no multiplicative factor since $\wOneP$ and $\wTwoP$ are constrained to equal their original $\wVec$ counterparts.
\AR{You should again argue each of the claimed equalities above. Actually in the second equality, the term $|h_i[\wVec]=h_i[\wVec']|$ should really be $|\{\wVec'|h_i[\wVec]=h_i[\wVec']\}|$. Also this change needs to be propagated.}
\AH{I have added both formal equations (to show the step by step evaluation) as well as verbose justification in English. Please let me know how I can be more clear in arguing the equalities.}
\AR{Also while I do like the use of macros, I think you have gone over-board in the other direction. It is good to create macros for symbols/variables names that you will use frequently but using macros for entire expressions is not a good idea. Among others, it makes it really hard for others to read it since they have to refer back to your macro definition each time they see it.}
Note that at the start of the analysis of $\var$, the second term (expectation \eqref{eq:estExpect} squared) of the $\var$ calculation was not considered. \AR{You should {\bf not} start with a {\em wrong} expression and then later on correct it. Start off with the correct expression in the first place: otherwise it just creates more confusion.} This is because it is canceled out by \eqref{eq:distPatOne} and \eqref{eq:variantOne}.
Notice that the second term (expectation \eqref{eq:estExpect} squared) of the $\var$ calculation is cancelled out by \eqref{eq:distPatOne} and \eqref{eq:variantOne}. \AR{You should {\bf not} start with a {\em wrong} expression and then later on correct it. Start off with the correct expression in the first place: otherwise it just creates more confusion.}
\AH{This has been fixed.}
\begin{equation*}
\big(\estExp\big)^2 = \distPatOne + \variantOne
\end{equation*}
@ -149,17 +201,19 @@ With only \eqref{eq:variantTwo} and \eqref{eq:variantThree} remaining, we have
\begin{multline*}
\varParam{\estimate} = \\
\variantTwo ~+ \\
\sum_{\wVec, \wVecPrime \in \pw \st \wVec \neq \wVecPrime}| \{\wVecPrime \st \sketchHashParam{\wVec} = \sketchHashParam{\wVecPrime}\} | \cdot \kMapParam{\wVec}^2 ~+ \\
\variantThree
\end{multline*}
\AR{The expectations are missing on the RHS. And this needs to be propagated.}
\AH{I am not sure what you mean?}
Converting terms into their space requirements yields
\begin{align}
&\variantTwo \Rightarrow\numWorldsP \cdot \frac{\numWorlds}{\sketchCols} - 1\label{eq:spaceOne}\\
& \sum_{\wVec, \wVecPrime \in \pw \st \wVec \neq \wVecPrime}| \{\wVecPrime \st \sketchHashParam{\wVec} = \sketchHashParam{\wVecPrime}\} | \cdot \kMapParam{\wVec}^2 \Rightarrow\numWorldsP \cdot \frac{\numWorlds}{\sketchCols} - 1\label{eq:spaceOne}\\
&\variantThree \Rightarrow \numWorldsP \cdot \frac{\numWorldsP - 1}{\sketchCols}\label{eq:spaceTwo}
\end{align}
\AR{Again, argue why the above claims are true.}
\AH{Revisiting this, I currently have some doubts as to whether or not the above claims are true.}
\eqref{eq:spaceOne} and \eqref{eq:spaceTwo} further reduce to
\begin{equation}
\frac{2^{2N}(\prob + \prob^2)}{\sketchCols} - \numWorlds(\frac{\prob}{\sketchCols} + \prob)\label{eq:variance}

View file

@ -36,6 +36,10 @@
%WVector Notation
%%%%%%%%%%%%%%%%
\newcommand{\w}{\wVec}
\newcommand{\wa}{\wVec_a}
\newcommand{\wb}{\wVec_b}
\newcommand{\wc}{\wVec_c}
\newcommand{\wVecD}{\wVec_d}
\newcommand{\wOneP}{\wVecPrime_1}
\newcommand{\wOne}{\wVec_1}
\newcommand{\wTwoP}{\wVecPrime_2}
@ -43,18 +47,18 @@
%%%%%%%%%%%%%%%%
%4-way cases
%%%%%%%%%%%%%%%%
\newcommand{\polarProdEq}{\sketchPolarParam{\wVec_1}\cdot\sketchPolarParam{\wVec_2}\cdot\sketchPolarParam{\wVecPrime_1}\cdot\sketchPolarParam{\wVecPrime_2}}
\newcommand{\elems}{\wOne, \wOneP, \wTwo, \wTwoP}
\newcommand{\polarProdEq}{\sketchPolarParam{\wa}\cdot\sketchPolarParam{\wb}\cdot\sketchPolarParam{\wc}\cdot\sketchPolarParam{\wVecD}}
\newcommand{\elems}{\wa, \wb, \wc, \wVecD}
\newcommand{\forAllW}[1]{\forall \elems \in {#1}}
\newcommand{\lab}[1]{#1}
\newcommand{\distPattern}[1]{\lab{S_{#1}}}
\newcommand{\vCase}[1]{\lab{Variant }{#1}}
\newcommand{\forElems}[1]{\{\elems \in \pw \st {#1}\}}
\newcommand{\cOne}{\wOne = \wOneP = \wTwo = \wTwoP}
\newcommand{\cTwo}{\wOne = \wOneP \neq \wTwo = \wTwoP}
\newcommand{\cThree}{\wOne = \wOneP = \wTwo \neq \wTwoP}
\newcommand{\cFour}{\wOne = \wOneP \neq \wTwo \neq \wTwoP}
\newcommand{\cFive}{\wOne \neq \wOneP \neq \wTwo \neq \wTwoP}
\newcommand{\cOne}{\wa = \wb = \wc = \wVecD}
\newcommand{\cTwo}{\wa = \wb \neq \wc = \wVecD}
\newcommand{\cThree}{\wa = \wb = \wc \neq \wVecD}
\newcommand{\cFour}{\wa = \wb \neq \wc \neq \wVecD}
\newcommand{\cFive}{\wa \neq \wb \neq \wc \neq \wVecD}
\newcommand{\cTwoV}[4]{{#1} = {#2} \neq {#3} = {#4}}
\newcommand{\relation}{R}
@ -72,7 +76,7 @@
%Chebyshev
%%%%%%%%%%%%%%%%%
\newcommand{\pr}[2]{Pr\big[|X - \mu| > {#1}\big] < {#2}}
\newcommand{\cheby}{\pr{\mu\epsilon}{\frac{1}{3}}}
\newcommand{\cheby}{\pr{\Delta}{\frac{1}{3}}}
\newcommand{\chebyK}{\pr{k\sd}{\frac{2}{\prob\errB^2\sketchCols}}}
%%%%%%%%%%%%%%%%%