'Update the parameters of the model
Updates the representation matrices to fill in the new parameter
values.
Parameters
params : array_like
Array of new parameters.
transformed : boolean, optional
Whether or not `params` is already transformed. If set to False,
`transform_params` is called. Default is True..
Returns
params : array_like
Array of parameters.'

def update(self, params, transformed=True, complex_step=False):

    params = super(SARIMAX, self).update(params, transformed=transformed, complex_step=False)
    params_trend = None
    params_exog = None
    params_ar = None
    params_ma = None
    params_seasonal_ar = None
    params_seasonal_ma = None
    params_exog_variance = None
    params_measurement_variance = None
    params_variance = None
    start = end = 0
    end += self.k_trend
    params_trend = params[start:end]
    start += self.k_trend
    if self.mle_regression:
        end += self.k_exog
        params_exog = params[start:end]
        start += self.k_exog
    end += self.k_ar_params
    params_ar = params[start:end]
    start += self.k_ar_params
    end += self.k_ma_params
    params_ma = params[start:end]
    start += self.k_ma_params
    end += self.k_seasonal_ar_params
    params_seasonal_ar = params[start:end]
    start += self.k_seasonal_ar_params
    end += self.k_seasonal_ma_params
    params_seasonal_ma = params[start:end]
    start += self.k_seasonal_ma_params
    if (self.state_regression and self.time_varying_regression):
        end += self.k_exog
        params_exog_variance = params[start:end]
        start += self.k_exog
    if self.measurement_error:
        params_measurement_variance = params[start]
        start += 1
        end += 1
    if self.state_error:
        params_variance = params[start]
    if (self.k_ar > 0):
        if (self.polynomial_ar.dtype == params.dtype):
            self.polynomial_ar[self._polynomial_ar_idx] = (- params_ar)
        else:
            polynomial_ar = self.polynomial_ar.real.astype(params.dtype)
            polynomial_ar[self._polynomial_ar_idx] = (- params_ar)
            self.polynomial_ar = polynomial_ar
    if (self.k_ma > 0):
        if (self.polynomial_ma.dtype == params.dtype):
            self.polynomial_ma[self._polynomial_ma_idx] = params_ma
        else:
            polynomial_ma = self.polynomial_ma.real.astype(params.dtype)
            polynomial_ma[self._polynomial_ma_idx] = params_ma
            self.polynomial_ma = polynomial_ma
    if (self.k_seasonal_ar > 0):
        idx = self._polynomial_seasonal_ar_idx
        if (self.polynomial_seasonal_ar.dtype == params.dtype):
            self.polynomial_seasonal_ar[idx] = (- params_seasonal_ar)
        else:
            polynomial_seasonal_ar = self.polynomial_seasonal_ar.real.astype(params.dtype)
            polynomial_seasonal_ar[idx] = (- params_seasonal_ar)
            self.polynomial_seasonal_ar = polynomial_seasonal_ar
    if (self.k_seasonal_ma > 0):
        idx = self._polynomial_seasonal_ma_idx
        if (self.polynomial_seasonal_ma.dtype == params.dtype):
            self.polynomial_seasonal_ma[idx] = params_seasonal_ma
        else:
            polynomial_seasonal_ma = self.polynomial_seasonal_ma.real.astype(params.dtype)
            polynomial_seasonal_ma[idx] = params_seasonal_ma
            self.polynomial_seasonal_ma = polynomial_seasonal_ma
    if (self.k_seasonal_ar > 0):
        reduced_polynomial_ar = (- np.polymul(self.polynomial_ar, self.polynomial_seasonal_ar))
    else:
        reduced_polynomial_ar = (- self.polynomial_ar)
    if (self.k_seasonal_ma > 0):
        reduced_polynomial_ma = np.polymul(self.polynomial_ma, self.polynomial_seasonal_ma)
    else:
        reduced_polynomial_ma = self.polynomial_ma
    if self.mle_regression:
        self.ssm['obs_intercept'] = np.dot(self.exog, params_exog)[None, :]
    if (self.k_trend > 0):
        data = np.dot(self._trend_data, params_trend).astype(params.dtype)
        if (not self.hamilton_representation):
            self.ssm['state_intercept', self._k_states_diff, :] = data
        else:
            if self.hamilton_representation:
                data /= np.sum((- reduced_polynomial_ar))
            if self.mle_regression:
                self.ssm.obs_intercept += data[None, :]
            else:
                self.ssm['obs_intercept'] = data[None, :]
    if self.measurement_error:
        self.ssm[('obs_cov', 0, 0)] = params_measurement_variance
    if ((self.k_ar > 0) or (self.k_seasonal_ar > 0)):
        self.ssm[self.transition_ar_params_idx] = reduced_polynomial_ar[1:]
    elif (not (self.ssm.transition.dtype == params.dtype)):
        self.ssm['transition'] = self.ssm['transition'].real.astype(params.dtype)
    if ((self.k_ma > 0) or (self.k_seasonal_ma > 0)):
        if (not self.hamilton_representation):
            self.ssm[self.selection_ma_params_idx] = reduced_polynomial_ma[1:]
        else:
            self.ssm[self.design_ma_params_idx] = reduced_polynomial_ma[1:]
    if (self.k_posdef > 0):
        self.ssm[('state_cov', 0, 0)] = params_variance
        if (self.state_regression and self.time_varying_regression):
            self.ssm[self._exog_variance_idx] = params_exog_variance
    if (not self._manual_initialization):
        self.initialize_state(complex_step=complex_step)
    return params
