Expecations for Variant 1 corrected; Other variants need correction still
This commit is contained in:
parent
ec80c510dd
commit
ac1e0048e6
|
@ -20,18 +20,39 @@ There are various ways we might 'consider' the multiplication of sketches. Firs
|
|||
&\est{3} = \sum_{j \in \sketchCols}\sCom{1}{j} \cdot \sCom{2}{j}.
|
||||
\end{align*}
|
||||
|
||||
Calculating the expectation for $\est{1}$ evaluates to
|
||||
Calculating the expectation for $\est{1}$ for a product of two terms evaluates to
|
||||
\begin{align*}
|
||||
&\expect{\sum_{\wVec \in \pw}\sCom{1}{\hashP{\wVec}}\polP{\wVec} \cdot \sCom{2}{\hashP{\wVec}}\polP{\wVec}}\\
|
||||
=& \expect{\sum_{\wVec \in \pw}\polP{\wVec}\polP{\wVec}\sum_{\substack{\wVecPrime \in \pw \st\\ \hashP{\wVecPrime} = \hashP{\wVec}}} \genV_1\paramBox{\wVecPrime}\polP{\wVecPrime} \sum_{\substack{\wVecPrime \in \pw \st\\ \hashP{\wVecPrime} = \hashP{\wVec}}}\genV_2\paramBox{\wVecPrime}\polP{\wVecPrime}}\\
|
||||
=& \mathbb{E}\big[\sum_{\wVec \in \pw}\polP{\wVec}\polP{\wVec}\left(\sum_{\substack{\wVecPrime \in \pw \st\\
|
||||
\wVecPrime \neq \wVec}} \genV_1\paramBox{\wVecPrime}\polP{\wVecPrime} + \genV_1\paramBox{\wVec}\polP{\wVec}\right)\\
|
||||
& \qquad \left(\sum_{\substack{\wVecPrime \in \pw \st\\
|
||||
\wVecPrime \neq \wVec}} \genV_2\paramBox{\wVecPrime}\polP{\wVecPrime} + \genV_2\paramBox{\wVec}\polP{\wVec}\right)\big]\\
|
||||
=& \expect{\sum_{\wVec \in \pw}\polP{\wVec}\polP{\wVec}\genV_1\paramBox{\wVec}\polP{\wVec}\genV_2\paramBox{\wVec}\polP{\wVec}}\\
|
||||
=& \genV_1\paramBox{\wVec}\genV_2\paramBox{\wVec}.
|
||||
=& \mathbb{E}\big[\sum_{\wVec \in \pw}\polP{\wVec}^2\left(\genV_1\paramBox{\wVec}\polP{\wVec} +\sum_{\substack{\wVecPrime \in \pw \st\\
|
||||
\wVecPrime \neq \wVec}} \genV_1\paramBox{\wVecPrime}\polP{\wVecPrime} \right)\\
|
||||
& \qquad \left(\genV_2\paramBox{\wVec}\polP{\wVec} +\sum_{\substack{\wVecPrime \in \pw \st\\
|
||||
\wVecPrime \neq \wVec}} \genV_2\paramBox{\wVecPrime}\polP{\wVecPrime} \right)\big]\\
|
||||
=& \mathbb{E}\big[\sum_{\wVec \in \pw}\polP{\wVec}^2\big(\gVP{1}{\wVec}\gVP{2}{\wVec}\polP{\wVec}^2 + \\
|
||||
&\qquad \gVP{1}{\wVec}\polP{\wVec}\sum_{\substack{\wVecPrime \in \pw \st\\
|
||||
\hashP{\wVecPrime = \wVec}\\
|
||||
\wVec \neq \wVecPrime}}\gVP{2}{\wVecPrime}\polP{\wVecPrime} + \\
|
||||
&\qquad \gVP{2}{\wVec}\polP{\wVec}\sum_{\substack{\wVecPrime \in \pw \st\\
|
||||
\hashP{\wVecPrime = \wVec}\\
|
||||
\wVec \neq \wVecPrime}}\gVP{1}{\wVecPrime}\polP{\wVecPrime} + \\
|
||||
&\qquad \sum_{\substack{\wVecPrime \in \pw \st\\
|
||||
\hashP{\wVecPrime = \wVec}\\
|
||||
\wVec \neq \wVecPrime}}\gVP{1}{\wVecPrime}\polP{\wVecPrime}\sum_{\substack{\wVecPrime \in \pw \st\\
|
||||
\hashP{\wVecPrime = \wVec}\\
|
||||
\wVec \neq \wVecPrime}}\gVP{2}{\wVecPrime}\polP{\wVecPrime}\big)\big]\\%\polP{\wVec}\genV_1\paramBox{\wVec}\polP{\wVec}\genV_2\paramBox{\wVec}\polP{\wVec}}\\
|
||||
=& \genV_1\paramBox{\wVec}\genV_2\paramBox{\wVec} + \sum_{\substack{\wVecPrime \in \pw \st \\
|
||||
\wVec \neq \wVecPrime}}\gVP{1}{\wVecPrime}\gVP{2}{\wVecPrime}.
|
||||
\end{align*}
|
||||
This result for three sketches in the product is
|
||||
\begin{align*}
|
||||
&\sum_{\wVec \in \pw}\gVP{1}{\wVec}\gVP{2}{\wVec}\gVP{3}{\wVec} + \gVP{1}{\wVec}\sum_{\substack{\wVec'' \in \pw \st \\
|
||||
\hashP{\wVec''} = \hashP{\wVec}\\
|
||||
\wVec'' \neq \wVec}} \gVP{2}{\wVec''}\gVP{3}{\wVec''}\\
|
||||
&\qquad +\gVP{2}{\wVec}\sum_{\substack{\wVec'\in \pw \st \\ \hashP{\wVec'} = \hashP{\wVec}\\
|
||||
\wVec' \neq \wVec}} \gVP{1}{\wVec'}\gVP{3}{\wVec'}\\
|
||||
&\qquad + \gVP{3}{\wVec}\sum_{\substack{\wVec'\in \pw \st \\ \hashP{\wVec'} = \hashP{\wVec}\\
|
||||
\wVec' \neq \wVec}} \gVP{1}{\wVec'}\gVP{2}{\wVec'}\\
|
||||
\end{align*}
|
||||
This result is consistent for an arbitrary number of sketches in the product.
|
||||
In expectation $\est{2}$ results in
|
||||
\begin{align*}
|
||||
&\expect{\sum_{\wVec \in \pw }\left(\sCom{1}{\hashP{\wVec}} \cdot \sCom{2}{\hashP{\wVec}}\right)\polP{\wVec}}\\
|
||||
|
|
Loading…
Reference in a new issue