>$<span class="no">mean</span><span class="kw">[[</span><span class="no">arm</span>]]) <span class="kw">&lt;-</span>
           (<span class="no">reward</span> - <span class="no">self</span>$<span class="no">theta</span>$<span class="no">mean</span><span class="kw">[[</span><span class="no">arm</span>]]) / <span class="no">self</span>$<span class="no">theta</span>$<span class="no">n</span><span class="kw">[[</span><span class="no">arm</span>]]
      }
      <span class="no">self</span>$<span class="no">thet