@property
    def initial_transition(self):
        """Initial transition matrix"""
        transition = np.zeros((self.k_states, self.k_states))

        # Exogenous regressors component
        if self.state_regression:
            start = -self.k_exog
            # T_\beta
            transition[start:, start:] = np.eye(self.k_exog)

            # Autoregressive component
            start = -(self.k_exog + self._k_order)
            end = -self.k_exog if self.k_exog > 0 else None
        else:
            # Autoregressive component
            start = -self._k_order
            end = None

        # T_c
        transition[start:end, start:end] = companion_matrix(self._k_order)
        if self.hamilton_representation:
            transition[start:end, start:end] = np.transpose(
                companion_matrix(self._k_order)
            )

        # Seasonal differencing component
        # T^*
        if self._k_seasonal_diff > 0:
            seasonal_companion = companion_matrix(self.k_seasons).T
            seasonal_companion[0, -1] = 1
            for d in range(self._k_seasonal_diff):
                start = self._k_diff + d * self.k_seasons
                end = self._k_diff + (d + 1) * self.k_seasons

                # T_c^*
                transition[start:end, start:end] = seasonal_companion

                # i
                for i in range(d + 1, self._k_seasonal_diff):
                    transition[start, end + self.k_seasons - 1] = 1

                # \iota
                transition[start, self._k_states_diff] = 1

        # Differencing component
        if self._k_diff > 0:
            idx = np.triu_indices(self._k_diff)
            # T^**
            transition[idx] = 1
            # [0 1]
            if self.k_seasons > 0:
                start = self._k_diff
                end = self._k_states_diff
                transition[:self._k_diff, start:end] = (
                    ([0] * (self.k_seasons - 1) + [1]) * self._k_seasonal_diff
                )
            # [1 0]
            column = self._k_states_diff
            transition[:self._k_diff, column] = 1

        return transition
dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/tsa/statespace/sarimax.py/SARIMAX.initial_transition/original