                                        forall k    : persistence</span>


<span class="sd">            Inputs:</span>
<span class="sd">             resid_sq ( np.shape = (num_regimes,T) )</span>
<span class="sd">             max_transitions = max number of switchings allowed</span>

<span class="sd">            Returns:</span>
<span class="sd">            Gamma_updated ( np.shape = (num_regimes,T) ))</span>
<span class="sd">            &quot;&quot;&quot;</span>

            <span class="n">num_regimes</spa