'Starting parameters for maximum likelihood estimation'

@property
def start_params(self):

    trend_data = self._trend_data
    if ((not self.simple_differencing) and ((self._k_diff > 0) or (self._k_seasonal_diff > 0))):
        endog = diff(self.endog, self._k_diff, self._k_seasonal_diff, self.seasonal_periods)
        if (self.exog is not None):
            exog = diff(self.exog, self._k_diff, self._k_seasonal_diff, self.seasonal_periods)
        else:
            exog = None
        trend_data = trend_data[:endog.shape[0], :]
    else:
        endog = self.endog.copy()
        exog = (self.exog.copy() if (self.exog is not None) else None)
    endog = endog.squeeze()
    if np.any(np.isnan(endog)):
        mask = (~ np.isnan(endog).squeeze())
        endog = endog[mask]
        if (exog is not None):
            exog = exog[mask]
        if (trend_data is not None):
            trend_data = trend_data[mask]
    params_exog = []
    if (self.k_exog > 0):
        params_exog = np.linalg.pinv(exog).dot(endog)
        endog = (endog - np.dot(exog, params_exog))
    if self.state_regression:
        params_exog = []
    (params_trend, params_ar, params_ma, params_variance) = self._conditional_sum_squares(endog, self.k_ar, self.polynomial_ar, self.k_ma, self.polynomial_ma, self.k_trend, trend_data)
    invalid_ar = ((self.k_ar > 0) and self.enforce_stationarity and (not is_invertible(np.r_[(1, (- params_ar))])))
    if invalid_ar:
        raise ValueError('Non-stationary    starting    autoregressive    parameters    found    with    `enforce_stationarity`    set    to    True.')
    invalid_ma = ((self.k_ma > 0) and self.enforce_invertibility and (not is_invertible(np.r_[(1, params_ma)])))
    if invalid_ma:
        raise ValueError('non-invertible    starting    MA    parameters    found    with    `enforce_invertibility`    set    to    True.')
    (_, params_seasonal_ar, params_seasonal_ma, params_seasonal_variance) = self._conditional_sum_squares(endog, self.k_seasonal_ar, self.polynomial_seasonal_ar, self.k_seasonal_ma, self.polynomial_seasonal_ma)
    invalid_seasonal_ar = ((self.k_seasonal_ar > 0) and self.enforce_stationarity and (not is_invertible(np.r_[(1, (- params_seasonal_ar))])))
    if invalid_seasonal_ar:
        raise ValueError('Non-stationary    starting    autoregressive    parameters    found    with    `enforce_stationarity`    set    to    True.')
    invalid_seasonal_ma = ((self.k_seasonal_ma > 0) and self.enforce_invertibility and (not is_invertible(np.r_[(1, params_seasonal_ma)])))
    if invalid_seasonal_ma:
        raise ValueError('non-invertible    starting    seasonal    moving    average    parameters    found    with    `enforce_invertibility`    set    to    True.')
    params_exog_variance = []
    if (self.state_regression and self.time_varying_regression):
        params_exog_variance = ([1] * self.k_exog)
    if (self.state_error and (params_variance == [])):
        if (not (params_seasonal_variance == [])):
            params_variance = params_seasonal_variance
        elif (self.k_exog > 0):
            params_variance = np.inner(endog, endog)
        else:
            params_variance = (np.inner(endog, endog) / self.nobs)
    params_measurement_variance = (1 if self.measurement_error else [])
    return np.r_[(params_trend, params_exog, params_ar, params_ma, params_seasonal_ar, params_seasonal_ma, params_exog_variance, params_measurement_variance, params_variance)]
