="va">b</span> <span class="op">)</span></span>
<span>    <span class="op">}</span></span>
<span>    <span class="va">P</span> <span class="op">&lt;-</span> <span class="va">P</span> <span class="op">/</span> <span class="fu"><a href="https://rdrr.io/pkg/Matrix/man/colSums.html" class="external-link">rowSums</a></span><span class="op">(</span><span class="va">P</span><span class="op">)</span></span>
<span>    <span class="kw"><a href="https://rdrr.io/r/base/function.html" class="external-link">return</a></s