'Construct the left-stochastic transition matrix
Notes
This matrix will either be shaped (k_regimes, k_regimes, 1) or if there
are time-varying transition probabilities, it will be shaped
(k_regimes, k_regimes, nobs).
The (i,j)th element of this matrix is the probability of transitioning
from regime j to regime i; thus the previous regime is represented in a
column and the next regime is represented by a row.
It is left-stochastic, meaning that each column sums to one (because
it is certain that from one regime (j) you will transition to *some
other regime*).'

def regime_transition_matrix(self, params, exog_tvtp=None):

    params = np.array(params, ndmin=1)
    if (not self.tvtp):
        regime_transition_matrix = np.zeros((self.k_regimes, self.k_regimes, 1), dtype=np.promote_types(np.float64, params.dtype))
        regime_transition_matrix[:(-1), :, 0] = np.reshape(params[self.parameters['regime_transition']], ((self.k_regimes - 1), self.k_regimes))
        regime_transition_matrix[(-1), :, 0] = (1 - np.sum(regime_transition_matrix[:(-1), :, 0], axis=0))
    else:
        regime_transition_matrix = self._regime_transition_matrix_tvtp(params, exog_tvtp)
    return regime_transition_matrix
