title: Convolution of two dependent distributions in MATLAB
body: <p>Assume that I have two discrete random variables <strong>X</strong> and <strong>Y</strong>.</p>
  
  <pre><code>X = {1,3,3,5,7,7,7,9,9,9,9,9}
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Y = {5,5,9,9,10,12,13}
  </code></pre>
  
  <p>Where their empirical CDFs are given as:</p>
  
  <pre><code>F_x(1) = 0.0833, F_x(3) = 0.25, F_x(5) = 0.33, F_x(7) = 0.5833 and F_x(9) = 1
  </code></pre>
  
  <p>and</p>
  
  <pre><code>F_y(5) = 0.2857, F_y(9) = 0.5714, F_y(10) = 0.7143, F_y(12) = 0.8571 and F_y(13) = 1 
  </code></pre>
  
  <p>Assuming their joint distribution is </p>
  
  <pre><code>H(x,y) = F_x(x) * F_y(y)
  </code></pre>
  
  <p>which is actually the "assumption" of X and Y are independent.</p>
  
  <p>How can i calculate the <strong>Z = X + Y</strong> and <strong>F(z)</strong> in MATLAB ?</p>
  
  <p>Note: I gave the <strong>H(x,y)</strong> as a simple product function for the simplicity, but it can be anything in reality which actually models the dependency between X and Y.</p>