title: Simulate a portfolio with active weights between [-0.02,0.02] and absolute weights sum to 1
body: <p>I have an original set of weights for a portfolio and need to generate new weights that don't deviate more than 2% from the original data. The new absolute weights (original weights + new increment) must sum to one and the absolute weights must also be larger than 0 (i.e it is a long only portfolio)</p>
  
  <ol>
  <li>I used runif(n=40, -0.02, 0.02) to generate my active weights</li>
  <li>I added the active weights to the original weights to get the new absolute weights</li>
  <li>I then calculated the sum of all the weights and divided every individual weight by the sum in order to get all the weights to sum to 1.</li>
  <li>I then take any new absolute weights that are smaller than zero and redistribute the excess "negative weight" between the positive weights</li>
  </ol>
  
  <p>But the problem with this is that now my active weights get enlarged by getting my absolute weights to sum to 1 and then they are outside the [-0.02,0.02] active weight bounds.</p>
  
  <p>Is there any way I can get my weights to sum to unity as well as making sure my active weights stay within the boundries and my portfolio only has absolute weights that are larger than zero.</p>
  
  <p>Any suggestions will be appreciated!</p>