Skip to content

Commit

Permalink
CLN: Clean up unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
bashtage committed Jul 25, 2019
1 parent a96ba16 commit d5cf028
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions statsmodels/tsa/arima_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,15 +513,10 @@ def _fit_start_params_hr(self, order, start_ar_lags=None):
if maxlag >= nobs:
maxlag = nobs - 1
armod = AR(endog).fit(ic='bic', trend='nc', maxlag=maxlag)
min_lag = max(p, q) + 1
if armod.k_ar < min_lag:
start_ar_lags = max(p, q) + 1
if start_ar_lags is not None:
# start_ar_lags was provided or AR bic-lags is too small
else:
if start_ar_lags >= nobs:
start_ar_lags = nobs - 1
armod = AR(endog).fit(trend='nc', maxlag=start_ar_lags)

arcoefs_tmp = armod.params
p_tmp = armod.k_ar
# it's possible in small samples that optimal lag-order
Expand Down Expand Up @@ -549,10 +544,9 @@ def _fit_start_params_hr(self, order, start_ar_lags=None):
coefs = OLS(endog[max(p_tmp + q, p):], X).fit().params
start_params[k:k + p + q] = coefs
else:
# start_params[k + p:k + p + q] = yule_walker(endog, order=q)[0]
ar_coeffs = yule_walker(endog, order=q)[0]
ar = np.r_[[1], -ar_coeffs.squeeze()]
start_params[k+p:k+p+q] = arma2ma(ar, [1], nobs=q+1)[1:]
start_params[k + p:k + p + q] = arma2ma(ar, [1], nobs=q+1)[1:]
if q == 0 and p != 0:
arcoefs = yule_walker(endog, order=p)[0]
start_params[k:k + p] = arcoefs
Expand Down

0 comments on commit d5cf028

Please sign in to comment.