Skip to content

Commit

Permalink
CLN/TST: Improve arima_process
Browse files Browse the repository at this point in the history
Clean and test arima process functions
  • Loading branch information
bashtage committed May 14, 2017
1 parent 95387b1 commit 0493843
Show file tree
Hide file tree
Showing 4 changed files with 515 additions and 430 deletions.
4 changes: 2 additions & 2 deletions statsmodels/sandbox/tsa/fftarma.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ def spdroots(self, w):
builds two arrays (number of roots, number of frequencies)
'''
return self.spdroots_(self.arroots, self.maroots, w)
return self._spdroots(self.arroots, self.maroots, w)

def spdroots_(self, arroots, maroots, w):
def _spdroots(self, arroots, maroots, w):
'''spectral density for frequency using polynomial roots
builds two arrays (number of roots, number of frequencies)
Expand Down
4 changes: 2 additions & 2 deletions statsmodels/tsa/arima_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -1497,7 +1497,7 @@ def predict(self, start=None, end=None, exog=None, dynamic=False):
def _forecast_error(self, steps):
sigma2 = self.sigma2
ma_rep = arma2ma(np.r_[1, -self.arparams],
np.r_[1, self.maparams], nobs=steps)
np.r_[1, self.maparams], lags=steps)

fcasterr = np.sqrt(sigma2 * np.cumsum(ma_rep**2))
return fcasterr
Expand Down Expand Up @@ -1815,7 +1815,7 @@ def predict(self, start=None, end=None, exog=None, typ='linear',
def _forecast_error(self, steps):
sigma2 = self.sigma2
ma_rep = arma2ma(np.r_[1, -self.arparams],
np.r_[1, self.maparams], nobs=steps)
np.r_[1, self.maparams], lags=steps)

fcerr = np.sqrt(np.cumsum(cumsum_n(ma_rep, self.k_diff)**2)*sigma2)
return fcerr
Expand Down
Loading

0 comments on commit 0493843

Please sign in to comment.