title: R: How to get a sum of two distributions?
body: <p>I have a simple question.
  I would like to sum of two non-parametric distributions.</p>
  
  <p>Here is an example.
  There are two cities which have 10 houses. we know energy consumption for each house. (edited) I want to get the probability distribution of the sum of a random house chosen from each city.</p>
  
  <pre><code>A1 &lt;- c(1,2,3,3,3,4,4,5,6,7) #10 houses' energy consumption for city A
  B1 &lt;- c(11,13,15,17,17,18,18,19,20,22) #10 houses' energy consumption for city B
  </code></pre>
  
  <p>I have a probability distribution of A1 and B1, how can I get the probability distribution of A1+B1? 
  If I just use <code>A1+B1</code> in R, it gives <code>12 15 18 20 20 22 22 24 26 29</code>. However, I don't think this is right. Becuase there is not order in houses.</p>
  
  <p>When I change the order of houses, it gives another results.</p>
  
  <pre><code># Original
  A1 &lt;- c(1,2,3,3,3,4,4,5,6,7)
  B1 &lt;- c(11,13,15,17,17,18,18,19,20,22)
  #change order 1
  A2 &lt;- c(7,6,5,4,4,3,3,3,2,1) 
  B2 &lt;- c(22,20,19,18,18,17,17,15,13,11)
  #change order 2
  A3 &lt;- c(3,3,3,4,4,5,6,7,1,2) 
  B3 &lt;- c(17,17,18,18,19,13,20,11,22,15)
  sum1 &lt;- A1+B1; sum1
  sum2 &lt;- A1+B2; sum2
  sum3 &lt;- A3+B3; sum3
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/zdfza.png" rel="noreferrer"><img src="https://i.stack.imgur.com/zdfza.png" alt="enter image description here"></a></p>
  
  <p>Red lines are sum1, sum2, and sum3. I am not sure how can I get the distribution of the sum of two distributions.Please give me any ideas.Thanks!</p>
  
  <p>(If those distributions are normal or uniform distributions, I could get the sum of distribution easily, but these are not a normal and there is no order)</p>