class="external-link">nrow</a></span><span class="op">(</span><span class="va">Theta</span><span class="op">)</span></span>
<span>    <span class="va">P</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/r/base/matrix.html" class="external-link">matrix</a></span><span class="op">(</span> <span class="cn">NA</span>, nrow<span class="op">=</span><span class="va">TP</span>, ncol<span class="op">=</span><span class="va">ncat</span><span class="op">)</span></span>
<span>    <span clas